diff --git a/nu_plugin_clipboard/.github/workflows/publish_crate.yaml b/nu_plugin_clipboard/.github/workflows/publish_crate.yaml new file mode 100644 index 0000000..1f3710d --- /dev/null +++ b/nu_plugin_clipboard/.github/workflows/publish_crate.yaml @@ -0,0 +1,25 @@ +name: Publish Crate + +on: + release: + workflow_dispatch: + + +jobs: + publish: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + + - name: Set up Rust toolchain + uses: actions-rs/toolchain@v1 + with: + toolchain: stable + override: true + + - name: Publish to crates.io + uses: katyo/publish-crates@v2 + with: + registry-token: ${{ secrets.CARGO_REGISTRY_TOKEN }} + env: + CARGO_REGISTRY_TOKEN: ${{ secrets.CARGO_REGISTRY_TOKEN }} diff --git a/nu_plugin_clipboard/.gitignore b/nu_plugin_clipboard/.gitignore new file mode 100644 index 0000000..ab0b00a --- /dev/null +++ b/nu_plugin_clipboard/.gitignore @@ -0,0 +1,3 @@ +/target +.vscode +.idea/ diff --git a/nu_plugin_clipboard/Cargo.lock b/nu_plugin_clipboard/Cargo.lock new file mode 100644 index 0000000..a726943 --- /dev/null +++ b/nu_plugin_clipboard/Cargo.lock @@ -0,0 +1,2316 @@ +# This file is automatically @generated by Cargo. +# It is not intended for manual editing. +version = 4 + +[[package]] +name = "adler2" +version = "2.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "320119579fcad9c21884f5c4861d16174d0e06250625266f50fe6898340abefa" + +[[package]] +name = "aho-corasick" +version = "1.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8e60d3430d3a69478ad0993f19238d2df97c507009a52b3c10addcd7f6bcb916" +dependencies = [ + "memchr", +] + +[[package]] +name = "alloc-no-stdlib" +version = "2.0.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cc7bb162ec39d46ab1ca8c77bf72e890535becd1751bb45f64c597edb4c8c6b3" + +[[package]] +name = "alloc-stdlib" +version = "0.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "94fb8275041c72129eb51b7d0322c29b8387a0386127718b096429201a5d6ece" +dependencies = [ + "alloc-no-stdlib", +] + +[[package]] +name = "allocator-api2" +version = "0.2.21" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "683d7910e743518b0e34f1186f92494becacb047c7b6bf616c96772180fef923" + +[[package]] +name = "android-tzdata" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e999941b234f3131b00bc13c22d06e8c5ff726d1b6318ac7eb276997bbb4fef0" + +[[package]] +name = "android_system_properties" +version = "0.1.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "819e7219dbd41043ac279b19830f2efc897156490d7fd6ea916720117ee66311" +dependencies = [ + "libc", +] + +[[package]] +name = "arboard" +version = "3.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c1df21f715862ede32a0c525ce2ca4d52626bb0007f8c18b87a384503ac33e70" +dependencies = [ + "clipboard-win", + "log", + "objc2", + "objc2-app-kit", + "objc2-foundation", + "parking_lot", + "percent-encoding", + "wl-clipboard-rs", + "x11rb", +] + +[[package]] +name = "arrayvec" +version = "0.7.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7c02d123df017efcdfbd739ef81735b36c5ba83ec3c59c80a9d7ecc718f92e50" + +[[package]] +name = "autocfg" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c08606f8c3cbf4ce6ec8e28fb0014a2c086708fe954eaa885384a6165172e7e8" + +[[package]] +name = "bindgen" +version = "0.70.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f49d8fed880d473ea71efb9bf597651e77201bdd4893efe54c9e5d65ae04ce6f" +dependencies = [ + "bitflags", + "cexpr", + "clang-sys", + "itertools 0.13.0", + "proc-macro2", + "quote", + "regex", + "rustc-hash", + "shlex", + "syn", +] + +[[package]] +name = "bit-set" +version = "0.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "08807e080ed7f9d5433fa9b275196cfc35414f66a0c79d864dc51a0d825231a3" +dependencies = [ + "bit-vec", +] + +[[package]] +name = "bit-vec" +version = "0.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5e764a1d40d510daf35e07be9eb06e75770908c27d411ee6c92109c9840eaaf7" + +[[package]] +name = "bitflags" +version = "2.9.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1b8e56985ec62d17e9c1001dc89c88ecd7dc08e47eba5ec7c29c7b5eeecde967" + +[[package]] +name = "brotli" +version = "7.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cc97b8f16f944bba54f0433f07e30be199b6dc2bd25937444bbad560bcea29bd" +dependencies = [ + "alloc-no-stdlib", + "alloc-stdlib", + "brotli-decompressor", +] + +[[package]] +name = "brotli-decompressor" +version = "4.0.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a334ef7c9e23abf0ce748e8cd309037da93e606ad52eb372e4ce327a0dcfbdfd" +dependencies = [ + "alloc-no-stdlib", + "alloc-stdlib", +] + +[[package]] +name = "bumpalo" +version = "3.19.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "46c5e41b57b8bba42a04676d81cb89e9ee8e859a1a66f80a5a72e1cb76b34d43" + +[[package]] +name = "byteorder" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1fd0f2584146f6f2ef48085050886acf353beff7305ebd1ae69500e27c67f64b" + +[[package]] +name = "bytes" +version = "1.10.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d71b6127be86fdcfddb610f7182ac57211d4b18a3e9c82eb2d17662f2227ad6a" + +[[package]] +name = "cc" +version = "1.2.27" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d487aa071b5f64da6f19a3e848e3578944b726ee5a4854b82172f02aa876bfdc" +dependencies = [ + "shlex", +] + +[[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.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9555578bc9e57714c812a1f84e4fc5b4d21fcb063490c624de019f7464c91268" + +[[package]] +name = "cfg_aliases" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "613afe47fcd5fac7ccf1db93babcb082c5994d996f20b8b159f2ad1658eb5724" + +[[package]] +name = "chrono" +version = "0.4.41" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c469d952047f47f91b68d1cba3f10d63c11d73e4636f24f08daf0278abf01c4d" +dependencies = [ + "android-tzdata", + "iana-time-zone", + "num-traits", + "pure-rust-locales", + "serde", + "windows-link", +] + +[[package]] +name = "chrono-humanize" +version = "0.2.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "799627e6b4d27827a814e837b9d8a504832086081806d45b1afa34dc982b023b" +dependencies = [ + "chrono", +] + +[[package]] +name = "clang-sys" +version = "1.8.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0b023947811758c97c59bf9d1c188fd619ad4718dcaa767947df1cadb14f39f4" +dependencies = [ + "glob", + "libc", + "libloading", +] + +[[package]] +name = "clipboard-win" +version = "5.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "15efe7a882b08f34e38556b14f2fb3daa98769d06c7f0c1b076dfd0d983bc892" +dependencies = [ + "error-code", +] + +[[package]] +name = "core-foundation-sys" +version = "0.8.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "773648b94d0e5d620f64f280777445740e61fe701025087ec8b57f45c791888b" + +[[package]] +name = "crc32fast" +version = "1.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a97769d94ddab943e4510d138150169a2758b5ef3eb191a9ee688de3e23ef7b3" +dependencies = [ + "cfg-if", +] + +[[package]] +name = "crossbeam-deque" +version = "0.8.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9dd111b7b7f7d55b72c0a6ae361660ee5853c9af73f70c3c2ef6858b950e2e51" +dependencies = [ + "crossbeam-epoch", + "crossbeam-utils", +] + +[[package]] +name = "crossbeam-epoch" +version = "0.9.18" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5b82ac4a3c2ca9c3460964f020e1402edd5753411d7737aa39c3714ad1b5420e" +dependencies = [ + "crossbeam-utils", +] + +[[package]] +name = "crossbeam-utils" +version = "0.8.21" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d0a5c400df2834b80a4c3327b3aad3a4c4cd4de0629063962b03235697506a28" + +[[package]] +name = "crossterm" +version = "0.28.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "829d955a0bb380ef178a640b91779e3987da38c9aea133b20614cfed8cdea9c6" +dependencies = [ + "bitflags", + "crossterm_winapi", + "mio", + "parking_lot", + "rustix 0.38.44", + "signal-hook", + "signal-hook-mio", + "winapi", +] + +[[package]] +name = "crossterm_winapi" +version = "0.9.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "acdd7c62a3665c7f6830a51635d9ac9b23ed385797f70a83bb8bafe9c572ab2b" +dependencies = [ + "winapi", +] + +[[package]] +name = "dirs" +version = "5.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "44c45a9d03d6676652bcb5e724c7e988de1acad23a711b5217ab9cbecbec2225" +dependencies = [ + "dirs-sys", +] + +[[package]] +name = "dirs-sys" +version = "0.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "520f05a5cbd335fae5a99ff7a6ab8627577660ee5cfd6a94a6a929b52ff0321c" +dependencies = [ + "libc", + "option-ext", + "redox_users", + "windows-sys 0.48.0", +] + +[[package]] +name = "dispatch2" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "89a09f22a6c6069a18470eb92d2298acf25463f14256d24778e1230d789a2aec" +dependencies = [ + "bitflags", + "objc2", +] + +[[package]] +name = "doctest-file" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "aac81fa3e28d21450aa4d2ac065992ba96a1d7303efbce51a95f4fd175b67562" + +[[package]] +name = "downcast-rs" +version = "1.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "75b325c5dbd37f80359721ad39aca5a29fb04c89279657cffdda8736d0c0b9d2" + +[[package]] +name = "either" +version = "1.15.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "48c757948c5ede0e46177b7add2e67155f70e33c07fea8284df6576da70b3719" + +[[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.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e004d887f51fcb9fef17317a2f3525c887d8aa3f4f50fed920816a688284a5b7" +dependencies = [ + "serde", + "typeid", +] + +[[package]] +name = "errno" +version = "0.3.13" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "778e2ac28f6c47af28e4907f13ffd1e1ddbd400980a9abd7c8df189bf578a5ad" +dependencies = [ + "libc", + "windows-sys 0.60.2", +] + +[[package]] +name = "error-code" +version = "3.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dea2df4cf52843e0452895c455a1a2cfbb842a1e7329671acf418fdc53ed4c59" + +[[package]] +name = "fancy-regex" +version = "0.14.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6e24cb5a94bcae1e5408b0effca5cd7172ea3c5755049c5f3af4cd283a165298" +dependencies = [ + "bit-set", + "regex-automata", + "regex-syntax", +] + +[[package]] +name = "fastrand" +version = "2.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "37909eebbb50d72f9059c3b6d82c0463f2ff062c9e95845c43a6c9c0355411be" + +[[package]] +name = "fixedbitset" +version = "0.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0ce7134b9999ecaf8bcd65542e436736ef32ddca1b3e06094cb6ec5755203b80" + +[[package]] +name = "flate2" +version = "1.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4a3d7db9596fecd151c5f638c0ee5d5bd487b6e0ea232e5dc96d5250f6f94b1d" +dependencies = [ + "crc32fast", + "miniz_oxide", +] + +[[package]] +name = "fnv" +version = "1.0.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3f9eec918d3f24069decb9af1554cad7c880e2da24a9afd88aca000531ab82c1" + +[[package]] +name = "foldhash" +version = "0.1.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d9c4f5dac5e15c24eb999c26181a6ca40b39fe946cbe4c263c7209467bc83af2" + +[[package]] +name = "gethostname" +version = "0.4.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0176e0459c2e4a1fe232f984bca6890e681076abb9934f6cea7c326f3fc47818" +dependencies = [ + "libc", + "windows-targets 0.48.5", +] + +[[package]] +name = "getrandom" +version = "0.2.16" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "335ff9f135e4384c8150d6f27c6daed433577f86b4750418338c01a1a2528592" +dependencies = [ + "cfg-if", + "libc", + "wasi 0.11.1+wasi-snapshot-preview1", +] + +[[package]] +name = "getrandom" +version = "0.3.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "26145e563e54f2cadc477553f1ec5ee650b00862f0a58bcd12cbdc5f0ea2d2f4" +dependencies = [ + "cfg-if", + "libc", + "r-efi", + "wasi 0.14.2+wasi-0.2.4", +] + +[[package]] +name = "glob" +version = "0.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a8d1add55171497b4705a648c6b583acafb01d58050a51727785f0b2c8e0a2b2" + +[[package]] +name = "hashbrown" +version = "0.15.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5971ac85611da7067dbfcabef3c70ebb5606018acd9e2a3903a0da507521e0d5" +dependencies = [ + "allocator-api2", + "equivalent", + "foldhash", +] + +[[package]] +name = "heck" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2304e00983f87ffb38b55b444b5e3b60a884b5d30c0fca7d82fe33449bbe55ea" + +[[package]] +name = "hex" +version = "0.4.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7f24254aa9a54b5c858eaee2f5bccdb46aaf0e486a595ed5fd8f86ba55232a70" + +[[package]] +name = "iana-time-zone" +version = "0.1.63" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b0c919e5debc312ad217002b8048a17b7d83f80703865bbfcfebb0458b0b27d8" +dependencies = [ + "android_system_properties", + "core-foundation-sys", + "iana-time-zone-haiku", + "js-sys", + "log", + "wasm-bindgen", + "windows-core 0.61.2", +] + +[[package]] +name = "iana-time-zone-haiku" +version = "0.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f31827a206f56af32e590ba56d5d2d085f558508192593743f16b2306495269f" +dependencies = [ + "cc", +] + +[[package]] +name = "indexmap" +version = "2.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cea70ddb795996207ad57735b50c5982d8844f38ba9ee5f1aedcfb708a2aa11e" +dependencies = [ + "equivalent", + "hashbrown", +] + +[[package]] +name = "interprocess" +version = "2.2.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d941b405bd2322993887859a8ee6ac9134945a24ec5ec763a8a962fc64dfec2d" +dependencies = [ + "doctest-file", + "libc", + "recvmsg", + "widestring", + "windows-sys 0.52.0", +] + +[[package]] +name = "inventory" +version = "0.3.20" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ab08d7cd2c5897f2c949e5383ea7c7db03fb19130ffcfbf7eda795137ae3cb83" +dependencies = [ + "rustversion", +] + +[[package]] +name = "is_ci" +version = "1.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7655c9839580ee829dfacba1d1278c2b7883e50a277ff7541299489d6bdfdc45" + +[[package]] +name = "itertools" +version = "0.13.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "413ee7dfc52ee1a4949ceeb7dbc8a33f2d6c088194d9f922fb8318faf1f01186" +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.15" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4a5f13b858c8d314ee3e8f639011f7ccefe71f97f96e50151fb991f267928e2c" + +[[package]] +name = "js-sys" +version = "0.3.77" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1cfaf33c695fc6e08064efbc1f72ec937429614f25eef83af942d0e227c3a28f" +dependencies = [ + "once_cell", + "wasm-bindgen", +] + +[[package]] +name = "libc" +version = "0.2.174" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1171693293099992e19cddea4e8b849964e9846f4acee11b3948bcc337be8776" + +[[package]] +name = "libloading" +version = "0.8.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "07033963ba89ebaf1584d767badaa2e8fcec21aedea6b8c0346d487d49c28667" +dependencies = [ + "cfg-if", + "windows-targets 0.53.2", +] + +[[package]] +name = "libproc" +version = "0.14.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e78a09b56be5adbcad5aa1197371688dc6bb249a26da3bca2011ee2fb987ebfb" +dependencies = [ + "bindgen", + "errno", + "libc", +] + +[[package]] +name = "libredox" +version = "0.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c0ff37bd590ca25063e35af745c343cb7a0271906fb7b37e4813e8f79f00268d" +dependencies = [ + "bitflags", + "libc", +] + +[[package]] +name = "linked-hash-map" +version = "0.5.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0717cef1bc8b636c6e1c1bbdefc09e6322da8a9321966e8928ef80d20f7f770f" +dependencies = [ + "serde", +] + +[[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.9.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cd945864f07fe9f5371a27ad7b52a172b4b499999f1d97574c9fa68373937e12" + +[[package]] +name = "lock_api" +version = "0.4.13" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "96936507f153605bddfcda068dd804796c84324ed2510809e5b2a624c81da765" +dependencies = [ + "autocfg", + "scopeguard", +] + +[[package]] +name = "log" +version = "0.4.27" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "13dc2df351e3202783a1fe0d44375f7295ffb4049267b0f3018346dc122a1d94" + +[[package]] +name = "lru" +version = "0.12.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "234cf4f4a04dc1f57e24b96cc0cd600cf2af460d4161ac5ecdd0af8e1f3b2a38" +dependencies = [ + "hashbrown", +] + +[[package]] +name = "lscolors" +version = "0.20.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "61183da5de8ba09a58e330d55e5ea796539d8443bd00fdeb863eac39724aa4ab" +dependencies = [ + "aho-corasick", + "nu-ansi-term", +] + +[[package]] +name = "mach2" +version = "0.4.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d640282b302c0bb0a2a8e0233ead9035e3bed871f0b7e81fe4a1ec829765db44" +dependencies = [ + "libc", +] + +[[package]] +name = "memchr" +version = "2.7.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "32a282da65faaf38286cf3be983213fcf1d2e2a58700e808f83f4ea9a4804bc0" + +[[package]] +name = "miette" +version = "7.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5f98efec8807c63c752b5bd61f862c165c115b0a35685bdcfd9238c7aeb592b7" +dependencies = [ + "cfg-if", + "miette-derive", + "owo-colors", + "supports-color", + "supports-hyperlinks", + "supports-unicode", + "terminal_size", + "textwrap", + "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", +] + +[[package]] +name = "minimal-lexical" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "68354c5c6bd36d73ff3feceb05efa59b6acb7626617f4962be322a825e61f79a" + +[[package]] +name = "miniz_oxide" +version = "0.8.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1fa76a2c86f704bdb222d66965fb3d63269ce38518b83cb0575fca855ebb6316" +dependencies = [ + "adler2", +] + +[[package]] +name = "mio" +version = "1.0.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "78bed444cc8a2160f01cbcf811ef18cac863ad68ae8ca62092e8db51d51c761c" +dependencies = [ + "libc", + "log", + "wasi 0.11.1+wasi-snapshot-preview1", + "windows-sys 0.59.0", +] + +[[package]] +name = "nix" +version = "0.29.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "71e2746dc3a24dd78b3cfcb7be93368c6de9963d30f43a6a73998a9cf4b17b46" +dependencies = [ + "bitflags", + "cfg-if", + "cfg_aliases", + "libc", +] + +[[package]] +name = "nom" +version = "7.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d273983c5a657a70a3e8f2a01329822f3b8c8172b73826411a55751e404a0a4a" +dependencies = [ + "memchr", + "minimal-lexical", +] + +[[package]] +name = "ntapi" +version = "0.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e8a3895c6391c39d7fe7ebc444a87eb2991b2a0bc718fdabd071eec617fc68e4" +dependencies = [ + "winapi", +] + +[[package]] +name = "nu-ansi-term" +version = "0.50.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d4a28e057d01f97e61255210fcff094d74ed0466038633e95017f5beb68e4399" +dependencies = [ + "windows-sys 0.52.0", +] + +[[package]] +name = "nu-derive-value" +version = "0.105.2" +dependencies = [ + "heck", + "proc-macro-error2", + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "nu-engine" +version = "0.105.2" +dependencies = [ + "log", + "nu-glob", + "nu-path", + "nu-protocol", + "nu-utils", +] + +[[package]] +name = "nu-glob" +version = "0.105.2" + +[[package]] +name = "nu-json" +version = "0.105.2" +dependencies = [ + "linked-hash-map", + "num-traits", + "serde", + "serde_json", +] + +[[package]] +name = "nu-path" +version = "0.105.2" +dependencies = [ + "dirs", + "omnipath", + "pwd", + "ref-cast", +] + +[[package]] +name = "nu-plugin" +version = "0.105.2" +dependencies = [ + "log", + "nix", + "nu-engine", + "nu-plugin-core", + "nu-plugin-protocol", + "nu-protocol", + "nu-utils", + "thiserror 2.0.12", +] + +[[package]] +name = "nu-plugin-core" +version = "0.105.2" +dependencies = [ + "interprocess", + "log", + "nu-plugin-protocol", + "nu-protocol", + "rmp-serde", + "serde", + "serde_json", + "windows 0.56.0", +] + +[[package]] +name = "nu-plugin-protocol" +version = "0.105.2" +dependencies = [ + "nu-protocol", + "nu-utils", + "rmp-serde", + "semver", + "serde", + "typetag", +] + +[[package]] +name = "nu-protocol" +version = "0.105.2" +dependencies = [ + "brotli", + "bytes", + "chrono", + "chrono-humanize", + "dirs", + "dirs-sys", + "fancy-regex", + "heck", + "indexmap", + "log", + "lru", + "memchr", + "miette", + "nix", + "nu-derive-value", + "nu-glob", + "nu-path", + "nu-system", + "nu-utils", + "num-format", + "os_pipe", + "rmp-serde", + "serde", + "serde_json", + "strum", + "strum_macros", + "thiserror 2.0.12", + "typetag", + "web-time", + "windows 0.56.0", + "windows-sys 0.48.0", +] + +[[package]] +name = "nu-system" +version = "0.105.2" +dependencies = [ + "chrono", + "itertools 0.14.0", + "libc", + "libproc", + "log", + "mach2", + "nix", + "ntapi", + "procfs", + "sysinfo", + "web-time", + "windows 0.56.0", +] + +[[package]] +name = "nu-utils" +version = "0.105.2" +dependencies = [ + "crossterm", + "crossterm_winapi", + "fancy-regex", + "log", + "lscolors", + "nix", + "num-format", + "serde", + "serde_json", + "strip-ansi-escapes", + "sys-locale", + "unicase", +] + +[[package]] +name = "nu_plugin_clipboard" +version = "0.105.2" +dependencies = [ + "arboard", + "nu-json", + "nu-plugin", + "nu-protocol", +] + +[[package]] +name = "num-format" +version = "0.4.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a652d9771a63711fd3c3deb670acfbe5c30a4072e664d7a3bf5a9e1056ac72c3" +dependencies = [ + "arrayvec", + "itoa", +] + +[[package]] +name = "num-traits" +version = "0.2.19" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "071dfc062690e90b734c0b2273ce72ad0ffa95f0c74596bc250dcfd960262841" +dependencies = [ + "autocfg", +] + +[[package]] +name = "objc2" +version = "0.6.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "88c6597e14493ab2e44ce58f2fdecf095a51f12ca57bec060a11c57332520551" +dependencies = [ + "objc2-encode", +] + +[[package]] +name = "objc2-app-kit" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e6f29f568bec459b0ddff777cec4fe3fd8666d82d5a40ebd0ff7e66134f89bcc" +dependencies = [ + "bitflags", + "objc2", + "objc2-core-graphics", + "objc2-foundation", +] + +[[package]] +name = "objc2-core-foundation" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1c10c2894a6fed806ade6027bcd50662746363a9589d3ec9d9bef30a4e4bc166" +dependencies = [ + "bitflags", + "dispatch2", + "objc2", +] + +[[package]] +name = "objc2-core-graphics" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "989c6c68c13021b5c2d6b71456ebb0f9dc78d752e86a98da7c716f4f9470f5a4" +dependencies = [ + "bitflags", + "dispatch2", + "objc2", + "objc2-core-foundation", + "objc2-io-surface", +] + +[[package]] +name = "objc2-encode" +version = "4.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ef25abbcd74fb2609453eb695bd2f860d389e457f67dc17cafc8b8cbc89d0c33" + +[[package]] +name = "objc2-foundation" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "900831247d2fe1a09a683278e5384cfb8c80c79fe6b166f9d14bfdde0ea1b03c" +dependencies = [ + "bitflags", + "objc2", + "objc2-core-foundation", +] + +[[package]] +name = "objc2-io-surface" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7282e9ac92529fa3457ce90ebb15f4ecbc383e8338060960760fa2cf75420c3c" +dependencies = [ + "bitflags", + "objc2", + "objc2-core-foundation", +] + +[[package]] +name = "omnipath" +version = "0.1.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "80adb31078122c880307e9cdfd4e3361e6545c319f9b9dcafcb03acd3b51a575" + +[[package]] +name = "once_cell" +version = "1.21.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "42f5e15c9953c5e4ccceeb2e7382a716482c34515315f7b03532b8b4e8393d2d" + +[[package]] +name = "option-ext" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "04744f49eae99ab78e0d5c0b603ab218f515ea8cfe5a456d7629ad883a3b6e7d" + +[[package]] +name = "os_pipe" +version = "1.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "db335f4760b14ead6290116f2427bf33a14d4f0617d49f78a246de10c1831224" +dependencies = [ + "libc", + "windows-sys 0.59.0", +] + +[[package]] +name = "owo-colors" +version = "4.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "48dd4f4a2c8405440fd0462561f0e5806bd0f77e86f51c761481bdd4018b545e" + +[[package]] +name = "parking_lot" +version = "0.12.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "70d58bf43669b5795d1576d0641cfb6fbb2057bf629506267a92807158584a13" +dependencies = [ + "lock_api", + "parking_lot_core", +] + +[[package]] +name = "parking_lot_core" +version = "0.9.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bc838d2a56b5b1a6c25f55575dfc605fabb63bb2365f6c2353ef9159aa69e4a5" +dependencies = [ + "cfg-if", + "libc", + "redox_syscall", + "smallvec", + "windows-targets 0.52.6", +] + +[[package]] +name = "paste" +version = "1.0.15" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "57c0d7b74b563b49d38dae00a0c37d4d6de9b432382b2892f0574ddcae73fd0a" + +[[package]] +name = "percent-encoding" +version = "2.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e3148f5046208a5d56bcfc03053e3ca6334e51da8dfb19b6cdc8b306fae3283e" + +[[package]] +name = "petgraph" +version = "0.6.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b4c5cc86750666a3ed20bdaf5ca2a0344f9c67674cae0515bec2da16fbaa47db" +dependencies = [ + "fixedbitset", + "indexmap", +] + +[[package]] +name = "pkg-config" +version = "0.3.32" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7edddbd0b52d732b21ad9a5fab5c704c14cd949e5e9a1ec5929a24fded1b904c" + +[[package]] +name = "proc-macro-error-attr2" +version = "2.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "96de42df36bb9bba5542fe9f1a054b8cc87e172759a1868aa05c1f3acc89dfc5" +dependencies = [ + "proc-macro2", + "quote", +] + +[[package]] +name = "proc-macro-error2" +version = "2.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "11ec05c52be0a07b08061f7dd003e7d7092e0472bc731b4af7bb1ef876109802" +dependencies = [ + "proc-macro-error-attr2", + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "proc-macro2" +version = "1.0.95" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "02b3e5e68a3a1a02aad3ec490a98007cbc13c37cbe84a3cd7b8e406d76e7f778" +dependencies = [ + "unicode-ident", +] + +[[package]] +name = "procfs" +version = "0.17.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cc5b72d8145275d844d4b5f6d4e1eef00c8cd889edb6035c21675d1bb1f45c9f" +dependencies = [ + "bitflags", + "chrono", + "flate2", + "hex", + "procfs-core", + "rustix 0.38.44", +] + +[[package]] +name = "procfs-core" +version = "0.17.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "239df02d8349b06fc07398a3a1697b06418223b1c7725085e801e7c0fc6a12ec" +dependencies = [ + "bitflags", + "chrono", + "hex", +] + +[[package]] +name = "pure-rust-locales" +version = "0.8.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1190fd18ae6ce9e137184f207593877e70f39b015040156b1e05081cdfe3733a" + +[[package]] +name = "pwd" +version = "1.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "72c71c0c79b9701efe4e1e4b563b2016dd4ee789eb99badcb09d61ac4b92e4a2" +dependencies = [ + "libc", + "thiserror 1.0.69", +] + +[[package]] +name = "quick-xml" +version = "0.37.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "331e97a1af0bf59823e6eadffe373d7b27f485be8748f71471c662c1f269b7fb" +dependencies = [ + "memchr", +] + +[[package]] +name = "quote" +version = "1.0.40" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1885c039570dc00dcb4ff087a89e185fd56bae234ddc7f056a945bf36467248d" +dependencies = [ + "proc-macro2", +] + +[[package]] +name = "r-efi" +version = "5.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "69cdb34c158ceb288df11e18b4bd39de994f6657d83847bdffdbd7f346754b0f" + +[[package]] +name = "rayon" +version = "1.10.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b418a60154510ca1a002a752ca9714984e21e4241e804d32555251faf8b78ffa" +dependencies = [ + "either", + "rayon-core", +] + +[[package]] +name = "rayon-core" +version = "1.12.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1465873a3dfdaa8ae7cb14b4383657caab0b3e8a0aa9ae8e04b044854c8dfce2" +dependencies = [ + "crossbeam-deque", + "crossbeam-utils", +] + +[[package]] +name = "recvmsg" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d3edd4d5d42c92f0a659926464d4cce56b562761267ecf0f469d85b7de384175" + +[[package]] +name = "redox_syscall" +version = "0.5.13" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0d04b7d0ee6b4a0207a0a7adb104d23ecb0b47d6beae7152d0fa34b692b29fd6" +dependencies = [ + "bitflags", +] + +[[package]] +name = "redox_users" +version = "0.4.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ba009ff324d1fc1b900bd1fdb31564febe58a8ccc8a6fdbb93b543d33b13ca43" +dependencies = [ + "getrandom 0.2.16", + "libredox", + "thiserror 1.0.69", +] + +[[package]] +name = "ref-cast" +version = "1.0.24" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4a0ae411dbe946a674d89546582cea4ba2bb8defac896622d6496f14c23ba5cf" +dependencies = [ + "ref-cast-impl", +] + +[[package]] +name = "ref-cast-impl" +version = "1.0.24" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1165225c21bff1f3bbce98f5a1f889949bc902d3575308cc7b0de30b4f6d27c7" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "regex" +version = "1.11.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b544ef1b4eac5dc2db33ea63606ae9ffcfac26c1416a2806ae0bf5f56b201191" +dependencies = [ + "aho-corasick", + "memchr", + "regex-automata", + "regex-syntax", +] + +[[package]] +name = "regex-automata" +version = "0.4.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "809e8dc61f6de73b46c85f4c96486310fe304c434cfa43669d7b40f711150908" +dependencies = [ + "aho-corasick", + "memchr", + "regex-syntax", +] + +[[package]] +name = "regex-syntax" +version = "0.8.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2b15c43186be67a4fd63bee50d0303afffcef381492ebe2c5d87f324e1b8815c" + +[[package]] +name = "rmp" +version = "0.8.14" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "228ed7c16fa39782c3b3468e974aec2795e9089153cd08ee2e9aefb3613334c4" +dependencies = [ + "byteorder", + "num-traits", + "paste", +] + +[[package]] +name = "rmp-serde" +version = "1.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "52e599a477cf9840e92f2cde9a7189e67b42c57532749bf90aea6ec10facd4db" +dependencies = [ + "byteorder", + "rmp", + "serde", +] + +[[package]] +name = "rustc-hash" +version = "1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "08d43f7aa6b08d49f382cde6a7982047c3426db949b1424bc4b7ec9ae12c6ce2" + +[[package]] +name = "rustix" +version = "0.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.0.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c71e83d6afe7ff64890ec6b71d6a69bb8a610ab78ce364b3352876bb4c801266" +dependencies = [ + "bitflags", + "errno", + "libc", + "linux-raw-sys 0.9.4", + "windows-sys 0.59.0", +] + +[[package]] +name = "rustversion" +version = "1.0.21" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8a0d197bd2c9dc6e53b84da9556a69ba4cdfab8619eb41a8bd1cc2027a0f6b1d" + +[[package]] +name = "ryu" +version = "1.0.20" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "28d3b2b1366ec20994f1fd18c3c594f05c5dd4bc44d8bb0c1c632c8d6829481f" + +[[package]] +name = "scopeguard" +version = "1.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "94143f37725109f92c262ed2cf5e59bce7498c01bcc1502d7b9afe439a4e9f49" + +[[package]] +name = "semver" +version = "1.0.26" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "56e6fa9c48d24d85fb3de5ad847117517440f6beceb7798af16b4a87d616b8d0" + +[[package]] +name = "serde" +version = "1.0.219" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5f0e2c6ed6606019b4e29e69dbaba95b11854410e5347d525002456dbbb786b6" +dependencies = [ + "serde_derive", +] + +[[package]] +name = "serde_derive" +version = "1.0.219" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5b0276cf7f2c73365f7157c8123c21cd9a50fbbd844757af28ca1f5925fc2a00" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "serde_json" +version = "1.0.140" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "20068b6e96dc6c9bd23e01df8827e6c7e1f2fddd43c21810382803c136b99373" +dependencies = [ + "itoa", + "memchr", + "ryu", + "serde", +] + +[[package]] +name = "shlex" +version = "1.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0fda2ff0d084019ba4d7c6f371c95d8fd75ce3524c3cb8fb653a3023f6323e64" + +[[package]] +name = "signal-hook" +version = "0.3.18" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d881a16cf4426aa584979d30bd82cb33429027e42122b169753d6ef1085ed6e2" +dependencies = [ + "libc", + "signal-hook-registry", +] + +[[package]] +name = "signal-hook-mio" +version = "0.2.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "34db1a06d485c9142248b7a054f034b349b212551f3dfd19c94d45a754a217cd" +dependencies = [ + "libc", + "mio", + "signal-hook", +] + +[[package]] +name = "signal-hook-registry" +version = "1.4.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9203b8055f63a2a00e2f593bb0510367fe707d7ff1e5c872de2f537b339e5410" +dependencies = [ + "libc", +] + +[[package]] +name = "smallvec" +version = "1.15.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "67b1b7a3b5fe4f1376887184045fcf45c69e92af734b7aaddc05fb777b6fbd03" + +[[package]] +name = "strip-ansi-escapes" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2a8f8038e7e7969abb3f1b7c2a811225e9296da208539e0f79c5251d6cac0025" +dependencies = [ + "vte", +] + +[[package]] +name = "strum" +version = "0.26.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8fec0f0aef304996cf250b31b5a10dee7980c85da9d759361292b8bca5a18f06" + +[[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", +] + +[[package]] +name = "supports-color" +version = "3.0.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c64fc7232dd8d2e4ac5ce4ef302b1d81e0b80d055b9d77c7c4f51f6aa4c867d6" +dependencies = [ + "is_ci", +] + +[[package]] +name = "supports-hyperlinks" +version = "3.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "804f44ed3c63152de6a9f90acbea1a110441de43006ea51bcce8f436196a288b" + +[[package]] +name = "supports-unicode" +version = "3.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b7401a30af6cb5818bb64852270bb722533397edcfc7344954a38f420819ece2" + +[[package]] +name = "syn" +version = "2.0.104" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "17b6f705963418cdb9927482fa304bc562ece2fdd4f616084c50b7023b435a40" +dependencies = [ + "proc-macro2", + "quote", + "unicode-ident", +] + +[[package]] +name = "sys-locale" +version = "0.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8eab9a99a024a169fe8a903cf9d4a3b3601109bcc13bd9e3c6fff259138626c4" +dependencies = [ + "libc", +] + +[[package]] +name = "sysinfo" +version = "0.33.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4fc858248ea01b66f19d8e8a6d55f41deaf91e9d495246fd01368d99935c6c01" +dependencies = [ + "core-foundation-sys", + "libc", + "memchr", + "ntapi", + "rayon", + "windows 0.57.0", +] + +[[package]] +name = "tempfile" +version = "3.20.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e8a64e3985349f2441a1a9ef0b853f869006c3855f2cda6862a94d26ebb9d6a1" +dependencies = [ + "fastrand", + "getrandom 0.3.3", + "once_cell", + "rustix 1.0.7", + "windows-sys 0.59.0", +] + +[[package]] +name = "terminal_size" +version = "0.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "45c6481c4829e4cc63825e62c49186a34538b7b2750b73b266581ffb612fb5ed" +dependencies = [ + "rustix 1.0.7", + "windows-sys 0.59.0", +] + +[[package]] +name = "textwrap" +version = "0.16.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c13547615a44dc9c452a8a534638acdf07120d4b6847c8178705da06306a3057" +dependencies = [ + "unicode-linebreak", + "unicode-width 0.2.1", +] + +[[package]] +name = "thiserror" +version = "1.0.69" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b6aaf5339b578ea85b50e080feb250a3e8ae8cfcdff9a461c9ec2904bc923f52" +dependencies = [ + "thiserror-impl 1.0.69", +] + +[[package]] +name = "thiserror" +version = "2.0.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "567b8a2dae586314f7be2a752ec7474332959c6460e02bde30d702a66d488708" +dependencies = [ + "thiserror-impl 2.0.12", +] + +[[package]] +name = "thiserror-impl" +version = "1.0.69" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4fee6c4efc90059e10f81e6d42c60a18f76588c3d74cb83a0b242a2b6c7504c1" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "thiserror-impl" +version = "2.0.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7f7cf42b4507d8ea322120659672cf1b9dbb93f8f2d4ecfd6e51350ff5b17a1d" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "tree_magic_mini" +version = "3.1.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "aac5e8971f245c3389a5a76e648bfc80803ae066a1243a75db0064d7c1129d63" +dependencies = [ + "fnv", + "memchr", + "nom", + "once_cell", + "petgraph", +] + +[[package]] +name = "typeid" +version = "1.0.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bc7d623258602320d5c55d1bc22793b57daff0ec7efc270ea7d55ce1d5f5471c" + +[[package]] +name = "typetag" +version = "0.2.20" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "73f22b40dd7bfe8c14230cf9702081366421890435b2d625fa92b4acc4c3de6f" +dependencies = [ + "erased-serde", + "inventory", + "once_cell", + "serde", + "typetag-impl", +] + +[[package]] +name = "typetag-impl" +version = "0.2.20" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "35f5380909ffc31b4de4f4bdf96b877175a016aa2ca98cee39fcfd8c4d53d952" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "unicase" +version = "2.8.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "75b844d17643ee918803943289730bec8aac480150456169e647ed0b576ba539" + +[[package]] +name = "unicode-ident" +version = "1.0.18" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5a5f39404a5da50712a4c1eecf25e90dd62b613502b7e925fd4e4d19b5c96512" + +[[package]] +name = "unicode-linebreak" +version = "0.1.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3b09c83c3c29d37506a3e260c08c03743a6bb66a9cd432c6934ab501a190571f" + +[[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.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4a1a07cc7db3810833284e8d372ccdc6da29741639ecc70c9ec107df0fa6154c" + +[[package]] +name = "vte" +version = "0.14.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "231fdcd7ef3037e8330d8e17e61011a2c244126acc0a982f4040ac3f9f0bc077" +dependencies = [ + "memchr", +] + +[[package]] +name = "wasi" +version = "0.11.1+wasi-snapshot-preview1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ccf3ec651a847eb01de73ccad15eb7d99f80485de043efb2f370cd654f4ea44b" + +[[package]] +name = "wasi" +version = "0.14.2+wasi-0.2.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9683f9a5a998d873c0d21fcbe3c083009670149a8fab228644b8bd36b2c48cb3" +dependencies = [ + "wit-bindgen-rt", +] + +[[package]] +name = "wasm-bindgen" +version = "0.2.100" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1edc8929d7499fc4e8f0be2262a241556cfc54a0bea223790e71446f2aab1ef5" +dependencies = [ + "cfg-if", + "once_cell", + "rustversion", + "wasm-bindgen-macro", +] + +[[package]] +name = "wasm-bindgen-backend" +version = "0.2.100" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2f0a0651a5c2bc21487bde11ee802ccaf4c51935d0d3d42a6101f98161700bc6" +dependencies = [ + "bumpalo", + "log", + "proc-macro2", + "quote", + "syn", + "wasm-bindgen-shared", +] + +[[package]] +name = "wasm-bindgen-macro" +version = "0.2.100" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7fe63fc6d09ed3792bd0897b314f53de8e16568c2b3f7982f468c0bf9bd0b407" +dependencies = [ + "quote", + "wasm-bindgen-macro-support", +] + +[[package]] +name = "wasm-bindgen-macro-support" +version = "0.2.100" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8ae87ea40c9f689fc23f209965b6fb8a99ad69aeeb0231408be24920604395de" +dependencies = [ + "proc-macro2", + "quote", + "syn", + "wasm-bindgen-backend", + "wasm-bindgen-shared", +] + +[[package]] +name = "wasm-bindgen-shared" +version = "0.2.100" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1a05d73b933a847d6cccdda8f838a22ff101ad9bf93e33684f39c1f5f0eece3d" +dependencies = [ + "unicode-ident", +] + +[[package]] +name = "wayland-backend" +version = "0.3.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fe770181423e5fc79d3e2a7f4410b7799d5aab1de4372853de3c6aa13ca24121" +dependencies = [ + "cc", + "downcast-rs", + "rustix 0.38.44", + "smallvec", + "wayland-sys", +] + +[[package]] +name = "wayland-client" +version = "0.31.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "978fa7c67b0847dbd6a9f350ca2569174974cd4082737054dbb7fbb79d7d9a61" +dependencies = [ + "bitflags", + "rustix 0.38.44", + "wayland-backend", + "wayland-scanner", +] + +[[package]] +name = "wayland-protocols" +version = "0.32.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "779075454e1e9a521794fed15886323ea0feda3f8b0fc1390f5398141310422a" +dependencies = [ + "bitflags", + "wayland-backend", + "wayland-client", + "wayland-scanner", +] + +[[package]] +name = "wayland-protocols-wlr" +version = "0.3.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1cb6cdc73399c0e06504c437fe3cf886f25568dd5454473d565085b36d6a8bbf" +dependencies = [ + "bitflags", + "wayland-backend", + "wayland-client", + "wayland-protocols", + "wayland-scanner", +] + +[[package]] +name = "wayland-scanner" +version = "0.31.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "896fdafd5d28145fce7958917d69f2fd44469b1d4e861cb5961bcbeebc6d1484" +dependencies = [ + "proc-macro2", + "quick-xml", + "quote", +] + +[[package]] +name = "wayland-sys" +version = "0.31.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dbcebb399c77d5aa9fa5db874806ee7b4eba4e73650948e8f93963f128896615" +dependencies = [ + "pkg-config", +] + +[[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 = "widestring" +version = "1.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dd7cf3379ca1aac9eea11fba24fd7e315d621f8dfe35c8d7d2be8b793726e07d" + +[[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" +version = "0.56.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1de69df01bdf1ead2f4ac895dc77c9351aefff65b2f3db429a343f9cbf05e132" +dependencies = [ + "windows-core 0.56.0", + "windows-targets 0.52.6", +] + +[[package]] +name = "windows" +version = "0.57.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "12342cb4d8e3b046f3d80effd474a7a02447231330ef77d71daa6fbc40681143" +dependencies = [ + "windows-core 0.57.0", + "windows-targets 0.52.6", +] + +[[package]] +name = "windows-core" +version = "0.56.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4698e52ed2d08f8658ab0c39512a7c00ee5fe2688c65f8c0a4f06750d729f2a6" +dependencies = [ + "windows-implement 0.56.0", + "windows-interface 0.56.0", + "windows-result 0.1.2", + "windows-targets 0.52.6", +] + +[[package]] +name = "windows-core" +version = "0.57.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d2ed2439a290666cd67ecce2b0ffaad89c2a56b976b736e6ece670297897832d" +dependencies = [ + "windows-implement 0.57.0", + "windows-interface 0.57.0", + "windows-result 0.1.2", + "windows-targets 0.52.6", +] + +[[package]] +name = "windows-core" +version = "0.61.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c0fdd3ddb90610c7638aa2b3a3ab2904fb9e5cdbecc643ddb3647212781c4ae3" +dependencies = [ + "windows-implement 0.60.0", + "windows-interface 0.59.1", + "windows-link", + "windows-result 0.3.4", + "windows-strings", +] + +[[package]] +name = "windows-implement" +version = "0.56.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f6fc35f58ecd95a9b71c4f2329b911016e6bec66b3f2e6a4aad86bd2e99e2f9b" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "windows-implement" +version = "0.57.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9107ddc059d5b6fbfbffdfa7a7fe3e22a226def0b2608f72e9d552763d3e1ad7" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "windows-implement" +version = "0.60.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a47fddd13af08290e67f4acabf4b459f647552718f683a7b415d290ac744a836" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "windows-interface" +version = "0.56.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "08990546bf4edef8f431fa6326e032865f27138718c587dc21bc0265bbcb57cc" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "windows-interface" +version = "0.57.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "29bee4b38ea3cde66011baa44dba677c432a78593e202392d1e9070cf2a7fca7" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "windows-interface" +version = "0.59.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bd9211b69f8dcdfa817bfd14bf1c97c9188afa36f4750130fcdf3f400eca9fa8" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "windows-link" +version = "0.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5e6ad25900d524eaabdbbb96d20b4311e1e7ae1699af4fb28c17ae66c80d798a" + +[[package]] +name = "windows-result" +version = "0.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5e383302e8ec8515204254685643de10811af0ed97ea37210dc26fb0032647f8" +dependencies = [ + "windows-targets 0.52.6", +] + +[[package]] +name = "windows-result" +version = "0.3.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "56f42bd332cc6c8eac5af113fc0c1fd6a8fd2aa08a0119358686e5160d0586c6" +dependencies = [ + "windows-link", +] + +[[package]] +name = "windows-strings" +version = "0.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "56e6c93f3a0c3b36176cb1327a4958a0353d5d166c2a35cb268ace15e91d3b57" +dependencies = [ + "windows-link", +] + +[[package]] +name = "windows-sys" +version = "0.48.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "677d2418bec65e3338edb076e806bc1ec15693c5d0104683f2efe857f61056a9" +dependencies = [ + "windows-targets 0.48.5", +] + +[[package]] +name = "windows-sys" +version = "0.52.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "282be5f36a8ce781fad8c8ae18fa3f9beff57ec1b52cb3de0789201425d9a33d" +dependencies = [ + "windows-targets 0.52.6", +] + +[[package]] +name = "windows-sys" +version = "0.59.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1e38bc4d79ed67fd075bcc251a1c39b32a1776bbe92e5bef1f0bf1f8c531853b" +dependencies = [ + "windows-targets 0.52.6", +] + +[[package]] +name = "windows-sys" +version = "0.60.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f2f500e4d28234f72040990ec9d39e3a6b950f9f22d3dba18416c35882612bcb" +dependencies = [ + "windows-targets 0.53.2", +] + +[[package]] +name = "windows-targets" +version = "0.48.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9a2fa6e2155d7247be68c096456083145c183cbbbc2764150dda45a87197940c" +dependencies = [ + "windows_aarch64_gnullvm 0.48.5", + "windows_aarch64_msvc 0.48.5", + "windows_i686_gnu 0.48.5", + "windows_i686_msvc 0.48.5", + "windows_x86_64_gnu 0.48.5", + "windows_x86_64_gnullvm 0.48.5", + "windows_x86_64_msvc 0.48.5", +] + +[[package]] +name = "windows-targets" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9b724f72796e036ab90c1021d4780d4d3d648aca59e491e6b98e725b84e99973" +dependencies = [ + "windows_aarch64_gnullvm 0.52.6", + "windows_aarch64_msvc 0.52.6", + "windows_i686_gnu 0.52.6", + "windows_i686_gnullvm 0.52.6", + "windows_i686_msvc 0.52.6", + "windows_x86_64_gnu 0.52.6", + "windows_x86_64_gnullvm 0.52.6", + "windows_x86_64_msvc 0.52.6", +] + +[[package]] +name = "windows-targets" +version = "0.53.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c66f69fcc9ce11da9966ddb31a40968cad001c5bedeb5c2b82ede4253ab48aef" +dependencies = [ + "windows_aarch64_gnullvm 0.53.0", + "windows_aarch64_msvc 0.53.0", + "windows_i686_gnu 0.53.0", + "windows_i686_gnullvm 0.53.0", + "windows_i686_msvc 0.53.0", + "windows_x86_64_gnu 0.53.0", + "windows_x86_64_gnullvm 0.53.0", + "windows_x86_64_msvc 0.53.0", +] + +[[package]] +name = "windows_aarch64_gnullvm" +version = "0.48.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2b38e32f0abccf9987a4e3079dfb67dcd799fb61361e53e2882c3cbaf0d905d8" + +[[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_gnullvm" +version = "0.53.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "86b8d5f90ddd19cb4a147a5fa63ca848db3df085e25fee3cc10b39b6eebae764" + +[[package]] +name = "windows_aarch64_msvc" +version = "0.48.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dc35310971f3b2dbbf3f0690a219f40e2d9afcf64f9ab7cc1be722937c26b4bc" + +[[package]] +name = "windows_aarch64_msvc" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "09ec2a7bb152e2252b53fa7803150007879548bc709c039df7627cabbd05d469" + +[[package]] +name = "windows_aarch64_msvc" +version = "0.53.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c7651a1f62a11b8cbd5e0d42526e55f2c99886c77e007179efff86c2b137e66c" + +[[package]] +name = "windows_i686_gnu" +version = "0.48.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a75915e7def60c94dcef72200b9a8e58e5091744960da64ec734a6c6e9b3743e" + +[[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_gnu" +version = "0.53.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c1dc67659d35f387f5f6c479dc4e28f1d4bb90ddd1a5d3da2e5d97b42d6272c3" + +[[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_gnullvm" +version = "0.53.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9ce6ccbdedbf6d6354471319e781c0dfef054c81fbc7cf83f338a4296c0cae11" + +[[package]] +name = "windows_i686_msvc" +version = "0.48.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8f55c233f70c4b27f66c523580f78f1004e8b5a8b659e05a4eb49d4166cca406" + +[[package]] +name = "windows_i686_msvc" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "240948bc05c5e7c6dabba28bf89d89ffce3e303022809e73deaefe4f6ec56c66" + +[[package]] +name = "windows_i686_msvc" +version = "0.53.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "581fee95406bb13382d2f65cd4a908ca7b1e4c2f1917f143ba16efe98a589b5d" + +[[package]] +name = "windows_x86_64_gnu" +version = "0.48.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "53d40abd2583d23e4718fddf1ebec84dbff8381c07cae67ff7768bbf19c6718e" + +[[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_gnu" +version = "0.53.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2e55b5ac9ea33f2fc1716d1742db15574fd6fc8dadc51caab1c16a3d3b4190ba" + +[[package]] +name = "windows_x86_64_gnullvm" +version = "0.48.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0b7b52767868a23d5bab768e390dc5f5c55825b6d30b86c844ff2dc7414044cc" + +[[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_gnullvm" +version = "0.53.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0a6e035dd0599267ce1ee132e51c27dd29437f63325753051e71dd9e42406c57" + +[[package]] +name = "windows_x86_64_msvc" +version = "0.48.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ed94fce61571a4006852b7389a063ab983c02eb1bb37b47f8272ce92d06d9538" + +[[package]] +name = "windows_x86_64_msvc" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "589f6da84c646204747d1270a2a5661ea66ed1cced2631d546fdfb155959f9ec" + +[[package]] +name = "windows_x86_64_msvc" +version = "0.53.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "271414315aff87387382ec3d271b52d7ae78726f5d44ac98b4f4030c91880486" + +[[package]] +name = "wit-bindgen-rt" +version = "0.39.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6f42320e61fe2cfd34354ecb597f86f413484a798ba44a8ca1165c58d42da6c1" +dependencies = [ + "bitflags", +] + +[[package]] +name = "wl-clipboard-rs" +version = "0.9.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8e5ff8d0e60065f549fafd9d6cb626203ea64a798186c80d8e7df4f8af56baeb" +dependencies = [ + "libc", + "log", + "os_pipe", + "rustix 0.38.44", + "tempfile", + "thiserror 2.0.12", + "tree_magic_mini", + "wayland-backend", + "wayland-client", + "wayland-protocols", + "wayland-protocols-wlr", +] + +[[package]] +name = "x11rb" +version = "0.13.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5d91ffca73ee7f68ce055750bf9f6eca0780b8c85eff9bc046a3b0da41755e12" +dependencies = [ + "gethostname", + "rustix 0.38.44", + "x11rb-protocol", +] + +[[package]] +name = "x11rb-protocol" +version = "0.13.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ec107c4503ea0b4a98ef47356329af139c0a4f7750e621cf2973cd3385ebcb3d" diff --git a/nu_plugin_clipboard/Cargo.toml b/nu_plugin_clipboard/Cargo.toml new file mode 100644 index 0000000..8dda478 --- /dev/null +++ b/nu_plugin_clipboard/Cargo.toml @@ -0,0 +1,32 @@ +[package] +name = "nu_plugin_clipboard" +license = "MIT" +authors = [ + "Motalleb Fallahnezhad ", +] +keywords = [ + "nushell", + "clipboard", + "plugin", +] +homepage = "https://github.com/FMotalleb/nu_plugin_clipboard" +repository = "https://github.com/FMotalleb/nu_plugin_clipboard" +description = "A nushell plugin to copy text into clipboard or get text from it." +version = "0.105.2" +edition = "2024" +readme = "README.md" + +[dependencies] +nu-plugin = { version = "0.105.2", path = "../nushell/crates/nu-plugin" } +nu-protocol = { version = "0.105.2", features = ["plugin"] , path = "../nushell/crates/nu-protocol" } +arboard = { version = "3.5.0", default-features = false } +nu-json = { path = "../nushell/crates/nu-json", version = "0.105.2" } + +[features] +default = [ +] +use-wayland = [ + "arboard/wayland-data-control", +] +debug = [ +] diff --git a/nu_plugin_clipboard/LICENSE b/nu_plugin_clipboard/LICENSE new file mode 100644 index 0000000..abbd7eb --- /dev/null +++ b/nu_plugin_clipboard/LICENSE @@ -0,0 +1,7 @@ +Copyright 2023 "Motalleb Fallahnezhad" + +Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/nu_plugin_clipboard/README.md b/nu_plugin_clipboard/README.md new file mode 100644 index 0000000..1684e66 --- /dev/null +++ b/nu_plugin_clipboard/README.md @@ -0,0 +1,95 @@ +# 📋 nu_plugin_clipboard + +A [nushell](https://www.nushell.sh/) plugin for interacting with the clipboard, allowing you to copy/paste text, objects, and tables. + +## ✨ Features + +- **`clipboard copy`**: Copies input text to the clipboard. + - **Daemon Behavior:** Since version **0.105.2**, using env variables will try to detect display server. + This config will override this behavior, if you need to override this please report and issue: + + ```bash + $env.config.plugins.clipboard.NO_DAEMON = true + ``` + + - To make this setting permanent, add it to your `config env`. + +- **`clipboard paste`**: Retrieves the current clipboard content. + +## ⚠️ Important + +If you face the error `Error: × Clipboard Error: The clipboard contents were not available in the requested format...` +Try disabling the daemon mode, as mentioned in [#20](https://github.com/FMotalleb/nu_plugin_clipboard/issues/20). + +## 📌 Usage Examples + +### Copying a string (supports only strings for now) + +```bash +echo "test value" | clipboard copy +``` + +### Using clipboard content + +```bash +clipboard paste | echo $in +``` + +### Copying tables and objects + +- Tables and objects are internally converted to **JSON**. +- When pasting, `clipboard paste` tries to parse JSON into a table or object. +- If parsing fails, the content is returned as a string. + +```bash +$env | clipboard copy +clipboard paste + +ps | clipboard copy +clipboard paste +``` + +## 🔧 Installation + +### 🚀 Recommended: Using [nupm](https://github.com/nushell/nupm) + +This method automatically handles dependencies and features: + +```bash +git clone https://github.com/FMotalleb/nu_plugin_clipboard.git +nupm install --path nu_plugin_clipboard -f +``` + +### ⚙️ Supported Features + +- **`use-wayland`**: Prioritizes the Wayland API, but falls back to X11 if needed. +- **`enforce-daemon`**: _(Deprecated)_ Now always enabled on Linux. Disable with: + + ```bash + $env.config.plugins.clipboard.NO_DAEMON = true + ``` + +### 🛠️ Manual Compilation + +```bash +git clone https://github.com/FMotalleb/nu_plugin_clipboard.git +cd nu_plugin_clipboard +cargo build -r +plugin add target/release/nu_plugin_clipboard +``` + +### 📦 Install via Cargo (using git) + +```bash +cargo install --git https://github.com/FMotalleb/nu_plugin_clipboard.git +plugin add ~/.cargo/bin/nu_plugin_clipboard +``` + +### 📦 Install via Cargo (crates.io) _Not Recommended_ + +- Since I live in Iran and crates.io won't let me update my packages like a normal person, most of the time crates.io is outdated. + +```bash +cargo install nu_plugin_clipboard +plugin add ~/.cargo/bin/nu_plugin_clipboard +``` diff --git a/nu_plugin_clipboard/build.nu b/nu_plugin_clipboard/build.nu new file mode 100644 index 0000000..0dda98e --- /dev/null +++ b/nu_plugin_clipboard/build.nu @@ -0,0 +1,44 @@ +use std log + +let messages = { + "use-wayland" : $"Found (ansi blue)wayland(ansi reset) in env\(`(ansi blue)XDG_SESSION_TYPE(ansi reset)`\): activating `(ansi green)use-wayland(ansi reset)` feature" + "debug" : $"Debug mode is enabled: activating `(ansi green)debug(ansi reset)` feature" +} +def append-feature [active: bool,feature: string] { + if $active { + $in | append $feature + } else { + $in + } +} + +def main [package_file: path = nupm.nuon] { + let repo_root = (ls -f $package_file | first | get name | path dirname) + let install_root = $env.NUPM_HOME | path join "plugins" + + let name = open ($repo_root | path join "Cargo.toml") | get package.name + let debug = (([no,yes] | input list "Enable debug mode (do not enable unless u wanna debug)") == "yes") + let use_wayland = ($nu.os-info.name == "linux" and ($env.XDG_SESSION_TYPE? == "wayland")) + let features = [] + | append-feature $use_wayland use-wayland + | append-feature $debug debug + for feature in $features { + let message = $messages | get $feature + if $message != null { + log info $message + } + } + + let channel = $repo_root + | path join rust-toolchain.toml + | open $in + | get toolchain?.channel? + | default stable + + let cmd = $"cargo +($channel) install --path ($repo_root) --root ($install_root) --features=($features | str join ",")" + log info $"building plugin using: (ansi blue)($cmd)(ansi reset)" + nu -c $cmd + let ext: string = if ($nu.os-info.name == 'windows') { '.exe' } else { '' } + plugin add $"($install_root | path join "bin" $name)($ext)" + log info "do not forget to restart Nushell for the plugin to be fully available!" +} diff --git a/nu_plugin_clipboard/nupm.nuon b/nu_plugin_clipboard/nupm.nuon new file mode 100644 index 0000000..341988d --- /dev/null +++ b/nu_plugin_clipboard/nupm.nuon @@ -0,0 +1,7 @@ +{ + "name": "nu_plugin_clipboard", + "version": "0.105.2", + "description": "A nushell plugin to copy text into clipboard or get text from it.", + "license": "LICENSE", + "type": "custom" +} diff --git a/nu_plugin_clipboard/rust-toolchain.toml b/nu_plugin_clipboard/rust-toolchain.toml new file mode 100644 index 0000000..29171b0 --- /dev/null +++ b/nu_plugin_clipboard/rust-toolchain.toml @@ -0,0 +1,3 @@ +[toolchain] +profile = "default" +channel = "stable" diff --git a/nu_plugin_clipboard/src/clipboard/arboard_provider.rs b/nu_plugin_clipboard/src/clipboard/arboard_provider.rs new file mode 100644 index 0000000..0f1ee93 --- /dev/null +++ b/nu_plugin_clipboard/src/clipboard/arboard_provider.rs @@ -0,0 +1,12 @@ +use super::error_mapper::map_arboard_err_to_label; +use nu_protocol::LabeledError; +pub(crate) fn with_clipboard_instance< + U, + F: FnOnce(&mut arboard::Clipboard) -> Result, +>( + op: F, +) -> Result { + let mut clipboard = arboard::Clipboard::new().map_err(map_arboard_err_to_label)?; + + op(&mut clipboard).map_err(map_arboard_err_to_label) +} diff --git a/nu_plugin_clipboard/src/clipboard/clipboard.rs b/nu_plugin_clipboard/src/clipboard/clipboard.rs new file mode 100644 index 0000000..2f812db --- /dev/null +++ b/nu_plugin_clipboard/src/clipboard/clipboard.rs @@ -0,0 +1,60 @@ +#[cfg(target_os = "linux")] +use std::io::Error; + +use nu_protocol::LabeledError; + +use super::arboard_provider::with_clipboard_instance; + +pub enum CheckResult { + Continue, + #[cfg(target_os = "linux")] + Exit(String, i32), +} + +#[cfg(target_os = "linux")] +fn no_daemon(config: Option) -> Result { + use crate::clipboard::detect_display::DisplayServer; + + match config { + None => Ok(!DisplayServer::should_use_daemon()), + Some(nu_protocol::Value::Record { val, .. }) => { + return no_daemon(val.get("NO_DAEMON").cloned()); + } + Some(nu_protocol::Value::Bool { val, .. }) => Ok(val), + Some(nu_protocol::Value::String { val, .. }) => match val.as_str() { + "true" | "True" | "1" => Ok(true), + _ => Ok(!DisplayServer::should_use_daemon()), + }, + Some(nu_protocol::Value::Int { val, .. }) => Ok(val == 1), + _ => Ok(!DisplayServer::should_use_daemon()), + } +} + +#[cfg(target_os = "linux")] +pub fn create_clipboard(config: Option) -> impl Clipboard { + crate::clipboard::linux::ClipBoardLinux::new(!no_daemon(config).unwrap_or(false)) +} + +#[cfg(not(target_os = "linux"))] +pub fn create_clipboard(_: Option) -> impl Clipboard { + #[cfg(target_os = "macos")] + { + crate::clipboard::mac_os::ClipBoardMacos::new() + } + #[cfg(target_os = "windows")] + { + crate::clipboard::windows::ClipBoardWindows::new() + } +} + +pub trait Clipboard { + fn pre_execute_check(&self) -> CheckResult { + CheckResult::Continue + } + fn copy_text(&self, text: &str) -> Result<(), LabeledError> { + with_clipboard_instance(|clip| clip.set_text(text)) + } + fn get_text(&self) -> Result { + with_clipboard_instance(|clip| clip.get_text()) + } +} diff --git a/nu_plugin_clipboard/src/clipboard/detect_display.rs b/nu_plugin_clipboard/src/clipboard/detect_display.rs new file mode 100644 index 0000000..4f5eeba --- /dev/null +++ b/nu_plugin_clipboard/src/clipboard/detect_display.rs @@ -0,0 +1,48 @@ +use std::env; + +use crate::debug_println; + +pub enum DisplayServer { + Wayland, + X11, + Unknown(String), + None, +} + +impl DisplayServer { + fn detect() -> DisplayServer { + if let Ok(session_type) = env::var("XDG_SESSION_TYPE") { + debug_println!("found XDG_SESSION: {}", session_type); + match session_type.to_lowercase().as_str() { + "wayland" => DisplayServer::Wayland, + "x11" => DisplayServer::X11, + _ => DisplayServer::Unknown(session_type), + } + } else if env::var("WAYLAND_DISPLAY").is_ok() { + debug_println!("WAYLAND_DISPLAY is found"); + DisplayServer::Wayland + } else if env::var("DISPLAY").is_ok() { + debug_println!("DISPLAY (X11) is found"); + DisplayServer::X11 + } else { + DisplayServer::None + } + } + + pub fn should_use_daemon() -> bool { + match Self::detect() { + DisplayServer::Wayland => false, + DisplayServer::X11 => true, + // Iam not sure about these values, let's assume they do not require a daemon + DisplayServer::Unknown(srv) => { + eprintln!( + "Unknown display server detected, assuming no daemon is needed, please report your display server's name in issue tracker. {} +If you experience issues with clipboard, follow daemon settings in https://github.com/FMotalleb/nu_plugin_clipboard.", + srv, + ); + false + } + DisplayServer::None => false, + } + } +} diff --git a/nu_plugin_clipboard/src/clipboard/error_mapper.rs b/nu_plugin_clipboard/src/clipboard/error_mapper.rs new file mode 100644 index 0000000..1cad115 --- /dev/null +++ b/nu_plugin_clipboard/src/clipboard/error_mapper.rs @@ -0,0 +1,3 @@ +pub(crate) fn map_arboard_err_to_label(err: arboard::Error) -> nu_protocol::LabeledError { + nu_protocol::LabeledError::new(format!("Clipboard Error: {}", err.to_string())) +} diff --git a/nu_plugin_clipboard/src/clipboard/linux.rs b/nu_plugin_clipboard/src/clipboard/linux.rs new file mode 100644 index 0000000..5711300 --- /dev/null +++ b/nu_plugin_clipboard/src/clipboard/linux.rs @@ -0,0 +1,103 @@ +use std::{ + env, + io::{stderr, stdout, Read, Write}, + process::{Command, Stdio}, +}; + +use super::{ + arboard_provider::with_clipboard_instance, + clipboard::{CheckResult, Clipboard}, +}; + +use arboard::Error; +use nu_protocol::LabeledError; + +const DAEMONIZE_ARG: &str = "daemon-copy"; + +pub(crate) struct ClipBoardLinux { + pub(crate) use_daemon: bool, +} + +impl ClipBoardLinux { + pub fn new(use_daemon: bool) -> Self { + Self { use_daemon } + } + + fn is_daemon_request() -> bool { + env::args().nth(1).as_deref() == Some(DAEMONIZE_ARG) + } + + fn request_daemon(&self, text: &str) -> Result<(), nu_protocol::LabeledError> { + match env::current_exe().map(|exe| spawn_daemon(text, exe)) { + Ok(res) => res, + Err(err) => Err(nu_protocol::LabeledError::new(format!( + "Failed to spawn daemon process: {}", + err.to_string() + ))), + } + } + + fn copy_with_daemon() -> Result<(), LabeledError> { + with_clipboard_instance(|clip: &mut arboard::Clipboard| { + clip.clear()?; + let mut input = String::new(); + if let Err(err) = std::io::stdin().read_to_string(&mut input) { + return Err(Error::Unknown { + description: format!("Failed to read from stdin: {}", err.to_string()), + }); + } + clip.set_text(input) + }) + } +} + +fn spawn_daemon(text: &str, exe: std::path::PathBuf) -> Result<(), LabeledError> { + let child = Command::new(exe) + .arg(DAEMONIZE_ARG) + .stdin(Stdio::piped()) + .stdout(stdout()) + .stderr(stderr()) + .current_dir(env::temp_dir()) + .spawn(); + if let Err(err) = child { + return Err(LabeledError::new(format!( + "failed to spawn daemon process: {}", + err + ))); + } + let mut child = child.unwrap(); + if let Some(mut stdin) = child.stdin.take() { + if let Err(err) = stdin.write_all(text.as_bytes()) { + return Err(LabeledError::new(format!( + "Failed to write to stdin: {}", + err + ))); + } + } + + // Optionally, wait for the child process to finish + let status = child.wait(); + status + .map(|_| ()) + .map_err(|e| LabeledError::new(e.to_string())) +} + +impl Clipboard for ClipBoardLinux { + fn pre_execute_check(&self) -> CheckResult { + match Self::is_daemon_request() { + true => match Self::copy_with_daemon() { + Err(e) => CheckResult::Exit(e.msg, 1), + _ => CheckResult::Exit("".to_string(), 0), + }, + false => CheckResult::Continue, + } + } + + fn copy_text(&self, text: &str) -> Result<(), LabeledError> { + if self.use_daemon { + self.request_daemon(text) + } else { + with_clipboard_instance(|clip: &mut arboard::Clipboard| clip.set_text(text)) + } + } +} diff --git a/nu_plugin_clipboard/src/clipboard/mac_os.rs b/nu_plugin_clipboard/src/clipboard/mac_os.rs new file mode 100644 index 0000000..39cb5d3 --- /dev/null +++ b/nu_plugin_clipboard/src/clipboard/mac_os.rs @@ -0,0 +1,11 @@ +use super::clipboard::Clipboard; + +pub(crate) struct ClipBoardMacos; + +impl ClipBoardMacos { + pub fn new() -> Self { + Self {} + } +} + +impl Clipboard for ClipBoardMacos {} diff --git a/nu_plugin_clipboard/src/clipboard/mod.rs b/nu_plugin_clipboard/src/clipboard/mod.rs new file mode 100644 index 0000000..72e1efa --- /dev/null +++ b/nu_plugin_clipboard/src/clipboard/mod.rs @@ -0,0 +1,14 @@ +mod arboard_provider; +pub mod clipboard; +mod error_mapper; + +#[cfg(target_os = "linux")] +mod detect_display; +#[cfg(target_os = "linux")] +pub(crate) mod linux; + +#[cfg(target_os = "macos")] +pub(crate) mod mac_os; + +#[cfg(target_os = "windows")] +pub(crate) mod windows; diff --git a/nu_plugin_clipboard/src/clipboard/windows.rs b/nu_plugin_clipboard/src/clipboard/windows.rs new file mode 100644 index 0000000..17335dd --- /dev/null +++ b/nu_plugin_clipboard/src/clipboard/windows.rs @@ -0,0 +1,11 @@ +use super::clipboard::Clipboard; + +pub(crate) struct ClipBoardWindows; + +impl ClipBoardWindows { + pub fn new() -> Self { + Self {} + } +} + +impl Clipboard for ClipBoardWindows {} diff --git a/nu_plugin_clipboard/src/command/copy.rs b/nu_plugin_clipboard/src/command/copy.rs new file mode 100644 index 0000000..575e3b6 --- /dev/null +++ b/nu_plugin_clipboard/src/command/copy.rs @@ -0,0 +1,77 @@ +use crate::clipboard::clipboard::Clipboard; +use crate::ClipboardPlugins; +use crate::{clipboard::clipboard::create_clipboard, utils::json}; +use nu_plugin::{EngineInterface, EvaluatedCall, PluginCommand}; +use nu_protocol::{Category, IntoPipelineData, LabeledError, PipelineData, Signature, Type, Value}; + +pub struct ClipboardCopy; + +impl ClipboardCopy { + pub fn new() -> ClipboardCopy { + ClipboardCopy {} + } + fn format_json(input: &Value) -> Result { + let json_value = + json::value_to_json_value(&input).map(|v| nu_json::to_string_with_indent(&v, 4)); + + match json_value { + Ok(Ok(text)) => Ok(text.to_owned()), // Return the owned String + Ok(Err(err)) => Err(LabeledError::new(format!( + "JSON Serialization Error: {}", + err, + ))), + Err(err) => Err(LabeledError::new(format!("JSON Conversion Error: {}", err))), + } + } + fn copy(engine: &EngineInterface, input: &Value) -> Result<(), LabeledError> { + let text: Result = match input { + Value::String { val, .. } => Ok(val.to_owned()), + _ => Self::format_json(input), + }; + + match text.map(|text| { + create_clipboard(engine.get_plugin_config().ok().unwrap_or(None)) + .copy_text(text.as_str()) + }) { + Ok(Ok(_)) => Ok(()), + Err(err) | Ok(Err(err)) => Err(err), + } + } +} + +impl PluginCommand for ClipboardCopy { + type Plugin = ClipboardPlugins; + + fn name(&self) -> &str { + "clipboard copy" + } + + fn signature(&self) -> Signature { + Signature::build("clipboard copy") + .input_output_types(vec![(Type::Any, Type::Any)]) + .category(Category::System) + } + + fn run( + &self, + _plugin: &Self::Plugin, + engine: &EngineInterface, + call: &EvaluatedCall, + input: PipelineData, + ) -> Result { + let value = input.into_value(call.head); + match value { + Ok(value) => { + if let Err(err) = Self::copy(engine, &value) { + return Err(err); + } + Ok(value.into_pipeline_data()) + } + Err(err) => Err(LabeledError::new(err.to_string())), + } + } + + fn description(&self) -> &str { + "copy the input into the clipboard" + } +} diff --git a/nu_plugin_clipboard/src/command/mod.rs b/nu_plugin_clipboard/src/command/mod.rs new file mode 100644 index 0000000..e2fc292 --- /dev/null +++ b/nu_plugin_clipboard/src/command/mod.rs @@ -0,0 +1,2 @@ +pub mod copy; +pub mod paste; diff --git a/nu_plugin_clipboard/src/command/paste.rs b/nu_plugin_clipboard/src/command/paste.rs new file mode 100644 index 0000000..a7a5267 --- /dev/null +++ b/nu_plugin_clipboard/src/command/paste.rs @@ -0,0 +1,62 @@ +use crate::{ + clipboard::clipboard::{create_clipboard, Clipboard}, + utils::json::json_to_value, + ClipboardPlugins, +}; +use nu_plugin::{EngineInterface, EvaluatedCall, PluginCommand}; +use nu_protocol::{Category, IntoPipelineData, LabeledError, PipelineData, Type, Value}; + +pub struct ClipboardPaste; + +impl ClipboardPaste { + pub fn new() -> Self { + Self + } +} + +impl PluginCommand for ClipboardPaste { + type Plugin = ClipboardPlugins; + + fn name(&self) -> &str { + "clipboard paste" + } + + fn signature(&self) -> nu_protocol::Signature { + nu_protocol::Signature::build("clipboard paste") + .switch("raw", "disable json formatting", Some('r')) + .input_output_types(vec![(Type::Nothing, Type::Any)]) + .category(Category::System) + } + + fn description(&self) -> &str { + "Outputs the current value in clipboard" + } + + fn run( + &self, + _plugin: &Self::Plugin, + engine: &EngineInterface, + call: &EvaluatedCall, + _input: PipelineData, + ) -> Result { + let text = create_clipboard(engine.get_plugin_config().ok().flatten()).get_text()?; + if text.trim().is_empty() { + return Err(LabeledError::new("Empty clipboard".to_string())); + } + + if call.has_flag("raw").unwrap_or(false) { + return Ok(Value::string(text, call.head).into_pipeline_data()); + } + + match nu_json::from_str::(&text) { + Ok(value) => json_to_value(value, call.head).map(|v| v.into_pipeline_data()), + Err(nu_json::Error::Syntax(_, _, _)) => { + Ok(Value::string(text, call.head).into_pipeline_data()) + } + Err(e) => Err(LabeledError::new(format!( + "JSON Deserialization error: {}", + e + ))), + } + } +} diff --git a/nu_plugin_clipboard/src/main.rs b/nu_plugin_clipboard/src/main.rs new file mode 100644 index 0000000..ebd5735 --- /dev/null +++ b/nu_plugin_clipboard/src/main.rs @@ -0,0 +1,47 @@ +mod clipboard; +mod command; +pub mod utils; +use std::io; +#[cfg(target_os = "linux")] +use std::{ + io::{stderr, stdout, Write}, + process::exit, +}; + +use crate::command::copy::ClipboardCopy; +use crate::command::paste::ClipboardPaste; +use clipboard::clipboard::{create_clipboard, CheckResult, Clipboard}; +use nu_plugin::PluginCommand; + +pub struct ClipboardPlugins; + +impl nu_plugin::Plugin for ClipboardPlugins { + fn commands(&self) -> Vec>> { + vec![ + Box::new(ClipboardCopy::new()), + Box::new(ClipboardPaste::new()), + ] + } + + fn version(&self) -> String { + env!("CARGO_PKG_VERSION").into() + } +} + +fn main() -> Result<(), io::Error> { + match create_clipboard(None).pre_execute_check() { + CheckResult::Continue => Ok(nu_plugin::serve_plugin( + &mut ClipboardPlugins {}, + nu_plugin::MsgPackSerializer {}, + )), + #[cfg(target_os = "linux")] + CheckResult::Exit(message, code) => { + if code != 0 { + writeln!(stderr(), "Error ({}): {}", code, message)?; + } else if !message.is_empty() { + writeln!(stdout(), "{}", message)?; + } + exit(code) + } + } +} diff --git a/nu_plugin_clipboard/src/utils/json.rs b/nu_plugin_clipboard/src/utils/json.rs new file mode 100644 index 0000000..213fb7e --- /dev/null +++ b/nu_plugin_clipboard/src/utils/json.rs @@ -0,0 +1,87 @@ +use nu_protocol::ast::PathMember; +use nu_protocol::{LabeledError, Record, ShellError, Span, Value}; + +pub fn value_to_json_value(v: &Value) -> Result { + let span = v.span(); + Ok(match v { + Value::Bool { val, .. } => nu_json::Value::Bool(*val), + Value::Filesize { val, .. } => nu_json::Value::I64(val.get()), + Value::Duration { val, .. } => nu_json::Value::I64(*val), + Value::Date { val, .. } => nu_json::Value::String(val.to_string()), + Value::Float { val, .. } => nu_json::Value::F64(*val), + Value::Int { val, .. } => nu_json::Value::I64(*val), + Value::Nothing { .. } => nu_json::Value::Null, + Value::String { val, .. } => nu_json::Value::String(val.to_string()), + Value::Glob { val, .. } => nu_json::Value::String(val.to_string()), + Value::CellPath { val, .. } => nu_json::Value::Array( + val.members + .iter() + .map(|x| match &x { + PathMember::String { val, .. } => Ok(nu_json::Value::String(val.clone())), + PathMember::Int { val, .. } => Ok(nu_json::Value::U64(*val as u64)), + }) + .collect::, ShellError>>()?, + ), + + Value::List { vals, .. } => nu_json::Value::Array(json_list(vals)?), + Value::Error { error, .. } => return Err(*error.clone()), + Value::Closure { .. } | Value::Range { .. } => nu_json::Value::Null, + Value::Binary { val, .. } => { + nu_json::Value::Array(val.iter().map(|x| nu_json::Value::U64(*x as u64)).collect()) + } + Value::Record { val, .. } => { + let mut m = nu_json::Map::new(); + for (k, v) in &**val { + m.insert(k.clone(), value_to_json_value(v)?); + } + nu_json::Value::Object(m) + } + Value::Custom { val, .. } => { + let collected = val.to_base_value(span)?; + value_to_json_value(&collected)? + } + }) +} + +pub fn json_list(input: &[Value]) -> Result, ShellError> { + let mut out = vec![]; + + for value in input { + out.push(value_to_json_value(value)?); + } + + Ok(out) +} + +pub fn json_to_value(v: nu_json::Value, span: Span) -> Result { + Ok(match v { + nu_json::Value::Null => Value::nothing(span), + nu_json::Value::Bool(val) => Value::bool(val, span), + nu_json::Value::I64(val) => Value::int(val, span), + nu_json::Value::U64(val) => { + if val <= i64::MAX as u64 { + let val = val as i64; + Value::int(val, span) + } else { + Value::string(format!("{}", val), span) + } + } + nu_json::Value::F64(val) => Value::float(val, span), + nu_json::Value::String(val) => Value::string(val, span), + nu_json::Value::Array(vec) => { + let arr: &mut Vec = &mut vec![]; + for jval in vec { + arr.push(json_to_value(jval, span)?); + } + Value::list(arr.to_vec(), span) + } + nu_json::Value::Object(val) => { + let mut rec = Record::new(); + for (k, v) in val { + let value = json_to_value(v, span)?; + rec.insert(k.clone(), value); + } + Value::record(rec, span) + } + }) +} diff --git a/nu_plugin_clipboard/src/utils/log.rs b/nu_plugin_clipboard/src/utils/log.rs new file mode 100644 index 0000000..aa5b1ff --- /dev/null +++ b/nu_plugin_clipboard/src/utils/log.rs @@ -0,0 +1,9 @@ +#[macro_export] +macro_rules! debug_println { + ($($arg:tt)*) => { + #[cfg(feature = "debug")] + { + eprintln!($($arg)*); + } + }; +} diff --git a/nu_plugin_clipboard/src/utils/mod.rs b/nu_plugin_clipboard/src/utils/mod.rs new file mode 100644 index 0000000..bf67ee7 --- /dev/null +++ b/nu_plugin_clipboard/src/utils/mod.rs @@ -0,0 +1,3 @@ +pub mod json; + +pub mod log; diff --git a/nu_plugin_desktop_notifications/.github/workflows/publish_crate.yaml b/nu_plugin_desktop_notifications/.github/workflows/publish_crate.yaml new file mode 100644 index 0000000..b5b8b5c --- /dev/null +++ b/nu_plugin_desktop_notifications/.github/workflows/publish_crate.yaml @@ -0,0 +1,30 @@ +name: Publish Crate + +on: + push: + branches: + - main + paths: + - Cargo.toml + release: + workflow_dispatch: + + +jobs: + publish: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + + - name: Set up Rust toolchain + uses: actions-rs/toolchain@v1 + with: + toolchain: stable + override: true + + - name: Publish to crates.io + uses: katyo/publish-crates@v2 + with: + registry-token: ${{ secrets.CARGO_REGISTRY_TOKEN }} + env: + CARGO_REGISTRY_TOKEN: ${{ secrets.CARGO_REGISTRY_TOKEN }} diff --git a/nu_plugin_desktop_notifications/.gitignore b/nu_plugin_desktop_notifications/.gitignore new file mode 100644 index 0000000..9026c77 --- /dev/null +++ b/nu_plugin_desktop_notifications/.gitignore @@ -0,0 +1,2 @@ +/target +.vscode diff --git a/nu_plugin_desktop_notifications/Cargo.lock b/nu_plugin_desktop_notifications/Cargo.lock new file mode 100644 index 0000000..e15e7c8 --- /dev/null +++ b/nu_plugin_desktop_notifications/Cargo.lock @@ -0,0 +1,2702 @@ +# This file is automatically @generated by Cargo. +# It is not intended for manual editing. +version = 4 + +[[package]] +name = "adler2" +version = "2.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "512761e0bb2578dd7380c6baaa0f4ce03e84f95e960231d1dec8bf4d7d6e2627" + +[[package]] +name = "aho-corasick" +version = "1.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8e60d3430d3a69478ad0993f19238d2df97c507009a52b3c10addcd7f6bcb916" +dependencies = [ + "memchr", +] + +[[package]] +name = "alloc-no-stdlib" +version = "2.0.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cc7bb162ec39d46ab1ca8c77bf72e890535becd1751bb45f64c597edb4c8c6b3" + +[[package]] +name = "alloc-stdlib" +version = "0.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "94fb8275041c72129eb51b7d0322c29b8387a0386127718b096429201a5d6ece" +dependencies = [ + "alloc-no-stdlib", +] + +[[package]] +name = "allocator-api2" +version = "0.2.21" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "683d7910e743518b0e34f1186f92494becacb047c7b6bf616c96772180fef923" + +[[package]] +name = "android-tzdata" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e999941b234f3131b00bc13c22d06e8c5ff726d1b6318ac7eb276997bbb4fef0" + +[[package]] +name = "android_system_properties" +version = "0.1.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "819e7219dbd41043ac279b19830f2efc897156490d7fd6ea916720117ee66311" +dependencies = [ + "libc", +] + +[[package]] +name = "arrayvec" +version = "0.7.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7c02d123df017efcdfbd739ef81735b36c5ba83ec3c59c80a9d7ecc718f92e50" + +[[package]] +name = "async-broadcast" +version = "0.7.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "435a87a52755b8f27fcf321ac4f04b2802e337c8c4872923137471ec39c37532" +dependencies = [ + "event-listener", + "event-listener-strategy", + "futures-core", + "pin-project-lite", +] + +[[package]] +name = "async-channel" +version = "2.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "89b47800b0be77592da0afd425cc03468052844aff33b84e33cc696f64e77b6a" +dependencies = [ + "concurrent-queue", + "event-listener-strategy", + "futures-core", + "pin-project-lite", +] + +[[package]] +name = "async-executor" +version = "1.13.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "30ca9a001c1e8ba5149f91a74362376cc6bc5b919d92d988668657bd570bdcec" +dependencies = [ + "async-task", + "concurrent-queue", + "fastrand", + "futures-lite", + "slab", +] + +[[package]] +name = "async-fs" +version = "2.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ebcd09b382f40fcd159c2d695175b2ae620ffa5f3bd6f664131efff4e8b9e04a" +dependencies = [ + "async-lock", + "blocking", + "futures-lite", +] + +[[package]] +name = "async-io" +version = "2.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "43a2b323ccce0a1d90b449fd71f2a06ca7faa7c54c2751f06c9bd851fc061059" +dependencies = [ + "async-lock", + "cfg-if", + "concurrent-queue", + "futures-io", + "futures-lite", + "parking", + "polling", + "rustix", + "slab", + "tracing", + "windows-sys 0.59.0", +] + +[[package]] +name = "async-lock" +version = "3.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ff6e472cdea888a4bd64f342f09b3f50e1886d32afe8df3d663c01140b811b18" +dependencies = [ + "event-listener", + "event-listener-strategy", + "pin-project-lite", +] + +[[package]] +name = "async-process" +version = "2.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "63255f1dc2381611000436537bbedfe83183faa303a5a0edaf191edef06526bb" +dependencies = [ + "async-channel", + "async-io", + "async-lock", + "async-signal", + "async-task", + "blocking", + "cfg-if", + "event-listener", + "futures-lite", + "rustix", + "tracing", +] + +[[package]] +name = "async-recursion" +version = "1.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3b43422f69d8ff38f95f1b2bb76517c91589a924d1559a0e935d7c8ce0274c11" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "async-signal" +version = "0.2.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "637e00349800c0bdf8bfc21ebbc0b6524abea702b0da4168ac00d070d0c0b9f3" +dependencies = [ + "async-io", + "async-lock", + "atomic-waker", + "cfg-if", + "futures-core", + "futures-io", + "rustix", + "signal-hook-registry", + "slab", + "windows-sys 0.59.0", +] + +[[package]] +name = "async-task" +version = "4.7.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8b75356056920673b02621b35afd0f7dda9306d03c79a30f5c56c44cf256e3de" + +[[package]] +name = "async-trait" +version = "0.1.86" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "644dd749086bf3771a2fbc5f256fdb982d53f011c7d5d560304eafeecebce79d" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "atomic-waker" +version = "1.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1505bd5d3d116872e7271a6d4e16d81d0c8570876c8de68093a09ac269d8aac0" + +[[package]] +name = "autocfg" +version = "1.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ace50bade8e6234aa140d9a2f552bbee1db4d353f69b8217bc503490fc1a9f26" + +[[package]] +name = "bindgen" +version = "0.70.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f49d8fed880d473ea71efb9bf597651e77201bdd4893efe54c9e5d65ae04ce6f" +dependencies = [ + "bitflags", + "cexpr", + "clang-sys", + "itertools 0.13.0", + "proc-macro2", + "quote", + "regex", + "rustc-hash", + "shlex", + "syn", +] + +[[package]] +name = "bit-set" +version = "0.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "08807e080ed7f9d5433fa9b275196cfc35414f66a0c79d864dc51a0d825231a3" +dependencies = [ + "bit-vec", +] + +[[package]] +name = "bit-vec" +version = "0.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5e764a1d40d510daf35e07be9eb06e75770908c27d411ee6c92109c9840eaaf7" + +[[package]] +name = "bitflags" +version = "2.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8f68f53c83ab957f72c32642f3868eec03eb974d1fb82e453128456482613d36" + +[[package]] +name = "block" +version = "0.1.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0d8c1fef690941d3e7788d328517591fecc684c084084702d6ff1641e993699a" + +[[package]] +name = "blocking" +version = "1.6.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "703f41c54fc768e63e091340b424302bb1c29ef4aa0c7f10fe849dfb114d29ea" +dependencies = [ + "async-channel", + "async-task", + "futures-io", + "futures-lite", + "piper", +] + +[[package]] +name = "brotli" +version = "7.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cc97b8f16f944bba54f0433f07e30be199b6dc2bd25937444bbad560bcea29bd" +dependencies = [ + "alloc-no-stdlib", + "alloc-stdlib", + "brotli-decompressor", +] + +[[package]] +name = "brotli-decompressor" +version = "4.0.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "74fa05ad7d803d413eb8380983b092cbbaf9a85f151b871360e7b00cd7060b37" +dependencies = [ + "alloc-no-stdlib", + "alloc-stdlib", +] + +[[package]] +name = "bumpalo" +version = "3.17.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1628fb46dfa0b37568d12e5edd512553eccf6a22a78e8bde00bb4aed84d5bdbf" + +[[package]] +name = "byteorder" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1fd0f2584146f6f2ef48085050886acf353beff7305ebd1ae69500e27c67f64b" + +[[package]] +name = "bytes" +version = "1.10.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f61dac84819c6588b558454b194026eb1f09c293b9036ae9b159e74e73ab6cf9" + +[[package]] +name = "cc" +version = "1.2.14" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0c3d1b2e905a3a7b00a6141adb0e4c0bb941d11caf55349d863942a1cc44e3c9" +dependencies = [ + "shlex", +] + +[[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.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" + +[[package]] +name = "cfg_aliases" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "613afe47fcd5fac7ccf1db93babcb082c5994d996f20b8b159f2ad1658eb5724" + +[[package]] +name = "chrono" +version = "0.4.39" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7e36cc9d416881d2e24f9a963be5fb1cd90966419ac844274161d10488b3e825" +dependencies = [ + "android-tzdata", + "iana-time-zone", + "num-traits", + "pure-rust-locales", + "serde", + "windows-targets 0.52.6", +] + +[[package]] +name = "chrono-humanize" +version = "0.2.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "799627e6b4d27827a814e837b9d8a504832086081806d45b1afa34dc982b023b" +dependencies = [ + "chrono", +] + +[[package]] +name = "clang-sys" +version = "1.8.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0b023947811758c97c59bf9d1c188fd619ad4718dcaa767947df1cadb14f39f4" +dependencies = [ + "glob", + "libc", + "libloading", +] + +[[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 = "core-foundation-sys" +version = "0.8.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "773648b94d0e5d620f64f280777445740e61fe701025087ec8b57f45c791888b" + +[[package]] +name = "crc32fast" +version = "1.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a97769d94ddab943e4510d138150169a2758b5ef3eb191a9ee688de3e23ef7b3" +dependencies = [ + "cfg-if", +] + +[[package]] +name = "crossbeam-deque" +version = "0.8.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9dd111b7b7f7d55b72c0a6ae361660ee5853c9af73f70c3c2ef6858b950e2e51" +dependencies = [ + "crossbeam-epoch", + "crossbeam-utils", +] + +[[package]] +name = "crossbeam-epoch" +version = "0.9.18" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5b82ac4a3c2ca9c3460964f020e1402edd5753411d7737aa39c3714ad1b5420e" +dependencies = [ + "crossbeam-utils", +] + +[[package]] +name = "crossbeam-utils" +version = "0.8.21" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d0a5c400df2834b80a4c3327b3aad3a4c4cd4de0629063962b03235697506a28" + +[[package]] +name = "crossterm" +version = "0.28.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "829d955a0bb380ef178a640b91779e3987da38c9aea133b20614cfed8cdea9c6" +dependencies = [ + "bitflags", + "crossterm_winapi", + "mio", + "parking_lot", + "rustix", + "signal-hook", + "signal-hook-mio", + "winapi", +] + +[[package]] +name = "crossterm_winapi" +version = "0.9.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "acdd7c62a3665c7f6830a51635d9ac9b23ed385797f70a83bb8bafe9c572ab2b" +dependencies = [ + "winapi", +] + +[[package]] +name = "deranged" +version = "0.3.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b42b6fa04a440b495c8b04d0e71b707c585f83cb9cb28cf8cd0d976c315e31b4" +dependencies = [ + "powerfmt", +] + +[[package]] +name = "dirs" +version = "5.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "44c45a9d03d6676652bcb5e724c7e988de1acad23a711b5217ab9cbecbec2225" +dependencies = [ + "dirs-sys", +] + +[[package]] +name = "dirs-next" +version = "2.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b98cf8ebf19c3d1b223e151f99a4f9f0690dca41414773390fc824184ac833e1" +dependencies = [ + "cfg-if", + "dirs-sys-next", +] + +[[package]] +name = "dirs-sys" +version = "0.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "520f05a5cbd335fae5a99ff7a6ab8627577660ee5cfd6a94a6a929b52ff0321c" +dependencies = [ + "libc", + "option-ext", + "redox_users", + "windows-sys 0.48.0", +] + +[[package]] +name = "dirs-sys-next" +version = "0.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4ebda144c4fe02d1f7ea1a7d9641b6fc6b580adcfa024ae48797ecdeb6825b4d" +dependencies = [ + "libc", + "redox_users", + "winapi", +] + +[[package]] +name = "doctest-file" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "aac81fa3e28d21450aa4d2ac065992ba96a1d7303efbce51a95f4fd175b67562" + +[[package]] +name = "either" +version = "1.13.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "60b1af1c220855b6ceac025d3f6ecdd2b7c4894bfe9cd9bda4fbb4bc7c0d4cf0" + +[[package]] +name = "endi" +version = "1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a3d8a32ae18130a3c84dd492d4215c3d913c3b07c6b63c2eb3eb7ff1101ab7bf" + +[[package]] +name = "enumflags2" +version = "0.7.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ba2f4b465f5318854c6f8dd686ede6c0a9dc67d4b1ac241cf0eb51521a309147" +dependencies = [ + "enumflags2_derive", + "serde", +] + +[[package]] +name = "enumflags2_derive" +version = "0.7.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fc4caf64a58d7a6d65ab00639b046ff54399a39f5f2554728895ace4b297cd79" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + +[[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.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "24e2389d65ab4fab27dc2a5de7b191e1f6617d1f1c8855c0dc569c94a4cbb18d" +dependencies = [ + "serde", + "typeid", +] + +[[package]] +name = "errno" +version = "0.3.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "33d852cb9b869c2a9b3df2f71a3074817f01e1844f839a144f5fcef059a4eb5d" +dependencies = [ + "libc", + "windows-sys 0.59.0", +] + +[[package]] +name = "event-listener" +version = "5.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3492acde4c3fc54c845eaab3eed8bd00c7a7d881f78bfc801e43a93dec1331ae" +dependencies = [ + "concurrent-queue", + "parking", + "pin-project-lite", +] + +[[package]] +name = "event-listener-strategy" +version = "0.5.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3c3e4e0dd3673c1139bf041f3008816d9cf2946bbfac2945c09e523b8d7b05b2" +dependencies = [ + "event-listener", + "pin-project-lite", +] + +[[package]] +name = "fancy-regex" +version = "0.14.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6e24cb5a94bcae1e5408b0effca5cd7172ea3c5755049c5f3af4cd283a165298" +dependencies = [ + "bit-set", + "regex-automata", + "regex-syntax", +] + +[[package]] +name = "fastrand" +version = "2.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "37909eebbb50d72f9059c3b6d82c0463f2ff062c9e95845c43a6c9c0355411be" + +[[package]] +name = "flate2" +version = "1.0.35" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c936bfdafb507ebbf50b8074c54fa31c5be9a1e7e5f467dd659697041407d07c" +dependencies = [ + "crc32fast", + "miniz_oxide", +] + +[[package]] +name = "foldhash" +version = "0.1.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a0d2fde1f7b3d48b8395d5f2de76c18a528bd6a9cdde438df747bfcba3e05d6f" + +[[package]] +name = "futures-core" +version = "0.3.31" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "05f29059c0c2090612e8d742178b0580d2dc940c837851ad723096f87af6663e" + +[[package]] +name = "futures-io" +version = "0.3.31" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9e5c1b78ca4aae1ac06c48a526a655760685149f0d465d21f37abfe57ce075c6" + +[[package]] +name = "futures-lite" +version = "2.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f5edaec856126859abb19ed65f39e90fea3a9574b9707f13539acf4abf7eb532" +dependencies = [ + "fastrand", + "futures-core", + "futures-io", + "parking", + "pin-project-lite", +] + +[[package]] +name = "getrandom" +version = "0.2.15" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c4567c8db10ae91089c99af84c68c38da3ec2f087c3f82960bcdbf3656b6f4d7" +dependencies = [ + "cfg-if", + "libc", + "wasi 0.11.0+wasi-snapshot-preview1", +] + +[[package]] +name = "getrandom" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "43a49c392881ce6d5c3b8cb70f98717b7c07aabbdff06687b9030dbfbe2725f8" +dependencies = [ + "cfg-if", + "libc", + "wasi 0.13.3+wasi-0.2.2", + "windows-targets 0.52.6", +] + +[[package]] +name = "glob" +version = "0.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a8d1add55171497b4705a648c6b583acafb01d58050a51727785f0b2c8e0a2b2" + +[[package]] +name = "hashbrown" +version = "0.15.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bf151400ff0baff5465007dd2f3e717f3fe502074ca563069ce3a6629d07b289" +dependencies = [ + "allocator-api2", + "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.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fbf6a919d6cf397374f7dfeeea91d974c7c0a7221d0d0f4f20d859d329e53fcc" + +[[package]] +name = "hex" +version = "0.4.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7f24254aa9a54b5c858eaee2f5bccdb46aaf0e486a595ed5fd8f86ba55232a70" + +[[package]] +name = "iana-time-zone" +version = "0.1.61" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "235e081f3925a06703c2d0117ea8b91f042756fd6e7a6e5d901e8ca1a996b220" +dependencies = [ + "android_system_properties", + "core-foundation-sys", + "iana-time-zone-haiku", + "js-sys", + "wasm-bindgen", + "windows-core 0.52.0", +] + +[[package]] +name = "iana-time-zone-haiku" +version = "0.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f31827a206f56af32e590ba56d5d2d085f558508192593743f16b2306495269f" +dependencies = [ + "cc", +] + +[[package]] +name = "indexmap" +version = "2.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cea70ddb795996207ad57735b50c5982d8844f38ba9ee5f1aedcfb708a2aa11e" +dependencies = [ + "equivalent", + "hashbrown", +] + +[[package]] +name = "interprocess" +version = "2.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "894148491d817cb36b6f778017b8ac46b17408d522dd90f539d677ea938362eb" +dependencies = [ + "doctest-file", + "libc", + "recvmsg", + "widestring", + "windows-sys 0.52.0", +] + +[[package]] +name = "inventory" +version = "0.3.19" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "54b12ebb6799019b044deaf431eadfe23245b259bba5a2c0796acec3943a3cdb" +dependencies = [ + "rustversion", +] + +[[package]] +name = "is_ci" +version = "1.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7655c9839580ee829dfacba1d1278c2b7883e50a277ff7541299489d6bdfdc45" + +[[package]] +name = "itertools" +version = "0.13.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "413ee7dfc52ee1a4949ceeb7dbc8a33f2d6c088194d9f922fb8318faf1f01186" +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.14" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d75a2a4b1b190afb6f5425f10f6a8f959d2ea0b9c2b1d79553551850539e4674" + +[[package]] +name = "js-sys" +version = "0.3.77" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1cfaf33c695fc6e08064efbc1f72ec937429614f25eef83af942d0e227c3a28f" +dependencies = [ + "once_cell", + "wasm-bindgen", +] + +[[package]] +name = "libc" +version = "0.2.169" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b5aba8db14291edd000dfcc4d620c7ebfb122c613afb886ca8803fa4e128a20a" + +[[package]] +name = "libloading" +version = "0.8.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fc2f4eb4bc735547cfed7c0a4922cbd04a4655978c09b54f1f7b228750664c34" +dependencies = [ + "cfg-if", + "windows-targets 0.52.6", +] + +[[package]] +name = "libproc" +version = "0.14.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e78a09b56be5adbcad5aa1197371688dc6bb249a26da3bca2011ee2fb987ebfb" +dependencies = [ + "bindgen", + "errno", + "libc", +] + +[[package]] +name = "libredox" +version = "0.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c0ff37bd590ca25063e35af745c343cb7a0271906fb7b37e4813e8f79f00268d" +dependencies = [ + "bitflags", + "libc", +] + +[[package]] +name = "linux-raw-sys" +version = "0.4.15" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d26c52dbd32dccf2d10cac7725f8eae5296885fb5703b261f7d0a0739ec807ab" + +[[package]] +name = "lock_api" +version = "0.4.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "07af8b9cdd281b7915f413fa73f29ebd5d55d0d3f0155584dade1ff18cea1b17" +dependencies = [ + "autocfg", + "scopeguard", +] + +[[package]] +name = "log" +version = "0.4.25" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "04cbf5b083de1c7e0222a7a51dbfdba1cbe1c6ab0b15e29fff3f6c077fd9cd9f" + +[[package]] +name = "lru" +version = "0.12.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "234cf4f4a04dc1f57e24b96cc0cd600cf2af460d4161ac5ecdd0af8e1f3b2a38" +dependencies = [ + "hashbrown", +] + +[[package]] +name = "lscolors" +version = "0.20.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "61183da5de8ba09a58e330d55e5ea796539d8443bd00fdeb863eac39724aa4ab" +dependencies = [ + "aho-corasick", + "nu-ansi-term", +] + +[[package]] +name = "mac-notification-sys" +version = "0.6.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dce8f34f3717aa37177e723df6c1fc5fb02b2a1087374ea3fe0ea42316dc8f91" +dependencies = [ + "cc", + "dirs-next", + "objc-foundation", + "objc_id", + "time", +] + +[[package]] +name = "mach2" +version = "0.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "19b955cdeb2a02b9117f121ce63aa52d08ade45de53e48fe6a38b39c10f6f709" +dependencies = [ + "libc", +] + +[[package]] +name = "malloc_buf" +version = "0.0.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "62bb907fe88d54d8d9ce32a3cceab4218ed2f6b7d35617cafe9adf84e43919cb" +dependencies = [ + "libc", +] + +[[package]] +name = "memchr" +version = "2.7.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "78ca9ab1a0babb1e7d5695e3530886289c18cf2f87ec19a575a0abdce112e3a3" + +[[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", + "owo-colors", + "supports-color", + "supports-hyperlinks", + "supports-unicode", + "terminal_size", + "textwrap", + "unicode-width", +] + +[[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", +] + +[[package]] +name = "minimal-lexical" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "68354c5c6bd36d73ff3feceb05efa59b6acb7626617f4962be322a825e61f79a" + +[[package]] +name = "miniz_oxide" +version = "0.8.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b3b1c9bd4fe1f0f8b387f6eb9eb3b4a1aa26185e5750efb9140301703f62cd1b" +dependencies = [ + "adler2", +] + +[[package]] +name = "mio" +version = "1.0.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2886843bf800fba2e3377cff24abf6379b4c4d5c6681eaf9ea5b0d15090450bd" +dependencies = [ + "libc", + "log", + "wasi 0.11.0+wasi-snapshot-preview1", + "windows-sys 0.52.0", +] + +[[package]] +name = "nix" +version = "0.29.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "71e2746dc3a24dd78b3cfcb7be93368c6de9963d30f43a6a73998a9cf4b17b46" +dependencies = [ + "bitflags", + "cfg-if", + "cfg_aliases", + "libc", + "memoffset", +] + +[[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 = "notify-rust" +version = "4.11.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6442248665a5aa2514e794af3b39661a8e73033b1cc5e59899e1276117ee4400" +dependencies = [ + "futures-lite", + "log", + "mac-notification-sys", + "serde", + "tauri-winrt-notification", + "zbus", +] + +[[package]] +name = "ntapi" +version = "0.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e8a3895c6391c39d7fe7ebc444a87eb2991b2a0bc718fdabd071eec617fc68e4" +dependencies = [ + "winapi", +] + +[[package]] +name = "nu-ansi-term" +version = "0.50.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d4a28e057d01f97e61255210fcff094d74ed0466038633e95017f5beb68e4399" +dependencies = [ + "windows-sys 0.52.0", +] + +[[package]] +name = "nu-derive-value" +version = "0.105.2" +dependencies = [ + "heck", + "proc-macro-error2", + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "nu-engine" +version = "0.105.2" +dependencies = [ + "log", + "nu-glob", + "nu-path", + "nu-protocol", + "nu-utils", +] + +[[package]] +name = "nu-glob" +version = "0.105.2" + +[[package]] +name = "nu-path" +version = "0.105.2" +dependencies = [ + "dirs", + "omnipath", + "pwd", + "ref-cast", +] + +[[package]] +name = "nu-plugin" +version = "0.105.2" +dependencies = [ + "log", + "nix", + "nu-engine", + "nu-plugin-core", + "nu-plugin-protocol", + "nu-protocol", + "nu-utils", + "thiserror 2.0.12", +] + +[[package]] +name = "nu-plugin-core" +version = "0.105.2" +dependencies = [ + "interprocess", + "log", + "nu-plugin-protocol", + "nu-protocol", + "rmp-serde", + "serde", + "serde_json", + "windows 0.56.0", +] + +[[package]] +name = "nu-plugin-protocol" +version = "0.105.2" +dependencies = [ + "nu-protocol", + "nu-utils", + "rmp-serde", + "semver", + "serde", + "typetag", +] + +[[package]] +name = "nu-protocol" +version = "0.105.2" +dependencies = [ + "brotli", + "bytes", + "chrono", + "chrono-humanize", + "dirs", + "dirs-sys", + "fancy-regex", + "heck", + "indexmap", + "log", + "lru", + "memchr", + "miette", + "nix", + "nu-derive-value", + "nu-glob", + "nu-path", + "nu-system", + "nu-utils", + "num-format", + "os_pipe", + "rmp-serde", + "serde", + "serde_json", + "strum", + "strum_macros", + "thiserror 2.0.12", + "typetag", + "web-time", + "windows 0.56.0", + "windows-sys 0.48.0", +] + +[[package]] +name = "nu-system" +version = "0.105.2" +dependencies = [ + "chrono", + "itertools 0.14.0", + "libc", + "libproc", + "log", + "mach2", + "nix", + "ntapi", + "procfs", + "sysinfo", + "web-time", + "windows 0.56.0", +] + +[[package]] +name = "nu-utils" +version = "0.105.2" +dependencies = [ + "crossterm", + "crossterm_winapi", + "fancy-regex", + "log", + "lscolors", + "nix", + "num-format", + "serde", + "serde_json", + "strip-ansi-escapes", + "sys-locale", + "unicase", +] + +[[package]] +name = "nu_plugin_desktop_notifications" +version = "1.2.12" +dependencies = [ + "notify-rust", + "nu-plugin", + "nu-protocol", +] + +[[package]] +name = "num-conv" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "51d515d32fb182ee37cda2ccdcb92950d6a3c2893aa280e540671c2cd0f3b1d9" + +[[package]] +name = "num-format" +version = "0.4.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a652d9771a63711fd3c3deb670acfbe5c30a4072e664d7a3bf5a9e1056ac72c3" +dependencies = [ + "arrayvec", + "itoa", +] + +[[package]] +name = "num-traits" +version = "0.2.19" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "071dfc062690e90b734c0b2273ce72ad0ffa95f0c74596bc250dcfd960262841" +dependencies = [ + "autocfg", +] + +[[package]] +name = "objc" +version = "0.2.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "915b1b472bc21c53464d6c8461c9d3af805ba1ef837e1cac254428f4a77177b1" +dependencies = [ + "malloc_buf", +] + +[[package]] +name = "objc-foundation" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1add1b659e36c9607c7aab864a76c7a4c2760cd0cd2e120f3fb8b952c7e22bf9" +dependencies = [ + "block", + "objc", + "objc_id", +] + +[[package]] +name = "objc_id" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c92d4ddb4bd7b50d730c215ff871754d0da6b2178849f8a2a2ab69712d0c073b" +dependencies = [ + "objc", +] + +[[package]] +name = "omnipath" +version = "0.1.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "80adb31078122c880307e9cdfd4e3361e6545c319f9b9dcafcb03acd3b51a575" + +[[package]] +name = "once_cell" +version = "1.20.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "945462a4b81e43c4e3ba96bd7b49d834c6f61198356aa858733bc4acf3cbe62e" + +[[package]] +name = "option-ext" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "04744f49eae99ab78e0d5c0b603ab218f515ea8cfe5a456d7629ad883a3b6e7d" + +[[package]] +name = "ordered-stream" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9aa2b01e1d916879f73a53d01d1d6cee68adbb31d6d9177a8cfce093cced1d50" +dependencies = [ + "futures-core", + "pin-project-lite", +] + +[[package]] +name = "os_pipe" +version = "1.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5ffd2b0a5634335b135d5728d84c5e0fd726954b87111f7506a61c502280d982" +dependencies = [ + "libc", + "windows-sys 0.59.0", +] + +[[package]] +name = "owo-colors" +version = "4.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fb37767f6569cd834a413442455e0f066d0d522de8630436e2a1761d9726ba56" + +[[package]] +name = "parking" +version = "2.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f38d5652c16fde515bb1ecef450ab0f6a219d619a7274976324d5e377f7dceba" + +[[package]] +name = "parking_lot" +version = "0.12.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f1bf18183cf54e8d6059647fc3063646a1801cf30896933ec2311622cc4b9a27" +dependencies = [ + "lock_api", + "parking_lot_core", +] + +[[package]] +name = "parking_lot_core" +version = "0.9.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1e401f977ab385c9e4e3ab30627d6f26d00e2c73eef317493c4ec6d468726cf8" +dependencies = [ + "cfg-if", + "libc", + "redox_syscall", + "smallvec", + "windows-targets 0.52.6", +] + +[[package]] +name = "paste" +version = "1.0.15" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "57c0d7b74b563b49d38dae00a0c37d4d6de9b432382b2892f0574ddcae73fd0a" + +[[package]] +name = "pin-project-lite" +version = "0.2.16" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3b3cff922bd51709b605d9ead9aa71031d81447142d828eb4a6eba76fe619f9b" + +[[package]] +name = "piper" +version = "0.2.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "96c8c490f422ef9a4efd2cb5b42b76c8613d7e7dfc1caf667b8a3350a5acc066" +dependencies = [ + "atomic-waker", + "fastrand", + "futures-io", +] + +[[package]] +name = "polling" +version = "3.7.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a604568c3202727d1507653cb121dbd627a58684eb09a820fd746bee38b4442f" +dependencies = [ + "cfg-if", + "concurrent-queue", + "hermit-abi", + "pin-project-lite", + "rustix", + "tracing", + "windows-sys 0.59.0", +] + +[[package]] +name = "powerfmt" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "439ee305def115ba05938db6eb1644ff94165c5ab5e9420d1c1bcedbba909391" + +[[package]] +name = "proc-macro-crate" +version = "3.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8ecf48c7ca261d60b74ab1a7b20da18bede46776b2e55535cb958eb595c5fa7b" +dependencies = [ + "toml_edit", +] + +[[package]] +name = "proc-macro-error-attr2" +version = "2.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "96de42df36bb9bba5542fe9f1a054b8cc87e172759a1868aa05c1f3acc89dfc5" +dependencies = [ + "proc-macro2", + "quote", +] + +[[package]] +name = "proc-macro-error2" +version = "2.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "11ec05c52be0a07b08061f7dd003e7d7092e0472bc731b4af7bb1ef876109802" +dependencies = [ + "proc-macro-error-attr2", + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "proc-macro2" +version = "1.0.93" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "60946a68e5f9d28b0dc1c21bb8a97ee7d018a8b322fa57838ba31cc878e22d99" +dependencies = [ + "unicode-ident", +] + +[[package]] +name = "procfs" +version = "0.17.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cc5b72d8145275d844d4b5f6d4e1eef00c8cd889edb6035c21675d1bb1f45c9f" +dependencies = [ + "bitflags", + "chrono", + "flate2", + "hex", + "procfs-core", + "rustix", +] + +[[package]] +name = "procfs-core" +version = "0.17.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "239df02d8349b06fc07398a3a1697b06418223b1c7725085e801e7c0fc6a12ec" +dependencies = [ + "bitflags", + "chrono", + "hex", +] + +[[package]] +name = "pure-rust-locales" +version = "0.8.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1190fd18ae6ce9e137184f207593877e70f39b015040156b1e05081cdfe3733a" + +[[package]] +name = "pwd" +version = "1.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "72c71c0c79b9701efe4e1e4b563b2016dd4ee789eb99badcb09d61ac4b92e4a2" +dependencies = [ + "libc", + "thiserror 1.0.69", +] + +[[package]] +name = "quick-xml" +version = "0.37.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "331e97a1af0bf59823e6eadffe373d7b27f485be8748f71471c662c1f269b7fb" +dependencies = [ + "memchr", +] + +[[package]] +name = "quote" +version = "1.0.38" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0e4dccaaaf89514f546c693ddc140f729f958c247918a13380cccc6078391acc" +dependencies = [ + "proc-macro2", +] + +[[package]] +name = "rayon" +version = "1.10.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b418a60154510ca1a002a752ca9714984e21e4241e804d32555251faf8b78ffa" +dependencies = [ + "either", + "rayon-core", +] + +[[package]] +name = "rayon-core" +version = "1.12.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1465873a3dfdaa8ae7cb14b4383657caab0b3e8a0aa9ae8e04b044854c8dfce2" +dependencies = [ + "crossbeam-deque", + "crossbeam-utils", +] + +[[package]] +name = "recvmsg" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d3edd4d5d42c92f0a659926464d4cce56b562761267ecf0f469d85b7de384175" + +[[package]] +name = "redox_syscall" +version = "0.5.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "03a862b389f93e68874fbf580b9de08dd02facb9a788ebadaf4a3fd33cf58834" +dependencies = [ + "bitflags", +] + +[[package]] +name = "redox_users" +version = "0.4.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ba009ff324d1fc1b900bd1fdb31564febe58a8ccc8a6fdbb93b543d33b13ca43" +dependencies = [ + "getrandom 0.2.15", + "libredox", + "thiserror 1.0.69", +] + +[[package]] +name = "ref-cast" +version = "1.0.23" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ccf0a6f84d5f1d581da8b41b47ec8600871962f2a528115b542b362d4b744931" +dependencies = [ + "ref-cast-impl", +] + +[[package]] +name = "ref-cast-impl" +version = "1.0.23" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bcc303e793d3734489387d205e9b186fac9c6cfacedd98cbb2e8a5943595f3e6" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "regex" +version = "1.11.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b544ef1b4eac5dc2db33ea63606ae9ffcfac26c1416a2806ae0bf5f56b201191" +dependencies = [ + "aho-corasick", + "memchr", + "regex-automata", + "regex-syntax", +] + +[[package]] +name = "regex-automata" +version = "0.4.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "809e8dc61f6de73b46c85f4c96486310fe304c434cfa43669d7b40f711150908" +dependencies = [ + "aho-corasick", + "memchr", + "regex-syntax", +] + +[[package]] +name = "regex-syntax" +version = "0.8.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2b15c43186be67a4fd63bee50d0303afffcef381492ebe2c5d87f324e1b8815c" + +[[package]] +name = "rmp" +version = "0.8.14" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "228ed7c16fa39782c3b3468e974aec2795e9089153cd08ee2e9aefb3613334c4" +dependencies = [ + "byteorder", + "num-traits", + "paste", +] + +[[package]] +name = "rmp-serde" +version = "1.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "52e599a477cf9840e92f2cde9a7189e67b42c57532749bf90aea6ec10facd4db" +dependencies = [ + "byteorder", + "rmp", + "serde", +] + +[[package]] +name = "rustc-hash" +version = "1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "08d43f7aa6b08d49f382cde6a7982047c3426db949b1424bc4b7ec9ae12c6ce2" + +[[package]] +name = "rustix" +version = "0.38.44" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fdb5bc1ae2baa591800df16c9ca78619bf65c0488b41b96ccec5d11220d8c154" +dependencies = [ + "bitflags", + "errno", + "libc", + "linux-raw-sys", + "windows-sys 0.59.0", +] + +[[package]] +name = "rustversion" +version = "1.0.19" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f7c45b9784283f1b2e7fb61b42047c2fd678ef0960d4f6f1eba131594cc369d4" + +[[package]] +name = "ryu" +version = "1.0.19" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6ea1a2d0a644769cc99faa24c3ad26b379b786fe7c36fd3c546254801650e6dd" + +[[package]] +name = "scopeguard" +version = "1.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "94143f37725109f92c262ed2cf5e59bce7498c01bcc1502d7b9afe439a4e9f49" + +[[package]] +name = "semver" +version = "1.0.25" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f79dfe2d285b0488816f30e700a7438c5a73d816b5b7d3ac72fbc48b0d185e03" + +[[package]] +name = "serde" +version = "1.0.217" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "02fc4265df13d6fa1d00ecff087228cc0a2b5f3c0e87e258d8b94a156e984c70" +dependencies = [ + "serde_derive", +] + +[[package]] +name = "serde_derive" +version = "1.0.217" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5a9bf7cf98d04a2b28aead066b7496853d4779c9cc183c440dbac457641e19a0" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "serde_json" +version = "1.0.138" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d434192e7da787e94a6ea7e9670b26a036d0ca41e0b7efb2676dd32bae872949" +dependencies = [ + "itoa", + "memchr", + "ryu", + "serde", +] + +[[package]] +name = "serde_repr" +version = "0.1.19" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6c64451ba24fc7a6a2d60fc75dd9c83c90903b19028d4eff35e88fc1e86564e9" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "shlex" +version = "1.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0fda2ff0d084019ba4d7c6f371c95d8fd75ce3524c3cb8fb653a3023f6323e64" + +[[package]] +name = "signal-hook" +version = "0.3.17" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8621587d4798caf8eb44879d42e56b9a93ea5dcd315a6487c357130095b62801" +dependencies = [ + "libc", + "signal-hook-registry", +] + +[[package]] +name = "signal-hook-mio" +version = "0.2.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "34db1a06d485c9142248b7a054f034b349b212551f3dfd19c94d45a754a217cd" +dependencies = [ + "libc", + "mio", + "signal-hook", +] + +[[package]] +name = "signal-hook-registry" +version = "1.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a9e9e0b4211b72e7b8b6e85c807d36c212bdb33ea8587f7569562a84df5465b1" +dependencies = [ + "libc", +] + +[[package]] +name = "slab" +version = "0.4.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8f92a496fb766b417c996b9c5e57daf2f7ad3b0bebe1ccfca4856390e3d3bb67" +dependencies = [ + "autocfg", +] + +[[package]] +name = "smallvec" +version = "1.14.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7fcf8323ef1faaee30a44a340193b1ac6814fd9b7b4e88e9d4519a3e4abe1cfd" + +[[package]] +name = "static_assertions" +version = "1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a2eb9349b6444b326872e140eb1cf5e7c522154d69e7a0ffb0fb81c06b37543f" + +[[package]] +name = "strip-ansi-escapes" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2a8f8038e7e7969abb3f1b7c2a811225e9296da208539e0f79c5251d6cac0025" +dependencies = [ + "vte", +] + +[[package]] +name = "strum" +version = "0.26.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8fec0f0aef304996cf250b31b5a10dee7980c85da9d759361292b8bca5a18f06" + +[[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", +] + +[[package]] +name = "supports-color" +version = "3.0.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c64fc7232dd8d2e4ac5ce4ef302b1d81e0b80d055b9d77c7c4f51f6aa4c867d6" +dependencies = [ + "is_ci", +] + +[[package]] +name = "supports-hyperlinks" +version = "3.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "804f44ed3c63152de6a9f90acbea1a110441de43006ea51bcce8f436196a288b" + +[[package]] +name = "supports-unicode" +version = "3.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b7401a30af6cb5818bb64852270bb722533397edcfc7344954a38f420819ece2" + +[[package]] +name = "syn" +version = "2.0.98" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "36147f1a48ae0ec2b5b3bc5b537d267457555a10dc06f3dbc8cb11ba3006d3b1" +dependencies = [ + "proc-macro2", + "quote", + "unicode-ident", +] + +[[package]] +name = "sys-locale" +version = "0.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8eab9a99a024a169fe8a903cf9d4a3b3601109bcc13bd9e3c6fff259138626c4" +dependencies = [ + "libc", +] + +[[package]] +name = "sysinfo" +version = "0.33.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4fc858248ea01b66f19d8e8a6d55f41deaf91e9d495246fd01368d99935c6c01" +dependencies = [ + "core-foundation-sys", + "libc", + "memchr", + "ntapi", + "rayon", + "windows 0.57.0", +] + +[[package]] +name = "tauri-winrt-notification" +version = "0.7.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0b1e66e07de489fe43a46678dd0b8df65e0c973909df1b60ba33874e297ba9b9" +dependencies = [ + "quick-xml", + "thiserror 2.0.12", + "windows 0.61.1", + "windows-version", +] + +[[package]] +name = "tempfile" +version = "3.16.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "38c246215d7d24f48ae091a2902398798e05d978b24315d6efbc00ede9a8bb91" +dependencies = [ + "cfg-if", + "fastrand", + "getrandom 0.3.1", + "once_cell", + "rustix", + "windows-sys 0.59.0", +] + +[[package]] +name = "terminal_size" +version = "0.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5352447f921fda68cf61b4101566c0bdb5104eff6804d0678e5227580ab6a4e9" +dependencies = [ + "rustix", + "windows-sys 0.59.0", +] + +[[package]] +name = "textwrap" +version = "0.16.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "23d434d3f8967a09480fb04132ebe0a3e088c173e6d0ee7897abbdf4eab0f8b9" +dependencies = [ + "unicode-linebreak", + "unicode-width", +] + +[[package]] +name = "thiserror" +version = "1.0.69" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b6aaf5339b578ea85b50e080feb250a3e8ae8cfcdff9a461c9ec2904bc923f52" +dependencies = [ + "thiserror-impl 1.0.69", +] + +[[package]] +name = "thiserror" +version = "2.0.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "567b8a2dae586314f7be2a752ec7474332959c6460e02bde30d702a66d488708" +dependencies = [ + "thiserror-impl 2.0.12", +] + +[[package]] +name = "thiserror-impl" +version = "1.0.69" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4fee6c4efc90059e10f81e6d42c60a18f76588c3d74cb83a0b242a2b6c7504c1" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "thiserror-impl" +version = "2.0.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7f7cf42b4507d8ea322120659672cf1b9dbb93f8f2d4ecfd6e51350ff5b17a1d" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "time" +version = "0.3.37" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "35e7868883861bd0e56d9ac6efcaaca0d6d5d82a2a7ec8209ff492c07cf37b21" +dependencies = [ + "deranged", + "num-conv", + "powerfmt", + "serde", + "time-core", +] + +[[package]] +name = "time-core" +version = "0.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ef927ca75afb808a4d64dd374f00a2adf8d0fcff8e7b184af886c3c87ec4a3f3" + +[[package]] +name = "toml_datetime" +version = "0.6.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0dd7358ecb8fc2f8d014bf86f6f638ce72ba252a2c3a2572f2a795f1d23efb41" + +[[package]] +name = "toml_edit" +version = "0.22.24" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "17b4795ff5edd201c7cd6dca065ae59972ce77d1b80fa0a84d94950ece7d1474" +dependencies = [ + "indexmap", + "toml_datetime", + "winnow", +] + +[[package]] +name = "tracing" +version = "0.1.41" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "784e0ac535deb450455cbfa28a6f0df145ea1bb7ae51b821cf5e7927fdcfbdd0" +dependencies = [ + "pin-project-lite", + "tracing-attributes", + "tracing-core", +] + +[[package]] +name = "tracing-attributes" +version = "0.1.28" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "395ae124c09f9e6918a2310af6038fba074bcf474ac352496d5910dd59a2226d" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "tracing-core" +version = "0.1.33" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e672c95779cf947c5311f83787af4fa8fffd12fb27e4993211a84bdfd9610f9c" +dependencies = [ + "once_cell", +] + +[[package]] +name = "typeid" +version = "1.0.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0e13db2e0ccd5e14a544e8a246ba2312cd25223f616442d7f2cb0e3db614236e" + +[[package]] +name = "typetag" +version = "0.2.19" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "044fc3365ddd307c297fe0fe7b2e70588cdab4d0f62dc52055ca0d11b174cf0e" +dependencies = [ + "erased-serde", + "inventory", + "once_cell", + "serde", + "typetag-impl", +] + +[[package]] +name = "typetag-impl" +version = "0.2.19" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d9d30226ac9cbd2d1ff775f74e8febdab985dab14fb14aa2582c29a92d5555dc" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "uds_windows" +version = "1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "89daebc3e6fd160ac4aa9fc8b3bf71e1f74fbf92367ae71fb83a037e8bf164b9" +dependencies = [ + "memoffset", + "tempfile", + "winapi", +] + +[[package]] +name = "unicase" +version = "2.8.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "75b844d17643ee918803943289730bec8aac480150456169e647ed0b576ba539" + +[[package]] +name = "unicode-ident" +version = "1.0.16" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a210d160f08b701c8721ba1c726c11662f877ea6b7094007e1ca9a1041945034" + +[[package]] +name = "unicode-linebreak" +version = "0.1.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3b09c83c3c29d37506a3e260c08c03743a6bb66a9cd432c6934ab501a190571f" + +[[package]] +name = "unicode-width" +version = "0.1.14" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7dd6e30e90baa6f72411720665d41d89b9a3d039dc45b8faea1ddd07f617f6af" + +[[package]] +name = "vte" +version = "0.14.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "231fdcd7ef3037e8330d8e17e61011a2c244126acc0a982f4040ac3f9f0bc077" +dependencies = [ + "memchr", +] + +[[package]] +name = "wasi" +version = "0.11.0+wasi-snapshot-preview1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9c8d87e72b64a3b4db28d11ce29237c246188f4f51057d65a7eab63b7987e423" + +[[package]] +name = "wasi" +version = "0.13.3+wasi-0.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "26816d2e1a4a36a2940b96c5296ce403917633dff8f3440e9b236ed6f6bacad2" +dependencies = [ + "wit-bindgen-rt", +] + +[[package]] +name = "wasm-bindgen" +version = "0.2.100" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1edc8929d7499fc4e8f0be2262a241556cfc54a0bea223790e71446f2aab1ef5" +dependencies = [ + "cfg-if", + "once_cell", + "rustversion", + "wasm-bindgen-macro", +] + +[[package]] +name = "wasm-bindgen-backend" +version = "0.2.100" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2f0a0651a5c2bc21487bde11ee802ccaf4c51935d0d3d42a6101f98161700bc6" +dependencies = [ + "bumpalo", + "log", + "proc-macro2", + "quote", + "syn", + "wasm-bindgen-shared", +] + +[[package]] +name = "wasm-bindgen-macro" +version = "0.2.100" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7fe63fc6d09ed3792bd0897b314f53de8e16568c2b3f7982f468c0bf9bd0b407" +dependencies = [ + "quote", + "wasm-bindgen-macro-support", +] + +[[package]] +name = "wasm-bindgen-macro-support" +version = "0.2.100" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8ae87ea40c9f689fc23f209965b6fb8a99ad69aeeb0231408be24920604395de" +dependencies = [ + "proc-macro2", + "quote", + "syn", + "wasm-bindgen-backend", + "wasm-bindgen-shared", +] + +[[package]] +name = "wasm-bindgen-shared" +version = "0.2.100" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1a05d73b933a847d6cccdda8f838a22ff101ad9bf93e33684f39c1f5f0eece3d" +dependencies = [ + "unicode-ident", +] + +[[package]] +name = "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 = "widestring" +version = "1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7219d36b6eac893fa81e84ebe06485e7dcbb616177469b142df14f1f4deb1311" + +[[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" +version = "0.56.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1de69df01bdf1ead2f4ac895dc77c9351aefff65b2f3db429a343f9cbf05e132" +dependencies = [ + "windows-core 0.56.0", + "windows-targets 0.52.6", +] + +[[package]] +name = "windows" +version = "0.57.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "12342cb4d8e3b046f3d80effd474a7a02447231330ef77d71daa6fbc40681143" +dependencies = [ + "windows-core 0.57.0", + "windows-targets 0.52.6", +] + +[[package]] +name = "windows" +version = "0.61.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c5ee8f3d025738cb02bad7868bbb5f8a6327501e870bf51f1b455b0a2454a419" +dependencies = [ + "windows-collections", + "windows-core 0.61.0", + "windows-future", + "windows-link", + "windows-numerics", +] + +[[package]] +name = "windows-collections" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3beeceb5e5cfd9eb1d76b381630e82c4241ccd0d27f1a39ed41b2760b255c5e8" +dependencies = [ + "windows-core 0.61.0", +] + +[[package]] +name = "windows-core" +version = "0.52.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "33ab640c8d7e35bf8ba19b884ba838ceb4fba93a4e8c65a9059d08afcfc683d9" +dependencies = [ + "windows-targets 0.52.6", +] + +[[package]] +name = "windows-core" +version = "0.56.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4698e52ed2d08f8658ab0c39512a7c00ee5fe2688c65f8c0a4f06750d729f2a6" +dependencies = [ + "windows-implement 0.56.0", + "windows-interface 0.56.0", + "windows-result 0.1.2", + "windows-targets 0.52.6", +] + +[[package]] +name = "windows-core" +version = "0.57.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d2ed2439a290666cd67ecce2b0ffaad89c2a56b976b736e6ece670297897832d" +dependencies = [ + "windows-implement 0.57.0", + "windows-interface 0.57.0", + "windows-result 0.1.2", + "windows-targets 0.52.6", +] + +[[package]] +name = "windows-core" +version = "0.61.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4763c1de310c86d75a878046489e2e5ba02c649d185f21c67d4cf8a56d098980" +dependencies = [ + "windows-implement 0.60.0", + "windows-interface 0.59.1", + "windows-link", + "windows-result 0.3.2", + "windows-strings", +] + +[[package]] +name = "windows-future" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7a1d6bbefcb7b60acd19828e1bc965da6fcf18a7e39490c5f8be71e54a19ba32" +dependencies = [ + "windows-core 0.61.0", + "windows-link", +] + +[[package]] +name = "windows-implement" +version = "0.56.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f6fc35f58ecd95a9b71c4f2329b911016e6bec66b3f2e6a4aad86bd2e99e2f9b" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "windows-implement" +version = "0.57.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9107ddc059d5b6fbfbffdfa7a7fe3e22a226def0b2608f72e9d552763d3e1ad7" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "windows-implement" +version = "0.60.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a47fddd13af08290e67f4acabf4b459f647552718f683a7b415d290ac744a836" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "windows-interface" +version = "0.56.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "08990546bf4edef8f431fa6326e032865f27138718c587dc21bc0265bbcb57cc" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "windows-interface" +version = "0.57.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "29bee4b38ea3cde66011baa44dba677c432a78593e202392d1e9070cf2a7fca7" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "windows-interface" +version = "0.59.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bd9211b69f8dcdfa817bfd14bf1c97c9188afa36f4750130fcdf3f400eca9fa8" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "windows-link" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "76840935b766e1b0a05c0066835fb9ec80071d4c09a16f6bd5f7e655e3c14c38" + +[[package]] +name = "windows-numerics" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9150af68066c4c5c07ddc0ce30421554771e528bde427614c61038bc2c92c2b1" +dependencies = [ + "windows-core 0.61.0", + "windows-link", +] + +[[package]] +name = "windows-result" +version = "0.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5e383302e8ec8515204254685643de10811af0ed97ea37210dc26fb0032647f8" +dependencies = [ + "windows-targets 0.52.6", +] + +[[package]] +name = "windows-result" +version = "0.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c64fd11a4fd95df68efcfee5f44a294fe71b8bc6a91993e2791938abcc712252" +dependencies = [ + "windows-link", +] + +[[package]] +name = "windows-strings" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7a2ba9642430ee452d5a7aa78d72907ebe8cfda358e8cb7918a2050581322f97" +dependencies = [ + "windows-link", +] + +[[package]] +name = "windows-sys" +version = "0.48.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "677d2418bec65e3338edb076e806bc1ec15693c5d0104683f2efe857f61056a9" +dependencies = [ + "windows-targets 0.48.5", +] + +[[package]] +name = "windows-sys" +version = "0.52.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "282be5f36a8ce781fad8c8ae18fa3f9beff57ec1b52cb3de0789201425d9a33d" +dependencies = [ + "windows-targets 0.52.6", +] + +[[package]] +name = "windows-sys" +version = "0.59.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1e38bc4d79ed67fd075bcc251a1c39b32a1776bbe92e5bef1f0bf1f8c531853b" +dependencies = [ + "windows-targets 0.52.6", +] + +[[package]] +name = "windows-targets" +version = "0.48.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9a2fa6e2155d7247be68c096456083145c183cbbbc2764150dda45a87197940c" +dependencies = [ + "windows_aarch64_gnullvm 0.48.5", + "windows_aarch64_msvc 0.48.5", + "windows_i686_gnu 0.48.5", + "windows_i686_msvc 0.48.5", + "windows_x86_64_gnu 0.48.5", + "windows_x86_64_gnullvm 0.48.5", + "windows_x86_64_msvc 0.48.5", +] + +[[package]] +name = "windows-targets" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9b724f72796e036ab90c1021d4780d4d3d648aca59e491e6b98e725b84e99973" +dependencies = [ + "windows_aarch64_gnullvm 0.52.6", + "windows_aarch64_msvc 0.52.6", + "windows_i686_gnu 0.52.6", + "windows_i686_gnullvm 0.52.6", + "windows_i686_msvc 0.52.6", + "windows_x86_64_gnu 0.52.6", + "windows_x86_64_gnullvm 0.52.6", + "windows_x86_64_msvc 0.52.6", +] + +[[package]] +name = "windows-targets" +version = "0.53.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b1e4c7e8ceaaf9cb7d7507c974735728ab453b67ef8f18febdd7c11fe59dca8b" +dependencies = [ + "windows_aarch64_gnullvm 0.53.0", + "windows_aarch64_msvc 0.53.0", + "windows_i686_gnu 0.53.0", + "windows_i686_gnullvm 0.53.0", + "windows_i686_msvc 0.53.0", + "windows_x86_64_gnu 0.53.0", + "windows_x86_64_gnullvm 0.53.0", + "windows_x86_64_msvc 0.53.0", +] + +[[package]] +name = "windows-version" +version = "0.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c12476c23a74725c539b24eae8bfc0dac4029c39cdb561d9f23616accd4ae26d" +dependencies = [ + "windows-targets 0.53.0", +] + +[[package]] +name = "windows_aarch64_gnullvm" +version = "0.48.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2b38e32f0abccf9987a4e3079dfb67dcd799fb61361e53e2882c3cbaf0d905d8" + +[[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_gnullvm" +version = "0.53.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "86b8d5f90ddd19cb4a147a5fa63ca848db3df085e25fee3cc10b39b6eebae764" + +[[package]] +name = "windows_aarch64_msvc" +version = "0.48.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dc35310971f3b2dbbf3f0690a219f40e2d9afcf64f9ab7cc1be722937c26b4bc" + +[[package]] +name = "windows_aarch64_msvc" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "09ec2a7bb152e2252b53fa7803150007879548bc709c039df7627cabbd05d469" + +[[package]] +name = "windows_aarch64_msvc" +version = "0.53.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c7651a1f62a11b8cbd5e0d42526e55f2c99886c77e007179efff86c2b137e66c" + +[[package]] +name = "windows_i686_gnu" +version = "0.48.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a75915e7def60c94dcef72200b9a8e58e5091744960da64ec734a6c6e9b3743e" + +[[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_gnu" +version = "0.53.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c1dc67659d35f387f5f6c479dc4e28f1d4bb90ddd1a5d3da2e5d97b42d6272c3" + +[[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_gnullvm" +version = "0.53.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9ce6ccbdedbf6d6354471319e781c0dfef054c81fbc7cf83f338a4296c0cae11" + +[[package]] +name = "windows_i686_msvc" +version = "0.48.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8f55c233f70c4b27f66c523580f78f1004e8b5a8b659e05a4eb49d4166cca406" + +[[package]] +name = "windows_i686_msvc" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "240948bc05c5e7c6dabba28bf89d89ffce3e303022809e73deaefe4f6ec56c66" + +[[package]] +name = "windows_i686_msvc" +version = "0.53.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "581fee95406bb13382d2f65cd4a908ca7b1e4c2f1917f143ba16efe98a589b5d" + +[[package]] +name = "windows_x86_64_gnu" +version = "0.48.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "53d40abd2583d23e4718fddf1ebec84dbff8381c07cae67ff7768bbf19c6718e" + +[[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_gnu" +version = "0.53.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2e55b5ac9ea33f2fc1716d1742db15574fd6fc8dadc51caab1c16a3d3b4190ba" + +[[package]] +name = "windows_x86_64_gnullvm" +version = "0.48.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0b7b52767868a23d5bab768e390dc5f5c55825b6d30b86c844ff2dc7414044cc" + +[[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_gnullvm" +version = "0.53.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0a6e035dd0599267ce1ee132e51c27dd29437f63325753051e71dd9e42406c57" + +[[package]] +name = "windows_x86_64_msvc" +version = "0.48.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ed94fce61571a4006852b7389a063ab983c02eb1bb37b47f8272ce92d06d9538" + +[[package]] +name = "windows_x86_64_msvc" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "589f6da84c646204747d1270a2a5661ea66ed1cced2631d546fdfb155959f9ec" + +[[package]] +name = "windows_x86_64_msvc" +version = "0.53.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "271414315aff87387382ec3d271b52d7ae78726f5d44ac98b4f4030c91880486" + +[[package]] +name = "winnow" +version = "0.7.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "59690dea168f2198d1a3b0cac23b8063efcd11012f10ae4698f284808c8ef603" +dependencies = [ + "memchr", +] + +[[package]] +name = "wit-bindgen-rt" +version = "0.33.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3268f3d866458b787f390cf61f4bbb563b922d091359f9608842999eaee3943c" +dependencies = [ + "bitflags", +] + +[[package]] +name = "xdg-home" +version = "1.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ec1cdab258fb55c0da61328dc52c8764709b249011b2cad0454c72f0bf10a1f6" +dependencies = [ + "libc", + "windows-sys 0.59.0", +] + +[[package]] +name = "zbus" +version = "5.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "59c333f648ea1b647bc95dc1d34807c8e25ed7a6feff3394034dc4776054b236" +dependencies = [ + "async-broadcast", + "async-executor", + "async-fs", + "async-io", + "async-lock", + "async-process", + "async-recursion", + "async-task", + "async-trait", + "blocking", + "enumflags2", + "event-listener", + "futures-core", + "futures-lite", + "hex", + "nix", + "ordered-stream", + "serde", + "serde_repr", + "static_assertions", + "tracing", + "uds_windows", + "windows-sys 0.59.0", + "winnow", + "xdg-home", + "zbus_macros", + "zbus_names", + "zvariant", +] + +[[package]] +name = "zbus_macros" +version = "5.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f325ad10eb0d0a3eb060203494c3b7ec3162a01a59db75d2deee100339709fc0" +dependencies = [ + "proc-macro-crate", + "proc-macro2", + "quote", + "syn", + "zbus_names", + "zvariant", + "zvariant_utils", +] + +[[package]] +name = "zbus_names" +version = "4.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7be68e64bf6ce8db94f63e72f0c7eb9a60d733f7e0499e628dfab0f84d6bcb97" +dependencies = [ + "serde", + "static_assertions", + "winnow", + "zvariant", +] + +[[package]] +name = "zvariant" +version = "5.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b2df9ee044893fcffbdc25de30546edef3e32341466811ca18421e3cd6c5a3ac" +dependencies = [ + "endi", + "enumflags2", + "serde", + "static_assertions", + "winnow", + "zvariant_derive", + "zvariant_utils", +] + +[[package]] +name = "zvariant_derive" +version = "5.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "74170caa85b8b84cc4935f2d56a57c7a15ea6185ccdd7eadb57e6edd90f94b2f" +dependencies = [ + "proc-macro-crate", + "proc-macro2", + "quote", + "syn", + "zvariant_utils", +] + +[[package]] +name = "zvariant_utils" +version = "3.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e16edfee43e5d7b553b77872d99bc36afdda75c223ca7ad5e3fbecd82ca5fc34" +dependencies = [ + "proc-macro2", + "quote", + "serde", + "static_assertions", + "syn", + "winnow", +] diff --git a/nu_plugin_desktop_notifications/Cargo.toml b/nu_plugin_desktop_notifications/Cargo.toml new file mode 100644 index 0000000..bb5de4a --- /dev/null +++ b/nu_plugin_desktop_notifications/Cargo.toml @@ -0,0 +1,22 @@ +[dependencies] +nu-plugin = { version = "0.105.2", path = "../nushell/crates/nu-plugin" } + +[dependencies.notify-rust] +version = "4.11.7" + +[dependencies.nu-protocol] +features = ["plugin"] +version = "0.105.2" +path = "../nushell/crates/nu-protocol" + +[package] +authors = ["Motalleb Fallahnezhad "] +description = "A nushell plugin to send desktop notifications" +edition = "2024" +homepage = "https://github.com/FMotalleb/nu_plugin_desktop_notifications" +keywords = ["nushell", "desktop", "notification", "plugin"] +license = "MIT" +name = "nu_plugin_desktop_notifications" +readme = "README.md" +repository = "https://github.com/FMotalleb/nu_plugin_desktop_notifications" +version = "1.2.12" diff --git a/nu_plugin_desktop_notifications/LICENSE b/nu_plugin_desktop_notifications/LICENSE new file mode 100644 index 0000000..abbd7eb --- /dev/null +++ b/nu_plugin_desktop_notifications/LICENSE @@ -0,0 +1,7 @@ +Copyright 2023 "Motalleb Fallahnezhad" + +Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/nu_plugin_desktop_notifications/README.md b/nu_plugin_desktop_notifications/README.md new file mode 100644 index 0000000..de3be44 --- /dev/null +++ b/nu_plugin_desktop_notifications/README.md @@ -0,0 +1,93 @@ +# 🔔 nu_plugin_desktop_notifications + +A [Nushell](https://www.nushell.sh/) plugin for sending desktop notifications using [notify-rust](https://github.com/hoodie/notify-rust). + +--- + +## ✨ Features + +- **Send notifications** with custom title, body, icon, and app name. +- **Supports macOS, Windows, and Linux (XDG Desktop)**. +- **Configurable timeout** (for macOS and XDG desktops). +- **Error handling** with optional crash reporting. + +--- + +## 📌 Usage + +### **Sending a Notification** + +```bash +notify -t "Test notification body" --summary "Test title" +``` + +### **Flags** + +- `-h, --help` → Show help message. +- `-s, --summary ` → Title of the notification. +- `-t, --body ` → Body message of the notification. +- `--subtitle ` → Subtitle (macOS & Windows only). +- `-a, --app-name ` → App name for the notification. +- `-i, --icon ` → Path to an icon for the notification. +- `--timeout ` → Duration before the notification disappears _(macOS & XDG Desktop only)_. Defaults to system settings. +- `--crash-on-error ` → Return an error if the notification fails. + +--- + +## 🎯 Example: Notify on Task Completion + +Send a notification after a task completes, displaying the elapsed time: + +![image](https://github.com/FMotalleb/nu_plugin_desktop_notifications/assets/30149519/a4fbc2a9-6537-4d18-8d98-e55ebcd6b0bd) + +```bash +def "notify on done" [ + task: closure +] { + let start = date now + let result = do $task + let end = date now + let total = $end - $start | format duration sec + let body = $"Task completed in ($total)" + notify -s "Task Finished" -t $body + return $result +} + +notify on done { port scan 8.8.8.8 53 } +``` + +--- + +## 🔧 Installation + +### 🚀 Recommended: Using [nupm](https://github.com/nushell/nupm) + +```bash +git clone https://github.com/FMotalleb/nu_plugin_desktop_notifications.git +nupm install --path nu_plugin_desktop_notifications -f +``` + +### 🛠️ Manual Compilation + +```bash +git clone https://github.com/FMotalleb/nu_plugin_desktop_notifications.git +cd nu_plugin_desktop_notifications +cargo build -r +register target/release/nu_plugin_desktop_notifications +``` + +### 📦 Install via Cargo (using git) + +```bash +cargo install --git https://github.com/FMotalleb/nu_plugin_desktop_notifications.git +register ~/.cargo/bin/nu_plugin_desktop_notifications +``` + +### 📦 Install via Cargo (crates.io) _Not Recommended_ +> +> _Since I live in Iran and crates.io often restricts package updates, the version there might be outdated._ + +```bash +cargo install nu_plugin_desktop_notifications +register ~/.cargo/bin/nu_plugin_desktop_notifications +``` diff --git a/nu_plugin_desktop_notifications/build.nu b/nu_plugin_desktop_notifications/build.nu new file mode 100644 index 0000000..375f003 --- /dev/null +++ b/nu_plugin_desktop_notifications/build.nu @@ -0,0 +1,17 @@ +use std log + + +def main [package_file: path = nupm.nuon] { + let repo_root = (ls -f $package_file | first | get name | path dirname) + let install_root = $env.NUPM_HOME | path join "plugins" + + let name = open ($repo_root | path join "Cargo.toml") | get package.name + let features = [] + + let cmd = $"cargo install --path ($repo_root) --root ($install_root) --features=($features | str join ",")" + log info $"building plugin using: (ansi blue)($cmd)(ansi reset)" + nu -c $cmd + let ext: string = if ($nu.os-info.name == 'windows') { '.exe' } else { '' } + plugin add $"($install_root | path join "bin" $name)($ext)" + log info "do not forget to restart Nushell for the plugin to be fully available!" +} diff --git a/nu_plugin_desktop_notifications/nupm.nuon b/nu_plugin_desktop_notifications/nupm.nuon new file mode 100644 index 0000000..ba94287 --- /dev/null +++ b/nu_plugin_desktop_notifications/nupm.nuon @@ -0,0 +1,7 @@ +{ + "name": "nu_plugin_desktop_notifications", + "version": "1.2.11", + "description": "A nushell plugin to send desktop notifications", + "license": "LICENSE", + "type": "custom" +} \ No newline at end of file diff --git a/nu_plugin_desktop_notifications/rust-toolchain.toml b/nu_plugin_desktop_notifications/rust-toolchain.toml new file mode 100644 index 0000000..29171b0 --- /dev/null +++ b/nu_plugin_desktop_notifications/rust-toolchain.toml @@ -0,0 +1,3 @@ +[toolchain] +profile = "default" +channel = "stable" diff --git a/nu_plugin_desktop_notifications/src/main.rs b/nu_plugin_desktop_notifications/src/main.rs new file mode 100644 index 0000000..29b62c0 --- /dev/null +++ b/nu_plugin_desktop_notifications/src/main.rs @@ -0,0 +1,19 @@ +use nu_plugin::{serve_plugin, Plugin}; + +use crate::notify::NotifyCommand; +mod notify; +pub struct NotifyPlugin; + +impl Plugin for NotifyPlugin { + fn commands(&self) -> Vec>> { + vec![Box::new(NotifyCommand::new())] + } + + fn version(&self) -> String { + env!("CARGO_PKG_VERSION").into() + } +} + +fn main() { + serve_plugin(&mut NotifyPlugin {}, nu_plugin::MsgPackSerializer {}) +} diff --git a/nu_plugin_desktop_notifications/src/notify.rs b/nu_plugin_desktop_notifications/src/notify.rs new file mode 100644 index 0000000..a0baf91 --- /dev/null +++ b/nu_plugin_desktop_notifications/src/notify.rs @@ -0,0 +1,132 @@ +use std::time::Duration; + +use notify_rust::{Notification, Timeout}; +use nu_plugin::{EngineInterface, EvaluatedCall, SimplePluginCommand}; +use nu_protocol::{Category, LabeledError, Signature, SyntaxShape, Value}; + +use crate::NotifyPlugin; + +#[derive(Default)] +pub struct NotifyCommand; +impl NotifyCommand { + pub(crate) fn new() -> NotifyCommand { + NotifyCommand {} + } + pub fn load_string(call: &EvaluatedCall, name: &str) -> Option { + let value = call.get_flag_value(name); + match value { + Some(Value::String { val, .. }) => Some(val), + _ => None, + } + } +} + +impl SimplePluginCommand for NotifyCommand { + type Plugin = NotifyPlugin; + + fn name(&self) -> &str { + "notify" + } + + fn signature(&self) -> Signature { + Signature::build("notify") + .named( + "summary", + SyntaxShape::String, + "summary of the notification", + Some('s'), + ) + .named( + "body", + SyntaxShape::String, + "body of the notification", + Some('t'), + ) + .named( + "subtitle", + SyntaxShape::String, + "subtitle of the notification [macOS only]", + None, + ) + .named( + "app-name", + SyntaxShape::String, + "app name of the notification", + Some('a'), + ) + .named( + "icon", + SyntaxShape::Filepath, + "path to the icon of the notification", + Some('i'), + ) + .named( + "timeout", + SyntaxShape::Duration, + "duration of the notification [XDG Desktops only] (defaults to system default)", + None, + ) + .named( + "crash-on-error", + SyntaxShape::Filepath, + "returns notification error if encountered", + None, + ) + .category(Category::Experimental) + } + + fn description(&self) -> &str { + "Send a desktop notification with customizable parameters." + } + + fn run( + &self, + _plugin: &Self::Plugin, + _engine: &EngineInterface, + call: &EvaluatedCall, + input: &Value, + ) -> Result { + let mut notification = Notification::new(); + if let Some(summary) = Self::load_string(call, "summary") { + notification.summary(&summary); + } + if let Some(body) = Self::load_string(call, "body") { + notification.body(&body); + } + if let Some(subtitle) = Self::load_string(call, "subtitle") { + notification.subtitle(&subtitle); + } + if let Some(app_name) = Self::load_string(call, "app-name") { + notification.appname(&app_name); + } + + if let Some(icon) = Self::load_string(call, "icon") { + notification.icon(&icon); + } else { + notification.auto_icon(); + } + + if let Some(duration_value) = call.get_flag_value("timeout") { + match duration_value.as_duration() { + Ok(timeout) => { + if let Ok(nanos) = timeout.try_into() { + let duration = Timeout::from(Duration::from_nanos(nanos)); + notification.timeout(duration); + } + } + Err(_) => {} + } + } + + match notification.show() { + Ok(_) => Ok(input.clone()), + Err(err) => { + if let Ok(true) = call.has_flag("crash-on-error") { + return Err(LabeledError::new(err.to_string()) + .with_label("Notification Exception", call.head)); + } + Ok(input.clone()) + } + } + } +} diff --git a/nu_plugin_hashes/.gitignore b/nu_plugin_hashes/.gitignore new file mode 100644 index 0000000..c41cc9e --- /dev/null +++ b/nu_plugin_hashes/.gitignore @@ -0,0 +1 @@ +/target \ No newline at end of file diff --git a/nu_plugin_hashes/Cargo.lock b/nu_plugin_hashes/Cargo.lock new file mode 100644 index 0000000..2998ae1 --- /dev/null +++ b/nu_plugin_hashes/Cargo.lock @@ -0,0 +1,2524 @@ +# This file is automatically @generated by Cargo. +# It is not intended for manual editing. +version = 4 + +[[package]] +name = "adler2" +version = "2.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "320119579fcad9c21884f5c4861d16174d0e06250625266f50fe6898340abefa" + +[[package]] +name = "aho-corasick" +version = "1.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8e60d3430d3a69478ad0993f19238d2df97c507009a52b3c10addcd7f6bcb916" +dependencies = [ + "memchr", +] + +[[package]] +name = "alloc-no-stdlib" +version = "2.0.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cc7bb162ec39d46ab1ca8c77bf72e890535becd1751bb45f64c597edb4c8c6b3" + +[[package]] +name = "alloc-stdlib" +version = "0.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "94fb8275041c72129eb51b7d0322c29b8387a0386127718b096429201a5d6ece" +dependencies = [ + "alloc-no-stdlib", +] + +[[package]] +name = "allocator-api2" +version = "0.2.21" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "683d7910e743518b0e34f1186f92494becacb047c7b6bf616c96772180fef923" + +[[package]] +name = "android-tzdata" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e999941b234f3131b00bc13c22d06e8c5ff726d1b6318ac7eb276997bbb4fef0" + +[[package]] +name = "android_system_properties" +version = "0.1.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "819e7219dbd41043ac279b19830f2efc897156490d7fd6ea916720117ee66311" +dependencies = [ + "libc", +] + +[[package]] +name = "arrayref" +version = "0.3.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "76a2e8124351fda1ef8aaaa3bbd7ebbcb486bbcd4225aca0aa0d84bb2db8fecb" + +[[package]] +name = "arrayvec" +version = "0.7.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7c02d123df017efcdfbd739ef81735b36c5ba83ec3c59c80a9d7ecc718f92e50" + +[[package]] +name = "ascon-core" +version = "0.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7c4c9bc969387b7d7e7e931b978833ab18251a39e0f94addad7b823d08b8db74" + +[[package]] +name = "ascon-hash" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "00df3a4d2b05a6c06e50ed7e87826a43ddb847c46835cd87caa3a8e633e31777" +dependencies = [ + "ascon-core", + "digest", +] + +[[package]] +name = "autocfg" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c08606f8c3cbf4ce6ec8e28fb0014a2c086708fe954eaa885384a6165172e7e8" + +[[package]] +name = "belt-block" +version = "0.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d9aa1eef3994e2ccd304a78fe3fea4a73e5792007f85f09b79bb82143ca5f82b" + +[[package]] +name = "belt-hash" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fbc405b3b8472f6e019aedf942fdee9516a0546d12e053d3744416e8f21ddb8a" +dependencies = [ + "belt-block", + "digest", +] + +[[package]] +name = "bindgen" +version = "0.70.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f49d8fed880d473ea71efb9bf597651e77201bdd4893efe54c9e5d65ae04ce6f" +dependencies = [ + "bitflags", + "cexpr", + "clang-sys", + "itertools 0.13.0", + "proc-macro2", + "quote", + "regex", + "rustc-hash", + "shlex", + "syn", +] + +[[package]] +name = "bit-set" +version = "0.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "08807e080ed7f9d5433fa9b275196cfc35414f66a0c79d864dc51a0d825231a3" +dependencies = [ + "bit-vec", +] + +[[package]] +name = "bit-vec" +version = "0.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5e764a1d40d510daf35e07be9eb06e75770908c27d411ee6c92109c9840eaaf7" + +[[package]] +name = "bitflags" +version = "2.9.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1b8e56985ec62d17e9c1001dc89c88ecd7dc08e47eba5ec7c29c7b5eeecde967" + +[[package]] +name = "blake2" +version = "0.10.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "46502ad458c9a52b69d4d4d32775c788b7a1b85e8bc9d482d92250fc0e3f8efe" +dependencies = [ + "digest", +] + +[[package]] +name = "blake3" +version = "1.8.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3888aaa89e4b2a40fca9848e400f6a658a5a3978de7be858e209cafa8be9a4a0" +dependencies = [ + "arrayref", + "arrayvec", + "cc", + "cfg-if", + "constant_time_eq", + "digest", +] + +[[package]] +name = "block-buffer" +version = "0.10.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3078c7629b62d3f0439517fa394996acacc5cbc91c5a20d8c658e77abd503a71" +dependencies = [ + "generic-array", +] + +[[package]] +name = "brotli" +version = "7.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cc97b8f16f944bba54f0433f07e30be199b6dc2bd25937444bbad560bcea29bd" +dependencies = [ + "alloc-no-stdlib", + "alloc-stdlib", + "brotli-decompressor", +] + +[[package]] +name = "brotli-decompressor" +version = "4.0.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a334ef7c9e23abf0ce748e8cd309037da93e606ad52eb372e4ce327a0dcfbdfd" +dependencies = [ + "alloc-no-stdlib", + "alloc-stdlib", +] + +[[package]] +name = "bumpalo" +version = "3.19.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "46c5e41b57b8bba42a04676d81cb89e9ee8e859a1a66f80a5a72e1cb76b34d43" + +[[package]] +name = "byteorder" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1fd0f2584146f6f2ef48085050886acf353beff7305ebd1ae69500e27c67f64b" + +[[package]] +name = "bytes" +version = "1.10.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d71b6127be86fdcfddb610f7182ac57211d4b18a3e9c82eb2d17662f2227ad6a" + +[[package]] +name = "bytesize" +version = "1.3.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2e93abca9e28e0a1b9877922aacb20576e05d4679ffa78c3d6dc22a26a216659" + +[[package]] +name = "cc" +version = "1.2.27" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d487aa071b5f64da6f19a3e848e3578944b726ee5a4854b82172f02aa876bfdc" +dependencies = [ + "shlex", +] + +[[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.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9555578bc9e57714c812a1f84e4fc5b4d21fcb063490c624de019f7464c91268" + +[[package]] +name = "cfg_aliases" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "613afe47fcd5fac7ccf1db93babcb082c5994d996f20b8b159f2ad1658eb5724" + +[[package]] +name = "chrono" +version = "0.4.41" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c469d952047f47f91b68d1cba3f10d63c11d73e4636f24f08daf0278abf01c4d" +dependencies = [ + "android-tzdata", + "iana-time-zone", + "num-traits", + "pure-rust-locales", + "serde", + "windows-link", +] + +[[package]] +name = "chrono-humanize" +version = "0.2.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "799627e6b4d27827a814e837b9d8a504832086081806d45b1afa34dc982b023b" +dependencies = [ + "chrono", +] + +[[package]] +name = "clang-sys" +version = "1.8.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0b023947811758c97c59bf9d1c188fd619ad4718dcaa767947df1cadb14f39f4" +dependencies = [ + "glob", + "libc", + "libloading", +] + +[[package]] +name = "const_format" +version = "0.2.34" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "126f97965c8ad46d6d9163268ff28432e8f6a1196a55578867832e3049df63dd" +dependencies = [ + "const_format_proc_macros", +] + +[[package]] +name = "const_format_proc_macros" +version = "0.2.34" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1d57c2eccfb16dbac1f4e61e206105db5820c9d26c3c472bc17c774259ef7744" +dependencies = [ + "proc-macro2", + "quote", + "unicode-xid", +] + +[[package]] +name = "constant_time_eq" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7c74b8349d32d297c9134b8c88677813a227df8f779daa29bfc29c183fe3dca6" + +[[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 = "crc32fast" +version = "1.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a97769d94ddab943e4510d138150169a2758b5ef3eb191a9ee688de3e23ef7b3" +dependencies = [ + "cfg-if", +] + +[[package]] +name = "crossbeam-deque" +version = "0.8.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9dd111b7b7f7d55b72c0a6ae361660ee5853c9af73f70c3c2ef6858b950e2e51" +dependencies = [ + "crossbeam-epoch", + "crossbeam-utils", +] + +[[package]] +name = "crossbeam-epoch" +version = "0.9.18" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5b82ac4a3c2ca9c3460964f020e1402edd5753411d7737aa39c3714ad1b5420e" +dependencies = [ + "crossbeam-utils", +] + +[[package]] +name = "crossbeam-utils" +version = "0.8.21" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d0a5c400df2834b80a4c3327b3aad3a4c4cd4de0629063962b03235697506a28" + +[[package]] +name = "crossterm" +version = "0.28.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "829d955a0bb380ef178a640b91779e3987da38c9aea133b20614cfed8cdea9c6" +dependencies = [ + "bitflags", + "crossterm_winapi", + "mio", + "parking_lot", + "rustix 0.38.44", + "signal-hook", + "signal-hook-mio", + "winapi", +] + +[[package]] +name = "crossterm_winapi" +version = "0.9.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "acdd7c62a3665c7f6830a51635d9ac9b23ed385797f70a83bb8bafe9c572ab2b" +dependencies = [ + "winapi", +] + +[[package]] +name = "crypto-common" +version = "0.1.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1bfb12502f3fc46cca1bb51ac28df9d618d813cdc3d2f25b9fe775a34af26bb3" +dependencies = [ + "generic-array", + "typenum", +] + +[[package]] +name = "deranged" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9c9e6a11ca8224451684bc0d7d5a7adbf8f2fd6887261a1cfc3c0432f9d4068e" +dependencies = [ + "powerfmt", +] + +[[package]] +name = "digest" +version = "0.10.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9ed9a281f7bc9b7576e61468ba615a66a5c8cfdff42420a70aa82701a3b1e292" +dependencies = [ + "block-buffer", + "crypto-common", + "subtle", +] + +[[package]] +name = "dirs" +version = "5.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "44c45a9d03d6676652bcb5e724c7e988de1acad23a711b5217ab9cbecbec2225" +dependencies = [ + "dirs-sys", +] + +[[package]] +name = "dirs-sys" +version = "0.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "520f05a5cbd335fae5a99ff7a6ab8627577660ee5cfd6a94a6a929b52ff0321c" +dependencies = [ + "libc", + "option-ext", + "redox_users", + "windows-sys 0.48.0", +] + +[[package]] +name = "doctest-file" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "aac81fa3e28d21450aa4d2ac065992ba96a1d7303efbce51a95f4fd175b67562" + +[[package]] +name = "either" +version = "1.15.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "48c757948c5ede0e46177b7add2e67155f70e33c07fea8284df6576da70b3719" + +[[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.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e004d887f51fcb9fef17317a2f3525c887d8aa3f4f50fed920816a688284a5b7" +dependencies = [ + "serde", + "typeid", +] + +[[package]] +name = "errno" +version = "0.3.13" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "778e2ac28f6c47af28e4907f13ffd1e1ddbd400980a9abd7c8df189bf578a5ad" +dependencies = [ + "libc", + "windows-sys 0.60.2", +] + +[[package]] +name = "fancy-regex" +version = "0.14.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6e24cb5a94bcae1e5408b0effca5cd7172ea3c5755049c5f3af4cd283a165298" +dependencies = [ + "bit-set", + "regex-automata", + "regex-syntax", +] + +[[package]] +name = "flate2" +version = "1.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4a3d7db9596fecd151c5f638c0ee5d5bd487b6e0ea232e5dc96d5250f6f94b1d" +dependencies = [ + "crc32fast", + "miniz_oxide", +] + +[[package]] +name = "foldhash" +version = "0.1.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d9c4f5dac5e15c24eb999c26181a6ca40b39fe946cbe4c263c7209467bc83af2" + +[[package]] +name = "fsb" +version = "0.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e54a22467e3d3e1b2d014c67cb074fe361d80e3293ffab4128918313eaf737c8" +dependencies = [ + "digest", + "whirlpool", +] + +[[package]] +name = "generic-array" +version = "0.14.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "85649ca51fd72272d7821adaf274ad91c288277713d9c18820d8499a7ff69e9a" +dependencies = [ + "typenum", + "version_check", +] + +[[package]] +name = "getrandom" +version = "0.2.16" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "335ff9f135e4384c8150d6f27c6daed433577f86b4750418338c01a1a2528592" +dependencies = [ + "cfg-if", + "libc", + "wasi", +] + +[[package]] +name = "glob" +version = "0.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a8d1add55171497b4705a648c6b583acafb01d58050a51727785f0b2c8e0a2b2" + +[[package]] +name = "gost94" +version = "0.10.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2f960e0ba8eb5e47a7d45097dc4159b5ef63d82e62dc85894bfcfd8e6b85526c" +dependencies = [ + "digest", +] + +[[package]] +name = "groestl" +version = "0.10.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "343cfc165f92a988fd60292f7a0bfde4352a5a0beff9fbec29251ca4e9676e4d" +dependencies = [ + "digest", +] + +[[package]] +name = "hashbrown" +version = "0.15.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5971ac85611da7067dbfcabef3c70ebb5606018acd9e2a3903a0da507521e0d5" +dependencies = [ + "allocator-api2", + "equivalent", + "foldhash", +] + +[[package]] +name = "heck" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2304e00983f87ffb38b55b444b5e3b60a884b5d30c0fca7d82fe33449bbe55ea" + +[[package]] +name = "hex" +version = "0.4.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7f24254aa9a54b5c858eaee2f5bccdb46aaf0e486a595ed5fd8f86ba55232a70" + +[[package]] +name = "hex-literal" +version = "0.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6fe2267d4ed49bc07b63801559be28c718ea06c4738b7a03c94df7386d2cde46" + +[[package]] +name = "iana-time-zone" +version = "0.1.63" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b0c919e5debc312ad217002b8048a17b7d83f80703865bbfcfebb0458b0b27d8" +dependencies = [ + "android_system_properties", + "core-foundation-sys", + "iana-time-zone-haiku", + "js-sys", + "log", + "wasm-bindgen", + "windows-core 0.61.2", +] + +[[package]] +name = "iana-time-zone-haiku" +version = "0.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f31827a206f56af32e590ba56d5d2d085f558508192593743f16b2306495269f" +dependencies = [ + "cc", +] + +[[package]] +name = "indexmap" +version = "2.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cea70ddb795996207ad57735b50c5982d8844f38ba9ee5f1aedcfb708a2aa11e" +dependencies = [ + "equivalent", + "hashbrown", +] + +[[package]] +name = "interprocess" +version = "2.2.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d941b405bd2322993887859a8ee6ac9134945a24ec5ec763a8a962fc64dfec2d" +dependencies = [ + "doctest-file", + "libc", + "recvmsg", + "widestring", + "windows-sys 0.52.0", +] + +[[package]] +name = "inventory" +version = "0.3.20" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ab08d7cd2c5897f2c949e5383ea7c7db03fb19130ffcfbf7eda795137ae3cb83" +dependencies = [ + "rustversion", +] + +[[package]] +name = "is_ci" +version = "1.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7655c9839580ee829dfacba1d1278c2b7883e50a277ff7541299489d6bdfdc45" + +[[package]] +name = "is_debug" +version = "1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1fe266d2e243c931d8190177f20bf7f24eed45e96f39e87dc49a27b32d12d407" + +[[package]] +name = "itertools" +version = "0.13.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "413ee7dfc52ee1a4949ceeb7dbc8a33f2d6c088194d9f922fb8318faf1f01186" +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.15" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4a5f13b858c8d314ee3e8f639011f7ccefe71f97f96e50151fb991f267928e2c" + +[[package]] +name = "jh" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f65735f9e73adc203417d2e05352aef71d7e832ec090f65de26c96c9ec563aa5" +dependencies = [ + "digest", + "hex-literal", + "ppv-lite86", +] + +[[package]] +name = "js-sys" +version = "0.3.77" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1cfaf33c695fc6e08064efbc1f72ec937429614f25eef83af942d0e227c3a28f" +dependencies = [ + "once_cell", + "wasm-bindgen", +] + +[[package]] +name = "keccak" +version = "0.1.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ecc2af9a1119c51f12a14607e783cb977bde58bc069ff0c3da1095e635d70654" +dependencies = [ + "cpufeatures", +] + +[[package]] +name = "libc" +version = "0.2.174" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1171693293099992e19cddea4e8b849964e9846f4acee11b3948bcc337be8776" + +[[package]] +name = "libloading" +version = "0.8.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "07033963ba89ebaf1584d767badaa2e8fcec21aedea6b8c0346d487d49c28667" +dependencies = [ + "cfg-if", + "windows-targets 0.53.2", +] + +[[package]] +name = "libproc" +version = "0.14.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e78a09b56be5adbcad5aa1197371688dc6bb249a26da3bca2011ee2fb987ebfb" +dependencies = [ + "bindgen", + "errno", + "libc", +] + +[[package]] +name = "libredox" +version = "0.1.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1580801010e535496706ba011c15f8532df6b42297d2e471fec38ceadd8c0638" +dependencies = [ + "bitflags", + "libc", +] + +[[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.9.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cd945864f07fe9f5371a27ad7b52a172b4b499999f1d97574c9fa68373937e12" + +[[package]] +name = "lock_api" +version = "0.4.13" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "96936507f153605bddfcda068dd804796c84324ed2510809e5b2a624c81da765" +dependencies = [ + "autocfg", + "scopeguard", +] + +[[package]] +name = "log" +version = "0.4.27" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "13dc2df351e3202783a1fe0d44375f7295ffb4049267b0f3018346dc122a1d94" + +[[package]] +name = "lru" +version = "0.12.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "234cf4f4a04dc1f57e24b96cc0cd600cf2af460d4161ac5ecdd0af8e1f3b2a38" +dependencies = [ + "hashbrown", +] + +[[package]] +name = "lscolors" +version = "0.20.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "61183da5de8ba09a58e330d55e5ea796539d8443bd00fdeb863eac39724aa4ab" +dependencies = [ + "aho-corasick", + "nu-ansi-term", +] + +[[package]] +name = "mach2" +version = "0.4.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d640282b302c0bb0a2a8e0233ead9035e3bed871f0b7e81fe4a1ec829765db44" +dependencies = [ + "libc", +] + +[[package]] +name = "md2" +version = "0.10.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1f4f0f3ed25ff4f8d8d102288d92f900efc202661c884cf67dfe4f0d07c43d1f" +dependencies = [ + "digest", +] + +[[package]] +name = "md4" +version = "0.10.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7da5ac363534dce5fabf69949225e174fbf111a498bf0ff794c8ea1fba9f3dda" +dependencies = [ + "digest", +] + +[[package]] +name = "memchr" +version = "2.7.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "32a282da65faaf38286cf3be983213fcf1d2e2a58700e808f83f4ea9a4804bc0" + +[[package]] +name = "miette" +version = "7.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5f98efec8807c63c752b5bd61f862c165c115b0a35685bdcfd9238c7aeb592b7" +dependencies = [ + "cfg-if", + "miette-derive", + "owo-colors", + "supports-color", + "supports-hyperlinks", + "supports-unicode", + "terminal_size", + "textwrap", + "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", +] + +[[package]] +name = "minimal-lexical" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "68354c5c6bd36d73ff3feceb05efa59b6acb7626617f4962be322a825e61f79a" + +[[package]] +name = "miniz_oxide" +version = "0.8.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1fa76a2c86f704bdb222d66965fb3d63269ce38518b83cb0575fca855ebb6316" +dependencies = [ + "adler2", +] + +[[package]] +name = "mio" +version = "1.0.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "78bed444cc8a2160f01cbcf811ef18cac863ad68ae8ca62092e8db51d51c761c" +dependencies = [ + "libc", + "log", + "wasi", + "windows-sys 0.59.0", +] + +[[package]] +name = "nix" +version = "0.29.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "71e2746dc3a24dd78b3cfcb7be93368c6de9963d30f43a6a73998a9cf4b17b46" +dependencies = [ + "bitflags", + "cfg-if", + "cfg_aliases", + "libc", +] + +[[package]] +name = "nom" +version = "7.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d273983c5a657a70a3e8f2a01329822f3b8c8172b73826411a55751e404a0a4a" +dependencies = [ + "memchr", + "minimal-lexical", +] + +[[package]] +name = "ntapi" +version = "0.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e8a3895c6391c39d7fe7ebc444a87eb2991b2a0bc718fdabd071eec617fc68e4" +dependencies = [ + "winapi", +] + +[[package]] +name = "nu-ansi-term" +version = "0.50.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d4a28e057d01f97e61255210fcff094d74ed0466038633e95017f5beb68e4399" +dependencies = [ + "windows-sys 0.52.0", +] + +[[package]] +name = "nu-cmd-base" +version = "0.105.2" +dependencies = [ + "indexmap", + "miette", + "nu-engine", + "nu-parser", + "nu-path", + "nu-protocol", +] + +[[package]] +name = "nu-cmd-lang" +version = "0.105.2" +dependencies = [ + "itertools 0.14.0", + "nu-cmd-base", + "nu-engine", + "nu-parser", + "nu-protocol", + "nu-utils", + "shadow-rs", +] + +[[package]] +name = "nu-derive-value" +version = "0.105.2" +dependencies = [ + "heck", + "proc-macro-error2", + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "nu-engine" +version = "0.105.2" +dependencies = [ + "log", + "nu-glob", + "nu-path", + "nu-protocol", + "nu-utils", +] + +[[package]] +name = "nu-glob" +version = "0.105.2" + +[[package]] +name = "nu-parser" +version = "0.105.2" +dependencies = [ + "bytesize", + "chrono", + "itertools 0.14.0", + "log", + "nu-engine", + "nu-path", + "nu-plugin-engine", + "nu-protocol", + "nu-utils", + "serde_json", +] + +[[package]] +name = "nu-path" +version = "0.105.2" +dependencies = [ + "dirs", + "omnipath", + "pwd", + "ref-cast", +] + +[[package]] +name = "nu-plugin" +version = "0.105.2" +dependencies = [ + "log", + "nix", + "nu-engine", + "nu-plugin-core", + "nu-plugin-protocol", + "nu-protocol", + "nu-utils", + "thiserror 2.0.12", +] + +[[package]] +name = "nu-plugin-core" +version = "0.105.2" +dependencies = [ + "interprocess", + "log", + "nu-plugin-protocol", + "nu-protocol", + "rmp-serde", + "serde", + "serde_json", + "windows 0.56.0", +] + +[[package]] +name = "nu-plugin-engine" +version = "0.105.2" +dependencies = [ + "log", + "nu-engine", + "nu-plugin-core", + "nu-plugin-protocol", + "nu-protocol", + "nu-system", + "nu-utils", + "serde", + "windows 0.56.0", +] + +[[package]] +name = "nu-plugin-protocol" +version = "0.105.2" +dependencies = [ + "nu-protocol", + "nu-utils", + "rmp-serde", + "semver", + "serde", + "typetag", +] + +[[package]] +name = "nu-plugin-test-support" +version = "0.105.2" +dependencies = [ + "nu-ansi-term", + "nu-cmd-lang", + "nu-engine", + "nu-parser", + "nu-plugin", + "nu-plugin-core", + "nu-plugin-engine", + "nu-plugin-protocol", + "nu-protocol", + "similar", +] + +[[package]] +name = "nu-protocol" +version = "0.105.2" +dependencies = [ + "brotli", + "bytes", + "chrono", + "chrono-humanize", + "dirs", + "dirs-sys", + "fancy-regex", + "heck", + "indexmap", + "log", + "lru", + "memchr", + "miette", + "nix", + "nu-derive-value", + "nu-glob", + "nu-path", + "nu-system", + "nu-utils", + "num-format", + "os_pipe", + "rmp-serde", + "serde", + "serde_json", + "strum", + "strum_macros", + "thiserror 2.0.12", + "typetag", + "web-time", + "windows 0.56.0", + "windows-sys 0.48.0", +] + +[[package]] +name = "nu-system" +version = "0.105.2" +dependencies = [ + "chrono", + "itertools 0.14.0", + "libc", + "libproc", + "log", + "mach2", + "nix", + "ntapi", + "procfs", + "sysinfo", + "web-time", + "windows 0.56.0", +] + +[[package]] +name = "nu-utils" +version = "0.105.2" +dependencies = [ + "crossterm", + "crossterm_winapi", + "fancy-regex", + "log", + "lscolors", + "nix", + "num-format", + "serde", + "serde_json", + "strip-ansi-escapes", + "sys-locale", + "unicase", +] + +[[package]] +name = "nu_plugin_hashes" +version = "0.1.8" +dependencies = [ + "ascon-hash", + "belt-hash", + "blake2", + "blake3", + "digest", + "fsb", + "gost94", + "groestl", + "jh", + "md2", + "md4", + "nu-cmd-base", + "nu-plugin", + "nu-plugin-test-support", + "nu-protocol", + "ripemd", + "sha1", + "sha2", + "sha3", + "shabal", + "skein", + "sm3", + "streebog", + "tiger", + "whirlpool", +] + +[[package]] +name = "num-conv" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "51d515d32fb182ee37cda2ccdcb92950d6a3c2893aa280e540671c2cd0f3b1d9" + +[[package]] +name = "num-format" +version = "0.4.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a652d9771a63711fd3c3deb670acfbe5c30a4072e664d7a3bf5a9e1056ac72c3" +dependencies = [ + "arrayvec", + "itoa", +] + +[[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_threads" +version = "0.1.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5c7398b9c8b70908f6371f47ed36737907c87c52af34c268fed0bf0ceb92ead9" +dependencies = [ + "libc", +] + +[[package]] +name = "omnipath" +version = "0.1.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "80adb31078122c880307e9cdfd4e3361e6545c319f9b9dcafcb03acd3b51a575" + +[[package]] +name = "once_cell" +version = "1.21.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "42f5e15c9953c5e4ccceeb2e7382a716482c34515315f7b03532b8b4e8393d2d" + +[[package]] +name = "option-ext" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "04744f49eae99ab78e0d5c0b603ab218f515ea8cfe5a456d7629ad883a3b6e7d" + +[[package]] +name = "os_pipe" +version = "1.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "db335f4760b14ead6290116f2427bf33a14d4f0617d49f78a246de10c1831224" +dependencies = [ + "libc", + "windows-sys 0.59.0", +] + +[[package]] +name = "owo-colors" +version = "4.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "48dd4f4a2c8405440fd0462561f0e5806bd0f77e86f51c761481bdd4018b545e" + +[[package]] +name = "parking_lot" +version = "0.12.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "70d58bf43669b5795d1576d0641cfb6fbb2057bf629506267a92807158584a13" +dependencies = [ + "lock_api", + "parking_lot_core", +] + +[[package]] +name = "parking_lot_core" +version = "0.9.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bc838d2a56b5b1a6c25f55575dfc605fabb63bb2365f6c2353ef9159aa69e4a5" +dependencies = [ + "cfg-if", + "libc", + "redox_syscall", + "smallvec", + "windows-targets 0.52.6", +] + +[[package]] +name = "paste" +version = "1.0.15" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "57c0d7b74b563b49d38dae00a0c37d4d6de9b432382b2892f0574ddcae73fd0a" + +[[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 = "proc-macro-error-attr2" +version = "2.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "96de42df36bb9bba5542fe9f1a054b8cc87e172759a1868aa05c1f3acc89dfc5" +dependencies = [ + "proc-macro2", + "quote", +] + +[[package]] +name = "proc-macro-error2" +version = "2.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "11ec05c52be0a07b08061f7dd003e7d7092e0472bc731b4af7bb1ef876109802" +dependencies = [ + "proc-macro-error-attr2", + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "proc-macro2" +version = "1.0.95" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "02b3e5e68a3a1a02aad3ec490a98007cbc13c37cbe84a3cd7b8e406d76e7f778" +dependencies = [ + "unicode-ident", +] + +[[package]] +name = "procfs" +version = "0.17.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cc5b72d8145275d844d4b5f6d4e1eef00c8cd889edb6035c21675d1bb1f45c9f" +dependencies = [ + "bitflags", + "chrono", + "flate2", + "hex", + "procfs-core", + "rustix 0.38.44", +] + +[[package]] +name = "procfs-core" +version = "0.17.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "239df02d8349b06fc07398a3a1697b06418223b1c7725085e801e7c0fc6a12ec" +dependencies = [ + "bitflags", + "chrono", + "hex", +] + +[[package]] +name = "pure-rust-locales" +version = "0.8.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1190fd18ae6ce9e137184f207593877e70f39b015040156b1e05081cdfe3733a" + +[[package]] +name = "pwd" +version = "1.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "72c71c0c79b9701efe4e1e4b563b2016dd4ee789eb99badcb09d61ac4b92e4a2" +dependencies = [ + "libc", + "thiserror 1.0.69", +] + +[[package]] +name = "quote" +version = "1.0.40" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1885c039570dc00dcb4ff087a89e185fd56bae234ddc7f056a945bf36467248d" +dependencies = [ + "proc-macro2", +] + +[[package]] +name = "rayon" +version = "1.10.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b418a60154510ca1a002a752ca9714984e21e4241e804d32555251faf8b78ffa" +dependencies = [ + "either", + "rayon-core", +] + +[[package]] +name = "rayon-core" +version = "1.12.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1465873a3dfdaa8ae7cb14b4383657caab0b3e8a0aa9ae8e04b044854c8dfce2" +dependencies = [ + "crossbeam-deque", + "crossbeam-utils", +] + +[[package]] +name = "recvmsg" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d3edd4d5d42c92f0a659926464d4cce56b562761267ecf0f469d85b7de384175" + +[[package]] +name = "redox_syscall" +version = "0.5.13" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0d04b7d0ee6b4a0207a0a7adb104d23ecb0b47d6beae7152d0fa34b692b29fd6" +dependencies = [ + "bitflags", +] + +[[package]] +name = "redox_users" +version = "0.4.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ba009ff324d1fc1b900bd1fdb31564febe58a8ccc8a6fdbb93b543d33b13ca43" +dependencies = [ + "getrandom", + "libredox", + "thiserror 1.0.69", +] + +[[package]] +name = "ref-cast" +version = "1.0.24" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4a0ae411dbe946a674d89546582cea4ba2bb8defac896622d6496f14c23ba5cf" +dependencies = [ + "ref-cast-impl", +] + +[[package]] +name = "ref-cast-impl" +version = "1.0.24" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1165225c21bff1f3bbce98f5a1f889949bc902d3575308cc7b0de30b4f6d27c7" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "regex" +version = "1.11.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b544ef1b4eac5dc2db33ea63606ae9ffcfac26c1416a2806ae0bf5f56b201191" +dependencies = [ + "aho-corasick", + "memchr", + "regex-automata", + "regex-syntax", +] + +[[package]] +name = "regex-automata" +version = "0.4.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "809e8dc61f6de73b46c85f4c96486310fe304c434cfa43669d7b40f711150908" +dependencies = [ + "aho-corasick", + "memchr", + "regex-syntax", +] + +[[package]] +name = "regex-syntax" +version = "0.8.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2b15c43186be67a4fd63bee50d0303afffcef381492ebe2c5d87f324e1b8815c" + +[[package]] +name = "ripemd" +version = "0.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bd124222d17ad93a644ed9d011a40f4fb64aa54275c08cc216524a9ea82fb09f" +dependencies = [ + "digest", +] + +[[package]] +name = "rmp" +version = "0.8.14" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "228ed7c16fa39782c3b3468e974aec2795e9089153cd08ee2e9aefb3613334c4" +dependencies = [ + "byteorder", + "num-traits", + "paste", +] + +[[package]] +name = "rmp-serde" +version = "1.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "52e599a477cf9840e92f2cde9a7189e67b42c57532749bf90aea6ec10facd4db" +dependencies = [ + "byteorder", + "rmp", + "serde", +] + +[[package]] +name = "rustc-hash" +version = "1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "08d43f7aa6b08d49f382cde6a7982047c3426db949b1424bc4b7ec9ae12c6ce2" + +[[package]] +name = "rustix" +version = "0.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.0.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c71e83d6afe7ff64890ec6b71d6a69bb8a610ab78ce364b3352876bb4c801266" +dependencies = [ + "bitflags", + "errno", + "libc", + "linux-raw-sys 0.9.4", + "windows-sys 0.59.0", +] + +[[package]] +name = "rustversion" +version = "1.0.21" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8a0d197bd2c9dc6e53b84da9556a69ba4cdfab8619eb41a8bd1cc2027a0f6b1d" + +[[package]] +name = "ryu" +version = "1.0.20" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "28d3b2b1366ec20994f1fd18c3c594f05c5dd4bc44d8bb0c1c632c8d6829481f" + +[[package]] +name = "scopeguard" +version = "1.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "94143f37725109f92c262ed2cf5e59bce7498c01bcc1502d7b9afe439a4e9f49" + +[[package]] +name = "semver" +version = "1.0.26" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "56e6fa9c48d24d85fb3de5ad847117517440f6beceb7798af16b4a87d616b8d0" + +[[package]] +name = "serde" +version = "1.0.219" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5f0e2c6ed6606019b4e29e69dbaba95b11854410e5347d525002456dbbb786b6" +dependencies = [ + "serde_derive", +] + +[[package]] +name = "serde_derive" +version = "1.0.219" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5b0276cf7f2c73365f7157c8123c21cd9a50fbbd844757af28ca1f5925fc2a00" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "serde_json" +version = "1.0.140" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "20068b6e96dc6c9bd23e01df8827e6c7e1f2fddd43c21810382803c136b99373" +dependencies = [ + "itoa", + "memchr", + "ryu", + "serde", +] + +[[package]] +name = "sha1" +version = "0.10.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e3bf829a2d51ab4a5ddf1352d8470c140cadc8301b2ae1789db023f01cedd6ba" +dependencies = [ + "cfg-if", + "cpufeatures", + "digest", +] + +[[package]] +name = "sha2" +version = "0.10.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a7507d819769d01a365ab707794a4084392c824f54a7a6a7862f8c3d0892b283" +dependencies = [ + "cfg-if", + "cpufeatures", + "digest", +] + +[[package]] +name = "sha3" +version = "0.10.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "75872d278a8f37ef87fa0ddbda7802605cb18344497949862c0d4dcb291eba60" +dependencies = [ + "digest", + "keccak", +] + +[[package]] +name = "shabal" +version = "0.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "990a6c7ff96ecc5664129bbf1f7b46a5a7c13f297d05af75e702f861cea6f08a" +dependencies = [ + "digest", +] + +[[package]] +name = "shadow-rs" +version = "1.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3f6fd27df794ced2ef39872879c93a9f87c012607318af8621cd56d2c3a8b3a2" +dependencies = [ + "const_format", + "is_debug", + "time", + "tzdb", +] + +[[package]] +name = "shlex" +version = "1.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0fda2ff0d084019ba4d7c6f371c95d8fd75ce3524c3cb8fb653a3023f6323e64" + +[[package]] +name = "signal-hook" +version = "0.3.18" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d881a16cf4426aa584979d30bd82cb33429027e42122b169753d6ef1085ed6e2" +dependencies = [ + "libc", + "signal-hook-registry", +] + +[[package]] +name = "signal-hook-mio" +version = "0.2.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "34db1a06d485c9142248b7a054f034b349b212551f3dfd19c94d45a754a217cd" +dependencies = [ + "libc", + "mio", + "signal-hook", +] + +[[package]] +name = "signal-hook-registry" +version = "1.4.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9203b8055f63a2a00e2f593bb0510367fe707d7ff1e5c872de2f537b339e5410" +dependencies = [ + "libc", +] + +[[package]] +name = "similar" +version = "2.7.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bbbb5d9659141646ae647b42fe094daf6c6192d1620870b449d9557f748b2daa" + +[[package]] +name = "skein" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "96a90a220ab98dbbfeabeae7c558a79f37839c10b9ef55c77082a741a463cab7" +dependencies = [ + "digest", + "threefish", +] + +[[package]] +name = "sm3" +version = "0.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ebb9a3b702d0a7e33bc4d85a14456633d2b165c2ad839c5fd9a8417c1ab15860" +dependencies = [ + "digest", +] + +[[package]] +name = "smallvec" +version = "1.15.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "67b1b7a3b5fe4f1376887184045fcf45c69e92af734b7aaddc05fb777b6fbd03" + +[[package]] +name = "streebog" +version = "0.10.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9e7fe6ed8a42cec360e070309427bb7959e102849b0dbaa7de19d5b9860bd536" +dependencies = [ + "digest", +] + +[[package]] +name = "strip-ansi-escapes" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2a8f8038e7e7969abb3f1b7c2a811225e9296da208539e0f79c5251d6cac0025" +dependencies = [ + "vte", +] + +[[package]] +name = "strum" +version = "0.26.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8fec0f0aef304996cf250b31b5a10dee7980c85da9d759361292b8bca5a18f06" + +[[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", +] + +[[package]] +name = "subtle" +version = "2.6.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "13c2bddecc57b384dee18652358fb23172facb8a2c51ccc10d74c157bdea3292" + +[[package]] +name = "supports-color" +version = "3.0.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c64fc7232dd8d2e4ac5ce4ef302b1d81e0b80d055b9d77c7c4f51f6aa4c867d6" +dependencies = [ + "is_ci", +] + +[[package]] +name = "supports-hyperlinks" +version = "3.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "804f44ed3c63152de6a9f90acbea1a110441de43006ea51bcce8f436196a288b" + +[[package]] +name = "supports-unicode" +version = "3.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b7401a30af6cb5818bb64852270bb722533397edcfc7344954a38f420819ece2" + +[[package]] +name = "syn" +version = "2.0.104" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "17b6f705963418cdb9927482fa304bc562ece2fdd4f616084c50b7023b435a40" +dependencies = [ + "proc-macro2", + "quote", + "unicode-ident", +] + +[[package]] +name = "sys-locale" +version = "0.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8eab9a99a024a169fe8a903cf9d4a3b3601109bcc13bd9e3c6fff259138626c4" +dependencies = [ + "libc", +] + +[[package]] +name = "sysinfo" +version = "0.33.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4fc858248ea01b66f19d8e8a6d55f41deaf91e9d495246fd01368d99935c6c01" +dependencies = [ + "core-foundation-sys", + "libc", + "memchr", + "ntapi", + "rayon", + "windows 0.57.0", +] + +[[package]] +name = "terminal_size" +version = "0.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "45c6481c4829e4cc63825e62c49186a34538b7b2750b73b266581ffb612fb5ed" +dependencies = [ + "rustix 1.0.7", + "windows-sys 0.59.0", +] + +[[package]] +name = "textwrap" +version = "0.16.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c13547615a44dc9c452a8a534638acdf07120d4b6847c8178705da06306a3057" +dependencies = [ + "unicode-linebreak", + "unicode-width 0.2.1", +] + +[[package]] +name = "thiserror" +version = "1.0.69" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b6aaf5339b578ea85b50e080feb250a3e8ae8cfcdff9a461c9ec2904bc923f52" +dependencies = [ + "thiserror-impl 1.0.69", +] + +[[package]] +name = "thiserror" +version = "2.0.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "567b8a2dae586314f7be2a752ec7474332959c6460e02bde30d702a66d488708" +dependencies = [ + "thiserror-impl 2.0.12", +] + +[[package]] +name = "thiserror-impl" +version = "1.0.69" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4fee6c4efc90059e10f81e6d42c60a18f76588c3d74cb83a0b242a2b6c7504c1" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "thiserror-impl" +version = "2.0.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7f7cf42b4507d8ea322120659672cf1b9dbb93f8f2d4ecfd6e51350ff5b17a1d" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "threefish" +version = "0.5.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a693d0c8cf16973fac5a93fbe47b8c6452e7097d4fcac49f3d7a18e39c76e62e" + +[[package]] +name = "tiger" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "579abbce4ad73b04386dbeb34369c9873a8f9b749c7b99cbf479a2949ff715ed" +dependencies = [ + "digest", +] + +[[package]] +name = "time" +version = "0.3.41" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8a7619e19bc266e0f9c5e6686659d394bc57973859340060a69221e57dbc0c40" +dependencies = [ + "deranged", + "itoa", + "libc", + "num-conv", + "num_threads", + "powerfmt", + "serde", + "time-core", + "time-macros", +] + +[[package]] +name = "time-core" +version = "0.1.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c9e9a38711f559d9e3ce1cdb06dd7c5b8ea546bc90052da6d06bb76da74bb07c" + +[[package]] +name = "time-macros" +version = "0.2.22" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3526739392ec93fd8b359c8e98514cb3e8e021beb4e5f597b00a0221f8ed8a49" +dependencies = [ + "num-conv", + "time-core", +] + +[[package]] +name = "typeid" +version = "1.0.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bc7d623258602320d5c55d1bc22793b57daff0ec7efc270ea7d55ce1d5f5471c" + +[[package]] +name = "typenum" +version = "1.18.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1dccffe3ce07af9386bfd29e80c0ab1a8205a2fc34e4bcd40364df902cfa8f3f" + +[[package]] +name = "typetag" +version = "0.2.20" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "73f22b40dd7bfe8c14230cf9702081366421890435b2d625fa92b4acc4c3de6f" +dependencies = [ + "erased-serde", + "inventory", + "once_cell", + "serde", + "typetag-impl", +] + +[[package]] +name = "typetag-impl" +version = "0.2.20" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "35f5380909ffc31b4de4f4bdf96b877175a016aa2ca98cee39fcfd8c4d53d952" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "tz-rs" +version = "0.7.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e1450bf2b99397e72070e7935c89facaa80092ac812502200375f1f7d33c71a1" + +[[package]] +name = "tzdb" +version = "0.7.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0be2ea5956f295449f47c0b825c5e109022ff1a6a53bb4f77682a87c2341fbf5" +dependencies = [ + "iana-time-zone", + "tz-rs", + "tzdb_data", +] + +[[package]] +name = "tzdb_data" +version = "0.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9c4c81d75033770e40fbd3643ce7472a1a9fd301f90b7139038228daf8af03ec" +dependencies = [ + "tz-rs", +] + +[[package]] +name = "unicase" +version = "2.8.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "75b844d17643ee918803943289730bec8aac480150456169e647ed0b576ba539" + +[[package]] +name = "unicode-ident" +version = "1.0.18" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5a5f39404a5da50712a4c1eecf25e90dd62b613502b7e925fd4e4d19b5c96512" + +[[package]] +name = "unicode-linebreak" +version = "0.1.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3b09c83c3c29d37506a3e260c08c03743a6bb66a9cd432c6934ab501a190571f" + +[[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.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4a1a07cc7db3810833284e8d372ccdc6da29741639ecc70c9ec107df0fa6154c" + +[[package]] +name = "unicode-xid" +version = "0.2.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ebc1c04c71510c7f702b52b7c350734c9ff1295c464a03335b00bb84fc54f853" + +[[package]] +name = "version_check" +version = "0.9.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0b928f33d975fc6ad9f86c8f283853ad26bdd5b10b7f1542aa2fa15e2289105a" + +[[package]] +name = "vte" +version = "0.14.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "231fdcd7ef3037e8330d8e17e61011a2c244126acc0a982f4040ac3f9f0bc077" +dependencies = [ + "memchr", +] + +[[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.100" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1edc8929d7499fc4e8f0be2262a241556cfc54a0bea223790e71446f2aab1ef5" +dependencies = [ + "cfg-if", + "once_cell", + "rustversion", + "wasm-bindgen-macro", +] + +[[package]] +name = "wasm-bindgen-backend" +version = "0.2.100" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2f0a0651a5c2bc21487bde11ee802ccaf4c51935d0d3d42a6101f98161700bc6" +dependencies = [ + "bumpalo", + "log", + "proc-macro2", + "quote", + "syn", + "wasm-bindgen-shared", +] + +[[package]] +name = "wasm-bindgen-macro" +version = "0.2.100" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7fe63fc6d09ed3792bd0897b314f53de8e16568c2b3f7982f468c0bf9bd0b407" +dependencies = [ + "quote", + "wasm-bindgen-macro-support", +] + +[[package]] +name = "wasm-bindgen-macro-support" +version = "0.2.100" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8ae87ea40c9f689fc23f209965b6fb8a99ad69aeeb0231408be24920604395de" +dependencies = [ + "proc-macro2", + "quote", + "syn", + "wasm-bindgen-backend", + "wasm-bindgen-shared", +] + +[[package]] +name = "wasm-bindgen-shared" +version = "0.2.100" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1a05d73b933a847d6cccdda8f838a22ff101ad9bf93e33684f39c1f5f0eece3d" +dependencies = [ + "unicode-ident", +] + +[[package]] +name = "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 = "whirlpool" +version = "0.10.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f1ae50671d985c15b3214c7d969b8b520759fb3c8682444bec15ef775335a05c" +dependencies = [ + "digest", +] + +[[package]] +name = "widestring" +version = "1.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dd7cf3379ca1aac9eea11fba24fd7e315d621f8dfe35c8d7d2be8b793726e07d" + +[[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" +version = "0.56.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1de69df01bdf1ead2f4ac895dc77c9351aefff65b2f3db429a343f9cbf05e132" +dependencies = [ + "windows-core 0.56.0", + "windows-targets 0.52.6", +] + +[[package]] +name = "windows" +version = "0.57.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "12342cb4d8e3b046f3d80effd474a7a02447231330ef77d71daa6fbc40681143" +dependencies = [ + "windows-core 0.57.0", + "windows-targets 0.52.6", +] + +[[package]] +name = "windows-core" +version = "0.56.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4698e52ed2d08f8658ab0c39512a7c00ee5fe2688c65f8c0a4f06750d729f2a6" +dependencies = [ + "windows-implement 0.56.0", + "windows-interface 0.56.0", + "windows-result 0.1.2", + "windows-targets 0.52.6", +] + +[[package]] +name = "windows-core" +version = "0.57.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d2ed2439a290666cd67ecce2b0ffaad89c2a56b976b736e6ece670297897832d" +dependencies = [ + "windows-implement 0.57.0", + "windows-interface 0.57.0", + "windows-result 0.1.2", + "windows-targets 0.52.6", +] + +[[package]] +name = "windows-core" +version = "0.61.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c0fdd3ddb90610c7638aa2b3a3ab2904fb9e5cdbecc643ddb3647212781c4ae3" +dependencies = [ + "windows-implement 0.60.0", + "windows-interface 0.59.1", + "windows-link", + "windows-result 0.3.4", + "windows-strings", +] + +[[package]] +name = "windows-implement" +version = "0.56.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f6fc35f58ecd95a9b71c4f2329b911016e6bec66b3f2e6a4aad86bd2e99e2f9b" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "windows-implement" +version = "0.57.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9107ddc059d5b6fbfbffdfa7a7fe3e22a226def0b2608f72e9d552763d3e1ad7" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "windows-implement" +version = "0.60.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a47fddd13af08290e67f4acabf4b459f647552718f683a7b415d290ac744a836" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "windows-interface" +version = "0.56.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "08990546bf4edef8f431fa6326e032865f27138718c587dc21bc0265bbcb57cc" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "windows-interface" +version = "0.57.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "29bee4b38ea3cde66011baa44dba677c432a78593e202392d1e9070cf2a7fca7" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "windows-interface" +version = "0.59.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bd9211b69f8dcdfa817bfd14bf1c97c9188afa36f4750130fcdf3f400eca9fa8" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "windows-link" +version = "0.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5e6ad25900d524eaabdbbb96d20b4311e1e7ae1699af4fb28c17ae66c80d798a" + +[[package]] +name = "windows-result" +version = "0.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5e383302e8ec8515204254685643de10811af0ed97ea37210dc26fb0032647f8" +dependencies = [ + "windows-targets 0.52.6", +] + +[[package]] +name = "windows-result" +version = "0.3.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "56f42bd332cc6c8eac5af113fc0c1fd6a8fd2aa08a0119358686e5160d0586c6" +dependencies = [ + "windows-link", +] + +[[package]] +name = "windows-strings" +version = "0.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "56e6c93f3a0c3b36176cb1327a4958a0353d5d166c2a35cb268ace15e91d3b57" +dependencies = [ + "windows-link", +] + +[[package]] +name = "windows-sys" +version = "0.48.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "677d2418bec65e3338edb076e806bc1ec15693c5d0104683f2efe857f61056a9" +dependencies = [ + "windows-targets 0.48.5", +] + +[[package]] +name = "windows-sys" +version = "0.52.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "282be5f36a8ce781fad8c8ae18fa3f9beff57ec1b52cb3de0789201425d9a33d" +dependencies = [ + "windows-targets 0.52.6", +] + +[[package]] +name = "windows-sys" +version = "0.59.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1e38bc4d79ed67fd075bcc251a1c39b32a1776bbe92e5bef1f0bf1f8c531853b" +dependencies = [ + "windows-targets 0.52.6", +] + +[[package]] +name = "windows-sys" +version = "0.60.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f2f500e4d28234f72040990ec9d39e3a6b950f9f22d3dba18416c35882612bcb" +dependencies = [ + "windows-targets 0.53.2", +] + +[[package]] +name = "windows-targets" +version = "0.48.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9a2fa6e2155d7247be68c096456083145c183cbbbc2764150dda45a87197940c" +dependencies = [ + "windows_aarch64_gnullvm 0.48.5", + "windows_aarch64_msvc 0.48.5", + "windows_i686_gnu 0.48.5", + "windows_i686_msvc 0.48.5", + "windows_x86_64_gnu 0.48.5", + "windows_x86_64_gnullvm 0.48.5", + "windows_x86_64_msvc 0.48.5", +] + +[[package]] +name = "windows-targets" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9b724f72796e036ab90c1021d4780d4d3d648aca59e491e6b98e725b84e99973" +dependencies = [ + "windows_aarch64_gnullvm 0.52.6", + "windows_aarch64_msvc 0.52.6", + "windows_i686_gnu 0.52.6", + "windows_i686_gnullvm 0.52.6", + "windows_i686_msvc 0.52.6", + "windows_x86_64_gnu 0.52.6", + "windows_x86_64_gnullvm 0.52.6", + "windows_x86_64_msvc 0.52.6", +] + +[[package]] +name = "windows-targets" +version = "0.53.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c66f69fcc9ce11da9966ddb31a40968cad001c5bedeb5c2b82ede4253ab48aef" +dependencies = [ + "windows_aarch64_gnullvm 0.53.0", + "windows_aarch64_msvc 0.53.0", + "windows_i686_gnu 0.53.0", + "windows_i686_gnullvm 0.53.0", + "windows_i686_msvc 0.53.0", + "windows_x86_64_gnu 0.53.0", + "windows_x86_64_gnullvm 0.53.0", + "windows_x86_64_msvc 0.53.0", +] + +[[package]] +name = "windows_aarch64_gnullvm" +version = "0.48.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2b38e32f0abccf9987a4e3079dfb67dcd799fb61361e53e2882c3cbaf0d905d8" + +[[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_gnullvm" +version = "0.53.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "86b8d5f90ddd19cb4a147a5fa63ca848db3df085e25fee3cc10b39b6eebae764" + +[[package]] +name = "windows_aarch64_msvc" +version = "0.48.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dc35310971f3b2dbbf3f0690a219f40e2d9afcf64f9ab7cc1be722937c26b4bc" + +[[package]] +name = "windows_aarch64_msvc" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "09ec2a7bb152e2252b53fa7803150007879548bc709c039df7627cabbd05d469" + +[[package]] +name = "windows_aarch64_msvc" +version = "0.53.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c7651a1f62a11b8cbd5e0d42526e55f2c99886c77e007179efff86c2b137e66c" + +[[package]] +name = "windows_i686_gnu" +version = "0.48.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a75915e7def60c94dcef72200b9a8e58e5091744960da64ec734a6c6e9b3743e" + +[[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_gnu" +version = "0.53.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c1dc67659d35f387f5f6c479dc4e28f1d4bb90ddd1a5d3da2e5d97b42d6272c3" + +[[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_gnullvm" +version = "0.53.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9ce6ccbdedbf6d6354471319e781c0dfef054c81fbc7cf83f338a4296c0cae11" + +[[package]] +name = "windows_i686_msvc" +version = "0.48.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8f55c233f70c4b27f66c523580f78f1004e8b5a8b659e05a4eb49d4166cca406" + +[[package]] +name = "windows_i686_msvc" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "240948bc05c5e7c6dabba28bf89d89ffce3e303022809e73deaefe4f6ec56c66" + +[[package]] +name = "windows_i686_msvc" +version = "0.53.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "581fee95406bb13382d2f65cd4a908ca7b1e4c2f1917f143ba16efe98a589b5d" + +[[package]] +name = "windows_x86_64_gnu" +version = "0.48.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "53d40abd2583d23e4718fddf1ebec84dbff8381c07cae67ff7768bbf19c6718e" + +[[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_gnu" +version = "0.53.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2e55b5ac9ea33f2fc1716d1742db15574fd6fc8dadc51caab1c16a3d3b4190ba" + +[[package]] +name = "windows_x86_64_gnullvm" +version = "0.48.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0b7b52767868a23d5bab768e390dc5f5c55825b6d30b86c844ff2dc7414044cc" + +[[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_gnullvm" +version = "0.53.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0a6e035dd0599267ce1ee132e51c27dd29437f63325753051e71dd9e42406c57" + +[[package]] +name = "windows_x86_64_msvc" +version = "0.48.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ed94fce61571a4006852b7389a063ab983c02eb1bb37b47f8272ce92d06d9538" + +[[package]] +name = "windows_x86_64_msvc" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "589f6da84c646204747d1270a2a5661ea66ed1cced2631d546fdfb155959f9ec" + +[[package]] +name = "windows_x86_64_msvc" +version = "0.53.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "271414315aff87387382ec3d271b52d7ae78726f5d44ac98b4f4030c91880486" + +[[package]] +name = "zerocopy" +version = "0.8.26" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1039dd0d3c310cf05de012d8a39ff557cb0d23087fd44cad61df08fc31907a2f" +dependencies = [ + "zerocopy-derive", +] + +[[package]] +name = "zerocopy-derive" +version = "0.8.26" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9ecf5b4cc5364572d7f4c329661bcc82724222973f2cab6f050a4e5c22f75181" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] diff --git a/nu_plugin_hashes/Cargo.toml b/nu_plugin_hashes/Cargo.toml new file mode 100644 index 0000000..d4551ba --- /dev/null +++ b/nu_plugin_hashes/Cargo.toml @@ -0,0 +1,96 @@ +[package] +name = "nu_plugin_hashes" +description = "A Nushell plugin that adds 63 cryptographic hash functions from Hashes project" +keywords = ["nu", "plugin", "hash"] +categories = ["algorithms"] +repository = "https://github.com/ArmoredPony/nu_plugin_hashes" +license = "MIT" +version = "0.1.8" +edition = "2024" + +[features] +default = [ + "ascon-hash", + "belt-hash", + "blake2", + "blake3", + "fsb", + "gost94", + "groestl", + "jh", + "md2", + "md4", + "ripemd", + "sha1", + "sha2", + "sha3", + "shabal", + "skein", + "sm3", + "streebog", + "tiger", + "whirlpool", +] + +[dependencies] +nu-cmd-base = { version = "0.105.2", path = "../nushell/crates/nu-cmd-base" } +nu-plugin = { version = "0.105.2", path = "../nushell/crates/nu-plugin" } +nu-protocol = { version = "0.105.2", path = "../nushell/crates/nu-protocol" } +digest = "0.10.7" +ascon-hash = { version = "0.2.0", optional = true } +belt-hash = { version = "0.1.1", optional = true } +blake2 = { version = "0.10.6", optional = true } +blake3 = { version = "1.6.1", optional = true, default-features = false, features = [ + "std", + "traits-preview", +] } +fsb = { version = "0.1.3", optional = true } +gost94 = { version = "0.10.4", optional = true } +groestl = { version = "0.10.1", optional = true } +jh = { version = "0.1.0", optional = true } +md2 = { version = "0.10.2", optional = true } +md4 = { version = "0.10.2", optional = true } +ripemd = { version = "0.1.3", optional = true } +sha1 = { version = "0.10.6", optional = true } +sha2 = { version = "0.10.9", optional = true } +sha3 = { version = "0.10.8", optional = true } +shabal = { version = "0.4.1", optional = true } +skein = { version = "0.1.0", optional = true } +sm3 = { version = "0.4.2", optional = true } +streebog = { version = "0.10.2", optional = true } +tiger = { version = "0.2.1", optional = true } +whirlpool = { version = "0.10.4", optional = true } + +[build-dependencies] +digest = "0.10.7" +ascon-hash = { version = "0.2.0", optional = true } +belt-hash = { version = "0.1.1", optional = true } +blake2 = { version = "0.10.6", optional = true } +blake3 = { version = "1.6.1", optional = true, default-features = false, features = [ + "std", + "traits-preview", +] } +fsb = { version = "0.1.3", optional = true } +gost94 = { version = "0.10.4", optional = true } +groestl = { version = "0.10.1", optional = true } +jh = { version = "0.1.0", optional = true } +md2 = { version = "0.10.2", optional = true } +md4 = { version = "0.10.2", optional = true } +ripemd = { version = "0.1.3", optional = true } +sha1 = { version = "0.10.6", optional = true } +sha2 = { version = "0.10.8", optional = true } +sha3 = { version = "0.10.8", optional = true } +shabal = { version = "0.4.1", optional = true } +skein = { version = "0.1.0", optional = true } +sm3 = { version = "0.4.2", optional = true } +streebog = { version = "0.10.2", optional = true } +tiger = { version = "0.2.1", optional = true } +whirlpool = { version = "0.10.4", optional = true } + +[dev-dependencies] +nu-plugin-test-support = { version = "0.105.2", path = "../nushell/crates/nu-plugin-test-support" } + +[profile.release] +strip = true +lto = true +codegen-units = 1 diff --git a/nu_plugin_hashes/LICENSE b/nu_plugin_hashes/LICENSE new file mode 100644 index 0000000..ca4c77b --- /dev/null +++ b/nu_plugin_hashes/LICENSE @@ -0,0 +1,7 @@ +Copyright 2024 ArmoredPony + +Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the “Software”), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. \ No newline at end of file diff --git a/nu_plugin_hashes/README.md b/nu_plugin_hashes/README.md new file mode 100644 index 0000000..a04681c --- /dev/null +++ b/nu_plugin_hashes/README.md @@ -0,0 +1,126 @@ +# Hashes for Nushell + +A [Nushell](https://www.nushell.sh) plugin that adds a collection of **63** +cryptographic hash functions from [Hashes](https://github.com/RustCrypto/hashes) +project. + +This plugin's implementation is based on code stolen from the official Nushell +repository and on compile-time code generation with a build script. + +Excess algorithms can be filtered off by selecting only specific features of the +crate. + +## Installation + +To install this plugin with all algorithms available run +```nu +cargo install nu_plugin_hashes +plugin add ($env.CARGO_HOME ++ /bin/nu_plugin_hashes) +``` + +or on Windows +```nu +cargo install nu_plugin_hashes +plugin add ($env.CARGO_HOME ++ /bin/nu_plugin_hashes.exe) +``` + +After loading the plugin, execute `help hash` to list newly added commands + +```nu +~> help hash +Apply hash function. + +... + +Subcommands: + hash ascon - Hash a value using the ascon hash algorithm. + hash ascon-a - Hash a value using the ascon-a hash algorithm. + hash belt - Hash a value using the belt hash algorithm. + hash blake2b-512 - Hash a value using the blake2b-512 hash algorithm. + hash blake2s-256 - Hash a value using the blake2s-256 hash algorithm. + hash fsb160 - Hash a value using the fsb160 hash algorithm. + hash fsb224 - Hash a value using the fsb224 hash algorithm. + ... +``` + +## Features + +If you only need some algorithms, disable default features and select only +those you need +```nu +cargo install nu_plugin_hashes --no-default-features --features sha2,streebog +``` + +Then check what's installed +```nu +~> help hash +Apply hash function. + +... + +Subcommands: + hash md5 - Hash a value using the md5 hash algorithm. + hash sha224 - Hash a value using the sha224 hash algorithm. + hash sha256 - Hash a value using the sha256 hash algorithm. + hash sha384 - Hash a value using the sha384 hash algorithm. + hash sha512 - Hash a value using the sha512 hash algorithm. + hash sha512-224 - Hash a value using the sha512-224 hash algorithm. + hash sha512-256 - Hash a value using the sha512-256 hash algorithm. + hash streebog256 - Hash a value using the streebog256 hash algorithm. + hash streebog512 - Hash a value using the streebog512 hash algorithm. + +Flags: + ... +``` + +## Hashes + +The list of implemented algorithms provided by the plugin can be found +in the Hashes project [repository](https://github.com/RustCrypto/hashes). + +Almost all algorithms from this project are included in this plugin. The +exceptions are MD5 and SHA-256 as they are already present in Nushell, and +those algorithms, that don't implement the `Digest` trait or require additional +arguments for them to be run. + +If you want to import only particular algorithms, build this plugin with those +features, which names correspond to the crates, that supply the algorithms you +want. Consult this [table](https://github.com/RustCrypto/hashes?tab=readme-ov-file#supported-algorithms) +to match features with required algorithms. + +If you disable the default features and forget to enable at least one of them, +the plugin won't compile. + +## Implemetation details + +All the functions are implemented via generic code that I borrowed from Nushell +source file [generic_digest.rs](https://github.com/nushell/nushell/blob/0.101.0/crates/nu-command/src/hash/generic_digest.rs). +Help page for each command is generated with a [build script](./build.rs). +Hashes of the test text for each example are generated during compilation by +this script: the test text is fed to each hashing algorithm, and resulting bytes +are inserted into examples. This approach isdifferent from Nushell's +implementations, where examples are hardcoded as strings. Then, generated +examples are tested with [nu-plugin-test-support](https://crates.io/crates/nu-plugin-test-support) +crate. This ensures that the code in examples always behaves exactly as printed. + +## TODO + +Here is a list of things that could not be implemented with code generation +as they don't implement the `Digest` trait or require additional arguments +to be executed. I doubt that I will ever complete this list so you are welcome +to contribute. + +- [ ] [blake2b] algorithm with runtime defined output size +- [ ] [sha1] algorithm with collision detection + +## License + +This crate is licensed under [MIT license](LICENSE). + +--- +
I only created this plugin to explore compile-time code generation and +educate myself on subject of features. The product of my activity terrifies +me and I'm surprised it worked out at all.
+ +[blake2b]: https://github.com/RustCrypto/hashes/blob/1dbb9535207176fceb93a8ec1d450712714aedec/blake2/src/lib.rs#L67 +[sha1]: https://github.com/RustCrypto/hashes/tree/master/sha1-checked diff --git a/nu_plugin_hashes/build.rs b/nu_plugin_hashes/build.rs new file mode 100644 index 0000000..8d25ded --- /dev/null +++ b/nu_plugin_hashes/build.rs @@ -0,0 +1,675 @@ +use digest::DynDigest; + +const TEST_TEXT: &str = "abcdefghijklmnopqrstuvwxyz"; + +struct GeneratedHasherImplMeta { + crate_name: &'static str, + hasher_type_name: &'static str, + hasher_command: &'static str, + hasher: Box, +} + +#[cfg(any( + feature = "ascon-hash", + feature = "belt-hash", + feature = "blake2", + feature = "blake3", + feature = "fsb", + feature = "gost94", + feature = "groestl", + feature = "jh", + feature = "md2", + feature = "md4", + feature = "ripemd", + feature = "sha1", + feature = "sha2", + feature = "sha3", + feature = "shabal", + feature = "skein", + feature = "sm3", + feature = "streebog", + feature = "tiger", + feature = "whirlpool", +))] +fn main() -> Result<(), Box> { + use std::{env, io::Write, path::Path}; + + // MD5 and SHA256 are skipped on purpose + let hasher_impls: Vec = vec![ + #[cfg(feature = "ascon-hash")] + GeneratedHasherImplMeta { + crate_name: "ascon_hash", + hasher_type_name: "AsconHash", + hasher_command: "ascon", + hasher: Box::new(ascon_hash::AsconHash::default()), + }, + #[cfg(feature = "ascon-hash")] + GeneratedHasherImplMeta { + crate_name: "ascon_hash", + hasher_type_name: "AsconAHash", + hasher_command: "ascon-a", + hasher: Box::new(ascon_hash::AsconAHash::default()), + }, + #[cfg(feature = "belt-hash")] + GeneratedHasherImplMeta { + crate_name: "belt_hash", + hasher_type_name: "BeltHash", + hasher_command: "belt", + hasher: Box::new(belt_hash::BeltHash::default()), + }, + #[cfg(feature = "blake2")] + GeneratedHasherImplMeta { + crate_name: "blake2", + hasher_type_name: "Blake2s256", + hasher_command: "blake2s-256", + hasher: Box::new(blake2::Blake2s256::default()), + }, + #[cfg(feature = "blake2")] + GeneratedHasherImplMeta { + crate_name: "blake2", + hasher_type_name: "Blake2b512", + hasher_command: "blake2b-512", + hasher: Box::new(blake2::Blake2b512::default()), + }, + #[cfg(feature = "blake3")] + GeneratedHasherImplMeta { + crate_name: "blake3", + hasher_type_name: "Hasher", + hasher_command: "blake3", + hasher: Box::new(blake3::Hasher::new()), + }, + #[cfg(feature = "fsb")] + GeneratedHasherImplMeta { + crate_name: "fsb", + hasher_type_name: "Fsb160", + hasher_command: "fsb160", + hasher: Box::new(fsb::Fsb160::default()), + }, + #[cfg(feature = "fsb")] + GeneratedHasherImplMeta { + crate_name: "fsb", + hasher_type_name: "Fsb224", + hasher_command: "fsb224", + hasher: Box::new(fsb::Fsb224::default()), + }, + #[cfg(feature = "fsb")] + GeneratedHasherImplMeta { + crate_name: "fsb", + hasher_type_name: "Fsb256", + hasher_command: "fsb256", + hasher: Box::new(fsb::Fsb256::default()), + }, + #[cfg(feature = "fsb")] + GeneratedHasherImplMeta { + crate_name: "fsb", + hasher_type_name: "Fsb384", + hasher_command: "fsb384", + hasher: Box::new(fsb::Fsb384::default()), + }, + #[cfg(feature = "fsb")] + GeneratedHasherImplMeta { + crate_name: "fsb", + hasher_type_name: "Fsb512", + hasher_command: "fsb512", + hasher: Box::new(fsb::Fsb512::default()), + }, + #[cfg(feature = "gost94")] + GeneratedHasherImplMeta { + crate_name: "gost94", + hasher_type_name: "Gost94CryptoPro", + hasher_command: "gost94-crypto-pro", + hasher: Box::new(gost94::Gost94CryptoPro::default()), + }, + #[cfg(feature = "gost94")] + GeneratedHasherImplMeta { + crate_name: "gost94", + hasher_type_name: "Gost94UA", + hasher_command: "gost94-ua", + hasher: Box::new(gost94::Gost94UA::default()), + }, + #[cfg(feature = "gost94")] + GeneratedHasherImplMeta { + crate_name: "gost94", + hasher_type_name: "Gost94s2015", + hasher_command: "gost94-2015", + hasher: Box::new(gost94::Gost94s2015::default()), + }, + #[cfg(feature = "groestl")] + GeneratedHasherImplMeta { + crate_name: "groestl", + hasher_type_name: "Groestl224", + hasher_command: "groestl224", + hasher: Box::new(groestl::Groestl224::default()), + }, + #[cfg(feature = "groestl")] + GeneratedHasherImplMeta { + crate_name: "groestl", + hasher_type_name: "Groestl256", + hasher_command: "groestl256", + hasher: Box::new(groestl::Groestl256::default()), + }, + #[cfg(feature = "groestl")] + GeneratedHasherImplMeta { + crate_name: "groestl", + hasher_type_name: "Groestl384", + hasher_command: "groestl384", + hasher: Box::new(groestl::Groestl384::default()), + }, + #[cfg(feature = "groestl")] + GeneratedHasherImplMeta { + crate_name: "groestl", + hasher_type_name: "Groestl512", + hasher_command: "groestl512", + hasher: Box::new(groestl::Groestl512::default()), + }, + #[cfg(feature = "jh")] + GeneratedHasherImplMeta { + crate_name: "jh", + hasher_type_name: "Jh224", + hasher_command: "jh224", + hasher: Box::new(jh::Jh224::default()), + }, + #[cfg(feature = "jh")] + GeneratedHasherImplMeta { + crate_name: "jh", + hasher_type_name: "Jh256", + hasher_command: "jh256", + hasher: Box::new(jh::Jh256::default()), + }, + #[cfg(feature = "jh")] + GeneratedHasherImplMeta { + crate_name: "jh", + hasher_type_name: "Jh384", + hasher_command: "jh384", + hasher: Box::new(jh::Jh384::default()), + }, + #[cfg(feature = "jh")] + GeneratedHasherImplMeta { + crate_name: "jh", + hasher_type_name: "Jh512", + hasher_command: "jh512", + hasher: Box::new(jh::Jh512::default()), + }, + #[cfg(feature = "md2")] + GeneratedHasherImplMeta { + crate_name: "md2", + hasher_type_name: "Md2", + hasher_command: "md2", + hasher: Box::new(md2::Md2::default()), + }, + #[cfg(feature = "md4")] + GeneratedHasherImplMeta { + crate_name: "md4", + hasher_type_name: "Md4", + hasher_command: "md4", + hasher: Box::new(md4::Md4::default()), + }, + #[cfg(feature = "ripemd")] + GeneratedHasherImplMeta { + crate_name: "ripemd", + hasher_type_name: "Ripemd128", + hasher_command: "ripemd128", + hasher: Box::new(ripemd::Ripemd128::default()), + }, + #[cfg(feature = "ripemd")] + GeneratedHasherImplMeta { + crate_name: "ripemd", + hasher_type_name: "Ripemd160", + hasher_command: "ripemd160", + hasher: Box::new(ripemd::Ripemd160::default()), + }, + #[cfg(feature = "ripemd")] + GeneratedHasherImplMeta { + crate_name: "ripemd", + hasher_type_name: "Ripemd256", + hasher_command: "ripemd256", + hasher: Box::new(ripemd::Ripemd256::default()), + }, + #[cfg(feature = "ripemd")] + GeneratedHasherImplMeta { + crate_name: "ripemd", + hasher_type_name: "Ripemd320", + hasher_command: "ripemd320", + hasher: Box::new(ripemd::Ripemd320::default()), + }, + #[cfg(feature = "sha1")] + GeneratedHasherImplMeta { + crate_name: "sha1", + hasher_type_name: "Sha1", + hasher_command: "sha1", + hasher: Box::new(sha1::Sha1::default()), + }, + #[cfg(feature = "sha2")] + GeneratedHasherImplMeta { + crate_name: "sha2", + hasher_type_name: "Sha224", + hasher_command: "sha224", + hasher: Box::new(sha2::Sha224::default()), + }, + #[cfg(feature = "sha2")] + GeneratedHasherImplMeta { + crate_name: "sha2", + hasher_type_name: "Sha384", + hasher_command: "sha384", + hasher: Box::new(sha2::Sha384::default()), + }, + #[cfg(feature = "sha2")] + GeneratedHasherImplMeta { + crate_name: "sha2", + hasher_type_name: "Sha512", + hasher_command: "sha512", + hasher: Box::new(sha2::Sha512::default()), + }, + #[cfg(feature = "sha2")] + GeneratedHasherImplMeta { + crate_name: "sha2", + hasher_type_name: "Sha512_224", + hasher_command: "sha512-224", + hasher: Box::new(sha2::Sha512_224::default()), + }, + #[cfg(feature = "sha2")] + GeneratedHasherImplMeta { + crate_name: "sha2", + hasher_type_name: "Sha512_256", + hasher_command: "sha512-256", + hasher: Box::new(sha2::Sha512_256::default()), + }, + #[cfg(feature = "sha3")] + GeneratedHasherImplMeta { + crate_name: "sha3", + hasher_type_name: "Sha3_224", + hasher_command: "sha3-224", + hasher: Box::new(sha3::Sha3_224::default()), + }, + #[cfg(feature = "sha3")] + GeneratedHasherImplMeta { + crate_name: "sha3", + hasher_type_name: "Sha3_256", + hasher_command: "sha3-256", + hasher: Box::new(sha3::Sha3_256::default()), + }, + #[cfg(feature = "sha3")] + GeneratedHasherImplMeta { + crate_name: "sha3", + hasher_type_name: "Sha3_384", + hasher_command: "sha3-384", + hasher: Box::new(sha3::Sha3_384::default()), + }, + #[cfg(feature = "sha3")] + GeneratedHasherImplMeta { + crate_name: "sha3", + hasher_type_name: "Sha3_512", + hasher_command: "sha3-512", + hasher: Box::new(sha3::Sha3_512::default()), + }, + #[cfg(feature = "sha3")] + GeneratedHasherImplMeta { + crate_name: "sha3", + hasher_type_name: "Keccak224", + hasher_command: "keccak224", + hasher: Box::new(sha3::Keccak224::default()), + }, + #[cfg(feature = "sha3")] + GeneratedHasherImplMeta { + crate_name: "sha3", + hasher_type_name: "Keccak256", + hasher_command: "keccak256", + hasher: Box::new(sha3::Keccak256::default()), + }, + #[cfg(feature = "sha3")] + GeneratedHasherImplMeta { + crate_name: "sha3", + hasher_type_name: "Keccak384", + hasher_command: "keccak384", + hasher: Box::new(sha3::Keccak384::default()), + }, + #[cfg(feature = "sha3")] + GeneratedHasherImplMeta { + crate_name: "sha3", + hasher_type_name: "Keccak512", + hasher_command: "keccak512", + hasher: Box::new(sha3::Keccak512::default()), + }, + #[cfg(feature = "shabal")] + GeneratedHasherImplMeta { + crate_name: "shabal", + hasher_type_name: "Shabal192", + hasher_command: "shabal192", + hasher: Box::new(shabal::Shabal192::default()), + }, + #[cfg(feature = "shabal")] + GeneratedHasherImplMeta { + crate_name: "shabal", + hasher_type_name: "Shabal224", + hasher_command: "shabal224", + hasher: Box::new(shabal::Shabal224::default()), + }, + #[cfg(feature = "shabal")] + GeneratedHasherImplMeta { + crate_name: "shabal", + hasher_type_name: "Shabal256", + hasher_command: "shabal256", + hasher: Box::new(shabal::Shabal256::default()), + }, + #[cfg(feature = "shabal")] + GeneratedHasherImplMeta { + crate_name: "shabal", + hasher_type_name: "Shabal384", + hasher_command: "shabal384", + hasher: Box::new(shabal::Shabal384::default()), + }, + #[cfg(feature = "shabal")] + GeneratedHasherImplMeta { + crate_name: "shabal", + hasher_type_name: "Shabal512", + hasher_command: "shabal512", + hasher: Box::new(shabal::Shabal512::default()), + }, + #[cfg(feature = "skein")] + GeneratedHasherImplMeta { + crate_name: "skein", + hasher_type_name: "Skein256::", + hasher_command: "skein256-32", + hasher: Box::new(skein::Skein256::::default()), + }, + #[cfg(feature = "skein")] + GeneratedHasherImplMeta { + crate_name: "skein", + hasher_type_name: "Skein256::", + hasher_command: "skein256-64", + hasher: Box::new(skein::Skein256::::default()), + }, + #[cfg(feature = "skein")] + GeneratedHasherImplMeta { + crate_name: "skein", + hasher_type_name: "Skein256::", + hasher_command: "skein256-128", + hasher: Box::new(skein::Skein256::::default()), + }, + #[cfg(feature = "skein")] + GeneratedHasherImplMeta { + crate_name: "skein", + hasher_type_name: "Skein512::", + hasher_command: "skein512-32", + hasher: Box::new(skein::Skein512::::default()), + }, + #[cfg(feature = "skein")] + GeneratedHasherImplMeta { + crate_name: "skein", + hasher_type_name: "Skein512::", + hasher_command: "skein512-64", + hasher: Box::new(skein::Skein512::::default()), + }, + #[cfg(feature = "skein")] + GeneratedHasherImplMeta { + crate_name: "skein", + hasher_type_name: "Skein512::", + hasher_command: "skein512-128", + hasher: Box::new(skein::Skein512::::default()), + }, + #[cfg(feature = "skein")] + GeneratedHasherImplMeta { + crate_name: "skein", + hasher_type_name: "Skein1024::", + hasher_command: "skein1024-32", + hasher: Box::new(skein::Skein1024::::default()), + }, + #[cfg(feature = "skein")] + GeneratedHasherImplMeta { + crate_name: "skein", + hasher_type_name: "Skein1024::", + hasher_command: "skein1024-64", + hasher: Box::new(skein::Skein1024::::default()), + }, + #[cfg(feature = "skein")] + GeneratedHasherImplMeta { + crate_name: "skein", + hasher_type_name: "Skein1024::", + hasher_command: "skein1024-128", + hasher: Box::new(skein::Skein1024::::default()), + }, + #[cfg(feature = "sm3")] + GeneratedHasherImplMeta { + crate_name: "sm3", + hasher_type_name: "Sm3", + hasher_command: "sm3", + hasher: Box::new(sm3::Sm3::default()), + }, + #[cfg(feature = "streebog")] + GeneratedHasherImplMeta { + crate_name: "streebog", + hasher_type_name: "Streebog256", + hasher_command: "streebog256", + hasher: Box::new(streebog::Streebog256::default()), + }, + #[cfg(feature = "streebog")] + GeneratedHasherImplMeta { + crate_name: "streebog", + hasher_type_name: "Streebog512", + hasher_command: "streebog512", + hasher: Box::new(streebog::Streebog512::default()), + }, + #[cfg(feature = "tiger")] + GeneratedHasherImplMeta { + crate_name: "tiger", + hasher_type_name: "Tiger", + hasher_command: "tiger", + hasher: Box::new(tiger::Tiger::default()), + }, + #[cfg(feature = "tiger")] + GeneratedHasherImplMeta { + crate_name: "tiger", + hasher_type_name: "Tiger2", + hasher_command: "tiger2", + hasher: Box::new(tiger::Tiger2::default()), + }, + #[cfg(feature = "whirlpool")] + GeneratedHasherImplMeta { + crate_name: "whirlpool", + hasher_type_name: "Whirlpool", + hasher_command: "whirlpool", + hasher: Box::new(whirlpool::Whirlpool::default()), + }, + ]; + + let out_dir = env::var_os("OUT_DIR").unwrap(); + let hashers_generated_path = Path::new(&out_dir).join("hashers_generated.rs"); + let commands_generated_path = + Path::new(&out_dir).join("commands_generated.rs"); + let mut hashers_generated_file = + std::fs::File::create(hashers_generated_path).unwrap(); + let mut commands_generated_file = + std::fs::File::create(commands_generated_path).unwrap(); + + write!( + hashers_generated_file, + "use nu_protocol::{{Example, Span, Value, ShellError}}; +use nu_plugin::PluginCommand; +use crate::HashesPlugin; +use crate::hasher::{{Hasher, GenericHasher}}; +" + )?; + + write!( + commands_generated_file, + "use nu_plugin::PluginCommand; +use crate::{{HashesPlugin, hasher::GenericHasher}}; + +pub fn commands() -> Vec>> {{ + vec![ +" + )?; + + for mut hasher_impl_meta in hasher_impls { + let feature_name = + hasher_impl_meta.crate_name.replace("-", "_").to_uppercase(); + if std::env::var(format!("CARGO_FEATURE_{feature_name}")).is_ok() { + hashers_generated_file + .write_all(build_impl_str(&mut hasher_impl_meta).as_bytes())?; + hashers_generated_file + .write_all(build_test_str(&hasher_impl_meta).as_bytes())?; + + let crate_name = hasher_impl_meta.crate_name; + let hasher_type_name = hasher_impl_meta.hasher_type_name; + writeln!( + commands_generated_file, + " Box::new(GenericHasher::<{crate_name}::{hasher_type_name}>::default())," + )?; + } + } + + write!( + commands_generated_file, + " ] +}}" + )?; + + hashers_generated_file.flush()?; + commands_generated_file.flush()?; + + Ok(()) +} + +#[cfg(any( + feature = "ascon-hash", + feature = "belt-hash", + feature = "blake2", + feature = "blake3", + feature = "fsb", + feature = "gost94", + feature = "groestl", + feature = "jh", + feature = "md2", + feature = "md4", + feature = "ripemd", + feature = "sha1", + feature = "sha2", + feature = "sha3", + feature = "shabal", + feature = "skein", + feature = "sm3", + feature = "streebog", + feature = "tiger", + feature = "whirlpool", +))] +fn build_impl_str(meta: &mut GeneratedHasherImplMeta) -> String { + let crate_name = meta.crate_name; + let hasher_type_name = meta.hasher_type_name; + let command = meta.hasher_command; + let mut hasher = meta.hasher.clone(); + hasher.update(TEST_TEXT.as_bytes()); + let hash = hasher.clone().finalize(); + format!( + " +impl Hasher for {crate_name}::{hasher_type_name} {{ + fn name() -> &'static str {{ + \"{command}\" + }} + + fn examples() -> Vec> {{ + vec![ + Example {{ + description: \"Return the {command} hash of a string, hex-encoded\", + example: \"'{TEST_TEXT}' | hash {command}\", + result: Some(Value::string( + \"{}\".to_owned(), + Span::test_data(), + )), + }}, + Example {{ + description: \"Return the {command} hash of a string, as binary\", + example: \"'{TEST_TEXT}' | hash {command} --binary\", + result: Some(Value::binary( + vec![{}], + Span::test_data(), + )), + }}, + Example {{ + description: \"Return the {command} hash of a file's contents\", + example: \"open ./nu_0_24_1_windows.zip | hash {command}\", + result: None, + }}, + ] + }} +}} +", + hash + .iter() + .map(|b| format!("{b:02x?}")) + .collect::>() + .join(""), + hash + .iter() + .map(|b| format!("0x{b:02x?}")) + .collect::>() + .join(",") + ) +} + +#[cfg(any( + feature = "ascon-hash", + feature = "belt-hash", + feature = "blake2", + feature = "blake3", + feature = "fsb", + feature = "gost94", + feature = "groestl", + feature = "jh", + feature = "md2", + feature = "md4", + feature = "ripemd", + feature = "sha1", + feature = "sha2", + feature = "sha3", + feature = "shabal", + feature = "skein", + feature = "sm3", + feature = "streebog", + feature = "tiger", + feature = "whirlpool", +))] +fn build_test_str(meta: &GeneratedHasherImplMeta) -> String { + let crate_name = meta.crate_name; + let hasher_type_name = meta.hasher_type_name; + let command = meta.hasher_command; + let test_name = command.replace("-", "_"); + format!( + " +#[test] +fn test_{test_name}_examples() -> Result<(), ShellError> {{ + nu_plugin_test_support::PluginTest::new + ( + \"hash {command}\", + HashesPlugin.into() + )? + .test_examples(&GenericHasher::<{crate_name}::{hasher_type_name}>::default().examples()) +}} + " + ) +} + +#[cfg(not(any( + feature = "ascon-hash", + feature = "belt-hash", + feature = "blake2", + feature = "blake3", + feature = "fsb", + feature = "gost94", + feature = "groestl", + feature = "jh", + feature = "md2", + feature = "md4", + feature = "ripemd", + feature = "sha1", + feature = "sha2", + feature = "sha3", + feature = "shabal", + feature = "skein", + feature = "sm3", + feature = "streebog", + feature = "tiger", + feature = "whirlpool", +)))] +fn main() { + compile_error!("enable at least one feature to compile this plugin"); +} diff --git a/nu_plugin_hashes/src/commands_generated.rs b/nu_plugin_hashes/src/commands_generated.rs new file mode 100644 index 0000000..c4594e3 --- /dev/null +++ b/nu_plugin_hashes/src/commands_generated.rs @@ -0,0 +1 @@ +include!(concat!(env!("OUT_DIR"), "/commands_generated.rs")); diff --git a/nu_plugin_hashes/src/hasher.rs b/nu_plugin_hashes/src/hasher.rs new file mode 100644 index 0000000..7217856 --- /dev/null +++ b/nu_plugin_hashes/src/hasher.rs @@ -0,0 +1,173 @@ +//! Contains a generic trait for hashers that implement `Digest`. +//! This implementation is stolen with minimal changes from *generic_digest.rs* +//! source code file of nushell v0.101.0 which can be found at +//! https://github.com/nushell/nushell/blob/0.101.0/crates/nu-command/src/hash/generic_digest.rs +//! The *hash* module is private, so I had no choice. + +use std::{io::Write, marker::PhantomData, ops::Not}; + +use digest::{Digest, Output}; +use nu_cmd_base::input_handler::{operate, CmdArgument}; +use nu_plugin::{EngineInterface, EvaluatedCall, PluginCommand}; +use nu_protocol::{ + ast::CellPath, + Category, + Example, + IntoPipelineData, + LabeledError, + PipelineData, + ShellError, + Signature, + Span, + SyntaxShape, + Type, + Value, +}; + +use crate::HashesPlugin; + +pub trait Hasher: Digest + Clone { + fn name() -> &'static str; + fn examples() -> Vec>; +} + +#[derive(Clone)] +pub struct GenericHasher { + name: String, + description: String, + _hasher: PhantomData, +} + +impl Default for GenericHasher { + fn default() -> Self { + Self { + name: format!("hash {}", H::name()), + description: format!( + "Hash a value using the {} hash algorithm.", + H::name() + ), + _hasher: PhantomData, + } + } +} + +struct Arguments { + cell_paths: Option>, + binary: bool, +} + +impl CmdArgument for Arguments { + fn take_cell_paths(&mut self) -> Option> { + self.cell_paths.take() + } +} + +impl PluginCommand for GenericHasher +where + H: Hasher + Write + Send + Sync + 'static, + Output: core::fmt::LowerHex, +{ + type Plugin = HashesPlugin; + + fn name(&self) -> &str { + &self.name + } + + fn signature(&self) -> Signature { + Signature::build(self.name()) + .category(Category::Hash) + .input_output_types(vec![ + (Type::Binary, Type::Any), + (Type::String, Type::Any), + (Type::table(), Type::table()), + (Type::record(), Type::record()), + ]) + .allow_variants_without_examples(true) + .switch( + "binary", + "Output binary instead of hexadecimal representation", + Some('b'), + ) + .rest( + "rest", + SyntaxShape::CellPath, + format!("Optionally {} hash data by cell path.", H::name()), + ) + } + + fn description(&self) -> &str { + &self.description + } + + fn examples(&self) -> Vec { + H::examples() + } + + fn run( + &self, + _plugin: &HashesPlugin, + engine: &EngineInterface, + call: &EvaluatedCall, + input: PipelineData, + ) -> Result { + let head = call.head; + let binary = call.has_flag("binary")?; + let cell_paths: Vec = call.rest(0)?; + let cell_paths = cell_paths.is_empty().not().then_some(cell_paths); + + if let PipelineData::ByteStream(stream, ..) = input { + let mut hasher = H::new(); + stream.write_to(&mut hasher)?; + let digest = hasher.finalize(); + if binary { + Ok(Value::binary(digest.to_vec(), head).into_pipeline_data()) + } else { + Ok(Value::string(format!("{digest:x}"), head).into_pipeline_data()) + } + } else { + operate( + action::, + Arguments { binary, cell_paths }, + input, + head, + engine.signals(), + ) + .map_err(Into::into) + } + } +} + +fn action(input: &Value, args: &Arguments, _span: Span) -> Value +where + H: Hasher, + Output: core::fmt::LowerHex, +{ + let span = input.span(); + let (bytes, span) = match input { + Value::String { val, .. } => (val.as_bytes(), span), + Value::Binary { val, .. } => (val.as_slice(), span), + // Propagate existing errors + Value::Error { .. } => return input.clone(), + other => { + let span = input.span(); + + return Value::error( + ShellError::OnlySupportsThisInputType { + exp_input_type: "string or binary".into(), + wrong_type: other.get_type().to_string(), + dst_span: span, + src_span: other.span(), + }, + span, + ); + } + }; + + let digest = H::digest(bytes); + + if args.binary { + Value::binary(digest.to_vec(), span) + } else { + Value::string(format!("{digest:x}"), span) + } +} diff --git a/nu_plugin_hashes/src/hashers_generated.rs b/nu_plugin_hashes/src/hashers_generated.rs new file mode 100644 index 0000000..78e0d4d --- /dev/null +++ b/nu_plugin_hashes/src/hashers_generated.rs @@ -0,0 +1,2 @@ +#![allow(unused_imports)] +include!(concat!(env!("OUT_DIR"), "/hashers_generated.rs")); diff --git a/nu_plugin_hashes/src/lib.rs b/nu_plugin_hashes/src/lib.rs new file mode 100644 index 0000000..10ee6d7 --- /dev/null +++ b/nu_plugin_hashes/src/lib.rs @@ -0,0 +1,17 @@ +mod commands_generated; +mod hasher; +mod hashers_generated; + +use nu_plugin::Plugin; + +pub struct HashesPlugin; + +impl Plugin for HashesPlugin { + fn version(&self) -> String { + env!("CARGO_PKG_VERSION").into() + } + + fn commands(&self) -> Vec>> { + commands_generated::commands() + } +} diff --git a/nu_plugin_hashes/src/main.rs b/nu_plugin_hashes/src/main.rs new file mode 100644 index 0000000..082cd39 --- /dev/null +++ b/nu_plugin_hashes/src/main.rs @@ -0,0 +1,6 @@ +use nu_plugin::{serve_plugin, MsgPackSerializer}; +use nu_plugin_hashes::HashesPlugin; + +fn main() { + serve_plugin(&HashesPlugin, MsgPackSerializer); +} diff --git a/nu_plugin_highlight/.gitignore b/nu_plugin_highlight/.gitignore new file mode 100644 index 0000000..c7dd739 --- /dev/null +++ b/nu_plugin_highlight/.gitignore @@ -0,0 +1,5 @@ +# Cargo build output +/target + +# JetBrains IDE +/.idea diff --git a/nu_plugin_highlight/Cargo.lock b/nu_plugin_highlight/Cargo.lock new file mode 100644 index 0000000..a498d11 --- /dev/null +++ b/nu_plugin_highlight/Cargo.lock @@ -0,0 +1,2376 @@ +# This file is automatically @generated by Cargo. +# It is not intended for manual editing. +version = 4 + +[[package]] +name = "adler2" +version = "2.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "320119579fcad9c21884f5c4861d16174d0e06250625266f50fe6898340abefa" + +[[package]] +name = "aho-corasick" +version = "1.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8e60d3430d3a69478ad0993f19238d2df97c507009a52b3c10addcd7f6bcb916" +dependencies = [ + "memchr", +] + +[[package]] +name = "alloc-no-stdlib" +version = "2.0.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cc7bb162ec39d46ab1ca8c77bf72e890535becd1751bb45f64c597edb4c8c6b3" + +[[package]] +name = "alloc-stdlib" +version = "0.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "94fb8275041c72129eb51b7d0322c29b8387a0386127718b096429201a5d6ece" +dependencies = [ + "alloc-no-stdlib", +] + +[[package]] +name = "allocator-api2" +version = "0.2.21" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "683d7910e743518b0e34f1186f92494becacb047c7b6bf616c96772180fef923" + +[[package]] +name = "android-tzdata" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e999941b234f3131b00bc13c22d06e8c5ff726d1b6318ac7eb276997bbb4fef0" + +[[package]] +name = "android_system_properties" +version = "0.1.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "819e7219dbd41043ac279b19830f2efc897156490d7fd6ea916720117ee66311" +dependencies = [ + "libc", +] + +[[package]] +name = "ansi_colours" +version = "1.2.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "14eec43e0298190790f41679fe69ef7a829d2a2ddd78c8c00339e84710e435fe" +dependencies = [ + "rgb", +] + +[[package]] +name = "arrayvec" +version = "0.7.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7c02d123df017efcdfbd739ef81735b36c5ba83ec3c59c80a9d7ecc718f92e50" + +[[package]] +name = "autocfg" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c08606f8c3cbf4ce6ec8e28fb0014a2c086708fe954eaa885384a6165172e7e8" + +[[package]] +name = "base64" +version = "0.22.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "72b3254f16251a8381aa12e40e3c4d2f0199f8c6508fbecb9d91f575e0fbb8c6" + +[[package]] +name = "bat" +version = "0.24.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9dcc9e5637c2330d8eb7b920f2aa5d9e184446c258466f825ea1412c7614cc86" +dependencies = [ + "ansi_colours", + "bincode", + "bytesize", + "clircle", + "console", + "content_inspector", + "encoding_rs", + "flate2", + "globset", + "home", + "nu-ansi-term 0.49.0", + "once_cell", + "path_abs", + "plist", + "semver", + "serde", + "serde_yaml", + "syntect", + "thiserror 1.0.69", + "unicode-width 0.1.14", +] + +[[package]] +name = "bincode" +version = "1.3.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b1f45e9417d87227c7a56d22e471c6206462cba514c7590c09aff4cf6d1ddcad" +dependencies = [ + "serde", +] + +[[package]] +name = "bindgen" +version = "0.70.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f49d8fed880d473ea71efb9bf597651e77201bdd4893efe54c9e5d65ae04ce6f" +dependencies = [ + "bitflags 2.9.1", + "cexpr", + "clang-sys", + "itertools 0.13.0", + "proc-macro2", + "quote", + "regex", + "rustc-hash", + "shlex", + "syn", +] + +[[package]] +name = "bit-set" +version = "0.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "08807e080ed7f9d5433fa9b275196cfc35414f66a0c79d864dc51a0d825231a3" +dependencies = [ + "bit-vec", +] + +[[package]] +name = "bit-vec" +version = "0.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5e764a1d40d510daf35e07be9eb06e75770908c27d411ee6c92109c9840eaaf7" + +[[package]] +name = "bitflags" +version = "1.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a" + +[[package]] +name = "bitflags" +version = "2.9.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1b8e56985ec62d17e9c1001dc89c88ecd7dc08e47eba5ec7c29c7b5eeecde967" + +[[package]] +name = "brotli" +version = "7.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cc97b8f16f944bba54f0433f07e30be199b6dc2bd25937444bbad560bcea29bd" +dependencies = [ + "alloc-no-stdlib", + "alloc-stdlib", + "brotli-decompressor", +] + +[[package]] +name = "brotli-decompressor" +version = "4.0.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a334ef7c9e23abf0ce748e8cd309037da93e606ad52eb372e4ce327a0dcfbdfd" +dependencies = [ + "alloc-no-stdlib", + "alloc-stdlib", +] + +[[package]] +name = "bstr" +version = "1.12.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "234113d19d0d7d613b40e86fb654acf958910802bcceab913a4f9e7cda03b1a4" +dependencies = [ + "memchr", + "serde", +] + +[[package]] +name = "bumpalo" +version = "3.19.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "46c5e41b57b8bba42a04676d81cb89e9ee8e859a1a66f80a5a72e1cb76b34d43" + +[[package]] +name = "bytecount" +version = "0.6.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "175812e0be2bccb6abe50bb8d566126198344f707e304f45c648fd8f2cc0365e" + +[[package]] +name = "bytemuck" +version = "1.23.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5c76a5792e44e4abe34d3abf15636779261d45a7450612059293d1d2cfc63422" + +[[package]] +name = "byteorder" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1fd0f2584146f6f2ef48085050886acf353beff7305ebd1ae69500e27c67f64b" + +[[package]] +name = "bytes" +version = "1.10.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d71b6127be86fdcfddb610f7182ac57211d4b18a3e9c82eb2d17662f2227ad6a" + +[[package]] +name = "bytesize" +version = "1.3.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2e93abca9e28e0a1b9877922aacb20576e05d4679ffa78c3d6dc22a26a216659" + +[[package]] +name = "cc" +version = "1.2.27" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d487aa071b5f64da6f19a3e848e3578944b726ee5a4854b82172f02aa876bfdc" +dependencies = [ + "shlex", +] + +[[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.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9555578bc9e57714c812a1f84e4fc5b4d21fcb063490c624de019f7464c91268" + +[[package]] +name = "cfg_aliases" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "613afe47fcd5fac7ccf1db93babcb082c5994d996f20b8b159f2ad1658eb5724" + +[[package]] +name = "chrono" +version = "0.4.41" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c469d952047f47f91b68d1cba3f10d63c11d73e4636f24f08daf0278abf01c4d" +dependencies = [ + "android-tzdata", + "iana-time-zone", + "js-sys", + "num-traits", + "pure-rust-locales", + "serde", + "wasm-bindgen", + "windows-link", +] + +[[package]] +name = "chrono-humanize" +version = "0.2.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "799627e6b4d27827a814e837b9d8a504832086081806d45b1afa34dc982b023b" +dependencies = [ + "chrono", +] + +[[package]] +name = "clang-sys" +version = "1.8.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0b023947811758c97c59bf9d1c188fd619ad4718dcaa767947df1cadb14f39f4" +dependencies = [ + "glob", + "libc", + "libloading", +] + +[[package]] +name = "clircle" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c8e87cbed5354f17bd8ca8821a097fb62599787fe8f611743fad7ee156a0a600" +dependencies = [ + "cfg-if", + "libc", + "serde", + "winapi", +] + +[[package]] +name = "console" +version = "0.15.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "054ccb5b10f9f2cbf51eb355ca1d05c2d279ce1804688d0db74b4733a5aeafd8" +dependencies = [ + "encode_unicode", + "libc", + "once_cell", + "unicode-width 0.2.1", + "windows-sys 0.59.0", +] + +[[package]] +name = "content_inspector" +version = "0.2.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b7bda66e858c683005a53a9a60c69a4aca7eeaa45d124526e389f7aec8e62f38" +dependencies = [ + "memchr", +] + +[[package]] +name = "core-foundation-sys" +version = "0.8.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "773648b94d0e5d620f64f280777445740e61fe701025087ec8b57f45c791888b" + +[[package]] +name = "crc32fast" +version = "1.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a97769d94ddab943e4510d138150169a2758b5ef3eb191a9ee688de3e23ef7b3" +dependencies = [ + "cfg-if", +] + +[[package]] +name = "crossbeam-deque" +version = "0.8.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9dd111b7b7f7d55b72c0a6ae361660ee5853c9af73f70c3c2ef6858b950e2e51" +dependencies = [ + "crossbeam-epoch", + "crossbeam-utils", +] + +[[package]] +name = "crossbeam-epoch" +version = "0.9.18" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5b82ac4a3c2ca9c3460964f020e1402edd5753411d7737aa39c3714ad1b5420e" +dependencies = [ + "crossbeam-utils", +] + +[[package]] +name = "crossbeam-utils" +version = "0.8.21" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d0a5c400df2834b80a4c3327b3aad3a4c4cd4de0629063962b03235697506a28" + +[[package]] +name = "crossterm" +version = "0.28.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "829d955a0bb380ef178a640b91779e3987da38c9aea133b20614cfed8cdea9c6" +dependencies = [ + "bitflags 2.9.1", + "crossterm_winapi", + "mio", + "parking_lot", + "rustix 0.38.44", + "signal-hook", + "signal-hook-mio", + "winapi", +] + +[[package]] +name = "crossterm_winapi" +version = "0.9.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "acdd7c62a3665c7f6830a51635d9ac9b23ed385797f70a83bb8bafe9c572ab2b" +dependencies = [ + "winapi", +] + +[[package]] +name = "deranged" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9c9e6a11ca8224451684bc0d7d5a7adbf8f2fd6887261a1cfc3c0432f9d4068e" +dependencies = [ + "powerfmt", +] + +[[package]] +name = "dirs" +version = "5.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "44c45a9d03d6676652bcb5e724c7e988de1acad23a711b5217ab9cbecbec2225" +dependencies = [ + "dirs-sys", +] + +[[package]] +name = "dirs-sys" +version = "0.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "520f05a5cbd335fae5a99ff7a6ab8627577660ee5cfd6a94a6a929b52ff0321c" +dependencies = [ + "libc", + "option-ext", + "redox_users", + "windows-sys 0.48.0", +] + +[[package]] +name = "doctest-file" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "aac81fa3e28d21450aa4d2ac065992ba96a1d7303efbce51a95f4fd175b67562" + +[[package]] +name = "either" +version = "1.15.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "48c757948c5ede0e46177b7add2e67155f70e33c07fea8284df6576da70b3719" + +[[package]] +name = "encode_unicode" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "34aa73646ffb006b8f5147f3dc182bd4bcb190227ce861fc4a4844bf8e3cb2c0" + +[[package]] +name = "encoding_rs" +version = "0.8.35" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "75030f3c4f45dafd7586dd6780965a8c7e8e285a5ecb86713e63a79c5b2766f3" +dependencies = [ + "cfg-if", +] + +[[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.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e004d887f51fcb9fef17317a2f3525c887d8aa3f4f50fed920816a688284a5b7" +dependencies = [ + "serde", + "typeid", +] + +[[package]] +name = "errno" +version = "0.3.13" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "778e2ac28f6c47af28e4907f13ffd1e1ddbd400980a9abd7c8df189bf578a5ad" +dependencies = [ + "libc", + "windows-sys 0.60.2", +] + +[[package]] +name = "fancy-regex" +version = "0.14.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6e24cb5a94bcae1e5408b0effca5cd7172ea3c5755049c5f3af4cd283a165298" +dependencies = [ + "bit-set", + "regex-automata", + "regex-syntax", +] + +[[package]] +name = "flate2" +version = "1.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4a3d7db9596fecd151c5f638c0ee5d5bd487b6e0ea232e5dc96d5250f6f94b1d" +dependencies = [ + "crc32fast", + "miniz_oxide", +] + +[[package]] +name = "fnv" +version = "1.0.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3f9eec918d3f24069decb9af1554cad7c880e2da24a9afd88aca000531ab82c1" + +[[package]] +name = "foldhash" +version = "0.1.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d9c4f5dac5e15c24eb999c26181a6ca40b39fe946cbe4c263c7209467bc83af2" + +[[package]] +name = "getrandom" +version = "0.2.16" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "335ff9f135e4384c8150d6f27c6daed433577f86b4750418338c01a1a2528592" +dependencies = [ + "cfg-if", + "libc", + "wasi", +] + +[[package]] +name = "glob" +version = "0.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a8d1add55171497b4705a648c6b583acafb01d58050a51727785f0b2c8e0a2b2" + +[[package]] +name = "globset" +version = "0.4.16" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "54a1028dfc5f5df5da8a56a73e6c153c9a9708ec57232470703592a3f18e49f5" +dependencies = [ + "aho-corasick", + "bstr", + "log", + "regex-automata", + "regex-syntax", +] + +[[package]] +name = "hashbrown" +version = "0.15.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5971ac85611da7067dbfcabef3c70ebb5606018acd9e2a3903a0da507521e0d5" +dependencies = [ + "allocator-api2", + "equivalent", + "foldhash", +] + +[[package]] +name = "heck" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2304e00983f87ffb38b55b444b5e3b60a884b5d30c0fca7d82fe33449bbe55ea" + +[[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.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "589533453244b0995c858700322199b2becb13b627df2851f64a2775d024abcf" +dependencies = [ + "windows-sys 0.59.0", +] + +[[package]] +name = "iana-time-zone" +version = "0.1.63" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b0c919e5debc312ad217002b8048a17b7d83f80703865bbfcfebb0458b0b27d8" +dependencies = [ + "android_system_properties", + "core-foundation-sys", + "iana-time-zone-haiku", + "js-sys", + "log", + "wasm-bindgen", + "windows-core 0.61.2", +] + +[[package]] +name = "iana-time-zone-haiku" +version = "0.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f31827a206f56af32e590ba56d5d2d085f558508192593743f16b2306495269f" +dependencies = [ + "cc", +] + +[[package]] +name = "indexmap" +version = "2.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cea70ddb795996207ad57735b50c5982d8844f38ba9ee5f1aedcfb708a2aa11e" +dependencies = [ + "equivalent", + "hashbrown", +] + +[[package]] +name = "interprocess" +version = "2.2.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d941b405bd2322993887859a8ee6ac9134945a24ec5ec763a8a962fc64dfec2d" +dependencies = [ + "doctest-file", + "libc", + "recvmsg", + "widestring", + "windows-sys 0.52.0", +] + +[[package]] +name = "inventory" +version = "0.3.20" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ab08d7cd2c5897f2c949e5383ea7c7db03fb19130ffcfbf7eda795137ae3cb83" +dependencies = [ + "rustversion", +] + +[[package]] +name = "is_ci" +version = "1.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7655c9839580ee829dfacba1d1278c2b7883e50a277ff7541299489d6bdfdc45" + +[[package]] +name = "itertools" +version = "0.13.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "413ee7dfc52ee1a4949ceeb7dbc8a33f2d6c088194d9f922fb8318faf1f01186" +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.15" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4a5f13b858c8d314ee3e8f639011f7ccefe71f97f96e50151fb991f267928e2c" + +[[package]] +name = "js-sys" +version = "0.3.77" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1cfaf33c695fc6e08064efbc1f72ec937429614f25eef83af942d0e227c3a28f" +dependencies = [ + "once_cell", + "wasm-bindgen", +] + +[[package]] +name = "libc" +version = "0.2.174" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1171693293099992e19cddea4e8b849964e9846f4acee11b3948bcc337be8776" + +[[package]] +name = "libloading" +version = "0.8.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "07033963ba89ebaf1584d767badaa2e8fcec21aedea6b8c0346d487d49c28667" +dependencies = [ + "cfg-if", + "windows-targets 0.53.2", +] + +[[package]] +name = "libproc" +version = "0.14.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e78a09b56be5adbcad5aa1197371688dc6bb249a26da3bca2011ee2fb987ebfb" +dependencies = [ + "bindgen", + "errno", + "libc", +] + +[[package]] +name = "libredox" +version = "0.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c0ff37bd590ca25063e35af745c343cb7a0271906fb7b37e4813e8f79f00268d" +dependencies = [ + "bitflags 2.9.1", + "libc", +] + +[[package]] +name = "linked-hash-map" +version = "0.5.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0717cef1bc8b636c6e1c1bbdefc09e6322da8a9321966e8928ef80d20f7f770f" + +[[package]] +name = "linux-raw-sys" +version = "0.4.15" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d26c52dbd32dccf2d10cac7725f8eae5296885fb5703b261f7d0a0739ec807ab" + +[[package]] +name = "linux-raw-sys" +version = "0.9.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cd945864f07fe9f5371a27ad7b52a172b4b499999f1d97574c9fa68373937e12" + +[[package]] +name = "lock_api" +version = "0.4.13" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "96936507f153605bddfcda068dd804796c84324ed2510809e5b2a624c81da765" +dependencies = [ + "autocfg", + "scopeguard", +] + +[[package]] +name = "log" +version = "0.4.27" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "13dc2df351e3202783a1fe0d44375f7295ffb4049267b0f3018346dc122a1d94" + +[[package]] +name = "lru" +version = "0.12.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "234cf4f4a04dc1f57e24b96cc0cd600cf2af460d4161ac5ecdd0af8e1f3b2a38" +dependencies = [ + "hashbrown", +] + +[[package]] +name = "lscolors" +version = "0.20.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "61183da5de8ba09a58e330d55e5ea796539d8443bd00fdeb863eac39724aa4ab" +dependencies = [ + "aho-corasick", + "nu-ansi-term 0.50.1", +] + +[[package]] +name = "mach2" +version = "0.4.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d640282b302c0bb0a2a8e0233ead9035e3bed871f0b7e81fe4a1ec829765db44" +dependencies = [ + "libc", +] + +[[package]] +name = "memchr" +version = "2.7.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "32a282da65faaf38286cf3be983213fcf1d2e2a58700e808f83f4ea9a4804bc0" + +[[package]] +name = "miette" +version = "7.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5f98efec8807c63c752b5bd61f862c165c115b0a35685bdcfd9238c7aeb592b7" +dependencies = [ + "cfg-if", + "miette-derive", + "owo-colors", + "supports-color", + "supports-hyperlinks", + "supports-unicode", + "terminal_size", + "textwrap", + "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", +] + +[[package]] +name = "mime" +version = "0.3.17" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6877bb514081ee2a7ff5ef9de3281f14a4dd4bceac4c09388074a6b5df8a139a" + +[[package]] +name = "mime_guess" +version = "2.0.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f7c44f8e672c00fe5308fa235f821cb4198414e1c77935c1ab6948d3fd78550e" +dependencies = [ + "mime", + "unicase", +] + +[[package]] +name = "minimal-lexical" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "68354c5c6bd36d73ff3feceb05efa59b6acb7626617f4962be322a825e61f79a" + +[[package]] +name = "miniz_oxide" +version = "0.8.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1fa76a2c86f704bdb222d66965fb3d63269ce38518b83cb0575fca855ebb6316" +dependencies = [ + "adler2", +] + +[[package]] +name = "mio" +version = "1.0.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "78bed444cc8a2160f01cbcf811ef18cac863ad68ae8ca62092e8db51d51c761c" +dependencies = [ + "libc", + "log", + "wasi", + "windows-sys 0.59.0", +] + +[[package]] +name = "nix" +version = "0.29.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "71e2746dc3a24dd78b3cfcb7be93368c6de9963d30f43a6a73998a9cf4b17b46" +dependencies = [ + "bitflags 2.9.1", + "cfg-if", + "cfg_aliases", + "libc", +] + +[[package]] +name = "nom" +version = "7.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d273983c5a657a70a3e8f2a01329822f3b8c8172b73826411a55751e404a0a4a" +dependencies = [ + "memchr", + "minimal-lexical", +] + +[[package]] +name = "nom_locate" +version = "4.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1e3c83c053b0713da60c5b8de47fe8e494fe3ece5267b2f23090a07a053ba8f3" +dependencies = [ + "bytecount", + "memchr", + "nom", +] + +[[package]] +name = "ntapi" +version = "0.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e8a3895c6391c39d7fe7ebc444a87eb2991b2a0bc718fdabd071eec617fc68e4" +dependencies = [ + "winapi", +] + +[[package]] +name = "nu-ansi-term" +version = "0.49.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c073d3c1930d0751774acf49e66653acecb416c3a54c6ec095a9b11caddb5a68" +dependencies = [ + "windows-sys 0.48.0", +] + +[[package]] +name = "nu-ansi-term" +version = "0.50.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d4a28e057d01f97e61255210fcff094d74ed0466038633e95017f5beb68e4399" +dependencies = [ + "windows-sys 0.52.0", +] + +[[package]] +name = "nu-derive-value" +version = "0.105.2" +dependencies = [ + "heck", + "proc-macro-error2", + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "nu-engine" +version = "0.105.2" +dependencies = [ + "log", + "nu-glob", + "nu-path", + "nu-protocol", + "nu-utils", +] + +[[package]] +name = "nu-glob" +version = "0.105.2" + +[[package]] +name = "nu-path" +version = "0.105.2" +dependencies = [ + "dirs", + "omnipath", + "pwd", + "ref-cast", +] + +[[package]] +name = "nu-plugin" +version = "0.105.2" +dependencies = [ + "log", + "nix", + "nu-engine", + "nu-plugin-core", + "nu-plugin-protocol", + "nu-protocol", + "nu-utils", + "thiserror 2.0.12", +] + +[[package]] +name = "nu-plugin-core" +version = "0.105.2" +dependencies = [ + "interprocess", + "log", + "nu-plugin-protocol", + "nu-protocol", + "rmp-serde", + "serde", + "serde_json", + "windows 0.56.0", +] + +[[package]] +name = "nu-plugin-protocol" +version = "0.105.2" +dependencies = [ + "nu-protocol", + "nu-utils", + "rmp-serde", + "semver", + "serde", + "typetag", +] + +[[package]] +name = "nu-protocol" +version = "0.105.2" +dependencies = [ + "brotli", + "bytes", + "chrono", + "chrono-humanize", + "dirs", + "dirs-sys", + "fancy-regex", + "heck", + "indexmap", + "log", + "lru", + "memchr", + "miette", + "nix", + "nu-derive-value", + "nu-glob", + "nu-path", + "nu-system", + "nu-utils", + "num-format", + "os_pipe", + "rmp-serde", + "serde", + "serde_json", + "strum", + "strum_macros", + "thiserror 2.0.12", + "typetag", + "web-time", + "windows 0.56.0", + "windows-sys 0.48.0", +] + +[[package]] +name = "nu-system" +version = "0.105.2" +dependencies = [ + "chrono", + "itertools 0.14.0", + "libc", + "libproc", + "log", + "mach2", + "nix", + "ntapi", + "procfs", + "sysinfo", + "web-time", + "windows 0.56.0", +] + +[[package]] +name = "nu-utils" +version = "0.105.2" +dependencies = [ + "crossterm", + "crossterm_winapi", + "fancy-regex", + "log", + "lscolors", + "nix", + "num-format", + "serde", + "serde_json", + "strip-ansi-escapes", + "sys-locale", + "unicase", +] + +[[package]] +name = "nu_plugin_highlight" +version = "1.4.7+0.105.2" +dependencies = [ + "ansi_colours", + "bat", + "mime_guess", + "nu-ansi-term 0.50.1", + "nu-path", + "nu-plugin", + "nu-protocol", + "patch-apply", + "syntect", +] + +[[package]] +name = "num-conv" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "51d515d32fb182ee37cda2ccdcb92950d6a3c2893aa280e540671c2cd0f3b1d9" + +[[package]] +name = "num-format" +version = "0.4.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a652d9771a63711fd3c3deb670acfbe5c30a4072e664d7a3bf5a9e1056ac72c3" +dependencies = [ + "arrayvec", + "itoa", +] + +[[package]] +name = "num-traits" +version = "0.2.19" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "071dfc062690e90b734c0b2273ce72ad0ffa95f0c74596bc250dcfd960262841" +dependencies = [ + "autocfg", +] + +[[package]] +name = "omnipath" +version = "0.1.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "80adb31078122c880307e9cdfd4e3361e6545c319f9b9dcafcb03acd3b51a575" + +[[package]] +name = "once_cell" +version = "1.21.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "42f5e15c9953c5e4ccceeb2e7382a716482c34515315f7b03532b8b4e8393d2d" + +[[package]] +name = "onig" +version = "6.5.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "336b9c63443aceef14bea841b899035ae3abe89b7c486aaf4c5bd8aafedac3f0" +dependencies = [ + "bitflags 2.9.1", + "libc", + "once_cell", + "onig_sys", +] + +[[package]] +name = "onig_sys" +version = "69.9.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c7f86c6eef3d6df15f23bcfb6af487cbd2fed4e5581d58d5bf1f5f8b7f6727dc" +dependencies = [ + "cc", + "pkg-config", +] + +[[package]] +name = "option-ext" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "04744f49eae99ab78e0d5c0b603ab218f515ea8cfe5a456d7629ad883a3b6e7d" + +[[package]] +name = "os_pipe" +version = "1.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "db335f4760b14ead6290116f2427bf33a14d4f0617d49f78a246de10c1831224" +dependencies = [ + "libc", + "windows-sys 0.59.0", +] + +[[package]] +name = "owo-colors" +version = "4.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "48dd4f4a2c8405440fd0462561f0e5806bd0f77e86f51c761481bdd4018b545e" + +[[package]] +name = "parking_lot" +version = "0.12.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "70d58bf43669b5795d1576d0641cfb6fbb2057bf629506267a92807158584a13" +dependencies = [ + "lock_api", + "parking_lot_core", +] + +[[package]] +name = "parking_lot_core" +version = "0.9.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bc838d2a56b5b1a6c25f55575dfc605fabb63bb2365f6c2353ef9159aa69e4a5" +dependencies = [ + "cfg-if", + "libc", + "redox_syscall", + "smallvec", + "windows-targets 0.52.6", +] + +[[package]] +name = "paste" +version = "1.0.15" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "57c0d7b74b563b49d38dae00a0c37d4d6de9b432382b2892f0574ddcae73fd0a" + +[[package]] +name = "patch-apply" +version = "0.8.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7fe95476ec50a4e9b95ed12a4677ff5996aba4329bf2535fb21c49afaad20809" +dependencies = [ + "chrono", + "nom", + "nom_locate", +] + +[[package]] +name = "path_abs" +version = "0.5.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "05ef02f6342ac01d8a93b65f96db53fe68a92a15f41144f97fb00a9e669633c3" +dependencies = [ + "std_prelude", +] + +[[package]] +name = "pkg-config" +version = "0.3.32" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7edddbd0b52d732b21ad9a5fab5c704c14cd949e5e9a1ec5929a24fded1b904c" + +[[package]] +name = "plist" +version = "1.7.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3d77244ce2d584cd84f6a15f86195b8c9b2a0dfbfd817c09e0464244091a58ed" +dependencies = [ + "base64", + "indexmap", + "quick-xml", + "serde", + "time", +] + +[[package]] +name = "powerfmt" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "439ee305def115ba05938db6eb1644ff94165c5ab5e9420d1c1bcedbba909391" + +[[package]] +name = "proc-macro-error-attr2" +version = "2.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "96de42df36bb9bba5542fe9f1a054b8cc87e172759a1868aa05c1f3acc89dfc5" +dependencies = [ + "proc-macro2", + "quote", +] + +[[package]] +name = "proc-macro-error2" +version = "2.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "11ec05c52be0a07b08061f7dd003e7d7092e0472bc731b4af7bb1ef876109802" +dependencies = [ + "proc-macro-error-attr2", + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "proc-macro2" +version = "1.0.95" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "02b3e5e68a3a1a02aad3ec490a98007cbc13c37cbe84a3cd7b8e406d76e7f778" +dependencies = [ + "unicode-ident", +] + +[[package]] +name = "procfs" +version = "0.17.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cc5b72d8145275d844d4b5f6d4e1eef00c8cd889edb6035c21675d1bb1f45c9f" +dependencies = [ + "bitflags 2.9.1", + "chrono", + "flate2", + "hex", + "procfs-core", + "rustix 0.38.44", +] + +[[package]] +name = "procfs-core" +version = "0.17.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "239df02d8349b06fc07398a3a1697b06418223b1c7725085e801e7c0fc6a12ec" +dependencies = [ + "bitflags 2.9.1", + "chrono", + "hex", +] + +[[package]] +name = "pure-rust-locales" +version = "0.8.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1190fd18ae6ce9e137184f207593877e70f39b015040156b1e05081cdfe3733a" + +[[package]] +name = "pwd" +version = "1.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "72c71c0c79b9701efe4e1e4b563b2016dd4ee789eb99badcb09d61ac4b92e4a2" +dependencies = [ + "libc", + "thiserror 1.0.69", +] + +[[package]] +name = "quick-xml" +version = "0.37.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "331e97a1af0bf59823e6eadffe373d7b27f485be8748f71471c662c1f269b7fb" +dependencies = [ + "memchr", +] + +[[package]] +name = "quote" +version = "1.0.40" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1885c039570dc00dcb4ff087a89e185fd56bae234ddc7f056a945bf36467248d" +dependencies = [ + "proc-macro2", +] + +[[package]] +name = "rayon" +version = "1.10.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b418a60154510ca1a002a752ca9714984e21e4241e804d32555251faf8b78ffa" +dependencies = [ + "either", + "rayon-core", +] + +[[package]] +name = "rayon-core" +version = "1.12.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1465873a3dfdaa8ae7cb14b4383657caab0b3e8a0aa9ae8e04b044854c8dfce2" +dependencies = [ + "crossbeam-deque", + "crossbeam-utils", +] + +[[package]] +name = "recvmsg" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d3edd4d5d42c92f0a659926464d4cce56b562761267ecf0f469d85b7de384175" + +[[package]] +name = "redox_syscall" +version = "0.5.13" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0d04b7d0ee6b4a0207a0a7adb104d23ecb0b47d6beae7152d0fa34b692b29fd6" +dependencies = [ + "bitflags 2.9.1", +] + +[[package]] +name = "redox_users" +version = "0.4.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ba009ff324d1fc1b900bd1fdb31564febe58a8ccc8a6fdbb93b543d33b13ca43" +dependencies = [ + "getrandom", + "libredox", + "thiserror 1.0.69", +] + +[[package]] +name = "ref-cast" +version = "1.0.24" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4a0ae411dbe946a674d89546582cea4ba2bb8defac896622d6496f14c23ba5cf" +dependencies = [ + "ref-cast-impl", +] + +[[package]] +name = "ref-cast-impl" +version = "1.0.24" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1165225c21bff1f3bbce98f5a1f889949bc902d3575308cc7b0de30b4f6d27c7" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "regex" +version = "1.11.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b544ef1b4eac5dc2db33ea63606ae9ffcfac26c1416a2806ae0bf5f56b201191" +dependencies = [ + "aho-corasick", + "memchr", + "regex-automata", + "regex-syntax", +] + +[[package]] +name = "regex-automata" +version = "0.4.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "809e8dc61f6de73b46c85f4c96486310fe304c434cfa43669d7b40f711150908" +dependencies = [ + "aho-corasick", + "memchr", + "regex-syntax", +] + +[[package]] +name = "regex-syntax" +version = "0.8.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2b15c43186be67a4fd63bee50d0303afffcef381492ebe2c5d87f324e1b8815c" + +[[package]] +name = "rgb" +version = "0.8.50" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "57397d16646700483b67d2dd6511d79318f9d057fdbd21a4066aeac8b41d310a" +dependencies = [ + "bytemuck", +] + +[[package]] +name = "rmp" +version = "0.8.14" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "228ed7c16fa39782c3b3468e974aec2795e9089153cd08ee2e9aefb3613334c4" +dependencies = [ + "byteorder", + "num-traits", + "paste", +] + +[[package]] +name = "rmp-serde" +version = "1.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "52e599a477cf9840e92f2cde9a7189e67b42c57532749bf90aea6ec10facd4db" +dependencies = [ + "byteorder", + "rmp", + "serde", +] + +[[package]] +name = "rustc-hash" +version = "1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "08d43f7aa6b08d49f382cde6a7982047c3426db949b1424bc4b7ec9ae12c6ce2" + +[[package]] +name = "rustix" +version = "0.38.44" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fdb5bc1ae2baa591800df16c9ca78619bf65c0488b41b96ccec5d11220d8c154" +dependencies = [ + "bitflags 2.9.1", + "errno", + "libc", + "linux-raw-sys 0.4.15", + "windows-sys 0.59.0", +] + +[[package]] +name = "rustix" +version = "1.0.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c71e83d6afe7ff64890ec6b71d6a69bb8a610ab78ce364b3352876bb4c801266" +dependencies = [ + "bitflags 2.9.1", + "errno", + "libc", + "linux-raw-sys 0.9.4", + "windows-sys 0.59.0", +] + +[[package]] +name = "rustversion" +version = "1.0.21" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8a0d197bd2c9dc6e53b84da9556a69ba4cdfab8619eb41a8bd1cc2027a0f6b1d" + +[[package]] +name = "ryu" +version = "1.0.20" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "28d3b2b1366ec20994f1fd18c3c594f05c5dd4bc44d8bb0c1c632c8d6829481f" + +[[package]] +name = "same-file" +version = "1.0.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "93fc1dc3aaa9bfed95e02e6eadabb4baf7e3078b0bd1b4d7b6b0b68378900502" +dependencies = [ + "winapi-util", +] + +[[package]] +name = "scopeguard" +version = "1.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "94143f37725109f92c262ed2cf5e59bce7498c01bcc1502d7b9afe439a4e9f49" + +[[package]] +name = "semver" +version = "1.0.26" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "56e6fa9c48d24d85fb3de5ad847117517440f6beceb7798af16b4a87d616b8d0" + +[[package]] +name = "serde" +version = "1.0.219" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5f0e2c6ed6606019b4e29e69dbaba95b11854410e5347d525002456dbbb786b6" +dependencies = [ + "serde_derive", +] + +[[package]] +name = "serde_derive" +version = "1.0.219" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5b0276cf7f2c73365f7157c8123c21cd9a50fbbd844757af28ca1f5925fc2a00" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "serde_json" +version = "1.0.140" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "20068b6e96dc6c9bd23e01df8827e6c7e1f2fddd43c21810382803c136b99373" +dependencies = [ + "itoa", + "memchr", + "ryu", + "serde", +] + +[[package]] +name = "serde_yaml" +version = "0.9.34+deprecated" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6a8b1a1a2ebf674015cc02edccce75287f1a0130d394307b36743c2f5d504b47" +dependencies = [ + "indexmap", + "itoa", + "ryu", + "serde", + "unsafe-libyaml", +] + +[[package]] +name = "shlex" +version = "1.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0fda2ff0d084019ba4d7c6f371c95d8fd75ce3524c3cb8fb653a3023f6323e64" + +[[package]] +name = "signal-hook" +version = "0.3.18" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d881a16cf4426aa584979d30bd82cb33429027e42122b169753d6ef1085ed6e2" +dependencies = [ + "libc", + "signal-hook-registry", +] + +[[package]] +name = "signal-hook-mio" +version = "0.2.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "34db1a06d485c9142248b7a054f034b349b212551f3dfd19c94d45a754a217cd" +dependencies = [ + "libc", + "mio", + "signal-hook", +] + +[[package]] +name = "signal-hook-registry" +version = "1.4.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9203b8055f63a2a00e2f593bb0510367fe707d7ff1e5c872de2f537b339e5410" +dependencies = [ + "libc", +] + +[[package]] +name = "smallvec" +version = "1.15.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "67b1b7a3b5fe4f1376887184045fcf45c69e92af734b7aaddc05fb777b6fbd03" + +[[package]] +name = "std_prelude" +version = "0.2.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8207e78455ffdf55661170876f88daf85356e4edd54e0a3dbc79586ca1e50cbe" + +[[package]] +name = "strip-ansi-escapes" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2a8f8038e7e7969abb3f1b7c2a811225e9296da208539e0f79c5251d6cac0025" +dependencies = [ + "vte", +] + +[[package]] +name = "strum" +version = "0.26.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8fec0f0aef304996cf250b31b5a10dee7980c85da9d759361292b8bca5a18f06" + +[[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", +] + +[[package]] +name = "supports-color" +version = "3.0.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c64fc7232dd8d2e4ac5ce4ef302b1d81e0b80d055b9d77c7c4f51f6aa4c867d6" +dependencies = [ + "is_ci", +] + +[[package]] +name = "supports-hyperlinks" +version = "3.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "804f44ed3c63152de6a9f90acbea1a110441de43006ea51bcce8f436196a288b" + +[[package]] +name = "supports-unicode" +version = "3.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b7401a30af6cb5818bb64852270bb722533397edcfc7344954a38f420819ece2" + +[[package]] +name = "syn" +version = "2.0.104" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "17b6f705963418cdb9927482fa304bc562ece2fdd4f616084c50b7023b435a40" +dependencies = [ + "proc-macro2", + "quote", + "unicode-ident", +] + +[[package]] +name = "syntect" +version = "5.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "874dcfa363995604333cf947ae9f751ca3af4522c60886774c4963943b4746b1" +dependencies = [ + "bincode", + "bitflags 1.3.2", + "flate2", + "fnv", + "once_cell", + "onig", + "plist", + "regex-syntax", + "serde", + "serde_derive", + "serde_json", + "thiserror 1.0.69", + "walkdir", + "yaml-rust", +] + +[[package]] +name = "sys-locale" +version = "0.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8eab9a99a024a169fe8a903cf9d4a3b3601109bcc13bd9e3c6fff259138626c4" +dependencies = [ + "libc", +] + +[[package]] +name = "sysinfo" +version = "0.33.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4fc858248ea01b66f19d8e8a6d55f41deaf91e9d495246fd01368d99935c6c01" +dependencies = [ + "core-foundation-sys", + "libc", + "memchr", + "ntapi", + "rayon", + "windows 0.57.0", +] + +[[package]] +name = "terminal_size" +version = "0.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "45c6481c4829e4cc63825e62c49186a34538b7b2750b73b266581ffb612fb5ed" +dependencies = [ + "rustix 1.0.7", + "windows-sys 0.59.0", +] + +[[package]] +name = "textwrap" +version = "0.16.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c13547615a44dc9c452a8a534638acdf07120d4b6847c8178705da06306a3057" +dependencies = [ + "unicode-linebreak", + "unicode-width 0.2.1", +] + +[[package]] +name = "thiserror" +version = "1.0.69" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b6aaf5339b578ea85b50e080feb250a3e8ae8cfcdff9a461c9ec2904bc923f52" +dependencies = [ + "thiserror-impl 1.0.69", +] + +[[package]] +name = "thiserror" +version = "2.0.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "567b8a2dae586314f7be2a752ec7474332959c6460e02bde30d702a66d488708" +dependencies = [ + "thiserror-impl 2.0.12", +] + +[[package]] +name = "thiserror-impl" +version = "1.0.69" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4fee6c4efc90059e10f81e6d42c60a18f76588c3d74cb83a0b242a2b6c7504c1" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "thiserror-impl" +version = "2.0.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7f7cf42b4507d8ea322120659672cf1b9dbb93f8f2d4ecfd6e51350ff5b17a1d" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "time" +version = "0.3.41" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8a7619e19bc266e0f9c5e6686659d394bc57973859340060a69221e57dbc0c40" +dependencies = [ + "deranged", + "itoa", + "num-conv", + "powerfmt", + "serde", + "time-core", + "time-macros", +] + +[[package]] +name = "time-core" +version = "0.1.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c9e9a38711f559d9e3ce1cdb06dd7c5b8ea546bc90052da6d06bb76da74bb07c" + +[[package]] +name = "time-macros" +version = "0.2.22" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3526739392ec93fd8b359c8e98514cb3e8e021beb4e5f597b00a0221f8ed8a49" +dependencies = [ + "num-conv", + "time-core", +] + +[[package]] +name = "typeid" +version = "1.0.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bc7d623258602320d5c55d1bc22793b57daff0ec7efc270ea7d55ce1d5f5471c" + +[[package]] +name = "typetag" +version = "0.2.20" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "73f22b40dd7bfe8c14230cf9702081366421890435b2d625fa92b4acc4c3de6f" +dependencies = [ + "erased-serde", + "inventory", + "once_cell", + "serde", + "typetag-impl", +] + +[[package]] +name = "typetag-impl" +version = "0.2.20" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "35f5380909ffc31b4de4f4bdf96b877175a016aa2ca98cee39fcfd8c4d53d952" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "unicase" +version = "2.8.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "75b844d17643ee918803943289730bec8aac480150456169e647ed0b576ba539" + +[[package]] +name = "unicode-ident" +version = "1.0.18" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5a5f39404a5da50712a4c1eecf25e90dd62b613502b7e925fd4e4d19b5c96512" + +[[package]] +name = "unicode-linebreak" +version = "0.1.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3b09c83c3c29d37506a3e260c08c03743a6bb66a9cd432c6934ab501a190571f" + +[[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.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4a1a07cc7db3810833284e8d372ccdc6da29741639ecc70c9ec107df0fa6154c" + +[[package]] +name = "unsafe-libyaml" +version = "0.2.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "673aac59facbab8a9007c7f6108d11f63b603f7cabff99fabf650fea5c32b861" + +[[package]] +name = "vte" +version = "0.14.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "231fdcd7ef3037e8330d8e17e61011a2c244126acc0a982f4040ac3f9f0bc077" +dependencies = [ + "memchr", +] + +[[package]] +name = "walkdir" +version = "2.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "29790946404f91d9c5d06f9874efddea1dc06c5efe94541a7d6863108e3a5e4b" +dependencies = [ + "same-file", + "winapi-util", +] + +[[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.100" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1edc8929d7499fc4e8f0be2262a241556cfc54a0bea223790e71446f2aab1ef5" +dependencies = [ + "cfg-if", + "once_cell", + "rustversion", + "wasm-bindgen-macro", +] + +[[package]] +name = "wasm-bindgen-backend" +version = "0.2.100" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2f0a0651a5c2bc21487bde11ee802ccaf4c51935d0d3d42a6101f98161700bc6" +dependencies = [ + "bumpalo", + "log", + "proc-macro2", + "quote", + "syn", + "wasm-bindgen-shared", +] + +[[package]] +name = "wasm-bindgen-macro" +version = "0.2.100" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7fe63fc6d09ed3792bd0897b314f53de8e16568c2b3f7982f468c0bf9bd0b407" +dependencies = [ + "quote", + "wasm-bindgen-macro-support", +] + +[[package]] +name = "wasm-bindgen-macro-support" +version = "0.2.100" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8ae87ea40c9f689fc23f209965b6fb8a99ad69aeeb0231408be24920604395de" +dependencies = [ + "proc-macro2", + "quote", + "syn", + "wasm-bindgen-backend", + "wasm-bindgen-shared", +] + +[[package]] +name = "wasm-bindgen-shared" +version = "0.2.100" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1a05d73b933a847d6cccdda8f838a22ff101ad9bf93e33684f39c1f5f0eece3d" +dependencies = [ + "unicode-ident", +] + +[[package]] +name = "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 = "widestring" +version = "1.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dd7cf3379ca1aac9eea11fba24fd7e315d621f8dfe35c8d7d2be8b793726e07d" + +[[package]] +name = "winapi" +version = "0.3.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5c839a674fcd7a98952e593242ea400abe93992746761e38641405d28b00f419" +dependencies = [ + "winapi-i686-pc-windows-gnu", + "winapi-x86_64-pc-windows-gnu", +] + +[[package]] +name = "winapi-i686-pc-windows-gnu" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ac3b87c63620426dd9b991e5ce0329eff545bccbbb34f3be09ff6fb6ab51b7b6" + +[[package]] +name = "winapi-util" +version = "0.1.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cf221c93e13a30d793f7645a0e7762c55d169dbb0a49671918a2319d289b10bb" +dependencies = [ + "windows-sys 0.59.0", +] + +[[package]] +name = "winapi-x86_64-pc-windows-gnu" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f" + +[[package]] +name = "windows" +version = "0.56.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1de69df01bdf1ead2f4ac895dc77c9351aefff65b2f3db429a343f9cbf05e132" +dependencies = [ + "windows-core 0.56.0", + "windows-targets 0.52.6", +] + +[[package]] +name = "windows" +version = "0.57.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "12342cb4d8e3b046f3d80effd474a7a02447231330ef77d71daa6fbc40681143" +dependencies = [ + "windows-core 0.57.0", + "windows-targets 0.52.6", +] + +[[package]] +name = "windows-core" +version = "0.56.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4698e52ed2d08f8658ab0c39512a7c00ee5fe2688c65f8c0a4f06750d729f2a6" +dependencies = [ + "windows-implement 0.56.0", + "windows-interface 0.56.0", + "windows-result 0.1.2", + "windows-targets 0.52.6", +] + +[[package]] +name = "windows-core" +version = "0.57.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d2ed2439a290666cd67ecce2b0ffaad89c2a56b976b736e6ece670297897832d" +dependencies = [ + "windows-implement 0.57.0", + "windows-interface 0.57.0", + "windows-result 0.1.2", + "windows-targets 0.52.6", +] + +[[package]] +name = "windows-core" +version = "0.61.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c0fdd3ddb90610c7638aa2b3a3ab2904fb9e5cdbecc643ddb3647212781c4ae3" +dependencies = [ + "windows-implement 0.60.0", + "windows-interface 0.59.1", + "windows-link", + "windows-result 0.3.4", + "windows-strings", +] + +[[package]] +name = "windows-implement" +version = "0.56.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f6fc35f58ecd95a9b71c4f2329b911016e6bec66b3f2e6a4aad86bd2e99e2f9b" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "windows-implement" +version = "0.57.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9107ddc059d5b6fbfbffdfa7a7fe3e22a226def0b2608f72e9d552763d3e1ad7" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "windows-implement" +version = "0.60.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a47fddd13af08290e67f4acabf4b459f647552718f683a7b415d290ac744a836" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "windows-interface" +version = "0.56.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "08990546bf4edef8f431fa6326e032865f27138718c587dc21bc0265bbcb57cc" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "windows-interface" +version = "0.57.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "29bee4b38ea3cde66011baa44dba677c432a78593e202392d1e9070cf2a7fca7" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "windows-interface" +version = "0.59.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bd9211b69f8dcdfa817bfd14bf1c97c9188afa36f4750130fcdf3f400eca9fa8" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "windows-link" +version = "0.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5e6ad25900d524eaabdbbb96d20b4311e1e7ae1699af4fb28c17ae66c80d798a" + +[[package]] +name = "windows-result" +version = "0.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5e383302e8ec8515204254685643de10811af0ed97ea37210dc26fb0032647f8" +dependencies = [ + "windows-targets 0.52.6", +] + +[[package]] +name = "windows-result" +version = "0.3.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "56f42bd332cc6c8eac5af113fc0c1fd6a8fd2aa08a0119358686e5160d0586c6" +dependencies = [ + "windows-link", +] + +[[package]] +name = "windows-strings" +version = "0.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "56e6c93f3a0c3b36176cb1327a4958a0353d5d166c2a35cb268ace15e91d3b57" +dependencies = [ + "windows-link", +] + +[[package]] +name = "windows-sys" +version = "0.48.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "677d2418bec65e3338edb076e806bc1ec15693c5d0104683f2efe857f61056a9" +dependencies = [ + "windows-targets 0.48.5", +] + +[[package]] +name = "windows-sys" +version = "0.52.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "282be5f36a8ce781fad8c8ae18fa3f9beff57ec1b52cb3de0789201425d9a33d" +dependencies = [ + "windows-targets 0.52.6", +] + +[[package]] +name = "windows-sys" +version = "0.59.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1e38bc4d79ed67fd075bcc251a1c39b32a1776bbe92e5bef1f0bf1f8c531853b" +dependencies = [ + "windows-targets 0.52.6", +] + +[[package]] +name = "windows-sys" +version = "0.60.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f2f500e4d28234f72040990ec9d39e3a6b950f9f22d3dba18416c35882612bcb" +dependencies = [ + "windows-targets 0.53.2", +] + +[[package]] +name = "windows-targets" +version = "0.48.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9a2fa6e2155d7247be68c096456083145c183cbbbc2764150dda45a87197940c" +dependencies = [ + "windows_aarch64_gnullvm 0.48.5", + "windows_aarch64_msvc 0.48.5", + "windows_i686_gnu 0.48.5", + "windows_i686_msvc 0.48.5", + "windows_x86_64_gnu 0.48.5", + "windows_x86_64_gnullvm 0.48.5", + "windows_x86_64_msvc 0.48.5", +] + +[[package]] +name = "windows-targets" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9b724f72796e036ab90c1021d4780d4d3d648aca59e491e6b98e725b84e99973" +dependencies = [ + "windows_aarch64_gnullvm 0.52.6", + "windows_aarch64_msvc 0.52.6", + "windows_i686_gnu 0.52.6", + "windows_i686_gnullvm 0.52.6", + "windows_i686_msvc 0.52.6", + "windows_x86_64_gnu 0.52.6", + "windows_x86_64_gnullvm 0.52.6", + "windows_x86_64_msvc 0.52.6", +] + +[[package]] +name = "windows-targets" +version = "0.53.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c66f69fcc9ce11da9966ddb31a40968cad001c5bedeb5c2b82ede4253ab48aef" +dependencies = [ + "windows_aarch64_gnullvm 0.53.0", + "windows_aarch64_msvc 0.53.0", + "windows_i686_gnu 0.53.0", + "windows_i686_gnullvm 0.53.0", + "windows_i686_msvc 0.53.0", + "windows_x86_64_gnu 0.53.0", + "windows_x86_64_gnullvm 0.53.0", + "windows_x86_64_msvc 0.53.0", +] + +[[package]] +name = "windows_aarch64_gnullvm" +version = "0.48.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2b38e32f0abccf9987a4e3079dfb67dcd799fb61361e53e2882c3cbaf0d905d8" + +[[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_gnullvm" +version = "0.53.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "86b8d5f90ddd19cb4a147a5fa63ca848db3df085e25fee3cc10b39b6eebae764" + +[[package]] +name = "windows_aarch64_msvc" +version = "0.48.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dc35310971f3b2dbbf3f0690a219f40e2d9afcf64f9ab7cc1be722937c26b4bc" + +[[package]] +name = "windows_aarch64_msvc" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "09ec2a7bb152e2252b53fa7803150007879548bc709c039df7627cabbd05d469" + +[[package]] +name = "windows_aarch64_msvc" +version = "0.53.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c7651a1f62a11b8cbd5e0d42526e55f2c99886c77e007179efff86c2b137e66c" + +[[package]] +name = "windows_i686_gnu" +version = "0.48.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a75915e7def60c94dcef72200b9a8e58e5091744960da64ec734a6c6e9b3743e" + +[[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_gnu" +version = "0.53.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c1dc67659d35f387f5f6c479dc4e28f1d4bb90ddd1a5d3da2e5d97b42d6272c3" + +[[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_gnullvm" +version = "0.53.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9ce6ccbdedbf6d6354471319e781c0dfef054c81fbc7cf83f338a4296c0cae11" + +[[package]] +name = "windows_i686_msvc" +version = "0.48.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8f55c233f70c4b27f66c523580f78f1004e8b5a8b659e05a4eb49d4166cca406" + +[[package]] +name = "windows_i686_msvc" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "240948bc05c5e7c6dabba28bf89d89ffce3e303022809e73deaefe4f6ec56c66" + +[[package]] +name = "windows_i686_msvc" +version = "0.53.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "581fee95406bb13382d2f65cd4a908ca7b1e4c2f1917f143ba16efe98a589b5d" + +[[package]] +name = "windows_x86_64_gnu" +version = "0.48.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "53d40abd2583d23e4718fddf1ebec84dbff8381c07cae67ff7768bbf19c6718e" + +[[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_gnu" +version = "0.53.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2e55b5ac9ea33f2fc1716d1742db15574fd6fc8dadc51caab1c16a3d3b4190ba" + +[[package]] +name = "windows_x86_64_gnullvm" +version = "0.48.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0b7b52767868a23d5bab768e390dc5f5c55825b6d30b86c844ff2dc7414044cc" + +[[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_gnullvm" +version = "0.53.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0a6e035dd0599267ce1ee132e51c27dd29437f63325753051e71dd9e42406c57" + +[[package]] +name = "windows_x86_64_msvc" +version = "0.48.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ed94fce61571a4006852b7389a063ab983c02eb1bb37b47f8272ce92d06d9538" + +[[package]] +name = "windows_x86_64_msvc" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "589f6da84c646204747d1270a2a5661ea66ed1cced2631d546fdfb155959f9ec" + +[[package]] +name = "windows_x86_64_msvc" +version = "0.53.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "271414315aff87387382ec3d271b52d7ae78726f5d44ac98b4f4030c91880486" + +[[package]] +name = "yaml-rust" +version = "0.4.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "56c1936c4cc7a1c9ab21a1ebb602eb942ba868cbd44a99cb7cdc5892335e1c85" +dependencies = [ + "linked-hash-map", +] diff --git a/nu_plugin_highlight/Cargo.toml b/nu_plugin_highlight/Cargo.toml new file mode 100644 index 0000000..90ba77e --- /dev/null +++ b/nu_plugin_highlight/Cargo.toml @@ -0,0 +1,35 @@ +[package] +name = "nu_plugin_highlight" +version = "1.4.7+0.105.2" +authors = ["Tim 'Piepmatz' Hesse"] +edition = "2024" +repository = "https://github.com/cptpiepmatz/nu-plugin-highlight" +description = "A nushell plugin for syntax highlighting" +license = "MIT" +keywords = ["nu", "plugin", "syntax", "highlighting"] +categories = ["command-line-utilities", "development-tools", "value-formatting"] + +[workspace.dependencies] +# share dependencies with build dependencies +syntect = "5" +bat = { version = "0.24", default-features = false } + +[dependencies] +# nu +nu-plugin = { version = "0.105.2", path = "../nushell/crates/nu-plugin" } +nu-protocol = { version = "0.105.2", path = "../nushell/crates/nu-protocol" } +nu-path = { version = "0.105.2", path = "../nushell/crates/nu-path" } + +# highlighting +syntect = { workspace = true } +nu-ansi-term = "0.50" +ansi_colours = "1" +bat = { workspace = true } + +# guess the type +mime_guess = "2" + +[build-dependencies] +patch-apply = "0.8.3" +syntect = { workspace = true } +bat = { workspace = true } diff --git a/nu_plugin_highlight/LICENSE b/nu_plugin_highlight/LICENSE new file mode 100644 index 0000000..9c6c4a1 --- /dev/null +++ b/nu_plugin_highlight/LICENSE @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) 2023 Tim 'Piepmatz' Hesse + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/nu_plugin_highlight/README.md b/nu_plugin_highlight/README.md new file mode 100644 index 0000000..bf1d78f --- /dev/null +++ b/nu_plugin_highlight/README.md @@ -0,0 +1,146 @@ +

nu-plugin-highlight

+

+ + A nushell + plugin for syntax + highlighting. + +

+ +
+ +
+ + [![Version](https://img.shields.io/crates/v/nu-plugin-highlight?style=for-the-badge)](https://crates.io/crates/nu-plugin-highlight) + [![License](https://img.shields.io/crates/l/nu-plugin-highlight?style=for-the-badge)](https://github.com/cptpiepmatz/nu-plugin-highlight/blob/main/LICENSE) + +
+ + +## About +`nu-plugin-highlight` is a plugin for [Nushell](https://www.nushell.sh) that +provides syntax highlighting for source code. +It uses the [`syntect`](https://crates.io/crates/syntect) library for syntax +highlighting and the [`bat`](https://crates.io/crates/bat) library for easy +access to its ready-to-use assets. +Custom themes can be loaded too. + +## Usage +The `highlight` command can be used for syntax highlighting source code. +Here are a few examples: +```nushell +# Highlight a Markdown file by guessing the type from the pipeline metadata +open README.md | highlight + +# Highlight a TOML file by its file extension +open Cargo.toml -r | echo $in | highlight toml + +# Highlight a Rust file by programming language name +open src/main.rs | echo $in | highlight Rust + +# Highlight a bash script by inferring the language (the file should start with a shebang) +open example.sh | echo $in | highlight + +# Highlight a TOML file with a different theme +open Cargo.toml -r | highlight -t ansi + +# List all available themes +highlight --list-themes +``` + +### Parameters +- `language `: + This is an optional parameter that can be used to specify the language or file + extension to aid language detection. + +### Flags +- `-h, --help`: + Display the help message for the highlight command. + +- `-t, --theme `: + The theme used for highlighting. + +- `--list-themes`: + List all possible themes. + +## Configuration +The plugin can be configured using the +[`$env.config.plugins.highlight`](https://github.com/nushell/nushell/pull/10955) +variable. + +### `true_colors` +Enable or disable true colors (24-bit). +By default, this is enabled. +```nushell +$env.config.plugins.highlight.true_colors = true +``` + +### `theme` +Set a theme to use. +The default theme depends on the operating system. +Use `highlight --list-themes | where default == true` to see your default theme. +Setting this environment variable should allow +`highlight --list-themes | where id == $env.config.plugins.highlight.theme` to +result in a single row with your selected theme. +If you get no results, you have set an invalid theme. +```nushell +$env.config.plugins.highlight.theme = ansi +``` + +### `custom_themes` +Set a directory to load custom themes from. +Using `synctect`s theme loader, you can load custom themes in the `.tmtheme` +format from a directory that is passed as this configuration value. +```nushell +$env.config.plugins.highlight.custom_themes = ~/.nu/highlight/themes +``` + +## Plugin Installation +Installing and registering the `nu-plugin-highlight` is a straightforward +process. +Follow these steps: + +1. Install the plugin from crates.io using cargo: + ```nushell + cargo install nu_plugin_highlight + ``` + +2. Restart your terminal session to ensure the newly installed plugin is recognized. + +3. Find path of your installation: + ```nushell + which nu_plugin_highlight + ``` + +4. Register the plugin with Nushell: + + If you are using a version **lower** than **0.93.0**, use `register` instead of `plugin add`. + ```nushell + plugin add path/to/the/plugin/binary + ``` + +5. Make the plugin available for use: + + Tip: You can simply restart the shell or terminal. When nushell starts, it loads all plugins. + + If you are using a version **lower** than **0.93.0**, you do **not need** to do this. + ```nushell + plugin use highlight + ``` + +After registering, the plugin is available as part of your set of commands: + +```nushell +help commands | where command_type == "plugin" +``` + +## Version Numbering +Starting with version `v1.1.0`, the version number of `nu-plugin-highlight` +incorporates the version number of its dependency, `nu-plugin`. +This is denoted in the format `v1.1.0+0.90.1`, where `v1.1.0` refers to the +version of `nu-plugin-highlight` and `0.90.1` refers to the version of the +`nu-plugin` dependency. + +## License +`nu_plugin_highlight` is licensed under the MIT License. +See [LICENSE](LICENSE) for more information. diff --git a/nu_plugin_highlight/build.rs b/nu_plugin_highlight/build.rs new file mode 100644 index 0000000..ec66cb3 --- /dev/null +++ b/nu_plugin_highlight/build.rs @@ -0,0 +1,34 @@ +use std::path::PathBuf; + +use bat::assets::HighlightingAssets; +use patch_apply::Patch; +use syntect::parsing::SyntaxDefinition; + +const NUSHELL_SYNTAX: &str = include_str!("./syntaxes/nushell/nushell.sublime-syntax"); +const NUSHELL_PATCH: &str = include_str!("./syntaxes/patches/nushell.sublime-syntax.patch"); + +fn main() { + println!("cargo:rerun-if-changed=build.rs"); + println!("cargo:rerun-if-changed=Cargo.toml"); + println!("cargo:rerun-if-changed=syntaxes/nushell/nushell.sublime-syntax"); + println!("cargo:rerun-if-changed=syntaxes/patches/nushell.sublime-syntax.patch"); + println!("cargo:rerun-if-env-changed=OUT_DIR"); + + let syntax_set = HighlightingAssets::from_binary() + .get_syntax_set() + .unwrap() + .clone(); + let mut syntax_set_builder = syntax_set.into_builder(); + + let patch = Patch::from_single(NUSHELL_PATCH).unwrap(); + let syntax = NUSHELL_SYNTAX.to_string(); + let syntax = patch_apply::apply(syntax, patch); + let syntax = SyntaxDefinition::load_from_str(&syntax, true, Some("nushell")).unwrap(); + + syntax_set_builder.add(syntax); + let syntax_set = syntax_set_builder.build(); + + let out_path = std::env::var("OUT_DIR").unwrap(); + let out_path = PathBuf::from(out_path).join("syntax_set.bin"); + syntect::dumps::dump_to_uncompressed_file(&syntax_set, out_path).unwrap(); +} diff --git a/nu_plugin_highlight/rustfmt.toml b/nu_plugin_highlight/rustfmt.toml new file mode 100644 index 0000000..88df1d9 --- /dev/null +++ b/nu_plugin_highlight/rustfmt.toml @@ -0,0 +1,14 @@ +unstable_features = true +edition = "2021" +binop_separator = "Back" +control_brace_style = "ClosingNextLine" +format_strings = true +hex_literal_case = "Upper" +imports_granularity = "Module" +overflow_delimited_expr = true +reorder_impl_items = true +reorder_imports = true +group_imports = "StdExternalCrate" +trailing_comma = "Never" +use_field_init_shorthand = true +wrap_comments = true diff --git a/nu_plugin_highlight/src/highlight.rs b/nu_plugin_highlight/src/highlight.rs new file mode 100644 index 0000000..bcc03a0 --- /dev/null +++ b/nu_plugin_highlight/src/highlight.rs @@ -0,0 +1,158 @@ +use std::ops::Deref; +use std::path::Path; + +use bat::assets::HighlightingAssets; +use syntect::easy::HighlightLines; +use syntect::highlighting::ThemeSet; +use syntect::parsing::{SyntaxReference, SyntaxSet}; +use syntect::LoadingError; + +use crate::terminal; +use crate::theme::{ListThemes, ThemeDescription}; + +const SYNTAX_SET: &[u8] = include_bytes!(concat!(env!("OUT_DIR"), "/syntax_set.bin")); + +/// The struct that handles the highlighting of code. +pub struct Highlighter { + syntax_set: SyntaxSet, + highlighting_assets: HighlightingAssets, + custom_themes: Option +} + +impl Highlighter { + /// Creates a new instance of the Highlighter. + pub fn new() -> Self { + Highlighter { + syntax_set: syntect::dumps::from_uncompressed_data(SYNTAX_SET).unwrap(), + highlighting_assets: HighlightingAssets::from_binary(), + custom_themes: None + } + } + + pub fn custom_themes_from_folder( + &mut self, + path: impl AsRef + ) -> Result<(), LoadingError> { + let path = nu_path::expand_to_real_path(path); + self.custom_themes = Some(ThemeSet::load_from_folder(path)?); + Ok(()) + } + + /// Lists all the available themes. + pub fn list_themes(&self, user_default: Option<&str>) -> ListThemes { + let ha = &self.highlighting_assets; + let default_theme_id = user_default.unwrap_or(HighlightingAssets::default_theme()); + + let mut themes: Vec<_> = ha + .themes() + .map(|t_id| { + let theme = ha.get_theme(t_id); + ThemeDescription { + id: t_id.to_owned(), + name: theme.name.clone(), + author: theme.author.clone(), + default: default_theme_id == t_id + } + }) + .collect(); + + if let Some(custom_themes) = self.custom_themes.as_ref() { + for (id, theme) in custom_themes.themes.iter() { + themes.push(ThemeDescription { + id: id.to_owned(), + name: theme.name.clone(), + author: theme.author.clone(), + default: default_theme_id == id + }); + } + } + + ListThemes(themes) + } + + /// Checks if a given theme id is valid. + pub fn is_valid_theme(&self, theme_name: &str) -> bool { + let ha = &self.highlighting_assets; + let custom_themes = self + .custom_themes + .as_ref() + .map(|themes| themes.themes.keys()) + .unwrap_or_default() + .map(Deref::deref); + custom_themes.chain(ha.themes()).any(|t| t == theme_name) + } + + /// Highlights the given input text based on the provided language and + /// theme. + pub fn highlight( + &self, + input: &str, + language: Option<&str>, + theme: Option<&str>, + true_colors: bool + ) -> String { + let syntax_set = &self.syntax_set; + let syntax_ref: Option<&SyntaxReference> = match language { + Some(language) if !language.is_empty() => { + // allow multiple variants to write the language + let language_lowercase = language.to_lowercase(); + let language_capitalized = { + let mut chars = language.chars(); + let mut out = String::with_capacity(language.len()); + chars + .next() + .expect("language not empty") + .to_uppercase() + .for_each(|c| out.push(c)); + chars.for_each(|c| out.push(c)); + out + }; + + syntax_set + .find_syntax_by_name(language) + .or_else(|| syntax_set.find_syntax_by_name(&language_lowercase)) + .or_else(|| syntax_set.find_syntax_by_name(&language_capitalized)) + .or_else(|| syntax_set.find_syntax_by_extension(language)) + .or_else(|| syntax_set.find_syntax_by_extension(&language_lowercase)) + .or_else(|| syntax_set.find_syntax_by_extension(&language_capitalized)) + } + _ => None + }; + let syntax_ref = syntax_ref + .or(syntax_set.find_syntax_by_first_line(input)) + .unwrap_or(syntax_set.find_syntax_plain_text()); + + let theme_id = match theme { + None => HighlightingAssets::default_theme(), + Some(theme) => theme + }; + let theme = self + .custom_themes + .as_ref() + .map(|themes| themes.themes.get(theme_id)) + .flatten(); + let theme = theme.unwrap_or_else(|| self.highlighting_assets.get_theme(theme_id)); + + let mut highlighter = HighlightLines::new(syntax_ref, theme); + let line_count = input.lines().count(); + input + .lines() + .enumerate() + .map(|(i, l)| { + // insert a newline in between lines, this is necessary for bats syntax set + let l = match i == line_count - 1 { + false => format!("{}\n", l.trim_end()), + true => l.trim_end().to_owned() + }; + + let styled_lines = highlighter.highlight_line(&l, &syntax_set).unwrap(); + styled_lines + .iter() + .map(|(style, s)| { + terminal::as_terminal_escaped(*style, s, true_colors, true, false, None) + }) + .collect::() + }) + .collect::() + } +} diff --git a/nu_plugin_highlight/src/main.rs b/nu_plugin_highlight/src/main.rs new file mode 100644 index 0000000..23ceb14 --- /dev/null +++ b/nu_plugin_highlight/src/main.rs @@ -0,0 +1,12 @@ +use nu_plugin::{serve_plugin, MsgPackSerializer}; +use plugin::HighlightPlugin; + +mod highlight; +mod plugin; +mod terminal; +mod theme; + +/// The main function that serves the plugin using MsgPackSerializer. +fn main() { + serve_plugin(&HighlightPlugin, MsgPackSerializer); +} diff --git a/nu_plugin_highlight/src/plugin.rs b/nu_plugin_highlight/src/plugin.rs new file mode 100644 index 0000000..9e41395 --- /dev/null +++ b/nu_plugin_highlight/src/plugin.rs @@ -0,0 +1,249 @@ +use std::path::PathBuf; +use std::str::FromStr; + +use mime_guess::Mime; +use nu_plugin::{EngineInterface, EvaluatedCall, Plugin, PluginCommand}; +use nu_protocol::shell_error::io::IoError; +use nu_protocol::{ + Category, DataSource, ErrorLabel, Example, FromValue, IntoValue, LabeledError, PipelineData, + PipelineMetadata, ShellError, Signature, Span, Spanned, SyntaxShape, Type, Value +}; +use syntect::LoadingError; + +use crate::highlight::Highlighter; + +/// The struct that handles the plugin itself. +pub struct HighlightPlugin; + +impl Plugin for HighlightPlugin { + fn commands(&self) -> Vec>> { + vec![Box::new(Highlight)] + } + + fn version(&self) -> String { + env!("CARGO_PKG_VERSION").into() + } +} + +#[derive(Debug, FromValue, Default)] +struct Config { + pub theme: Option>, + pub true_colors: Option, + pub custom_themes: Option> +} + +struct Highlight; + +impl PluginCommand for Highlight { + type Plugin = HighlightPlugin; + + fn name(&self) -> &str { + "highlight" + } + + fn signature(&self) -> Signature { + Signature::build(PluginCommand::name(self)) + .optional( + "language", + SyntaxShape::String, + "language or file extension to help language detection" + ) + .named( + "theme", + SyntaxShape::String, + "them used for highlighting", + Some('t') + ) + .switch("list-themes", "list all possible themes", None) + .category(Category::Strings) + .input_output_type(Type::String, Type::String) + .input_output_type( + Type::Any, + Type::Table( + vec![ + (String::from("id"), Type::String), + (String::from("name"), Type::String), + (String::from("author"), Type::String), + (String::from("default"), Type::Bool), + ] + .into() + ) + ) + } + + fn description(&self) -> &str { + "Syntax highlight source code." + } + + fn run( + &self, + _plugin: &Self::Plugin, + engine: &EngineInterface, + call: &EvaluatedCall, + input: PipelineData + ) -> Result { + let mut highlighter = Highlighter::new(); + + let config = Option::::from_value(engine.get_plugin_config()?.unwrap_or_default())? + .unwrap_or_default(); + + if let Some(custom_themes_path) = config.custom_themes { + match highlighter.custom_themes_from_folder(&custom_themes_path.item) { + Ok(_) => (), + Err(LoadingError::Io(err)) => { + return Err(LabeledError::from(ShellError::from( + IoError::new_with_additional_context( + err, + custom_themes_path.span, + custom_themes_path.item, + "Error while loading custom themes" + ) + ))) + } + Err(err) => { + return Err(labeled_error( + err, + "Error while loading custom themes", + custom_themes_path.span, + None + )) + } + } + } + + let theme = call + .get_flag_value("theme") + .map(Spanned::::from_value) + .transpose()? + .or(config.theme); + if let Some(theme) = &theme { + if !highlighter.is_valid_theme(&theme.item) { + return Err(labeled_error( + "use `highlight --list-themes` to list all themes", + format!("Unknown passed theme {:?}", &theme.item), + theme.span, + None + )); + } + } + let theme = theme.map(|spanned| spanned.item); + let theme = theme.as_deref(); + + let true_colors = config.true_colors.unwrap_or(true); + + if call.has_flag("list-themes")? { + let themes = highlighter.list_themes(theme).into_value(call.head); + return Ok(PipelineData::Value(themes, None)); + } + + let metadata = input.metadata(); + let input = input.into_value(call.head)?; + let Spanned { item: input, span } = Spanned::::from_value(input)?; + + let language = language_hint(call, metadata.as_ref())?; + let highlighted = highlighter.highlight(&input, language.as_deref(), theme, true_colors); + let highlighted = Value::string(highlighted, span); + Ok(PipelineData::Value(highlighted, metadata)) + } + + fn search_terms(&self) -> Vec<&str> { + vec!["syntax", "highlight", "highlighting"] + } + + fn examples(&self) -> Vec { + const fn example<'e>(description: &'e str, example: &'e str) -> Example<'e> + where + 'e: 'static + { + Example { + example, + description, + result: None + } + } + + vec![ + example( + "Highlight a Markdown file by guessing the type from the pipeline metadata", + "open README.md | highlight" + ), + example( + "Highlight a toml file by its file extension", + "open Cargo.toml -r | echo $in | highlight toml" + ), + example( + "Highlight a rust file by programming language", + "open src/main.rs | echo $in | highlight Rust" + ), + example( + "Highlight a bash script by inferring the language (needs shebang)", + "open example.sh | echo $in | highlight" + ), + example( + "Highlight a toml file with another theme", + "open Cargo.toml -r | highlight -t ansi" + ), + example("List all available themes", "highlight --list-themes"), + ] + } +} + +fn language_hint( + call: &EvaluatedCall, + metadata: Option<&PipelineMetadata> +) -> Result, ShellError> { + // first use passed argument + let arg = call.opt(0)?.map(String::from_value).transpose()?; + + // then try to parse a mime type + let content_type = || -> Option { + let metadata = metadata?; + let content_type = metadata.content_type.as_ref(); + let content_type = content_type?.as_str(); + let content_type = Mime::from_str(content_type).ok()?; + let sub_type = content_type.subtype().to_string(); + match sub_type.as_str() { + "tab-separated-values" => Some("tsv".to_string()), + "x-toml" => Some("toml".to_string()), + "x-nuscript" | "x-nushell" | "x-nuon" => Some("nushell".to_string()), + s if s.starts_with("x-") => None, // we cannot be sure about this type, + _ => Some(sub_type) + } + }; + + // as last resort, try to use the extension of data source + let data_source = || -> Option { + let data_source = &metadata?.data_source; + let DataSource::FilePath(path) = data_source + else { + return None; + }; + let extension = path.extension()?.to_string_lossy(); + Some(extension.to_string()) + }; + + Ok(arg.or_else(content_type).or_else(data_source)) +} + +/// Simple constructor for [`LabeledError`]. +fn labeled_error( + msg: impl ToString, + label: impl ToString, + span: Span, + inner: impl Into> +) -> LabeledError { + LabeledError { + msg: msg.to_string(), + labels: Box::new(vec![ErrorLabel { + text: label.to_string(), + span + }]), + code: None, + url: None, + help: None, + inner: match inner.into() { + Some(inner) => Box::new(vec![inner.into()]), + None => Box::new(vec![]) + } + } +} diff --git a/nu_plugin_highlight/src/terminal.rs b/nu_plugin_highlight/src/terminal.rs new file mode 100644 index 0000000..a21f3e2 --- /dev/null +++ b/nu_plugin_highlight/src/terminal.rs @@ -0,0 +1,87 @@ +// pulled from: +// https://github.com/sharkdp/bat/blob/8676bbf97f2832ad2231e102ca9c9b7b72267fda/src/terminal.rs +// applied patch to 64-67 to fix default update construction +#![cfg_attr(rustfmt, rustfmt_skip)] + +use nu_ansi_term::Color::{self, Fixed, Rgb}; +use nu_ansi_term::{self, Style}; + +use syntect::highlighting::{self, FontStyle}; + +pub fn to_ansi_color(color: highlighting::Color, true_color: bool) -> Option { + if color.a == 0 { + // Themes can specify one of the user-configurable terminal colors by + // encoding them as #RRGGBBAA with AA set to 00 (transparent) and RR set + // to the 8-bit color palette number. The built-in themes ansi, base16, + // and base16-256 use this. + Some(match color.r { + // For the first 8 colors, use the Color enum to produce ANSI escape + // sequences using codes 30-37 (foreground) and 40-47 (background). + // For example, red foreground is \x1b[31m. This works on terminals + // without 256-color support. + 0x00 => Color::Black, + 0x01 => Color::Red, + 0x02 => Color::Green, + 0x03 => Color::Yellow, + 0x04 => Color::Blue, + 0x05 => Color::Purple, + 0x06 => Color::Cyan, + 0x07 => Color::White, + // For all other colors, use Fixed to produce escape sequences using + // codes 38;5 (foreground) and 48;5 (background). For example, + // bright red foreground is \x1b[38;5;9m. This only works on + // terminals with 256-color support. + // + // TODO: When ansi_term adds support for bright variants using codes + // 90-97 (foreground) and 100-107 (background), we should use those + // for values 0x08 to 0x0f and only use Fixed for 0x10 to 0xff. + n => Fixed(n), + }) + } else if color.a == 1 { + // Themes can specify the terminal's default foreground/background color + // (i.e. no escape sequence) using the encoding #RRGGBBAA with AA set to + // 01. The built-in theme ansi uses this. + None + } else if true_color { + Some(Rgb(color.r, color.g, color.b)) + } else { + Some(Fixed(ansi_colours::ansi256_from_rgb(( + color.r, color.g, color.b, + )))) + } +} + +pub fn as_terminal_escaped( + style: highlighting::Style, + text: &str, + true_color: bool, + colored: bool, + italics: bool, + background_color: Option, +) -> String { + if text.is_empty() { + return text.to_string(); + } + + let mut style = if !colored { + Style::default() + } else { + let mut color = Style { + foreground: to_ansi_color(style.foreground, true_color), + ..Default::default() + }; + if style.font_style.contains(FontStyle::BOLD) { + color = color.bold(); + } + if style.font_style.contains(FontStyle::UNDERLINE) { + color = color.underline(); + } + if italics && style.font_style.contains(FontStyle::ITALIC) { + color = color.italic(); + } + color + }; + + style.background = background_color.and_then(|c| to_ansi_color(c, true_color)); + style.paint(text).to_string() +} diff --git a/nu_plugin_highlight/src/theme.rs b/nu_plugin_highlight/src/theme.rs new file mode 100644 index 0000000..8e854bc --- /dev/null +++ b/nu_plugin_highlight/src/theme.rs @@ -0,0 +1,20 @@ +use nu_protocol::{IntoValue, Span, Value}; + +/// Description of a theme. +#[derive(Debug, IntoValue)] +pub struct ThemeDescription { + pub id: String, + pub name: Option, + pub author: Option, + pub default: bool +} + +/// List of theme descriptions. +#[derive(Debug)] +pub struct ListThemes(pub Vec); + +impl IntoValue for ListThemes { + fn into_value(self, span: Span) -> Value { + self.0.into_value(span) + } +} diff --git a/nu_plugin_highlight/syntaxes/nushell/Example-LSP.sublime-settings b/nu_plugin_highlight/syntaxes/nushell/Example-LSP.sublime-settings new file mode 100644 index 0000000..f419be9 --- /dev/null +++ b/nu_plugin_highlight/syntaxes/nushell/Example-LSP.sublime-settings @@ -0,0 +1,13 @@ +{ + "clients": { + "nushell": { + "command": [ + "/home/kira/.cargo/bin/nu", + "--lsp", + "--no-config-file" + ], + "enabled": true, + "selector": "source.nu" + } + } +} diff --git a/nu_plugin_highlight/syntaxes/nushell/LICENSE b/nu_plugin_highlight/syntaxes/nushell/LICENSE new file mode 100644 index 0000000..a9f03a8 --- /dev/null +++ b/nu_plugin_highlight/syntaxes/nushell/LICENSE @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) 2023 kurokirasama + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/nu_plugin_highlight/syntaxes/nushell/README.md b/nu_plugin_highlight/syntaxes/nushell/README.md new file mode 100644 index 0000000..ca8cc4a --- /dev/null +++ b/nu_plugin_highlight/syntaxes/nushell/README.md @@ -0,0 +1,24 @@ +# Nushell syntax highlight for sublime text +- Just copied matlab syntax file and modified it for nushell +- Use nushell lsp language server (need lsp sublime package) + +## Installation +1. In sublime text install the LSP package. +2. After cloning and cd-ing into the directory, in nushell run (tested in Ubuntu 20.04): +```nu +ls +| find -v README & export & color +| get name +| ansi strip +| each {|file| + cp -f $file (~/.config/sublime-text/Packages/User | path expand) + } +``` +3. In sublime, open `Preferences > Customize Color Scheme` and add the contents of `sublime-color-scheme`. Modify to your liking. + +## Update commands +If you need to update nushell functions or add your custom commands and aliases, run: +```nu +chmod +x export.nu +./export.nu +``` diff --git a/nu_plugin_highlight/syntaxes/nushell/export.nu b/nu_plugin_highlight/syntaxes/nushell/export.nu new file mode 100644 index 0000000..b02e93c --- /dev/null +++ b/nu_plugin_highlight/syntaxes/nushell/export.nu @@ -0,0 +1,58 @@ +#update nushell sublime syntax +export def "nushell-syntax-2-sublime" [] { + let builtin = filter-command built-in + let plugins = filter-command plugin + let custom = filter-command custom + let keywords = filter-command keyword + + let aliases = ( + scope aliases + | get name + | uniq + | str join " | " + ) + + let personal_external = ( + $env.PATH + | find bash & nushell + | get 0 + | ansi strip + | ls $in + | find -v Readme + | get name + | path parse + | get stem + | str join " | " + ) + + let extra_keywords = " | else | catch" + let builtin = " (?x: " + $builtin + ")" + let plugins = " (?x: " + $plugins + ")" + let custom = " (?x: " + $custom + ")" + let keywords = " (?x: " + $keywords + $extra_keywords + ")" + let aliases = " (?x: " + $aliases + ")" + let personal_external = " (?x: " + $personal_external + ")" + let operators = " (?x: and | or | mod | in | not-in | not | xor | bit-or | bit-xor | bit-and | bit-shl | bit-shr | starts-with | ends-with)" + + let new_commands = [] ++ $builtin ++ $custom ++ $plugins ++ $keywords ++ $aliases ++ $personal_external ++ $operators + + mut file = open ~/.config/sublime-text/Packages/User/nushell.sublime-syntax | lines + let idx = $file | indexify | find '(?x:' | get index | drop | enumerate + + for i in $idx { + $file = ($file | upsert $i.item ($new_commands | get $i.index)) + } + + $file | save -f ~/.config/sublime-text/Packages/User/nushell.sublime-syntax +} + +#add a hidden column with the content of the # column +export def indexify [ + column_name?: string = 'index' + ] { + enumerate + | upsert $column_name {|el| + $el.index + } + | flatten +} \ No newline at end of file diff --git a/nu_plugin_highlight/syntaxes/nushell/nuComments.tmPreferences b/nu_plugin_highlight/syntaxes/nushell/nuComments.tmPreferences new file mode 100644 index 0000000..960cb4c --- /dev/null +++ b/nu_plugin_highlight/syntaxes/nushell/nuComments.tmPreferences @@ -0,0 +1,33 @@ + + + + scope + source.nu + settings + + shellVariables + + + name + TM_COMMENT_START + value + # + + + name + TM_COMMENT_START_2 + value + + + + + name + TM_COMMENT_END_2 + value + + + + + + + diff --git a/nu_plugin_highlight/syntaxes/nushell/nushell.sublime-settings b/nu_plugin_highlight/syntaxes/nushell/nushell.sublime-settings new file mode 100644 index 0000000..666d8db --- /dev/null +++ b/nu_plugin_highlight/syntaxes/nushell/nushell.sublime-settings @@ -0,0 +1,6 @@ +{ + "extensions": + [ + "nu", + ], +} diff --git a/nu_plugin_highlight/syntaxes/nushell/nushell.sublime-syntax b/nu_plugin_highlight/syntaxes/nushell/nushell.sublime-syntax new file mode 100644 index 0000000..b164bbf --- /dev/null +++ b/nu_plugin_highlight/syntaxes/nushell/nushell.sublime-syntax @@ -0,0 +1,1256 @@ +%YAML 1.2 +--- +# https://www.sublimetext.com/docs/syntax.html +# https://www.https://www.nushell.sh/book/ +name: nushell +scope: source.nu +version: 2 + +file_extensions: + - nu + +first_line_match: |- + (?xi: + ^ \s* \%+ .*? -\*- .*? \bnu\b .*? -\*- # editorconfig + ) + +variables: + # ? + identifier: (?:[A-Za-z]\w*) + filename: (?:[^;,(\s]+) + eol: (?=\s*[%\n]) + + # https://www.nushell.sh/book/command_reference.html#command-reference + nushell_functions: |- + (?x: all | ansi | any | append | ast | bits | bytes | cd | char | chunks | clear | collect | columns | commandline | compact | complete | config | cp | date | debug | decode | default | describe | detect | do | drop | du | each | echo | encode | enumerate | error | every | exec | exit | explain | explore | fill | filter | find | first | flatten | fmt | format | from | generate | get | glob | grid | group-by | hash | headers | help | hide-env | histogram | history | http | ignore | input | insert | inspect | interleave | into | is-admin | is-empty | is-not-empty | is-terminal | items | join | keybindings | kill | last | length | let-env | lines | load-env | ls | math | merge | metadata | mkdir | mktemp | move | mv | nu-check | nu-highlight | open | overlay | panic | par-each | parse | path | plugin | port | prepend | print | ps | query | random | range | reduce | reject | rename | reverse | rm | roll | rotate | run-external | save | schema | scope | select | seq | shuffle | skip | sleep | sort | sort-by | split | split-by | start | stor | str | sys | table | take | tee | term | timeit | to | touch | transpose | tutor | ulimit | uname | uniq | update | upsert | url | values | version | view | watch | which | whoami | window | with-env | wrap | zip) + + custom_functions: |- + (?x: 7z | ? | _atuin_search_cmd | activate | adbtasker | add-preamble | ai | ansi-strip-table | apps-update | askai | askdalle | askpdf | autolister | autouse-file | balena | banner | bar | base2dec | batstat | bhe-update | bitly | cblue | cd-pipe | chat_gpt | chatpdf | check-link | claude_ai | clean-analytics | clone-ubuntu-install | code | column | column2 | const-table | copy-downloads-2-ubbdrive | copy-research-2-ubbdrive | copy-scripts-and-commit | copy-webies-2-ubbdrive | copy-yandex-and-commit | coretemp | countdown | cp-pipe | cpwd | create_left_prompt | create_right_prompt | dall_e | date | debunk-table | dec2base | default-table | dpx | echo-c | echo-g | echo-r | exchange_rates | export-nushell-docs | find-file | find-index | fix-docker | fix-green-dirs | format-mails | fuzzy-dispatcher | fuzzy-select-fs | gcal | get-aliases | get-devices | get-dirs | get-env | get-files | get-github-latest | get-input | get-ips | get-keybindings | get-miss-chapters | get-monitors | get-pass | get-phone-number | get-rows | get-vers | get_weather_by_interval | gg | gg-trans | github-app-update | gmail | gnome-settings | gnu-plot | google_ai | google_search | goto-nuconfigdir | grep-nu | group-list | guake | h | habitica | history | history-stats | http | indexify | install-font | intersect | into | is-column | is-in | is-mounted | iselect | isleap | jd | jdown | join-text-files | killn | le | left_prompt | lg | libreoff | list-diff | list-sum | listen-ports | lister | lists2table | ln | lo | ls-ports | lt | m | maps | math | matlab-cli | mcx | med_discord | media | mk-anime | mkcd | monitor | mpv | multiwhere | mv-anime | mv-manga | mv-pipe | mv-torrents | my-pandoc | my-pdflatex | nchat | nerd-fonts-clean | network-switcher | nu-crypt | nu-sloc | nufetch | nushell-syntax-2-sublime | o_llama | obs | op | open-analytics | open-credential | open-link | openf | openl | openm | patch-font | pdf | pip3-upgrade | pivot-table | plot-table | png-plot | print-file | progress_bar | ps | psn | pwd | pwd-short | qrenc | quick-ubuntu-and-tools-update-module | ram | rand-select | randi | random | range2list | rclone | re-enamerate | rebrandly | rename-all | rename-date | rename-file | replicate-tree | reset-alpine-auth | return-error | rm-empty-dirs | rm-pipe | rml | rmount | save-credential | scale-minmax | scale-minmax-table | scompact | send-gmail | set-env | set-screen | setdiff | show-ips | show_banner | speedtest-plot | ssh-sin-pass | ssh-termux | ssh-to | std | stop-net-apps | str | subl | sum-size | supgrade | svg2pdf | sys | t | table-diff | table2record | tasker | tasker-join | to-conversiones | to-onedrive | tokei | token2word | trans | tts | typeof | ubb | ubb_announce | um | umall | union | uniq-by | unset-env | up2ubb | update-nu-config | upload-debs-to-gdrive | usage | ver | verify | weather | wget-all | which-cd | wifi-info | wifi-pass | xls2csv | ydx | yt-api | ytcli | ytm | z | zi) + + plugin_functions: |- + (?x: from | gstat | highlight | hist | inc | plot | polars | port | query | to | xyplot) + + nushell_keywords: |- + (?x: alias | break | const | continue | def | export | export-env | extern | for | hide | if | let | loop | match | module | mut | overlay | plugin | return | source | source-env | try | use | where | while | else | catch) + + nushell_aliases: |- + (?x: R | apagar | append-table | bard | bat | btop | cable-ubb | cal | copy | cputemp | ds | dsitcl | finished | g | get-mac | get-wg | grp | math mean | math std | max-vol | mcv | mount-ssd4 | mpydf | mute | ncdu | netspeed | nu-clean | open-config | paste | png | print-list | quantum | reiniciar | s | takephoto | to matlab-matrix | trc | tree | unmute | wsp) + + nushell_personal: |- + (?x: speedtest | myffmpeg | imgcat | subtitles-renamer) + + nushell_operators: |- + (?x: and | or | mod | in | not-in | not | xor | bit-or | bit-xor | bit-and | bit-shl | bit-shr | starts-with | ends-with) + + boolean_operators: |- + (?x: true | false) + +################################################################################ + +contexts: + + main: + - include: function-declarations + - include: class-declarations + - include: keywords + - include: expressions + + expressions: + - include: comments + - include: line-continuations + - include: parens + - include: brackets + - include: braces + - include: numbers + - include: strings + - include: operators + - include: accessor-dots + - include: terminators + - include: separator-commas + - include: builtin-packages + - include: structures + - include: builtin-constants + - include: builtin-variables + - include: transposed-variables + - include: variable-assignments + - include: builtin-types + - include: builtin-commands + - include: builtin-functions + - include: custom-functions + - include: plugin-functions + - include: nushell-keywords + - include: nushell-aliases + - include: nushell-personal + - include: nushell-operators + - include: boolean-operators + - include: variables + - include: invalid-variables + + eol-pop: + - match: '{{eol}}' + pop: 1 + + else-pop: + - match: (?=\S) + pop: 1 + +###[ COMMENTS AND LINE CONTINUATION ]########################################### + + comments: + - include: block-comments + - include: line-comments + + block-comments: + - match: ^\s*(#\{)\s*\n + captures: + 1: punctuation.definition.comment.nu + push: block-comment-content + + block-comment-content: + - meta_scope: comment.block.percentage.nu + - match: ^\s*(#)\s*$\n? + captures: + 1: punctuation.definition.comment.nu + pop: 1 + - include: block-comments + + line-comments: + - match: (#+).*\n? + scope: comment.line.percentage.nu + captures: + 1: punctuation.definition.comment.nu + + # line-continuations: + # - match: (\.{3})\s*(\S.*\n?)? + # captures: + # 1: punctuation.separator.continuation.line.nu + # 2: comment.line.nu + +###[ LANGUAGE FUNDAMENTALS ]#################################################### + + numbers: #? + - match: \b(0[xX])(\h+)(u8|u16|u32|u64|s8|s16|s32|s64)?\b + scope: meta.number.integer.hexadecimal.nu + captures: + 1: constant.numeric.base.nu + 2: constant.numeric.value.nu + 3: constant.numeric.suffix.nu + push: maybe-transpose + - match: \b(0[bB])([01]+)(u8|u16|u32|u64|s8|s16|s32|s64)?\b + scope: meta.number.integer.binary.nu + captures: + 1: constant.numeric.base.nu + 2: constant.numeric.value.nu + 3: constant.numeric.suffix.nu + push: maybe-transpose + - match: ((?:\d+(\.)\d*|(\.)?\d+)(?:[Ee][-+]?\d+)?)(i|j)\b + scope: meta.number.imaginary.decimal.nu + captures: + 1: constant.numeric.value.nu + 2: punctuation.separator.decimal.nu + 3: punctuation.separator.decimal.nu + 4: constant.numeric.suffix.nu + push: maybe-transpose + - match: (?:\d+(\.)\d*|(\.)?\d+)(?:[Ee][-+]?\d+)?(?!\w) + scope: meta.number.float.decimal.nu constant.numeric.value.nu + captures: + 1: punctuation.separator.decimal.nu + 2: punctuation.separator.decimal.nu + push: maybe-transpose + + strings: + - match: \' + scope: punctuation.definition.string.begin.nu + push: single-quoted-string + - match: \" + scope: punctuation.definition.string.begin.nu + push: double-quoted-string + + single-quoted-string: + - meta_include_prototype: false + - meta_scope: meta.string.nu string.quoted.single.nu + - match: \'\' + scope: constant.character.escape.nu + - match: \' + scope: punctuation.definition.string.end.nu + set: maybe-dot-transpose + - match: $\n? + scope: invalid.illegal.unclosed-string.nu + pop: 1 + - include: escaped-characters + - include: format-specs + + double-quoted-string: + - meta_include_prototype: false + - meta_scope: meta.string.nu string.quoted.double.nu + - match: \"\" + scope: constant.character.escape.nu + - match: \" + scope: punctuation.definition.string.end.nu + set: maybe-transpose + - match: $\n? + scope: invalid.illegal.unclosed-string.nu + pop: 1 + - include: escaped-characters + - include: format-specs + + escaped-characters: + - match: \%\%|\\\\|\\[abfnrtv] + scope: constant.character.escape.nu + + format-specs: + - match: \%(?:\d\$)?[-+\s0#]?(?:\d+|\*)?(?:\.\d+|\.\*)?(?:[cdeEfgGis]|[bt]?[ouxX]) + scope: constant.other.placeholder.nu + + variables: + - match: \b{{identifier}} + scope: variable.other.nu + + transposed-variables: + - match: \b({{identifier}})(?:\s*(\.\')|(\')) + captures: + 1: variable.other.nu + 2: keyword.operator.transpose.nu + 3: keyword.operator.transpose.nu + + variable-assignments: + - match: \b({{identifier}})\s*(=)(?!=) + captures: + 1: variable.other.nu + 2: keyword.operator.assignment.nu + + structures: + - match: \b({{identifier}})(\.)(?={{identifier}}) + captures: + 1: variable.other.nu + 2: punctuation.accessor.dot.nu + push: structure-fields + + structure-fields: + - match: ({{identifier}})(\.)(?={{identifier}}) + captures: + 1: variable.other.member.nu + 2: punctuation.accessor.dot.nu + - match: '{{identifier}}' + scope: variable.other.member.nu + set: maybe-transpose + +###[ PARENS/BRACKETS/BRACES BLOCKS ]############################################ + + parens: + - match: \( + scope: punctuation.section.parens.begin.nu + push: parens-content + + parens-content: + - meta_scope: meta.parens.nu + - match: \) + scope: punctuation.section.parens.end.nu + set: maybe-fields-or-transpose + - include: last-indices + - include: expressions + + maybe-fields-or-transpose: + - match: (\.)({{identifier}}) + captures: + 1: punctuation.accessor.dot.nu + 2: variable.other.member.nu + - match: \.(?!['*/\\^]) + scope: punctuation.accessor.dot.nu + pop: 1 + - include: maybe-transpose + + brackets: + - match: \[ + scope: punctuation.section.brackets.begin.nu + push: brackets-content + + brackets-content: + - meta_scope: meta.brackets.nu + - match: \] + scope: punctuation.section.brackets.end.nu + set: maybe-transpose + - include: separator-semicolons + - include: argument-placeholders + - include: expressions + + braces: + - match: \{ + scope: punctuation.section.braces.begin.nu + push: braces-content + + braces-content: + - meta_scope: meta.braces.nu + - match: \} + scope: punctuation.section.braces.end.nu + set: maybe-fields-or-transpose + - include: separator-semicolons + - include: last-indices + - include: expressions + +###[ DECLARATION BLOCKS ]####################################################### + + function-declarations: + - match: \bdef\b + scope: keyword.declaration.function.nu + push: function-declaration-header + + function-declaration-header: + - meta_scope: meta.function.nu + - include: line-continuations + - match: '{{eol}}' + set: maybe-function-arguments-block + - match: ({{identifier}})\s*(=) + captures: + 1: variable.parameter.output.nu + 2: keyword.operator.assignment.nu + - match: \[ + scope: punctuation.section.brackets.begin.nu + push: function-output-parameters-list + # - match: = + # scope: keyword.operator.assignment.nu + - match: (?:(?:set|get)(\.))?{{identifier}} + scope: entity.name.function.nu + captures: + 1: punctuation.accessor.dot.nu + - match: \{ + scope: punctuation.section.parens.begin.nu + push: function-input-parameters-list + + function-output-parameters-list: + - include: line-continuations + - include: eol-pop + - include: separator-commas + - match: \] + scope: punctuation.section.brackets.end.nu + pop: 1 + - match: '{{identifier}}' + scope: variable.parameter.output.nu + + function-input-parameters-list: + - clear_scopes: 1 + - meta_scope: meta.function.parameters.nu + - include: line-continuations + - include: eol-pop + - include: separator-commas + - include: argument-placeholders + - match: \) + scope: punctuation.section.parens.end.nu + pop: 1 + - match: '{{identifier}}' + scope: variable.parameter.input.nu + + maybe-function-arguments-block: + - meta_content_scope: meta.function.nu + - include: comments + - match: \barguments\b + scope: keyword.context.arguments.nu + push: function-arguments-block-header + - match: (?=\S) + set: function-body + + function-arguments-block-header: + - meta_scope: meta.arguments.nu + - match: \[ + scope: punctuation.section.parens.begin.nu + push: function-arguments-block-attributes-list + - match: '{{eol}}' + set: function-arguments-block-content + + function-arguments-block-attributes-list: + - meta_scope: meta.attributes.nu + - include: eol-pop + - match: \] + scope: punctuation.section.parens.end.nu + pop: 1 + - match: \bRepeating\b + scope: variable.parameter.attribute.nu + + function-arguments-block-content: + - meta_scope: meta.arguments.nu + - match: \bend\b + scope: keyword.context.arguments.end.nu + pop: 1 + - match: \b\.\? + scope: keyword.operator.properties.nu + - include: argument-placeholders + - include: builtin-types + - include: expressions + + function-body: + - meta_scope: meta.function.nu + - match: \bend\b + scope: keyword.declaration.function.end.nu + pop: 1 + - include: function-declarations + - include: keywords + - include: expressions + + +###[ KEYWORDS AND FLOW CONTROL BLOCKS ]######################################### + + # https://www.mathworks.com/help/matlab/ref/iskeyword.html + # https://www.mathworks.com/help/matlab/control-flow.html + keywords: + - include: if-blocks + - include: switch-blocks + - include: for-blocks + - include: parfor-blocks + - include: while-blocks + - include: try-blocks + - include: spmd-blocks + # - match: \bbreak\b + # scope: keyword.control.flow.break.nu + # - match: \bcontinue\b + # scope: keyword.control.flow.continue.nu + # - match: \breturn\b + # scope: keyword.control.flow.return.nu + # - match: \bglobal\b + # scope: storage.modifier.global.nu + # - match: \bpersistent\b + # scope: storage.modifier.persistent.nu + + if-blocks: + - match: \bif\b + scope: keyword.control.conditional.if.nu + push: if-block-content + + if-block-content: + - meta_scope: meta.block.if.nu + - match: \belseif\b + scope: keyword.control.conditional.elseif.nu + - match: \belse\b + scope: keyword.control.conditional.else.nu + - match: \bend\b + scope: keyword.control.conditional.end.nu + pop: 1 + - include: keywords + - include: expressions + + # switch-blocks: + # - match: \bswitch\b + # scope: keyword.control.conditional.switch.nu + # push: switch-block-content + + # switch-block-content: + # - meta_scope: meta.block.switch.nu + # - match: \bcase\b + # scope: keyword.control.conditional.case.nu + # - match: \botherwise\b + # scope: keyword.control.conditional.otherwise.nu + # - match: \bend\b + # scope: keyword.control.conditional.end.nu + # pop: 1 + # - include: keywords + # - include: expressions + + for-blocks: + - match: \bfor\b + scope: keyword.control.loop.for.nu + push: for-block-content + + for-block-content: + - meta_scope: meta.block.for.nu + - match: \bend\b + scope: keyword.control.loop.end.nu + pop: 1 + - include: keywords + - include: expressions + + # parfor-blocks: + # - match: \bparfor\b + # scope: keyword.control.loop.parfor.nu + # push: parfor-block-content + + # parfor-block-content: + # - meta_scope: meta.block.parfor.nu + # - match: \bend\b + # scope: keyword.control.loop.end.nu + # pop: 1 + # - include: keywords + # - include: expressions + + # while-blocks: + # - match: \bwhile\b + # scope: keyword.control.loop.while.nu + # push: while-block-content + + # while-block-content: + # - meta_scope: meta.block.while.nu + # - match: \bend\b + # scope: keyword.control.loop.end.nu + # pop: 1 + # - include: keywords + # - include: expressions + + # try-blocks: + # - match: \btry\b + # scope: keyword.control.exception.try.nu + # push: try-block-content + + # try-block-content: + # - meta_scope: meta.block.try.nu + # - match: \bcatch\b + # scope: keyword.control.exception.catch.nu + # - match: \bend\b + # scope: keyword.control.exception.end.nu + # pop: 1 + # - include: keywords + # - include: expressions + + # spmd-blocks: + # - match: \bspmd\b + # scope: keyword.context.spmd.nu + # push: spmd-block-content + + # spmd-block-content: + # - meta_scope: meta.block.spmd.nu + # - match: \bend\b + # scope: keyword.context.spmd.end.nu + # pop: 1 + # - include: keywords + # - include: expressions + +###[ OPERATORS AND PUNCTUATION ]################################################ + + # https://www.mathworks.com/help/matlab/matlab_prog/matlab-operators-and-special-characters.html + operators: + - match: '\+|-|\*|\.\*|/|\./|\\|\.\\|\^|\.\^' + scope: keyword.operator.arithmetic.nu + - match: '==|~=|>=|>|<=|<' + scope: keyword.operator.comparison.nu + - match: '~|&&|&|\|\||\|' + scope: keyword.operator.logical.nu + - match: ':' + scope: keyword.operator.colon.nu + - match: '=' + scope: keyword.operator.assignment.nu + - match: \?(?=[A-Za-z]) + scope: keyword.operator.metaclass.nu + - match: \! + scope: keyword.operator.shell-escape.nu + push: shell-escape-content + - match: \b\@ + scope: punctuation.accessor.at.nu + - match: \@ + scope: keyword.operator.at.nu + push: function-handle + + shell-escape-content: + - meta_content_scope: meta.string.nu string.unquoted.nu + - match: \n + pop: 1 + + function-handle: + - match: \( + scope: punctuation.section.parens.begin.nu + set: anonymous-function-parameters-list + - match: '' + pop: 1 + + anonymous-function-parameters-list: + - meta_scope: meta.function.parameters.nu + - include: line-continuations + - include: eol-pop + - match: '{{identifier}}' + scope: variable.parameter.input.nu + - include: separator-commas + - match: \) + scope: punctuation.section.parens.end.nu + pop: 1 + + maybe-transpose: + - match: (?:\s*(\.\')|(\'))? + captures: + 1: keyword.operator.transpose.nu + 2: keyword.operator.transpose.nu + pop: 1 + + maybe-dot-transpose: + - match: (?:\s*(\.\'))? + captures: + 1: keyword.operator.transpose.nu + pop: 1 + + accessor-dots: + - match: \b\. + scope: punctuation.accessor.dot.nu + + terminators: + - match: \; + scope: punctuation.terminator.nu + + separator-commas: + - match: \, + scope: punctuation.separator.sequence.nu + + separator-semicolons: + - match: \; + scope: punctuation.separator.sequence.nu + +###[ BUILTIN CONSTANTS, VARIABLES AND DATA TYPES ]############################## + + # Functions that return essential constants, usually used without parameters + # builtin-constants: + # - match: \b(true|false|eps|pi|Inf|NaN|NaT|flintmax|intmax|intmin|realmax|realmin|namelengthmax)\b + # scope: constant.language.nu + # push: maybe-transpose + + # builtin-variables: + # - match: \b(ans|nargin|nargout|varargin|varargout)\b + # scope: variable.language.nu + # push: maybe-transpose + + # builtin-types: + # - match: \b(?:categorical|cell|char|complex|double|int8|int16|int32|int64|logical|single|string|struct|table|timeseries|timetable|uint8|uint16|uint32|uint64)\b(?!\() + # scope: storage.type.nu + + # last-indices: + # - match: \bend\b + # scope: variable.language.nu + # push: maybe-transpose + + # argument-placeholders: + # - match: \~(?![A-Za-z]) + # scope: variable.language.anonymous.nu + +###[ BUILTIN COMMANDS AND FUNCTIONS ]########################################### + + # Functions with predefined parameters, mostly used in command syntax form + # builtin-commands: + # # https://www.mathworks.com/help/matlab/ref/axis.html + # - match: \baxis\b + # scope: meta.function-call.nu support.function.builtin.nu + # push: maybe-axis-parameter + # # https://www.mathworks.com/help/matlab/ref/beep.html + # - match: \bbeep\b + # scope: meta.function-call.nu support.function.builtin.nu + # push: maybe-on-off-parameter + # # https://www.mathworks.com/help/matlab/ref/box.html + # - match: \bbox\b + # scope: meta.function-call.nu support.function.builtin.nu + # push: maybe-on-off-parameter + # # https://www.mathworks.com/help/matlab/ref/matlab.graphics.interaction.internal.brush.html + # - match: \bbrush\b + # scope: meta.function-call.nu support.function.builtin.nu + # push: maybe-on-off-parameter + # # https://www.mathworks.com/help/matlab/ref/cla.html + # - match: \bcla\b + # scope: meta.function-call.nu support.function.builtin.nu + # push: maybe-cla-parameter + # # https://www.mathworks.com/help/matlab/ref/clear.html + # - match: \bclear\b + # scope: meta.function-call.nu support.function.builtin.nu + # push: maybe-clear-parameter + # # https://www.mathworks.com/help/matlab/ref/close.html + # - match: \bclose\b + # scope: meta.function-call.nu support.function.builtin.nu + # push: maybe-close-parameter + # # https://www.mathworks.com/help/matlab/ref/diary.html + # - match: \bdiary\b + # scope: meta.function-call.nu support.function.builtin.nu + # push: maybe-on-off-parameter + # # https://www.mathworks.com/help/matlab/ref/drawnow.html + # - match: \bdrawnow\b + # scope: meta.function-call.nu support.function.builtin.nu + # push: maybe-drawnow-parameter + # # https://www.mathworks.com/help/matlab/ref/echo.html + # - match: \becho\b + # scope: meta.function-call.nu support.function.builtin.nu + # push: maybe-echo-parameter + # # https://www.mathworks.com/help/matlab/ref/exist.html + # - match: \bexist\b + # scope: meta.function-call.nu support.function.builtin.nu + # push: maybe-exist-parameter + # # https://www.mathworks.com/help/matlab/ref/exit.html + # # https://www.mathworks.com/help/matlab/ref/quit.html + # - match: \b(?:exit|quit)\b + # scope: meta.function-call.nu support.function.builtin.nu + # push: maybe-exit-parameter + # # https://www.mathworks.com/help/matlab/ref/format.html + # - match: \bformat\b + # scope: meta.function-call.nu support.function.builtin.nu + # push: maybe-format-parameter + # # https://www.mathworks.com/help/matlab/ref/grid.html + # - match: \bgrid\b + # scope: meta.function-call.nu support.function.builtin.nu + # push: maybe-grid-parameter + # # https://www.mathworks.com/help/matlab/ref/hidden.html + # - match: \bhidden\b + # scope: meta.function-call.nu support.function.builtin.nu + # push: maybe-on-off-parameter + # # https://www.mathworks.com/help/matlab/ref/hold.html + # - match: \bhold\b + # scope: meta.function-call.nu support.function.builtin.nu + # push: maybe-hold-parameter + # # https://www.mathworks.com/help/matlab/ref/import.html + # - match: \bimport\b + # scope: meta.function-call.nu support.function.builtin.nu + # push: maybe-import-parameter + # # https://www.mathworks.com/help/matlab/ref/material.html + # - match: \bmaterial\b + # scope: meta.function-call.nu support.function.builtin.nu + # push: maybe-material-parameter + # # https://www.mathworks.com/help/matlab/ref/mkdir.html + # - match: \bmkdir\b + # scope: meta.function-call.nu support.function.builtin.nu + # push: maybe-mkdir-parameter + # # https://www.mathworks.com/help/matlab/ref/more.html + # - match: \bmore\b + # scope: meta.function-call.nu support.function.builtin.nu + # push: maybe-on-off-parameter + # # https://www.mathworks.com/help/matlab/ref/movefile.html + # - match: \bmovefile\b + # scope: meta.function-call.nu support.function.builtin.nu + # push: maybe-movefile-parameter + # # https://www.mathworks.com/help/matlab/ref/opengl.html + # - match: \bopengl\b + # scope: meta.function-call.nu support.function.builtin.nu + # push: maybe-opengl-parameter + # # https://www.mathworks.com/help/matlab/ref/rmdir.html + # - match: \brmdir\b + # scope: meta.function-call.nu support.function.builtin.nu + # push: maybe-rmdir-parameter + # # https://www.mathworks.com/help/matlab/ref/who.html + # # https://www.mathworks.com/help/matlab/ref/whos.html + # - match: \b(?:who|whos)\b + # scope: meta.function-call.nu support.function.builtin.nu + # push: maybe-who-parameter + + # maybe-on-off-parameter: + # - match: (?:on|off)\b + # scope: meta.string.nu support.constant.nu + # pop: 1 + # - include: else-pop + # - include: eol-pop + + # maybe-axis-parameter: + # - match: (?:manual|auto|tight|padded|equal|image|square|fill|vis3d|normal|xy|ij|on|off)\b + # scope: meta.string.nu support.constant.nu + # pop: 1 + # - include: else-pop + # - include: eol-pop + + # maybe-cla-parameter: + # - match: reset\b + # scope: meta.string.nu support.constant.nu + # pop: 1 + # - include: else-pop + # - include: eol-pop + + # maybe-clear-parameter: + # - match: -regexp\b + # scope: meta.string.nu support.constant.nu + # set: regexp-pattern-list + # - match: (?:all|classes|functions|global|import|java|mex|variables)\b + # scope: meta.string.nu support.constant.nu + # pop: 1 + # - include: else-pop + # - include: eol-pop + + # regexp-pattern-list: + # - include: eol-pop + # - match: (?=[;,]) + # pop: 1 + # - match: '[^;,\s]+' + # scope: meta.string.nu string.regexp.nu + + # maybe-close-parameter: + # - match: all\b + # scope: meta.string.nu support.constant.nu + # set: maybe-close-parameter-2 + # - include: else-pop + # - include: eol-pop + + # maybe-close-parameter-2: + # - match: (?:hidden|force)\b + # scope: meta.string.nu support.constant.nu + # pop: 1 + # - include: else-pop + # - include: eol-pop + + # maybe-drawnow-parameter: + # - match: (?:limitrate|nocallbacks|update|expose)\b + # scope: meta.string.nu support.constant.nu + # pop: 1 + # - include: else-pop + # - include: eol-pop + + # maybe-echo-parameter: + # - match: (?:on|off)\b + # scope: meta.string.nu support.constant.nu + # set: maybe-echo-parameter-2 + # - match: '{{filename}}' + # scope: meta.string.nu string.unquoted.nu + # set: maybe-on-off-parameter + # - include: else-pop + # - include: eol-pop + + # maybe-echo-parameter-2: + # - match: all\b + # scope: meta.string.nu support.constant.nu + # pop: 1 + # - include: else-pop + # - include: eol-pop + + # maybe-exist-parameter: + # - match: '{{filename}}' + # scope: meta.string.nu string.unquoted.nu + # set: maybe-exist-parameter-2 + # - include: else-pop + # - include: eol-pop + + # maybe-exist-parameter-2: + # - match: (?:builtin|class|dir|file|var)\b + # scope: meta.string.nu support.constant.nu + # pop: 1 + # - include: else-pop + # - include: eol-pop + + # maybe-exit-parameter: + # - match: (?:cancel|force)\b + # scope: meta.string.nu support.constant.nu + # pop: 1 + # - include: else-pop + # - include: eol-pop + + # maybe-format-parameter: + # - match: (?:short|long|shortE|longE|shortG|longG|shortEng|longEng|bank|hex|rational|compact|loose)\b + # scope: meta.string.nu support.constant.nu + # pop: 1 + # - include: else-pop + # - include: eol-pop + + # maybe-grid-parameter: + # - match: (?:on|off|minor)\b + # scope: meta.string.nu support.constant.nu + # pop: 1 + # - include: else-pop + # - include: eol-pop + + # maybe-hold-parameter: + # - match: (?:on|off|all)\b + # scope: meta.string.nu support.constant.nu + # pop: 1 + # - include: else-pop + # - include: eol-pop + + # maybe-import-parameter: + # - match: (?:\w+\.)*(?:\w+|\*) + # scope: meta.string.nu string.unquoted.nu + # pop: 1 + # - include: else-pop + # - include: eol-pop + + # maybe-material-parameter: + # - match: (?:shiny|dull|metal|default)\b + # scope: meta.string.nu support.constant.nu + # pop: 1 + # - include: else-pop + # - include: eol-pop + + # maybe-mkdir-parameter: + # - match: '{{filename}}' + # scope: meta.string.nu string.unquoted.nu + # set: maybe-mkdir-parameter-2 + # - include: else-pop + # - include: eol-pop + + # maybe-mkdir-parameter-2: + # - match: '{{filename}}' + # scope: meta.string.nu string.unquoted.nu + # pop: 1 + # - include: else-pop + # - include: eol-pop + + # maybe-movefile-parameter: + # - match: '{{filename}}' + # scope: meta.string.nu string.unquoted.nu + # set: maybe-movefile-parameter-2 + # - include: else-pop + # - include: eol-pop + + # maybe-movefile-parameter-2: + # - match: '{{filename}}' + # scope: meta.string.nu string.unquoted.nu + # set: maybe-movefile-parameter-3 + # - include: else-pop + # - include: eol-pop + + # maybe-movefile-parameter-3: + # - match: f\b + # scope: meta.string.nu support.constant.nu + # pop: 1 + # - include: else-pop + # - include: eol-pop + + # maybe-opengl-parameter: + # - match: (?:info|software|hardware|hardwarebasic)\b + # scope: meta.string.nu support.constant.nu + # pop: 1 + # - include: else-pop + # - include: eol-pop + + # maybe-rmdir-parameter: + # - match: '{{filename}}' + # scope: meta.string.nu string.unquoted.nu + # set: maybe-rmdir-parameter-2 + # - include: else-pop + # - include: eol-pop + + # maybe-rmdir-parameter-2: + # - match: s\b + # scope: meta.string.nu support.constant.nu + # pop: 1 + # - include: else-pop + # - include: eol-pop + + # maybe-who-parameter: + # - match: global\b + # scope: meta.string.nu support.constant.nu + # pop: 1 + # - include: else-pop + # - include: eol-pop + + # Parentheses are usually omitted when functions are used without parameters. + # This command syntax is also possible for functions if all parameters are character arrays. + # Only the function names are matched here to allow both command syntax and function syntax form. + # https://www.mathworks.com/help/matlab/matlab_prog/command-vs-function-syntax.html + builtin-functions: + - match: \b{{nushell_functions}}\b + scope: meta.function-call.nu support.function.builtin.nu + + custom-functions: + - match: \b{{custom_functions}}\b + scope: support.function.custom.nu + + plugin-functions: + - match: \b{{plugin_functions}}\b + scope: support.function.plugin.nu + + nushell-keywords: + - match: \b{{nushell_keywords}}\b + scope: support.function.keywords.nu + + nushell-aliases: + - match: \b{{nushell_aliases}}\b + scope: support.function.aliases.nu + + nushell-personal: + - match: \b{{nushell_personal}}\b + scope: support.function.personal.nu + + nushell-operators: + - match: \b{{nushell_operators}}\b + scope: support.function.operators.nu + + boolean-operators: + - match: \b{{boolean_operators}}\b + scope: support.function.boolean.nu + +###[ BUILTIN PACKAGES AND OBJECT FUNCTIONS ]#################################### + + # builtin-packages: + # - match: \bcdflib\b + # scope: support.module.builtin.nu + # push: + # - maybe-cdflib-object-function + # - maybe-accessor-dot + # - match: \bclibgen\b + # scope: support.module.builtin.nu + # push: + # - maybe-clibgen-object-function + # - maybe-accessor-dot + # - match: \bH5\b + # scope: support.module.builtin.nu + # push: + # - maybe-h5-object-function + # - maybe-accessor-dot + # - match: \bH5A\b + # scope: support.module.builtin.nu + # push: + # - maybe-h5a-object-function + # - maybe-accessor-dot + # - match: \bH5DS\b + # scope: support.module.builtin.nu + # push: + # - maybe-h5ds-object-function + # - maybe-accessor-dot + # - match: \bH5E\b + # scope: support.module.builtin.nu + # push: + # - maybe-h5e-object-function + # - maybe-accessor-dot + # - match: \bH5F\b + # scope: support.module.builtin.nu + # push: + # - maybe-h5f-object-function + # - maybe-accessor-dot + # - match: \bH5G\b + # scope: support.module.builtin.nu + # push: + # - maybe-h5g-object-function + # - maybe-accessor-dot + # - match: \bH5I\b + # scope: support.module.builtin.nu + # push: + # - maybe-h5i-object-function + # - maybe-accessor-dot + # - match: \bH5L\b + # scope: support.module.builtin.nu + # push: + # - maybe-h5l-object-function + # - maybe-accessor-dot + # - match: \bH5ML\b + # scope: support.module.builtin.nu + # push: + # - maybe-h5ml-object-function + # - maybe-accessor-dot + # - match: \bH5O\b + # scope: support.module.builtin.nu + # push: + # - maybe-h5o-object-function + # - maybe-accessor-dot + # - match: \bH5P\b + # scope: support.module.builtin.nu + # push: + # - maybe-h5p-object-function + # - maybe-accessor-dot + # - match: \bH5R\b + # scope: support.module.builtin.nu + # push: + # - maybe-h5r-object-function + # - maybe-accessor-dot + # - match: \bH5S\b + # scope: support.module.builtin.nu + # push: + # - maybe-h5s-object-function + # - maybe-accessor-dot + # - match: \bH5T\b + # scope: support.module.builtin.nu + # push: + # - maybe-h5t-object-function + # - maybe-accessor-dot + # - match: \bH5Z\b + # scope: support.module.builtin.nu + # push: + # - maybe-h5z-object-function + # - maybe-accessor-dot + # - match: \bMException\b + # scope: support.module.builtin.nu + # push: + # - maybe-mexception-object-function + # - maybe-accessor-dot + # - match: \bNET\b + # scope: support.module.builtin.nu + # push: + # - maybe-net-object-function + # - maybe-accessor-dot + # - match: \bnetcdf\b + # scope: support.module.builtin.nu + # push: + # - maybe-netcdf-object-function + # - maybe-accessor-dot + # - match: \bRandStream\b + # scope: support.module.builtin.nu + # push: + # - maybe-randstream-object-function + # - maybe-accessor-dot + # - match: \bTiff\b + # scope: support.module.builtin.nu + # push: + # - maybe-tiff-object-function + # - maybe-accessor-dot + + # maybe-accessor-dot: + # - match: \.\' + # scope: keyword.operator.transpose.nu + # pop: 2 + # - match: \.(?!\*|/|\\|\^) + # scope: punctuation.accessor.dot.nu + # pop: 1 + # - match: '' + # pop: 2 + + # maybe-cdflib-object-function: + # - match: '{{cdflib_object_functions}}\b' + # scope: meta.function-call.nu support.function.nu + # pop: 1 + # - match: '{{identifier}}?' + # scope: variable.other.nu + # pop: 1 + + # maybe-clibgen-object-function: + # - match: '{{clibgen_object_functions}}\b' + # scope: meta.function-call.nu support.function.nu + # pop: 1 + # - match: '{{identifier}}?' + # scope: variable.other.nu + # pop: 1 + + # maybe-h5-object-function: + # - match: '{{H5_object_functions}}\b' + # scope: meta.function-call.nu support.function.nu + # pop: 1 + # - match: '{{identifier}}?' + # scope: variable.other.nu + # pop: 1 + + # maybe-h5a-object-function: + # - match: '{{H5A_object_functions}}\b' + # scope: meta.function-call.nu support.function.nu + # pop: 1 + # - match: '{{identifier}}?' + # scope: variable.other.nu + # pop: 1 + + # maybe-h5ds-object-function: + # - match: '{{H5DS_object_functions}}\b' + # scope: meta.function-call.nu support.function.nu + # pop: 1 + # - match: '{{identifier}}?' + # scope: variable.other.nu + # pop: 1 + + # maybe-h5e-object-function: + # - match: '{{H5E_object_functions}}\b' + # scope: meta.function-call.nu support.function.nu + # pop: 1 + # - match: '{{identifier}}?' + # scope: variable.other.nu + # pop: 1 + + # maybe-h5f-object-function: + # - match: '{{H5F_object_functions}}\b' + # scope: meta.function-call.nu support.function.nu + # pop: 1 + # - match: '{{identifier}}?' + # scope: variable.other.nu + # pop: 1 + + # maybe-h5g-object-function: + # - match: '{{H5G_object_functions}}\b' + # scope: meta.function-call.nu support.function.nu + # pop: 1 + # - match: '{{identifier}}?' + # scope: variable.other.nu + # pop: 1 + + # maybe-h5i-object-function: + # - match: '{{H5I_object_functions}}\b' + # scope: meta.function-call.nu support.function.nu + # pop: 1 + # - match: '{{identifier}}?' + # scope: variable.other.nu + # pop: 1 + + # maybe-h5l-object-function: + # - match: '{{H5L_object_functions}}\b' + # scope: meta.function-call.nu support.function.nu + # pop: 1 + # - match: '{{identifier}}?' + # scope: variable.other.nu + # pop: 1 + + # maybe-h5ml-object-function: + # - match: '{{H5ML_object_functions}}\b' + # scope: meta.function-call.nu support.function.nu + # pop: 1 + # - match: '{{identifier}}?' + # scope: variable.other.nu + # pop: 1 + + # maybe-h5o-object-function: + # - match: '{{H5O_object_functions}}\b' + # scope: meta.function-call.nu support.function.nu + # pop: 1 + # - match: '{{identifier}}?' + # scope: variable.other.nu + # pop: 1 + + # maybe-h5p-object-function: + # - match: '{{H5P_object_functions}}\b' + # scope: meta.function-call.nu support.function.nu + # pop: 1 + # - match: '{{identifier}}?' + # scope: variable.other.nu + # pop: 1 + + # maybe-h5r-object-function: + # - match: '{{H5R_object_functions}}\b' + # scope: meta.function-call.nu support.function.nu + # pop: 1 + # - match: '{{identifier}}?' + # scope: variable.other.nu + # pop: 1 + + # maybe-h5s-object-function: + # - match: '{{H5S_object_functions}}\b' + # scope: meta.function-call.nu support.function.nu + # pop: 1 + # - match: '{{identifier}}?' + # scope: variable.other.nu + # pop: 1 + + # maybe-h5t-object-function: + # - match: '{{H5T_object_functions}}\b' + # scope: meta.function-call.nu support.function.nu + # pop: 1 + # - match: '{{identifier}}?' + # scope: variable.other.nu + # pop: 1 + + # maybe-h5z-object-function: + # - match: '{{H5Z_object_functions}}\b' + # scope: meta.function-call.nu support.function.nu + # pop: 1 + # - match: '{{identifier}}?' + # scope: variable.other.nu + # pop: 1 + + # maybe-mexception-object-function: + # - match: last\b + # scope: meta.function-call.nu support.function.nu + # pop: 1 + # - match: '{{identifier}}?' + # scope: variable.other.nu + # pop: 1 + + # maybe-net-object-function: + # - match: '{{NET_object_functions}}\b' + # scope: meta.function-call.nu support.function.nu + # pop: 1 + # - match: '{{identifier}}?' + # scope: variable.other.nu + # pop: 1 + + # maybe-netcdf-object-function: + # - match: '{{netcdf_object_functions}}\b' + # scope: meta.function-call.nu support.function.nu + # pop: 1 + # - match: '{{identifier}}?' + # scope: variable.other.nu + # pop: 1 + + # maybe-randstream-object-function: + # - match: '{{RandStream_object_functions}}\b' + # scope: meta.function-call.nu support.function.nu + # pop: 1 + # - match: '{{identifier}}?' + # scope: variable.other.nu + # pop: 1 + + # maybe-tiff-object-function: + # - match: '{{Tiff_object_functions}}\b' + # scope: meta.function-call.nu support.function.nu + # pop: 1 + # - match: '{{identifier}}?' + # scope: variable.other.nu + # pop: 1 + +###[ INVALID ]################################################################## + + invalid-variables: + # No variables or function names can start with a number or an underscore. + - match: '\b(_\w|\d+[_a-df-zA-DF-Z])\w*\b' + scope: invalid.illegal.invalid-variable-name.nu diff --git a/nu_plugin_highlight/syntaxes/nushell/sublime-color-scheme b/nu_plugin_highlight/syntaxes/nushell/sublime-color-scheme new file mode 100644 index 0000000..7922f0b --- /dev/null +++ b/nu_plugin_highlight/syntaxes/nushell/sublime-color-scheme @@ -0,0 +1,46 @@ +//add this to your theme.sublime-color-scheme +{ + "rules": [ + { + // "scope": "string", + // "foreground": "#00FF00", + }, + + { + "scope": "comment", + "foreground": "#ff0000", + }, + { + "scope": "support.function.builtin.nu", + "foreground": "#BB00FF", + }, + { + "scope": "support.function.custom.nu", + "foreground": "#FF00FF", + }, + { + "scope": "support.function.plugin.nu", + "foreground": "#004CFF", + }, + { + "scope": "support.function.keywords.nu", + "foreground": "#A020F0", + }, + { + "scope": "support.function.aliases.nu", + "foreground": "#D580FF", + }, + { + "scope": "support.function.personal.nu", + "foreground": "#004CFF", + }, + { + "scope": "support.function.operators.nu", + "foreground": "#FFFF00", + }, + { + "scope": "support.function.boolean.nu", + "foreground": "#00FFFF", + } + ], +} \ No newline at end of file diff --git a/nu_plugin_highlight/syntaxes/patches/nushell.sublime-syntax.patch b/nu_plugin_highlight/syntaxes/patches/nushell.sublime-syntax.patch new file mode 100644 index 0000000..7451dab --- /dev/null +++ b/nu_plugin_highlight/syntaxes/patches/nushell.sublime-syntax.patch @@ -0,0 +1,13 @@ +diff --git a/nushell.sublime-syntax b/nushell.sublime-syntax +index b164bbf..c66d6f1 100644 +--- a/nushell.sublime-syntax ++++ b/nushell.sublime-syntax +@@ -25,7 +25,7 @@ variables: + (?x: all | ansi | any | append | ast | bits | bytes | cd | char | chunks | clear | collect | columns | commandline | compact | complete | config | cp | date | debug | decode | default | describe | detect | do | drop | du | each | echo | encode | enumerate | error | every | exec | exit | explain | explore | fill | filter | find | first | flatten | fmt | format | from | generate | get | glob | grid | group-by | hash | headers | help | hide-env | histogram | history | http | ignore | input | insert | inspect | interleave | into | is-admin | is-empty | is-not-empty | is-terminal | items | join | keybindings | kill | last | length | let-env | lines | load-env | ls | math | merge | metadata | mkdir | mktemp | move | mv | nu-check | nu-highlight | open | overlay | panic | par-each | parse | path | plugin | port | prepend | print | ps | query | random | range | reduce | reject | rename | reverse | rm | roll | rotate | run-external | save | schema | scope | select | seq | shuffle | skip | sleep | sort | sort-by | split | split-by | start | stor | str | sys | table | take | tee | term | timeit | to | touch | transpose | tutor | ulimit | uname | uniq | update | upsert | url | values | version | view | watch | which | whoami | window | with-env | wrap | zip) + + custom_functions: |- +- (?x: 7z | ? | _atuin_search_cmd | activate | adbtasker | add-preamble | ai | ansi-strip-table | apps-update | askai | askdalle | askpdf | autolister | autouse-file | balena | banner | bar | base2dec | batstat | bhe-update | bitly | cblue | cd-pipe | chat_gpt | chatpdf | check-link | claude_ai | clean-analytics | clone-ubuntu-install | code | column | column2 | const-table | copy-downloads-2-ubbdrive | copy-research-2-ubbdrive | copy-scripts-and-commit | copy-webies-2-ubbdrive | copy-yandex-and-commit | coretemp | countdown | cp-pipe | cpwd | create_left_prompt | create_right_prompt | dall_e | date | debunk-table | dec2base | default-table | dpx | echo-c | echo-g | echo-r | exchange_rates | export-nushell-docs | find-file | find-index | fix-docker | fix-green-dirs | format-mails | fuzzy-dispatcher | fuzzy-select-fs | gcal | get-aliases | get-devices | get-dirs | get-env | get-files | get-github-latest | get-input | get-ips | get-keybindings | get-miss-chapters | get-monitors | get-pass | get-phone-number | get-rows | get-vers | get_weather_by_interval | gg | gg-trans | github-app-update | gmail | gnome-settings | gnu-plot | google_ai | google_search | goto-nuconfigdir | grep-nu | group-list | guake | h | habitica | history | history-stats | http | indexify | install-font | intersect | into | is-column | is-in | is-mounted | iselect | isleap | jd | jdown | join-text-files | killn | le | left_prompt | lg | libreoff | list-diff | list-sum | listen-ports | lister | lists2table | ln | lo | ls-ports | lt | m | maps | math | matlab-cli | mcx | med_discord | media | mk-anime | mkcd | monitor | mpv | multiwhere | mv-anime | mv-manga | mv-pipe | mv-torrents | my-pandoc | my-pdflatex | nchat | nerd-fonts-clean | network-switcher | nu-crypt | nu-sloc | nufetch | nushell-syntax-2-sublime | o_llama | obs | op | open-analytics | open-credential | open-link | openf | openl | openm | patch-font | pdf | pip3-upgrade | pivot-table | plot-table | png-plot | print-file | progress_bar | ps | psn | pwd | pwd-short | qrenc | quick-ubuntu-and-tools-update-module | ram | rand-select | randi | random | range2list | rclone | re-enamerate | rebrandly | rename-all | rename-date | rename-file | replicate-tree | reset-alpine-auth | return-error | rm-empty-dirs | rm-pipe | rml | rmount | save-credential | scale-minmax | scale-minmax-table | scompact | send-gmail | set-env | set-screen | setdiff | show-ips | show_banner | speedtest-plot | ssh-sin-pass | ssh-termux | ssh-to | std | stop-net-apps | str | subl | sum-size | supgrade | svg2pdf | sys | t | table-diff | table2record | tasker | tasker-join | to-conversiones | to-onedrive | tokei | token2word | trans | tts | typeof | ubb | ubb_announce | um | umall | union | uniq-by | unset-env | up2ubb | update-nu-config | upload-debs-to-gdrive | usage | ver | verify | weather | wget-all | which-cd | wifi-info | wifi-pass | xls2csv | ydx | yt-api | ytcli | ytm | z | zi) ++ (?x: 7z | \? | _atuin_search_cmd | activate | adbtasker | add-preamble | ai | ansi-strip-table | apps-update | askai | askdalle | askpdf | autolister | autouse-file | balena | banner | bar | base2dec | batstat | bhe-update | bitly | cblue | cd-pipe | chat_gpt | chatpdf | check-link | claude_ai | clean-analytics | clone-ubuntu-install | code | column | column2 | const-table | copy-downloads-2-ubbdrive | copy-research-2-ubbdrive | copy-scripts-and-commit | copy-webies-2-ubbdrive | copy-yandex-and-commit | coretemp | countdown | cp-pipe | cpwd | create_left_prompt | create_right_prompt | dall_e | date | debunk-table | dec2base | default-table | dpx | echo-c | echo-g | echo-r | exchange_rates | export-nushell-docs | find-file | find-index | fix-docker | fix-green-dirs | format-mails | fuzzy-dispatcher | fuzzy-select-fs | gcal | get-aliases | get-devices | get-dirs | get-env | get-files | get-github-latest | get-input | get-ips | get-keybindings | get-miss-chapters | get-monitors | get-pass | get-phone-number | get-rows | get-vers | get_weather_by_interval | gg | gg-trans | github-app-update | gmail | gnome-settings | gnu-plot | google_ai | google_search | goto-nuconfigdir | grep-nu | group-list | guake | h | habitica | history | history-stats | http | indexify | install-font | intersect | into | is-column | is-in | is-mounted | iselect | isleap | jd | jdown | join-text-files | killn | le | left_prompt | lg | libreoff | list-diff | list-sum | listen-ports | lister | lists2table | ln | lo | ls-ports | lt | m | maps | math | matlab-cli | mcx | med_discord | media | mk-anime | mkcd | monitor | mpv | multiwhere | mv-anime | mv-manga | mv-pipe | mv-torrents | my-pandoc | my-pdflatex | nchat | nerd-fonts-clean | network-switcher | nu-crypt | nu-sloc | nufetch | nushell-syntax-2-sublime | o_llama | obs | op | open-analytics | open-credential | open-link | openf | openl | openm | patch-font | pdf | pip3-upgrade | pivot-table | plot-table | png-plot | print-file | progress_bar | ps | psn | pwd | pwd-short | qrenc | quick-ubuntu-and-tools-update-module | ram | rand-select | randi | random | range2list | rclone | re-enamerate | rebrandly | rename-all | rename-date | rename-file | replicate-tree | reset-alpine-auth | return-error | rm-empty-dirs | rm-pipe | rml | rmount | save-credential | scale-minmax | scale-minmax-table | scompact | send-gmail | set-env | set-screen | setdiff | show-ips | show_banner | speedtest-plot | ssh-sin-pass | ssh-termux | ssh-to | std | stop-net-apps | str | subl | sum-size | supgrade | svg2pdf | sys | t | table-diff | table2record | tasker | tasker-join | to-conversiones | to-onedrive | tokei | token2word | trans | tts | typeof | ubb | ubb_announce | um | umall | union | uniq-by | unset-env | up2ubb | update-nu-config | upload-debs-to-gdrive | usage | ver | verify | weather | wget-all | which-cd | wifi-info | wifi-pass | xls2csv | ydx | yt-api | ytcli | ytm | z | zi) + + plugin_functions: |- + (?x: from | gstat | highlight | hist | inc | plot | polars | port | query | to | xyplot) diff --git a/nu_plugin_image/.github/workflows/dependency-update.yaml b/nu_plugin_image/.github/workflows/dependency-update.yaml new file mode 100644 index 0000000..95c2d97 --- /dev/null +++ b/nu_plugin_image/.github/workflows/dependency-update.yaml @@ -0,0 +1,49 @@ +on: + workflow_dispatch: + schedule: + - cron: '0 0 */2 * *' + +name: Update dependencies + +jobs: + update: + runs-on: ubuntu-latest + steps: + - name: Setup Nushell + uses: hustcer/setup-nu@main + with: + version: "*" + - uses: actions/checkout@v2 + - name: prepare + shell: nu {0} + run: | + nu -c ' + cargo install cargo-edit cargo-upgrades nu_plugin_inc -f + ' + - name: Update Dependencies + shell: nu {0} + run: | + nu -c ' + register /home/runner/.cargo/bin/nu_plugin_inc + cargo upgrade + let changed = git status -s | is-empty | not $in + if ($changed) { + open Cargo.toml + | upsert package.version ( $in + | get package.version + | inc --patch + ) + | save Cargo.toml -f + + open package.nuon + | upsert version ( open Cargo.toml | get package.version ) + | save package.nuon -f + cargo upgrade + } + + echo { "changed": $changed } + ' + + - uses: EndBug/add-and-commit@v9 + with: + author_name: GitHub-Action diff --git a/nu_plugin_image/.github/workflows/publish.yml b/nu_plugin_image/.github/workflows/publish.yml new file mode 100644 index 0000000..3737a05 --- /dev/null +++ b/nu_plugin_image/.github/workflows/publish.yml @@ -0,0 +1,30 @@ +name: Publish Crate + +on: + push: + branches: + - main + paths: + - Cargo.tom + release: + workflow_dispatch: + + +jobs: + publish: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + + - name: Set up Rust toolchain + uses: actions-rs/toolchain@v1 + with: + toolchain: stable + override: true + + - name: Publish to crates.io + uses: katyo/publish-crates@v2 + with: + registry-token: ${{ secrets.CARGO_REGISTRY_TOKEN }} + env: + CARGO_REGISTRY_TOKEN: ${{ secrets.CARGO_REGISTRY_TOKEN }} \ No newline at end of file diff --git a/nu_plugin_image/.gitignore b/nu_plugin_image/.gitignore new file mode 100644 index 0000000..0843886 --- /dev/null +++ b/nu_plugin_image/.gitignore @@ -0,0 +1,5 @@ +/target +.vscode +*.png +*.ansi +*.tmp diff --git a/nu_plugin_image/.idea/.gitignore b/nu_plugin_image/.idea/.gitignore new file mode 100644 index 0000000..13566b8 --- /dev/null +++ b/nu_plugin_image/.idea/.gitignore @@ -0,0 +1,8 @@ +# Default ignored files +/shelf/ +/workspace.xml +# Editor-based HTTP Client requests +/httpRequests/ +# Datasource local storage ignored files +/dataSources/ +/dataSources.local.xml diff --git a/nu_plugin_image/.idea/modules.xml b/nu_plugin_image/.idea/modules.xml new file mode 100644 index 0000000..7394e8a --- /dev/null +++ b/nu_plugin_image/.idea/modules.xml @@ -0,0 +1,8 @@ + + + + + + + + \ No newline at end of file diff --git a/nu_plugin_image/.idea/nu_plugin_image.iml b/nu_plugin_image/.idea/nu_plugin_image.iml new file mode 100644 index 0000000..cf84ae4 --- /dev/null +++ b/nu_plugin_image/.idea/nu_plugin_image.iml @@ -0,0 +1,11 @@ + + + + + + + + + + + \ No newline at end of file diff --git a/nu_plugin_image/.idea/vcs.xml b/nu_plugin_image/.idea/vcs.xml new file mode 100644 index 0000000..35eb1dd --- /dev/null +++ b/nu_plugin_image/.idea/vcs.xml @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/nu_plugin_image/Cargo.lock b/nu_plugin_image/Cargo.lock new file mode 100644 index 0000000..37ecc3f --- /dev/null +++ b/nu_plugin_image/Cargo.lock @@ -0,0 +1,3324 @@ +# This file is automatically @generated by Cargo. +# It is not intended for manual editing. +version = 4 + +[[package]] +name = "ab_glyph" +version = "0.2.29" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ec3672c180e71eeaaac3a541fbbc5f5ad4def8b747c595ad30d674e43049f7b0" +dependencies = [ + "ab_glyph_rasterizer", + "owned_ttf_parser", +] + +[[package]] +name = "ab_glyph_rasterizer" +version = "0.1.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c71b1793ee61086797f5c80b6efa2b8ffa6d5dd703f118545808a7f2e27f7046" + +[[package]] +name = "adler2" +version = "2.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "320119579fcad9c21884f5c4861d16174d0e06250625266f50fe6898340abefa" + +[[package]] +name = "adler32" +version = "1.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "aae1277d39aeec15cb388266ecc24b11c80469deae6067e17a1a7aa9e5c1f234" + +[[package]] +name = "ahash" +version = "0.8.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5a15f179cd60c4584b8a8c596927aadc462e27f2ca70c04e0071964a73ba7a75" +dependencies = [ + "cfg-if", + "once_cell", + "version_check", + "zerocopy", +] + +[[package]] +name = "aho-corasick" +version = "1.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8e60d3430d3a69478ad0993f19238d2df97c507009a52b3c10addcd7f6bcb916" +dependencies = [ + "memchr", +] + +[[package]] +name = "aligned-vec" +version = "0.6.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dc890384c8602f339876ded803c97ad529f3842aba97f6392b3dba0dd171769b" +dependencies = [ + "equator", +] + +[[package]] +name = "alloc-no-stdlib" +version = "2.0.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cc7bb162ec39d46ab1ca8c77bf72e890535becd1751bb45f64c597edb4c8c6b3" + +[[package]] +name = "alloc-stdlib" +version = "0.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "94fb8275041c72129eb51b7d0322c29b8387a0386127718b096429201a5d6ece" +dependencies = [ + "alloc-no-stdlib", +] + +[[package]] +name = "allocator-api2" +version = "0.2.21" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "683d7910e743518b0e34f1186f92494becacb047c7b6bf616c96772180fef923" + +[[package]] +name = "android-tzdata" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e999941b234f3131b00bc13c22d06e8c5ff726d1b6318ac7eb276997bbb4fef0" + +[[package]] +name = "android_system_properties" +version = "0.1.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "819e7219dbd41043ac279b19830f2efc897156490d7fd6ea916720117ee66311" +dependencies = [ + "libc", +] + +[[package]] +name = "ansi_colours" +version = "1.2.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "14eec43e0298190790f41679fe69ef7a829d2a2ddd78c8c00339e84710e435fe" +dependencies = [ + "rgb", +] + +[[package]] +name = "anstream" +version = "0.6.19" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "301af1932e46185686725e0fad2f8f2aa7da69dd70bf6ecc44d6b703844a3933" +dependencies = [ + "anstyle", + "anstyle-parse", + "anstyle-query", + "anstyle-wincon", + "colorchoice", + "is_terminal_polyfill", + "utf8parse", +] + +[[package]] +name = "anstyle" +version = "1.0.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "862ed96ca487e809f1c8e5a8447f6ee2cf102f846893800b20cebdf541fc6bbd" + +[[package]] +name = "anstyle-parse" +version = "0.2.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4e7644824f0aa2c7b9384579234ef10eb7efb6a0deb83f9630a49594dd9c15c2" +dependencies = [ + "utf8parse", +] + +[[package]] +name = "anstyle-query" +version = "1.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6c8bdeb6047d8983be085bab0ba1472e6dc604e7041dbf6fcd5e71523014fae9" +dependencies = [ + "windows-sys 0.59.0", +] + +[[package]] +name = "anstyle-wincon" +version = "3.0.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "403f75924867bb1033c59fbf0797484329750cfbe3c4325cd33127941fabc882" +dependencies = [ + "anstyle", + "once_cell_polyfill", + "windows-sys 0.59.0", +] + +[[package]] +name = "anyhow" +version = "1.0.98" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e16d2d3311acee920a9eb8d33b8cbc1787ce4a264e85f964c2404b969bdcd487" + +[[package]] +name = "approx" +version = "0.5.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cab112f0a86d568ea0e627cc1d6be74a1e9cd55214684db5561995f6dad897c6" +dependencies = [ + "num-traits", +] + +[[package]] +name = "arbitrary" +version = "1.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dde20b3d026af13f561bdd0f15edf01fc734f0dafcedbaf42bba506a9517f223" + +[[package]] +name = "arg_enum_proc_macro" +version = "0.3.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0ae92a5119aa49cdbcf6b9f893fe4e1d98b04ccbf82ee0584ad948a44a734dea" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "arrayvec" +version = "0.7.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7c02d123df017efcdfbd739ef81735b36c5ba83ec3c59c80a9d7ecc718f92e50" + +[[package]] +name = "autocfg" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c08606f8c3cbf4ce6ec8e28fb0014a2c086708fe954eaa885384a6165172e7e8" + +[[package]] +name = "av1-grain" +version = "0.2.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4f3efb2ca85bc610acfa917b5aaa36f3fcbebed5b3182d7f877b02531c4b80c8" +dependencies = [ + "anyhow", + "arrayvec", + "log", + "nom", + "num-rational", + "v_frame", +] + +[[package]] +name = "avif-serialize" +version = "0.8.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "19135c0c7a60bfee564dbe44ab5ce0557c6bf3884e5291a50be76a15640c4fbd" +dependencies = [ + "arrayvec", +] + +[[package]] +name = "bindgen" +version = "0.70.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f49d8fed880d473ea71efb9bf597651e77201bdd4893efe54c9e5d65ae04ce6f" +dependencies = [ + "bitflags 2.9.1", + "cexpr", + "clang-sys", + "itertools 0.13.0", + "proc-macro2", + "quote", + "regex", + "rustc-hash", + "shlex", + "syn", +] + +[[package]] +name = "bit-set" +version = "0.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "08807e080ed7f9d5433fa9b275196cfc35414f66a0c79d864dc51a0d825231a3" +dependencies = [ + "bit-vec", +] + +[[package]] +name = "bit-vec" +version = "0.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5e764a1d40d510daf35e07be9eb06e75770908c27d411ee6c92109c9840eaaf7" + +[[package]] +name = "bit_field" +version = "0.10.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dc827186963e592360843fb5ba4b973e145841266c1357f7180c43526f2e5b61" + +[[package]] +name = "bitflags" +version = "1.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a" + +[[package]] +name = "bitflags" +version = "2.9.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1b8e56985ec62d17e9c1001dc89c88ecd7dc08e47eba5ec7c29c7b5eeecde967" + +[[package]] +name = "bitstream-io" +version = "2.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6099cdc01846bc367c4e7dd630dc5966dccf36b652fae7a74e17b640411a91b2" + +[[package]] +name = "brotli" +version = "7.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cc97b8f16f944bba54f0433f07e30be199b6dc2bd25937444bbad560bcea29bd" +dependencies = [ + "alloc-no-stdlib", + "alloc-stdlib", + "brotli-decompressor", +] + +[[package]] +name = "brotli-decompressor" +version = "4.0.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a334ef7c9e23abf0ce748e8cd309037da93e606ad52eb372e4ce327a0dcfbdfd" +dependencies = [ + "alloc-no-stdlib", + "alloc-stdlib", +] + +[[package]] +name = "built" +version = "0.7.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "56ed6191a7e78c36abdb16ab65341eefd73d64d303fffccdbb00d51e4205967b" + +[[package]] +name = "bumpalo" +version = "3.19.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "46c5e41b57b8bba42a04676d81cb89e9ee8e859a1a66f80a5a72e1cb76b34d43" + +[[package]] +name = "bytemuck" +version = "1.23.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5c76a5792e44e4abe34d3abf15636779261d45a7450612059293d1d2cfc63422" + +[[package]] +name = "byteorder" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1fd0f2584146f6f2ef48085050886acf353beff7305ebd1ae69500e27c67f64b" + +[[package]] +name = "byteorder-lite" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8f1fe948ff07f4bd06c30984e69f5b4899c516a3ef74f34df92a2df2ab535495" + +[[package]] +name = "bytes" +version = "1.10.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d71b6127be86fdcfddb610f7182ac57211d4b18a3e9c82eb2d17662f2227ad6a" + +[[package]] +name = "cc" +version = "1.2.27" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d487aa071b5f64da6f19a3e848e3578944b726ee5a4854b82172f02aa876bfdc" +dependencies = [ + "jobserver", + "libc", + "shlex", +] + +[[package]] +name = "cexpr" +version = "0.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6fac387a98bb7c37292057cffc56d62ecb629900026402633ae9160df93a8766" +dependencies = [ + "nom", +] + +[[package]] +name = "cfg-expr" +version = "0.15.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d067ad48b8650848b989a59a86c6c36a995d02d2bf778d45c3c5d57bc2718f02" +dependencies = [ + "smallvec", + "target-lexicon", +] + +[[package]] +name = "cfg-if" +version = "1.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9555578bc9e57714c812a1f84e4fc5b4d21fcb063490c624de019f7464c91268" + +[[package]] +name = "cfg_aliases" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "613afe47fcd5fac7ccf1db93babcb082c5994d996f20b8b159f2ad1658eb5724" + +[[package]] +name = "chrono" +version = "0.4.41" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c469d952047f47f91b68d1cba3f10d63c11d73e4636f24f08daf0278abf01c4d" +dependencies = [ + "android-tzdata", + "iana-time-zone", + "num-traits", + "pure-rust-locales", + "serde", + "windows-link", +] + +[[package]] +name = "chrono-humanize" +version = "0.2.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "799627e6b4d27827a814e837b9d8a504832086081806d45b1afa34dc982b023b" +dependencies = [ + "chrono", +] + +[[package]] +name = "clang-sys" +version = "1.8.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0b023947811758c97c59bf9d1c188fd619ad4718dcaa767947df1cadb14f39f4" +dependencies = [ + "glob", + "libc", + "libloading", +] + +[[package]] +name = "clap" +version = "4.5.40" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "40b6887a1d8685cebccf115538db5c0efe625ccac9696ad45c409d96566e910f" +dependencies = [ + "clap_builder", + "clap_derive", +] + +[[package]] +name = "clap_builder" +version = "4.5.40" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e0c66c08ce9f0c698cbce5c0279d0bb6ac936d8674174fe48f736533b964f59e" +dependencies = [ + "anstream", + "anstyle", + "clap_lex", + "strsim", +] + +[[package]] +name = "clap_derive" +version = "4.5.40" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d2c7947ae4cc3d851207c1adb5b5e260ff0cca11446b1d6d1423788e442257ce" +dependencies = [ + "heck", + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "clap_lex" +version = "0.7.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b94f61472cee1439c0b966b47e3aca9ae07e45d070759512cd390ea2bebc6675" + +[[package]] +name = "color_quant" +version = "1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3d7b894f5411737b7867f4827955924d7c254fc9f4d91a6aad6b097804b1018b" + +[[package]] +name = "colorchoice" +version = "1.0.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b05b61dc5112cbb17e4b6cd61790d9845d13888356391624cbe7e41efeac1e75" + +[[package]] +name = "convert_case" +version = "0.7.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bb402b8d4c85569410425650ce3eddc7d698ed96d39a73f941b08fb63082f1e7" +dependencies = [ + "unicode-segmentation", +] + +[[package]] +name = "core-foundation-sys" +version = "0.8.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "773648b94d0e5d620f64f280777445740e61fe701025087ec8b57f45c791888b" + +[[package]] +name = "core2" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b49ba7ef1ad6107f8824dbe97de947cbaac53c44e7f9756a1fba0d37c1eec505" +dependencies = [ + "memchr", +] + +[[package]] +name = "crc32fast" +version = "1.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a97769d94ddab943e4510d138150169a2758b5ef3eb191a9ee688de3e23ef7b3" +dependencies = [ + "cfg-if", +] + +[[package]] +name = "crossbeam-channel" +version = "0.5.15" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "82b8f8f868b36967f9606790d1903570de9ceaf870a7bf9fbbd3016d636a2cb2" +dependencies = [ + "crossbeam-utils", +] + +[[package]] +name = "crossbeam-deque" +version = "0.8.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9dd111b7b7f7d55b72c0a6ae361660ee5853c9af73f70c3c2ef6858b950e2e51" +dependencies = [ + "crossbeam-epoch", + "crossbeam-utils", +] + +[[package]] +name = "crossbeam-epoch" +version = "0.9.18" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5b82ac4a3c2ca9c3460964f020e1402edd5753411d7737aa39c3714ad1b5420e" +dependencies = [ + "crossbeam-utils", +] + +[[package]] +name = "crossbeam-utils" +version = "0.8.21" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d0a5c400df2834b80a4c3327b3aad3a4c4cd4de0629063962b03235697506a28" + +[[package]] +name = "crossterm" +version = "0.28.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "829d955a0bb380ef178a640b91779e3987da38c9aea133b20614cfed8cdea9c6" +dependencies = [ + "bitflags 2.9.1", + "crossterm_winapi", + "mio", + "parking_lot", + "rustix 0.38.44", + "signal-hook", + "signal-hook-mio", + "winapi", +] + +[[package]] +name = "crossterm" +version = "0.29.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d8b9f2e4c67f833b660cdb0a3523065869fb35570177239812ed4c905aeff87b" +dependencies = [ + "bitflags 2.9.1", + "crossterm_winapi", + "derive_more", + "document-features", + "mio", + "parking_lot", + "rustix 1.0.7", + "signal-hook", + "signal-hook-mio", + "winapi", +] + +[[package]] +name = "crossterm_winapi" +version = "0.9.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "acdd7c62a3665c7f6830a51635d9ac9b23ed385797f70a83bb8bafe9c572ab2b" +dependencies = [ + "winapi", +] + +[[package]] +name = "crunchy" +version = "0.2.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "43da5946c66ffcc7745f48db692ffbb10a83bfe0afd96235c5c2a4fb23994929" + +[[package]] +name = "dary_heap" +version = "0.3.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "04d2cd9c18b9f454ed67da600630b021a8a80bf33f8c95896ab33aaf1c26b728" + +[[package]] +name = "deranged" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9c9e6a11ca8224451684bc0d7d5a7adbf8f2fd6887261a1cfc3c0432f9d4068e" +dependencies = [ + "powerfmt", +] + +[[package]] +name = "derive_more" +version = "2.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "093242cf7570c207c83073cf82f79706fe7b8317e98620a47d5be7c3d8497678" +dependencies = [ + "derive_more-impl", +] + +[[package]] +name = "derive_more-impl" +version = "2.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bda628edc44c4bb645fbe0f758797143e4e07926f7ebf4e9bdfbd3d2ce621df3" +dependencies = [ + "convert_case", + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "dirs" +version = "5.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "44c45a9d03d6676652bcb5e724c7e988de1acad23a711b5217ab9cbecbec2225" +dependencies = [ + "dirs-sys", +] + +[[package]] +name = "dirs-next" +version = "2.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b98cf8ebf19c3d1b223e151f99a4f9f0690dca41414773390fc824184ac833e1" +dependencies = [ + "cfg-if", + "dirs-sys-next", +] + +[[package]] +name = "dirs-sys" +version = "0.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "520f05a5cbd335fae5a99ff7a6ab8627577660ee5cfd6a94a6a929b52ff0321c" +dependencies = [ + "libc", + "option-ext", + "redox_users", + "windows-sys 0.48.0", +] + +[[package]] +name = "dirs-sys-next" +version = "0.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4ebda144c4fe02d1f7ea1a7d9641b6fc6b580adcfa024ae48797ecdeb6825b4d" +dependencies = [ + "libc", + "redox_users", + "winapi", +] + +[[package]] +name = "doctest-file" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "aac81fa3e28d21450aa4d2ac065992ba96a1d7303efbce51a95f4fd175b67562" + +[[package]] +name = "document-features" +version = "0.2.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "95249b50c6c185bee49034bcb378a49dc2b5dff0be90ff6616d31d64febab05d" +dependencies = [ + "litrs", +] + +[[package]] +name = "either" +version = "1.15.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "48c757948c5ede0e46177b7add2e67155f70e33c07fea8284df6576da70b3719" + +[[package]] +name = "equator" +version = "0.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4711b213838dfee0117e3be6ac926007d7f433d7bbe33595975d4190cb07e6fc" +dependencies = [ + "equator-macro", +] + +[[package]] +name = "equator-macro" +version = "0.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "44f23cf4b44bfce11a86ace86f8a73ffdec849c9fd00a386a53d278bd9e81fb3" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + +[[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.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e004d887f51fcb9fef17317a2f3525c887d8aa3f4f50fed920816a688284a5b7" +dependencies = [ + "serde", + "typeid", +] + +[[package]] +name = "errno" +version = "0.3.13" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "778e2ac28f6c47af28e4907f13ffd1e1ddbd400980a9abd7c8df189bf578a5ad" +dependencies = [ + "libc", + "windows-sys 0.60.2", +] + +[[package]] +name = "exr" +version = "1.73.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f83197f59927b46c04a183a619b7c29df34e63e63c7869320862268c0ef687e0" +dependencies = [ + "bit_field", + "half", + "lebe", + "miniz_oxide", + "rayon-core", + "smallvec", + "zune-inflate", +] + +[[package]] +name = "fancy-regex" +version = "0.14.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6e24cb5a94bcae1e5408b0effca5cd7172ea3c5755049c5f3af4cd283a165298" +dependencies = [ + "bit-set", + "regex-automata", + "regex-syntax", +] + +[[package]] +name = "fdeflate" +version = "0.3.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1e6853b52649d4ac5c0bd02320cddc5ba956bdb407c4b75a2c6b75bf51500f8c" +dependencies = [ + "simd-adler32", +] + +[[package]] +name = "flate2" +version = "1.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4a3d7db9596fecd151c5f638c0ee5d5bd487b6e0ea232e5dc96d5250f6f94b1d" +dependencies = [ + "crc32fast", + "miniz_oxide", +] + +[[package]] +name = "foldhash" +version = "0.1.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d9c4f5dac5e15c24eb999c26181a6ca40b39fe946cbe4c263c7209467bc83af2" + +[[package]] +name = "getrandom" +version = "0.2.16" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "335ff9f135e4384c8150d6f27c6daed433577f86b4750418338c01a1a2528592" +dependencies = [ + "cfg-if", + "js-sys", + "libc", + "wasi 0.11.1+wasi-snapshot-preview1", + "wasm-bindgen", +] + +[[package]] +name = "getrandom" +version = "0.3.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "26145e563e54f2cadc477553f1ec5ee650b00862f0a58bcd12cbdc5f0ea2d2f4" +dependencies = [ + "cfg-if", + "libc", + "r-efi", + "wasi 0.14.2+wasi-0.2.4", +] + +[[package]] +name = "gif" +version = "0.13.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4ae047235e33e2829703574b54fdec96bfbad892062d97fed2f76022287de61b" +dependencies = [ + "color_quant", + "weezl", +] + +[[package]] +name = "glob" +version = "0.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a8d1add55171497b4705a648c6b583acafb01d58050a51727785f0b2c8e0a2b2" + +[[package]] +name = "half" +version = "2.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "459196ed295495a68f7d7fe1d84f6c4b7ff0e21fe3017b2f283c6fac3ad803c9" +dependencies = [ + "cfg-if", + "crunchy", +] + +[[package]] +name = "hashbrown" +version = "0.14.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e5274423e17b7c9fc20b6e7e208532f9b19825d82dfd615708b70edd83df41f1" +dependencies = [ + "ahash", + "allocator-api2", +] + +[[package]] +name = "hashbrown" +version = "0.15.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5971ac85611da7067dbfcabef3c70ebb5606018acd9e2a3903a0da507521e0d5" +dependencies = [ + "allocator-api2", + "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 = "iana-time-zone" +version = "0.1.63" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b0c919e5debc312ad217002b8048a17b7d83f80703865bbfcfebb0458b0b27d8" +dependencies = [ + "android_system_properties", + "core-foundation-sys", + "iana-time-zone-haiku", + "js-sys", + "log", + "wasm-bindgen", + "windows-core 0.61.2", +] + +[[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 = "image" +version = "0.25.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "db35664ce6b9810857a38a906215e75a9c879f0696556a39f59c62829710251a" +dependencies = [ + "bytemuck", + "byteorder-lite", + "color_quant", + "exr", + "gif", + "image-webp", + "num-traits", + "png", + "qoi", + "ravif", + "rayon", + "rgb", + "tiff", + "zune-core", + "zune-jpeg", +] + +[[package]] +name = "image-webp" +version = "0.2.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f6970fe7a5300b4b42e62c52efa0187540a5bef546c60edaf554ef595d2e6f0b" +dependencies = [ + "byteorder-lite", + "quick-error", +] + +[[package]] +name = "imageproc" +version = "0.25.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2393fb7808960751a52e8a154f67e7dd3f8a2ef9bd80d1553078a7b4e8ed3f0d" +dependencies = [ + "ab_glyph", + "approx", + "getrandom 0.2.16", + "image", + "itertools 0.12.1", + "nalgebra", + "num", + "rand", + "rand_distr", + "rayon", +] + +[[package]] +name = "imgref" +version = "1.11.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d0263a3d970d5c054ed9312c0057b4f3bde9c0b33836d3637361d4a9e6e7a408" + +[[package]] +name = "include-flate" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "df49c16750695486c1f34de05da5b7438096156466e7f76c38fcdf285cf0113e" +dependencies = [ + "include-flate-codegen", + "lazy_static", + "libflate", +] + +[[package]] +name = "include-flate-codegen" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8c5b246c6261be723b85c61ecf87804e8ea4a35cb68be0ff282ed84b95ffe7d7" +dependencies = [ + "libflate", + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "indexmap" +version = "2.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cea70ddb795996207ad57735b50c5982d8844f38ba9ee5f1aedcfb708a2aa11e" +dependencies = [ + "equivalent", + "hashbrown 0.15.4", +] + +[[package]] +name = "interpolate_name" +version = "0.2.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c34819042dc3d3971c46c2190835914dfbe0c3c13f61449b2997f4e9722dfa60" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "interprocess" +version = "2.2.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d941b405bd2322993887859a8ee6ac9134945a24ec5ec763a8a962fc64dfec2d" +dependencies = [ + "doctest-file", + "libc", + "recvmsg", + "widestring", + "windows-sys 0.52.0", +] + +[[package]] +name = "inventory" +version = "0.3.20" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ab08d7cd2c5897f2c949e5383ea7c7db03fb19130ffcfbf7eda795137ae3cb83" +dependencies = [ + "rustversion", +] + +[[package]] +name = "is-terminal" +version = "0.4.16" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e04d7f318608d35d4b61ddd75cbdaee86b023ebe2bd5a66ee0915f0bf93095a9" +dependencies = [ + "hermit-abi", + "libc", + "windows-sys 0.59.0", +] + +[[package]] +name = "is_ci" +version = "1.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7655c9839580ee829dfacba1d1278c2b7883e50a277ff7541299489d6bdfdc45" + +[[package]] +name = "is_terminal_polyfill" +version = "1.70.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7943c866cc5cd64cbc25b2e01621d07fa8eb2a1a23160ee81ce38704e97b8ecf" + +[[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.13.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "413ee7dfc52ee1a4949ceeb7dbc8a33f2d6c088194d9f922fb8318faf1f01186" +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.15" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4a5f13b858c8d314ee3e8f639011f7ccefe71f97f96e50151fb991f267928e2c" + +[[package]] +name = "jobserver" +version = "0.1.33" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "38f262f097c174adebe41eb73d66ae9c06b2844fb0da69969647bbddd9b0538a" +dependencies = [ + "getrandom 0.3.3", + "libc", +] + +[[package]] +name = "jpeg-decoder" +version = "0.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "00810f1d8b74be64b13dbf3db89ac67740615d6c891f0e7b6179326533011a07" + +[[package]] +name = "js-sys" +version = "0.3.77" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1cfaf33c695fc6e08064efbc1f72ec937429614f25eef83af942d0e227c3a28f" +dependencies = [ + "once_cell", + "wasm-bindgen", +] + +[[package]] +name = "lazy_static" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bbd2bcb4c963f2ddae06a2efc7e9f3591312473c50c6685e1f298068316e66fe" + +[[package]] +name = "lebe" +version = "0.5.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "03087c2bad5e1034e8cace5926dec053fb3790248370865f5117a7d0213354c8" + +[[package]] +name = "libc" +version = "0.2.174" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1171693293099992e19cddea4e8b849964e9846f4acee11b3948bcc337be8776" + +[[package]] +name = "libflate" +version = "2.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "45d9dfdc14ea4ef0900c1cddbc8dcd553fbaacd8a4a282cf4018ae9dd04fb21e" +dependencies = [ + "adler32", + "core2", + "crc32fast", + "dary_heap", + "libflate_lz77", +] + +[[package]] +name = "libflate_lz77" +version = "2.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e6e0d73b369f386f1c44abd9c570d5318f55ccde816ff4b562fa452e5182863d" +dependencies = [ + "core2", + "hashbrown 0.14.5", + "rle-decode-fast", +] + +[[package]] +name = "libfuzzer-sys" +version = "0.4.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cf78f52d400cf2d84a3a973a78a592b4adc535739e0a5597a0da6f0c357adc75" +dependencies = [ + "arbitrary", + "cc", +] + +[[package]] +name = "libloading" +version = "0.8.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "07033963ba89ebaf1584d767badaa2e8fcec21aedea6b8c0346d487d49c28667" +dependencies = [ + "cfg-if", + "windows-targets 0.53.2", +] + +[[package]] +name = "libm" +version = "0.2.15" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f9fbbcab51052fe104eb5e5d351cf728d30a5be1fe14d9be8a3b097481fb97de" + +[[package]] +name = "libproc" +version = "0.14.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e78a09b56be5adbcad5aa1197371688dc6bb249a26da3bca2011ee2fb987ebfb" +dependencies = [ + "bindgen", + "errno", + "libc", +] + +[[package]] +name = "libredox" +version = "0.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c0ff37bd590ca25063e35af745c343cb7a0271906fb7b37e4813e8f79f00268d" +dependencies = [ + "bitflags 2.9.1", + "libc", +] + +[[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.9.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cd945864f07fe9f5371a27ad7b52a172b4b499999f1d97574c9fa68373937e12" + +[[package]] +name = "litrs" +version = "0.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b4ce301924b7887e9d637144fdade93f9dfff9b60981d4ac161db09720d39aa5" + +[[package]] +name = "lock_api" +version = "0.4.13" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "96936507f153605bddfcda068dd804796c84324ed2510809e5b2a624c81da765" +dependencies = [ + "autocfg", + "scopeguard", +] + +[[package]] +name = "log" +version = "0.4.27" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "13dc2df351e3202783a1fe0d44375f7295ffb4049267b0f3018346dc122a1d94" + +[[package]] +name = "loop9" +version = "0.1.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0fae87c125b03c1d2c0150c90365d7d6bcc53fb73a9acaef207d2d065860f062" +dependencies = [ + "imgref", +] + +[[package]] +name = "lru" +version = "0.12.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "234cf4f4a04dc1f57e24b96cc0cd600cf2af460d4161ac5ecdd0af8e1f3b2a38" +dependencies = [ + "hashbrown 0.15.4", +] + +[[package]] +name = "lscolors" +version = "0.20.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "61183da5de8ba09a58e330d55e5ea796539d8443bd00fdeb863eac39724aa4ab" +dependencies = [ + "aho-corasick", + "nu-ansi-term", +] + +[[package]] +name = "mach2" +version = "0.4.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d640282b302c0bb0a2a8e0233ead9035e3bed871f0b7e81fe4a1ec829765db44" +dependencies = [ + "libc", +] + +[[package]] +name = "matrixmultiply" +version = "0.3.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a06de3016e9fae57a36fd14dba131fccf49f74b40b7fbdb472f96e361ec71a08" +dependencies = [ + "autocfg", + "rawpointer", +] + +[[package]] +name = "maybe-rayon" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8ea1f30cedd69f0a2954655f7188c6a834246d2bcf1e315e2ac40c4b24dc9519" +dependencies = [ + "cfg-if", + "rayon", +] + +[[package]] +name = "memchr" +version = "2.7.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "32a282da65faaf38286cf3be983213fcf1d2e2a58700e808f83f4ea9a4804bc0" + +[[package]] +name = "miette" +version = "7.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5f98efec8807c63c752b5bd61f862c165c115b0a35685bdcfd9238c7aeb592b7" +dependencies = [ + "cfg-if", + "miette-derive", + "owo-colors", + "supports-color", + "supports-hyperlinks", + "supports-unicode", + "terminal_size", + "textwrap", + "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", +] + +[[package]] +name = "minimal-lexical" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "68354c5c6bd36d73ff3feceb05efa59b6acb7626617f4962be322a825e61f79a" + +[[package]] +name = "miniz_oxide" +version = "0.8.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1fa76a2c86f704bdb222d66965fb3d63269ce38518b83cb0575fca855ebb6316" +dependencies = [ + "adler2", + "simd-adler32", +] + +[[package]] +name = "mio" +version = "1.0.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "78bed444cc8a2160f01cbcf811ef18cac863ad68ae8ca62092e8db51d51c761c" +dependencies = [ + "libc", + "log", + "wasi 0.11.1+wasi-snapshot-preview1", + "windows-sys 0.59.0", +] + +[[package]] +name = "nalgebra" +version = "0.32.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7b5c17de023a86f59ed79891b2e5d5a94c705dbe904a5b5c9c952ea6221b03e4" +dependencies = [ + "approx", + "matrixmultiply", + "num-complex", + "num-rational", + "num-traits", + "simba", + "typenum", +] + +[[package]] +name = "new_debug_unreachable" +version = "1.0.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "650eef8c711430f1a879fdd01d4745a7deea475becfb90269c06775983bbf086" + +[[package]] +name = "nix" +version = "0.29.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "71e2746dc3a24dd78b3cfcb7be93368c6de9963d30f43a6a73998a9cf4b17b46" +dependencies = [ + "bitflags 2.9.1", + "cfg-if", + "cfg_aliases", + "libc", +] + +[[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 = "noop_proc_macro" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0676bb32a98c1a483ce53e500a81ad9c3d5b3f7c920c28c24e9cb0980d0b5bc8" + +[[package]] +name = "ntapi" +version = "0.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e8a3895c6391c39d7fe7ebc444a87eb2991b2a0bc718fdabd071eec617fc68e4" +dependencies = [ + "winapi", +] + +[[package]] +name = "nu-ansi-term" +version = "0.50.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d4a28e057d01f97e61255210fcff094d74ed0466038633e95017f5beb68e4399" +dependencies = [ + "windows-sys 0.52.0", +] + +[[package]] +name = "nu-derive-value" +version = "0.105.2" +dependencies = [ + "heck", + "proc-macro-error2", + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "nu-engine" +version = "0.105.2" +dependencies = [ + "log", + "nu-glob", + "nu-path", + "nu-protocol", + "nu-utils", +] + +[[package]] +name = "nu-glob" +version = "0.105.2" + +[[package]] +name = "nu-path" +version = "0.105.2" +dependencies = [ + "dirs", + "omnipath", + "pwd", + "ref-cast", +] + +[[package]] +name = "nu-plugin" +version = "0.105.2" +dependencies = [ + "log", + "nix", + "nu-engine", + "nu-plugin-core", + "nu-plugin-protocol", + "nu-protocol", + "nu-utils", + "thiserror 2.0.12", +] + +[[package]] +name = "nu-plugin-core" +version = "0.105.2" +dependencies = [ + "interprocess", + "log", + "nu-plugin-protocol", + "nu-protocol", + "rmp-serde", + "serde", + "serde_json", + "windows 0.56.0", +] + +[[package]] +name = "nu-plugin-protocol" +version = "0.105.2" +dependencies = [ + "nu-protocol", + "nu-utils", + "rmp-serde", + "semver", + "serde", + "typetag", +] + +[[package]] +name = "nu-protocol" +version = "0.105.2" +dependencies = [ + "brotli", + "bytes", + "chrono", + "chrono-humanize", + "dirs", + "dirs-sys", + "fancy-regex", + "heck", + "indexmap", + "log", + "lru", + "memchr", + "miette", + "nix", + "nu-derive-value", + "nu-glob", + "nu-path", + "nu-system", + "nu-utils", + "num-format", + "os_pipe", + "rmp-serde", + "serde", + "serde_json", + "strum", + "strum_macros", + "thiserror 2.0.12", + "typetag", + "web-time", + "windows 0.56.0", + "windows-sys 0.48.0", +] + +[[package]] +name = "nu-system" +version = "0.105.2" +dependencies = [ + "chrono", + "itertools 0.14.0", + "libc", + "libproc", + "log", + "mach2", + "nix", + "ntapi", + "procfs", + "sysinfo", + "web-time", + "windows 0.56.0", +] + +[[package]] +name = "nu-utils" +version = "0.105.2" +dependencies = [ + "crossterm 0.28.1", + "crossterm_winapi", + "fancy-regex", + "log", + "lscolors", + "nix", + "num-format", + "serde", + "serde_json", + "strip-ansi-escapes", + "sys-locale", + "unicase", +] + +[[package]] +name = "nu_plugin_image" +version = "0.105.1" +dependencies = [ + "ab_glyph", + "ansi_colours", + "clap", + "crossterm 0.29.0", + "image", + "imageproc", + "include-flate", + "lazy_static", + "nu-plugin", + "nu-protocol", + "slog", + "slog-async", + "slog-term", + "termcolor", + "vte 0.15.0", +] + +[[package]] +name = "num" +version = "0.4.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "35bd024e8b2ff75562e5f34e7f4905839deb4b22955ef5e73d2fea1b9813cb23" +dependencies = [ + "num-bigint", + "num-complex", + "num-integer", + "num-iter", + "num-rational", + "num-traits", +] + +[[package]] +name = "num-bigint" +version = "0.4.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a5e44f723f1133c9deac646763579fdb3ac745e418f2a7af9cd0c431da1f20b9" +dependencies = [ + "num-integer", + "num-traits", +] + +[[package]] +name = "num-complex" +version = "0.4.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "73f88a1307638156682bada9d7604135552957b7818057dcef22705b4d509495" +dependencies = [ + "num-traits", +] + +[[package]] +name = "num-conv" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "51d515d32fb182ee37cda2ccdcb92950d6a3c2893aa280e540671c2cd0f3b1d9" + +[[package]] +name = "num-derive" +version = "0.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ed3955f1a9c7c0c15e092f9c887db08b1fc683305fdf6eb6684f22555355e202" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "num-format" +version = "0.4.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a652d9771a63711fd3c3deb670acfbe5c30a4072e664d7a3bf5a9e1056ac72c3" +dependencies = [ + "arrayvec", + "itoa", +] + +[[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-iter" +version = "0.1.45" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1429034a0490724d0075ebb2bc9e875d6503c3cf69e235a8941aa757d83ef5bf" +dependencies = [ + "autocfg", + "num-integer", + "num-traits", +] + +[[package]] +name = "num-rational" +version = "0.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f83d14da390562dca69fc84082e73e548e1ad308d24accdedd2720017cb37824" +dependencies = [ + "num-bigint", + "num-integer", + "num-traits", +] + +[[package]] +name = "num-traits" +version = "0.2.19" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "071dfc062690e90b734c0b2273ce72ad0ffa95f0c74596bc250dcfd960262841" +dependencies = [ + "autocfg", + "libm", +] + +[[package]] +name = "omnipath" +version = "0.1.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "80adb31078122c880307e9cdfd4e3361e6545c319f9b9dcafcb03acd3b51a575" + +[[package]] +name = "once_cell" +version = "1.21.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "42f5e15c9953c5e4ccceeb2e7382a716482c34515315f7b03532b8b4e8393d2d" + +[[package]] +name = "once_cell_polyfill" +version = "1.70.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a4895175b425cb1f87721b59f0f286c2092bd4af812243672510e1ac53e2e0ad" + +[[package]] +name = "option-ext" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "04744f49eae99ab78e0d5c0b603ab218f515ea8cfe5a456d7629ad883a3b6e7d" + +[[package]] +name = "os_pipe" +version = "1.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "db335f4760b14ead6290116f2427bf33a14d4f0617d49f78a246de10c1831224" +dependencies = [ + "libc", + "windows-sys 0.59.0", +] + +[[package]] +name = "owned_ttf_parser" +version = "0.25.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "22ec719bbf3b2a81c109a4e20b1f129b5566b7dce654bc3872f6a05abf82b2c4" +dependencies = [ + "ttf-parser", +] + +[[package]] +name = "owo-colors" +version = "4.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "48dd4f4a2c8405440fd0462561f0e5806bd0f77e86f51c761481bdd4018b545e" + +[[package]] +name = "parking_lot" +version = "0.12.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "70d58bf43669b5795d1576d0641cfb6fbb2057bf629506267a92807158584a13" +dependencies = [ + "lock_api", + "parking_lot_core", +] + +[[package]] +name = "parking_lot_core" +version = "0.9.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bc838d2a56b5b1a6c25f55575dfc605fabb63bb2365f6c2353ef9159aa69e4a5" +dependencies = [ + "cfg-if", + "libc", + "redox_syscall", + "smallvec", + "windows-targets 0.52.6", +] + +[[package]] +name = "paste" +version = "1.0.15" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "57c0d7b74b563b49d38dae00a0c37d4d6de9b432382b2892f0574ddcae73fd0a" + +[[package]] +name = "pkg-config" +version = "0.3.32" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7edddbd0b52d732b21ad9a5fab5c704c14cd949e5e9a1ec5929a24fded1b904c" + +[[package]] +name = "png" +version = "0.17.16" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "82151a2fc869e011c153adc57cf2789ccb8d9906ce52c0b39a6b5697749d7526" +dependencies = [ + "bitflags 1.3.2", + "crc32fast", + "fdeflate", + "flate2", + "miniz_oxide", +] + +[[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 = "proc-macro-error-attr2" +version = "2.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "96de42df36bb9bba5542fe9f1a054b8cc87e172759a1868aa05c1f3acc89dfc5" +dependencies = [ + "proc-macro2", + "quote", +] + +[[package]] +name = "proc-macro-error2" +version = "2.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "11ec05c52be0a07b08061f7dd003e7d7092e0472bc731b4af7bb1ef876109802" +dependencies = [ + "proc-macro-error-attr2", + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "proc-macro2" +version = "1.0.95" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "02b3e5e68a3a1a02aad3ec490a98007cbc13c37cbe84a3cd7b8e406d76e7f778" +dependencies = [ + "unicode-ident", +] + +[[package]] +name = "procfs" +version = "0.17.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cc5b72d8145275d844d4b5f6d4e1eef00c8cd889edb6035c21675d1bb1f45c9f" +dependencies = [ + "bitflags 2.9.1", + "chrono", + "flate2", + "hex", + "procfs-core", + "rustix 0.38.44", +] + +[[package]] +name = "procfs-core" +version = "0.17.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "239df02d8349b06fc07398a3a1697b06418223b1c7725085e801e7c0fc6a12ec" +dependencies = [ + "bitflags 2.9.1", + "chrono", + "hex", +] + +[[package]] +name = "profiling" +version = "1.0.17" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3eb8486b569e12e2c32ad3e204dbaba5e4b5b216e9367044f25f1dba42341773" +dependencies = [ + "profiling-procmacros", +] + +[[package]] +name = "profiling-procmacros" +version = "1.0.17" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "52717f9a02b6965224f95ca2a81e2e0c5c43baacd28ca057577988930b6c3d5b" +dependencies = [ + "quote", + "syn", +] + +[[package]] +name = "pure-rust-locales" +version = "0.8.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1190fd18ae6ce9e137184f207593877e70f39b015040156b1e05081cdfe3733a" + +[[package]] +name = "pwd" +version = "1.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "72c71c0c79b9701efe4e1e4b563b2016dd4ee789eb99badcb09d61ac4b92e4a2" +dependencies = [ + "libc", + "thiserror 1.0.69", +] + +[[package]] +name = "qoi" +version = "0.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7f6d64c71eb498fe9eae14ce4ec935c555749aef511cca85b5568910d6e48001" +dependencies = [ + "bytemuck", +] + +[[package]] +name = "quick-error" +version = "2.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a993555f31e5a609f617c12db6250dedcac1b0a85076912c436e6fc9b2c8e6a3" + +[[package]] +name = "quote" +version = "1.0.40" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1885c039570dc00dcb4ff087a89e185fd56bae234ddc7f056a945bf36467248d" +dependencies = [ + "proc-macro2", +] + +[[package]] +name = "r-efi" +version = "5.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "69cdb34c158ceb288df11e18b4bd39de994f6657d83847bdffdbd7f346754b0f" + +[[package]] +name = "rand" +version = "0.8.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "34af8d1a0e25924bc5b7c43c079c942339d8f0a8b57c39049bef581b46327404" +dependencies = [ + "libc", + "rand_chacha", + "rand_core", +] + +[[package]] +name = "rand_chacha" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e6c10a63a0fa32252be49d21e7709d4d4baf8d231c2dbce1eaa8141b9b127d88" +dependencies = [ + "ppv-lite86", + "rand_core", +] + +[[package]] +name = "rand_core" +version = "0.6.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ec0be4795e2f6a28069bec0b5ff3e2ac9bafc99e6a9a7dc3547996c5c816922c" +dependencies = [ + "getrandom 0.2.16", +] + +[[package]] +name = "rand_distr" +version = "0.4.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "32cb0b9bc82b0a0876c2dd994a7e7a2683d3e7390ca40e6886785ef0c7e3ee31" +dependencies = [ + "num-traits", + "rand", +] + +[[package]] +name = "rav1e" +version = "0.7.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cd87ce80a7665b1cce111f8a16c1f3929f6547ce91ade6addf4ec86a8dda5ce9" +dependencies = [ + "arbitrary", + "arg_enum_proc_macro", + "arrayvec", + "av1-grain", + "bitstream-io", + "built", + "cfg-if", + "interpolate_name", + "itertools 0.12.1", + "libc", + "libfuzzer-sys", + "log", + "maybe-rayon", + "new_debug_unreachable", + "noop_proc_macro", + "num-derive", + "num-traits", + "once_cell", + "paste", + "profiling", + "rand", + "rand_chacha", + "simd_helpers", + "system-deps", + "thiserror 1.0.69", + "v_frame", + "wasm-bindgen", +] + +[[package]] +name = "ravif" +version = "0.11.20" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5825c26fddd16ab9f515930d49028a630efec172e903483c94796cfe31893e6b" +dependencies = [ + "avif-serialize", + "imgref", + "loop9", + "quick-error", + "rav1e", + "rayon", + "rgb", +] + +[[package]] +name = "rawpointer" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "60a357793950651c4ed0f3f52338f53b2f809f32d83a07f72909fa13e4c6c1e3" + +[[package]] +name = "rayon" +version = "1.10.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b418a60154510ca1a002a752ca9714984e21e4241e804d32555251faf8b78ffa" +dependencies = [ + "either", + "rayon-core", +] + +[[package]] +name = "rayon-core" +version = "1.12.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1465873a3dfdaa8ae7cb14b4383657caab0b3e8a0aa9ae8e04b044854c8dfce2" +dependencies = [ + "crossbeam-deque", + "crossbeam-utils", +] + +[[package]] +name = "recvmsg" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d3edd4d5d42c92f0a659926464d4cce56b562761267ecf0f469d85b7de384175" + +[[package]] +name = "redox_syscall" +version = "0.5.13" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0d04b7d0ee6b4a0207a0a7adb104d23ecb0b47d6beae7152d0fa34b692b29fd6" +dependencies = [ + "bitflags 2.9.1", +] + +[[package]] +name = "redox_users" +version = "0.4.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ba009ff324d1fc1b900bd1fdb31564febe58a8ccc8a6fdbb93b543d33b13ca43" +dependencies = [ + "getrandom 0.2.16", + "libredox", + "thiserror 1.0.69", +] + +[[package]] +name = "ref-cast" +version = "1.0.24" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4a0ae411dbe946a674d89546582cea4ba2bb8defac896622d6496f14c23ba5cf" +dependencies = [ + "ref-cast-impl", +] + +[[package]] +name = "ref-cast-impl" +version = "1.0.24" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1165225c21bff1f3bbce98f5a1f889949bc902d3575308cc7b0de30b4f6d27c7" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "regex" +version = "1.11.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b544ef1b4eac5dc2db33ea63606ae9ffcfac26c1416a2806ae0bf5f56b201191" +dependencies = [ + "aho-corasick", + "memchr", + "regex-automata", + "regex-syntax", +] + +[[package]] +name = "regex-automata" +version = "0.4.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "809e8dc61f6de73b46c85f4c96486310fe304c434cfa43669d7b40f711150908" +dependencies = [ + "aho-corasick", + "memchr", + "regex-syntax", +] + +[[package]] +name = "regex-syntax" +version = "0.8.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2b15c43186be67a4fd63bee50d0303afffcef381492ebe2c5d87f324e1b8815c" + +[[package]] +name = "rgb" +version = "0.8.50" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "57397d16646700483b67d2dd6511d79318f9d057fdbd21a4066aeac8b41d310a" +dependencies = [ + "bytemuck", +] + +[[package]] +name = "rle-decode-fast" +version = "1.0.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3582f63211428f83597b51b2ddb88e2a91a9d52d12831f9d08f5e624e8977422" + +[[package]] +name = "rmp" +version = "0.8.14" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "228ed7c16fa39782c3b3468e974aec2795e9089153cd08ee2e9aefb3613334c4" +dependencies = [ + "byteorder", + "num-traits", + "paste", +] + +[[package]] +name = "rmp-serde" +version = "1.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "52e599a477cf9840e92f2cde9a7189e67b42c57532749bf90aea6ec10facd4db" +dependencies = [ + "byteorder", + "rmp", + "serde", +] + +[[package]] +name = "rustc-hash" +version = "1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "08d43f7aa6b08d49f382cde6a7982047c3426db949b1424bc4b7ec9ae12c6ce2" + +[[package]] +name = "rustix" +version = "0.38.44" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fdb5bc1ae2baa591800df16c9ca78619bf65c0488b41b96ccec5d11220d8c154" +dependencies = [ + "bitflags 2.9.1", + "errno", + "libc", + "linux-raw-sys 0.4.15", + "windows-sys 0.59.0", +] + +[[package]] +name = "rustix" +version = "1.0.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c71e83d6afe7ff64890ec6b71d6a69bb8a610ab78ce364b3352876bb4c801266" +dependencies = [ + "bitflags 2.9.1", + "errno", + "libc", + "linux-raw-sys 0.9.4", + "windows-sys 0.59.0", +] + +[[package]] +name = "rustversion" +version = "1.0.21" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8a0d197bd2c9dc6e53b84da9556a69ba4cdfab8619eb41a8bd1cc2027a0f6b1d" + +[[package]] +name = "ryu" +version = "1.0.20" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "28d3b2b1366ec20994f1fd18c3c594f05c5dd4bc44d8bb0c1c632c8d6829481f" + +[[package]] +name = "safe_arch" +version = "0.7.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "96b02de82ddbe1b636e6170c21be622223aea188ef2e139be0a5b219ec215323" +dependencies = [ + "bytemuck", +] + +[[package]] +name = "scopeguard" +version = "1.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "94143f37725109f92c262ed2cf5e59bce7498c01bcc1502d7b9afe439a4e9f49" + +[[package]] +name = "semver" +version = "1.0.26" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "56e6fa9c48d24d85fb3de5ad847117517440f6beceb7798af16b4a87d616b8d0" + +[[package]] +name = "serde" +version = "1.0.219" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5f0e2c6ed6606019b4e29e69dbaba95b11854410e5347d525002456dbbb786b6" +dependencies = [ + "serde_derive", +] + +[[package]] +name = "serde_derive" +version = "1.0.219" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5b0276cf7f2c73365f7157c8123c21cd9a50fbbd844757af28ca1f5925fc2a00" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "serde_json" +version = "1.0.140" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "20068b6e96dc6c9bd23e01df8827e6c7e1f2fddd43c21810382803c136b99373" +dependencies = [ + "itoa", + "memchr", + "ryu", + "serde", +] + +[[package]] +name = "serde_spanned" +version = "0.6.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bf41e0cfaf7226dca15e8197172c295a782857fcb97fad1808a166870dee75a3" +dependencies = [ + "serde", +] + +[[package]] +name = "shlex" +version = "1.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0fda2ff0d084019ba4d7c6f371c95d8fd75ce3524c3cb8fb653a3023f6323e64" + +[[package]] +name = "signal-hook" +version = "0.3.18" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d881a16cf4426aa584979d30bd82cb33429027e42122b169753d6ef1085ed6e2" +dependencies = [ + "libc", + "signal-hook-registry", +] + +[[package]] +name = "signal-hook-mio" +version = "0.2.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "34db1a06d485c9142248b7a054f034b349b212551f3dfd19c94d45a754a217cd" +dependencies = [ + "libc", + "mio", + "signal-hook", +] + +[[package]] +name = "signal-hook-registry" +version = "1.4.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9203b8055f63a2a00e2f593bb0510367fe707d7ff1e5c872de2f537b339e5410" +dependencies = [ + "libc", +] + +[[package]] +name = "simba" +version = "0.8.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "061507c94fc6ab4ba1c9a0305018408e312e17c041eb63bef8aa726fa33aceae" +dependencies = [ + "approx", + "num-complex", + "num-traits", + "paste", + "wide", +] + +[[package]] +name = "simd-adler32" +version = "0.3.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d66dc143e6b11c1eddc06d5c423cfc97062865baf299914ab64caa38182078fe" + +[[package]] +name = "simd_helpers" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "95890f873bec569a0362c235787f3aca6e1e887302ba4840839bcc6459c42da6" +dependencies = [ + "quote", +] + +[[package]] +name = "slog" +version = "2.7.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8347046d4ebd943127157b94d63abb990fcf729dc4e9978927fdf4ac3c998d06" + +[[package]] +name = "slog-async" +version = "2.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "72c8038f898a2c79507940990f05386455b3a317d8f18d4caea7cbc3d5096b84" +dependencies = [ + "crossbeam-channel", + "slog", + "take_mut", + "thread_local", +] + +[[package]] +name = "slog-term" +version = "2.9.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b6e022d0b998abfe5c3782c1f03551a596269450ccd677ea51c56f8b214610e8" +dependencies = [ + "is-terminal", + "slog", + "term", + "thread_local", + "time", +] + +[[package]] +name = "smallvec" +version = "1.15.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "67b1b7a3b5fe4f1376887184045fcf45c69e92af734b7aaddc05fb777b6fbd03" + +[[package]] +name = "strip-ansi-escapes" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2a8f8038e7e7969abb3f1b7c2a811225e9296da208539e0f79c5251d6cac0025" +dependencies = [ + "vte 0.14.1", +] + +[[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" + +[[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", +] + +[[package]] +name = "supports-color" +version = "3.0.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c64fc7232dd8d2e4ac5ce4ef302b1d81e0b80d055b9d77c7c4f51f6aa4c867d6" +dependencies = [ + "is_ci", +] + +[[package]] +name = "supports-hyperlinks" +version = "3.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "804f44ed3c63152de6a9f90acbea1a110441de43006ea51bcce8f436196a288b" + +[[package]] +name = "supports-unicode" +version = "3.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b7401a30af6cb5818bb64852270bb722533397edcfc7344954a38f420819ece2" + +[[package]] +name = "syn" +version = "2.0.104" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "17b6f705963418cdb9927482fa304bc562ece2fdd4f616084c50b7023b435a40" +dependencies = [ + "proc-macro2", + "quote", + "unicode-ident", +] + +[[package]] +name = "sys-locale" +version = "0.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8eab9a99a024a169fe8a903cf9d4a3b3601109bcc13bd9e3c6fff259138626c4" +dependencies = [ + "libc", +] + +[[package]] +name = "sysinfo" +version = "0.33.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4fc858248ea01b66f19d8e8a6d55f41deaf91e9d495246fd01368d99935c6c01" +dependencies = [ + "core-foundation-sys", + "libc", + "memchr", + "ntapi", + "rayon", + "windows 0.57.0", +] + +[[package]] +name = "system-deps" +version = "6.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a3e535eb8dded36d55ec13eddacd30dec501792ff23a0b1682c38601b8cf2349" +dependencies = [ + "cfg-expr", + "heck", + "pkg-config", + "toml", + "version-compare", +] + +[[package]] +name = "take_mut" +version = "0.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f764005d11ee5f36500a149ace24e00e3da98b0158b3e2d53a7495660d3f4d60" + +[[package]] +name = "target-lexicon" +version = "0.12.16" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "61c41af27dd6d1e27b1b16b489db798443478cef1f06a660c96db617ba5de3b1" + +[[package]] +name = "term" +version = "0.7.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c59df8ac95d96ff9bede18eb7300b0fda5e5d8d90960e76f8e14ae765eedbf1f" +dependencies = [ + "dirs-next", + "rustversion", + "winapi", +] + +[[package]] +name = "termcolor" +version = "1.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "06794f8f6c5c898b3275aebefa6b8a1cb24cd2c6c79397ab15774837a0bc5755" +dependencies = [ + "winapi-util", +] + +[[package]] +name = "terminal_size" +version = "0.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "45c6481c4829e4cc63825e62c49186a34538b7b2750b73b266581ffb612fb5ed" +dependencies = [ + "rustix 1.0.7", + "windows-sys 0.59.0", +] + +[[package]] +name = "textwrap" +version = "0.16.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c13547615a44dc9c452a8a534638acdf07120d4b6847c8178705da06306a3057" +dependencies = [ + "unicode-linebreak", + "unicode-width 0.2.1", +] + +[[package]] +name = "thiserror" +version = "1.0.69" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b6aaf5339b578ea85b50e080feb250a3e8ae8cfcdff9a461c9ec2904bc923f52" +dependencies = [ + "thiserror-impl 1.0.69", +] + +[[package]] +name = "thiserror" +version = "2.0.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "567b8a2dae586314f7be2a752ec7474332959c6460e02bde30d702a66d488708" +dependencies = [ + "thiserror-impl 2.0.12", +] + +[[package]] +name = "thiserror-impl" +version = "1.0.69" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4fee6c4efc90059e10f81e6d42c60a18f76588c3d74cb83a0b242a2b6c7504c1" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "thiserror-impl" +version = "2.0.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7f7cf42b4507d8ea322120659672cf1b9dbb93f8f2d4ecfd6e51350ff5b17a1d" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "thread_local" +version = "1.1.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f60246a4944f24f6e018aa17cdeffb7818b76356965d03b07d6a9886e8962185" +dependencies = [ + "cfg-if", +] + +[[package]] +name = "tiff" +version = "0.9.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ba1310fcea54c6a9a4fd1aad794ecc02c31682f6bfbecdf460bf19533eed1e3e" +dependencies = [ + "flate2", + "jpeg-decoder", + "weezl", +] + +[[package]] +name = "time" +version = "0.3.41" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8a7619e19bc266e0f9c5e6686659d394bc57973859340060a69221e57dbc0c40" +dependencies = [ + "deranged", + "itoa", + "num-conv", + "powerfmt", + "serde", + "time-core", + "time-macros", +] + +[[package]] +name = "time-core" +version = "0.1.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c9e9a38711f559d9e3ce1cdb06dd7c5b8ea546bc90052da6d06bb76da74bb07c" + +[[package]] +name = "time-macros" +version = "0.2.22" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3526739392ec93fd8b359c8e98514cb3e8e021beb4e5f597b00a0221f8ed8a49" +dependencies = [ + "num-conv", + "time-core", +] + +[[package]] +name = "toml" +version = "0.8.23" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dc1beb996b9d83529a9e75c17a1686767d148d70663143c7854d8b4a09ced362" +dependencies = [ + "serde", + "serde_spanned", + "toml_datetime", + "toml_edit", +] + +[[package]] +name = "toml_datetime" +version = "0.6.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "22cddaf88f4fbc13c51aebbf5f8eceb5c7c5a9da2ac40a13519eb5b0a0e8f11c" +dependencies = [ + "serde", +] + +[[package]] +name = "toml_edit" +version = "0.22.27" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "41fe8c660ae4257887cf66394862d21dbca4a6ddd26f04a3560410406a2f819a" +dependencies = [ + "indexmap", + "serde", + "serde_spanned", + "toml_datetime", + "winnow", +] + +[[package]] +name = "ttf-parser" +version = "0.25.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d2df906b07856748fa3f6e0ad0cbaa047052d4a7dd609e231c4f72cee8c36f31" + +[[package]] +name = "typeid" +version = "1.0.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bc7d623258602320d5c55d1bc22793b57daff0ec7efc270ea7d55ce1d5f5471c" + +[[package]] +name = "typenum" +version = "1.18.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1dccffe3ce07af9386bfd29e80c0ab1a8205a2fc34e4bcd40364df902cfa8f3f" + +[[package]] +name = "typetag" +version = "0.2.20" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "73f22b40dd7bfe8c14230cf9702081366421890435b2d625fa92b4acc4c3de6f" +dependencies = [ + "erased-serde", + "inventory", + "once_cell", + "serde", + "typetag-impl", +] + +[[package]] +name = "typetag-impl" +version = "0.2.20" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "35f5380909ffc31b4de4f4bdf96b877175a016aa2ca98cee39fcfd8c4d53d952" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "unicase" +version = "2.8.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "75b844d17643ee918803943289730bec8aac480150456169e647ed0b576ba539" + +[[package]] +name = "unicode-ident" +version = "1.0.18" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5a5f39404a5da50712a4c1eecf25e90dd62b613502b7e925fd4e4d19b5c96512" + +[[package]] +name = "unicode-linebreak" +version = "0.1.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3b09c83c3c29d37506a3e260c08c03743a6bb66a9cd432c6934ab501a190571f" + +[[package]] +name = "unicode-segmentation" +version = "1.12.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f6ccf251212114b54433ec949fd6a7841275f9ada20dddd2f29e9ceea4501493" + +[[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.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4a1a07cc7db3810833284e8d372ccdc6da29741639ecc70c9ec107df0fa6154c" + +[[package]] +name = "utf8parse" +version = "0.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "06abde3611657adf66d383f00b093d7faecc7fa57071cce2578660c9f1010821" + +[[package]] +name = "v_frame" +version = "0.3.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "666b7727c8875d6ab5db9533418d7c764233ac9c0cff1d469aec8fa127597be2" +dependencies = [ + "aligned-vec", + "num-traits", + "wasm-bindgen", +] + +[[package]] +name = "version-compare" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "852e951cb7832cb45cb1169900d19760cfa39b82bc0ea9c0e5a14ae88411c98b" + +[[package]] +name = "version_check" +version = "0.9.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0b928f33d975fc6ad9f86c8f283853ad26bdd5b10b7f1542aa2fa15e2289105a" + +[[package]] +name = "vte" +version = "0.14.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "231fdcd7ef3037e8330d8e17e61011a2c244126acc0a982f4040ac3f9f0bc077" +dependencies = [ + "memchr", +] + +[[package]] +name = "vte" +version = "0.15.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a5924018406ce0063cd67f8e008104968b74b563ee1b85dde3ed1f7cb87d3dbd" +dependencies = [ + "arrayvec", + "memchr", +] + +[[package]] +name = "wasi" +version = "0.11.1+wasi-snapshot-preview1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ccf3ec651a847eb01de73ccad15eb7d99f80485de043efb2f370cd654f4ea44b" + +[[package]] +name = "wasi" +version = "0.14.2+wasi-0.2.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9683f9a5a998d873c0d21fcbe3c083009670149a8fab228644b8bd36b2c48cb3" +dependencies = [ + "wit-bindgen-rt", +] + +[[package]] +name = "wasm-bindgen" +version = "0.2.100" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1edc8929d7499fc4e8f0be2262a241556cfc54a0bea223790e71446f2aab1ef5" +dependencies = [ + "cfg-if", + "once_cell", + "rustversion", + "wasm-bindgen-macro", +] + +[[package]] +name = "wasm-bindgen-backend" +version = "0.2.100" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2f0a0651a5c2bc21487bde11ee802ccaf4c51935d0d3d42a6101f98161700bc6" +dependencies = [ + "bumpalo", + "log", + "proc-macro2", + "quote", + "syn", + "wasm-bindgen-shared", +] + +[[package]] +name = "wasm-bindgen-macro" +version = "0.2.100" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7fe63fc6d09ed3792bd0897b314f53de8e16568c2b3f7982f468c0bf9bd0b407" +dependencies = [ + "quote", + "wasm-bindgen-macro-support", +] + +[[package]] +name = "wasm-bindgen-macro-support" +version = "0.2.100" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8ae87ea40c9f689fc23f209965b6fb8a99ad69aeeb0231408be24920604395de" +dependencies = [ + "proc-macro2", + "quote", + "syn", + "wasm-bindgen-backend", + "wasm-bindgen-shared", +] + +[[package]] +name = "wasm-bindgen-shared" +version = "0.2.100" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1a05d73b933a847d6cccdda8f838a22ff101ad9bf93e33684f39c1f5f0eece3d" +dependencies = [ + "unicode-ident", +] + +[[package]] +name = "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 = "weezl" +version = "0.1.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a751b3277700db47d3e574514de2eced5e54dc8a5436a3bf7a0b248b2cee16f3" + +[[package]] +name = "wide" +version = "0.7.33" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0ce5da8ecb62bcd8ec8b7ea19f69a51275e91299be594ea5cc6ef7819e16cd03" +dependencies = [ + "bytemuck", + "safe_arch", +] + +[[package]] +name = "widestring" +version = "1.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dd7cf3379ca1aac9eea11fba24fd7e315d621f8dfe35c8d7d2be8b793726e07d" + +[[package]] +name = "winapi" +version = "0.3.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5c839a674fcd7a98952e593242ea400abe93992746761e38641405d28b00f419" +dependencies = [ + "winapi-i686-pc-windows-gnu", + "winapi-x86_64-pc-windows-gnu", +] + +[[package]] +name = "winapi-i686-pc-windows-gnu" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ac3b87c63620426dd9b991e5ce0329eff545bccbbb34f3be09ff6fb6ab51b7b6" + +[[package]] +name = "winapi-util" +version = "0.1.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cf221c93e13a30d793f7645a0e7762c55d169dbb0a49671918a2319d289b10bb" +dependencies = [ + "windows-sys 0.59.0", +] + +[[package]] +name = "winapi-x86_64-pc-windows-gnu" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f" + +[[package]] +name = "windows" +version = "0.56.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1de69df01bdf1ead2f4ac895dc77c9351aefff65b2f3db429a343f9cbf05e132" +dependencies = [ + "windows-core 0.56.0", + "windows-targets 0.52.6", +] + +[[package]] +name = "windows" +version = "0.57.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "12342cb4d8e3b046f3d80effd474a7a02447231330ef77d71daa6fbc40681143" +dependencies = [ + "windows-core 0.57.0", + "windows-targets 0.52.6", +] + +[[package]] +name = "windows-core" +version = "0.56.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4698e52ed2d08f8658ab0c39512a7c00ee5fe2688c65f8c0a4f06750d729f2a6" +dependencies = [ + "windows-implement 0.56.0", + "windows-interface 0.56.0", + "windows-result 0.1.2", + "windows-targets 0.52.6", +] + +[[package]] +name = "windows-core" +version = "0.57.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d2ed2439a290666cd67ecce2b0ffaad89c2a56b976b736e6ece670297897832d" +dependencies = [ + "windows-implement 0.57.0", + "windows-interface 0.57.0", + "windows-result 0.1.2", + "windows-targets 0.52.6", +] + +[[package]] +name = "windows-core" +version = "0.61.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c0fdd3ddb90610c7638aa2b3a3ab2904fb9e5cdbecc643ddb3647212781c4ae3" +dependencies = [ + "windows-implement 0.60.0", + "windows-interface 0.59.1", + "windows-link", + "windows-result 0.3.4", + "windows-strings", +] + +[[package]] +name = "windows-implement" +version = "0.56.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f6fc35f58ecd95a9b71c4f2329b911016e6bec66b3f2e6a4aad86bd2e99e2f9b" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "windows-implement" +version = "0.57.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9107ddc059d5b6fbfbffdfa7a7fe3e22a226def0b2608f72e9d552763d3e1ad7" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "windows-implement" +version = "0.60.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a47fddd13af08290e67f4acabf4b459f647552718f683a7b415d290ac744a836" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "windows-interface" +version = "0.56.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "08990546bf4edef8f431fa6326e032865f27138718c587dc21bc0265bbcb57cc" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "windows-interface" +version = "0.57.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "29bee4b38ea3cde66011baa44dba677c432a78593e202392d1e9070cf2a7fca7" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "windows-interface" +version = "0.59.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bd9211b69f8dcdfa817bfd14bf1c97c9188afa36f4750130fcdf3f400eca9fa8" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "windows-link" +version = "0.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5e6ad25900d524eaabdbbb96d20b4311e1e7ae1699af4fb28c17ae66c80d798a" + +[[package]] +name = "windows-result" +version = "0.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5e383302e8ec8515204254685643de10811af0ed97ea37210dc26fb0032647f8" +dependencies = [ + "windows-targets 0.52.6", +] + +[[package]] +name = "windows-result" +version = "0.3.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "56f42bd332cc6c8eac5af113fc0c1fd6a8fd2aa08a0119358686e5160d0586c6" +dependencies = [ + "windows-link", +] + +[[package]] +name = "windows-strings" +version = "0.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "56e6c93f3a0c3b36176cb1327a4958a0353d5d166c2a35cb268ace15e91d3b57" +dependencies = [ + "windows-link", +] + +[[package]] +name = "windows-sys" +version = "0.48.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "677d2418bec65e3338edb076e806bc1ec15693c5d0104683f2efe857f61056a9" +dependencies = [ + "windows-targets 0.48.5", +] + +[[package]] +name = "windows-sys" +version = "0.52.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "282be5f36a8ce781fad8c8ae18fa3f9beff57ec1b52cb3de0789201425d9a33d" +dependencies = [ + "windows-targets 0.52.6", +] + +[[package]] +name = "windows-sys" +version = "0.59.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1e38bc4d79ed67fd075bcc251a1c39b32a1776bbe92e5bef1f0bf1f8c531853b" +dependencies = [ + "windows-targets 0.52.6", +] + +[[package]] +name = "windows-sys" +version = "0.60.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f2f500e4d28234f72040990ec9d39e3a6b950f9f22d3dba18416c35882612bcb" +dependencies = [ + "windows-targets 0.53.2", +] + +[[package]] +name = "windows-targets" +version = "0.48.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9a2fa6e2155d7247be68c096456083145c183cbbbc2764150dda45a87197940c" +dependencies = [ + "windows_aarch64_gnullvm 0.48.5", + "windows_aarch64_msvc 0.48.5", + "windows_i686_gnu 0.48.5", + "windows_i686_msvc 0.48.5", + "windows_x86_64_gnu 0.48.5", + "windows_x86_64_gnullvm 0.48.5", + "windows_x86_64_msvc 0.48.5", +] + +[[package]] +name = "windows-targets" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9b724f72796e036ab90c1021d4780d4d3d648aca59e491e6b98e725b84e99973" +dependencies = [ + "windows_aarch64_gnullvm 0.52.6", + "windows_aarch64_msvc 0.52.6", + "windows_i686_gnu 0.52.6", + "windows_i686_gnullvm 0.52.6", + "windows_i686_msvc 0.52.6", + "windows_x86_64_gnu 0.52.6", + "windows_x86_64_gnullvm 0.52.6", + "windows_x86_64_msvc 0.52.6", +] + +[[package]] +name = "windows-targets" +version = "0.53.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c66f69fcc9ce11da9966ddb31a40968cad001c5bedeb5c2b82ede4253ab48aef" +dependencies = [ + "windows_aarch64_gnullvm 0.53.0", + "windows_aarch64_msvc 0.53.0", + "windows_i686_gnu 0.53.0", + "windows_i686_gnullvm 0.53.0", + "windows_i686_msvc 0.53.0", + "windows_x86_64_gnu 0.53.0", + "windows_x86_64_gnullvm 0.53.0", + "windows_x86_64_msvc 0.53.0", +] + +[[package]] +name = "windows_aarch64_gnullvm" +version = "0.48.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2b38e32f0abccf9987a4e3079dfb67dcd799fb61361e53e2882c3cbaf0d905d8" + +[[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_gnullvm" +version = "0.53.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "86b8d5f90ddd19cb4a147a5fa63ca848db3df085e25fee3cc10b39b6eebae764" + +[[package]] +name = "windows_aarch64_msvc" +version = "0.48.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dc35310971f3b2dbbf3f0690a219f40e2d9afcf64f9ab7cc1be722937c26b4bc" + +[[package]] +name = "windows_aarch64_msvc" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "09ec2a7bb152e2252b53fa7803150007879548bc709c039df7627cabbd05d469" + +[[package]] +name = "windows_aarch64_msvc" +version = "0.53.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c7651a1f62a11b8cbd5e0d42526e55f2c99886c77e007179efff86c2b137e66c" + +[[package]] +name = "windows_i686_gnu" +version = "0.48.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a75915e7def60c94dcef72200b9a8e58e5091744960da64ec734a6c6e9b3743e" + +[[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_gnu" +version = "0.53.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c1dc67659d35f387f5f6c479dc4e28f1d4bb90ddd1a5d3da2e5d97b42d6272c3" + +[[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_gnullvm" +version = "0.53.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9ce6ccbdedbf6d6354471319e781c0dfef054c81fbc7cf83f338a4296c0cae11" + +[[package]] +name = "windows_i686_msvc" +version = "0.48.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8f55c233f70c4b27f66c523580f78f1004e8b5a8b659e05a4eb49d4166cca406" + +[[package]] +name = "windows_i686_msvc" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "240948bc05c5e7c6dabba28bf89d89ffce3e303022809e73deaefe4f6ec56c66" + +[[package]] +name = "windows_i686_msvc" +version = "0.53.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "581fee95406bb13382d2f65cd4a908ca7b1e4c2f1917f143ba16efe98a589b5d" + +[[package]] +name = "windows_x86_64_gnu" +version = "0.48.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "53d40abd2583d23e4718fddf1ebec84dbff8381c07cae67ff7768bbf19c6718e" + +[[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_gnu" +version = "0.53.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2e55b5ac9ea33f2fc1716d1742db15574fd6fc8dadc51caab1c16a3d3b4190ba" + +[[package]] +name = "windows_x86_64_gnullvm" +version = "0.48.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0b7b52767868a23d5bab768e390dc5f5c55825b6d30b86c844ff2dc7414044cc" + +[[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_gnullvm" +version = "0.53.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0a6e035dd0599267ce1ee132e51c27dd29437f63325753051e71dd9e42406c57" + +[[package]] +name = "windows_x86_64_msvc" +version = "0.48.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ed94fce61571a4006852b7389a063ab983c02eb1bb37b47f8272ce92d06d9538" + +[[package]] +name = "windows_x86_64_msvc" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "589f6da84c646204747d1270a2a5661ea66ed1cced2631d546fdfb155959f9ec" + +[[package]] +name = "windows_x86_64_msvc" +version = "0.53.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "271414315aff87387382ec3d271b52d7ae78726f5d44ac98b4f4030c91880486" + +[[package]] +name = "winnow" +version = "0.7.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "74c7b26e3480b707944fc872477815d29a8e429d2f93a1ce000f5fa84a15cbcd" +dependencies = [ + "memchr", +] + +[[package]] +name = "wit-bindgen-rt" +version = "0.39.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6f42320e61fe2cfd34354ecb597f86f413484a798ba44a8ca1165c58d42da6c1" +dependencies = [ + "bitflags 2.9.1", +] + +[[package]] +name = "zerocopy" +version = "0.8.26" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1039dd0d3c310cf05de012d8a39ff557cb0d23087fd44cad61df08fc31907a2f" +dependencies = [ + "zerocopy-derive", +] + +[[package]] +name = "zerocopy-derive" +version = "0.8.26" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9ecf5b4cc5364572d7f4c329661bcc82724222973f2cab6f050a4e5c22f75181" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "zune-core" +version = "0.4.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3f423a2c17029964870cfaabb1f13dfab7d092a62a29a89264f4d36990ca414a" + +[[package]] +name = "zune-inflate" +version = "0.2.54" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "73ab332fe2f6680068f3582b16a24f90ad7096d5d39b974d1c0aff0125116f02" +dependencies = [ + "simd-adler32", +] + +[[package]] +name = "zune-jpeg" +version = "0.4.18" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7384255a918371b5af158218d131530f694de9ad3815ebdd0453a940485cb0fa" +dependencies = [ + "zune-core", +] diff --git a/nu_plugin_image/Cargo.toml b/nu_plugin_image/Cargo.toml new file mode 100644 index 0000000..4c343e8 --- /dev/null +++ b/nu_plugin_image/Cargo.toml @@ -0,0 +1,48 @@ +[dependencies] +slog = "2.7.0" +termcolor = "1.4.1" +ansi_colours = "1.2.3" +crossterm = "0.29.0" +image = "0.25.6" +imageproc = "0.25.0" +include-flate = "0.3.0" +ab_glyph = "0.2.29" +vte = "0.15.0" +lazy_static = "1.5.0" +slog-term = "2.9.1" +slog-async = "2.8.0" + +[dependencies.clap] +features = ["derive"] +version = "4.5.40" + +[dependencies.nu-plugin] +version = "0.105.2" +path = "../nushell/crates/nu-plugin" + +[dependencies.nu-protocol] +features = ["plugin"] +version = "0.105.2" +path = "../nushell/crates/nu-protocol" + +[features] +all-fonts = ["font-iosevka_term", "font-anonymous_pro", "font-ubuntu"] +default = [] +font-anonymous_pro = [] +font-iosevka_term = [] +font-ubuntu = [] + +with-debug = ["slog/max_level_debug", "slog/release_max_level_debug"] +with-trace = ["slog/max_level_trace", "slog/release_max_level_trace"] + +[package] +authors = ["Motalleb Fallahnezhad "] +description = "A nushell plugin to open png images in the shell and save ansi string as images (like tables or ...)" +edition = "2024" +homepage = "https://github.com/FMotalleb/nu_plugin_image" +keywords = ["nushell", "image", "render", "plugin"] +license = "MIT" +name = "nu_plugin_image" +readme = "README.md" +repository = "https://github.com/FMotalleb/nu_plugin_image" +version = "0.105.1" diff --git a/nu_plugin_image/LICENSE b/nu_plugin_image/LICENSE new file mode 100644 index 0000000..abbd7eb --- /dev/null +++ b/nu_plugin_image/LICENSE @@ -0,0 +1,7 @@ +Copyright 2023 "Motalleb Fallahnezhad" + +Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/nu_plugin_image/README.md b/nu_plugin_image/README.md new file mode 100644 index 0000000..c7789f0 --- /dev/null +++ b/nu_plugin_image/README.md @@ -0,0 +1,115 @@ +# 🖼 nu_plugin_image + +A [Nushell](https://www.nushell.sh/) plugin to convert ANSI strings into PNG images and create ANSI text from images. + +--- + +## ✨ Features + +This plugin allows you to: + +- Convert ANSI strings to PNG images with customizable fonts and themes. +- Create ANSI text from an image, enabling you to transform visual data into a textual representation. + +--- + +### **`to png`** – Convert ANSI String to PNG Image + +The `to png` command converts an ANSI string into a PNG image. Customizable font and theme options are available, with custom flags overriding the default settings. + +#### 📌 Usage + +```bash +> to png {flags} (output-path) +``` + +#### ⚙️ Available Flags + +- `-h, --help` → Display the help message for this command. +- `-w, --width ` → Output width. +- `-t, --theme ` → Select the theme of the output. Available themes: ["vscode", "xterm", "ubuntu", "eclipse", "mirc", "putty", "winxp", "terminal", "win10", "win_power-shell", "win_ps"]. Defaults to `vscode`. +- `--font ` → Select the font from one of ["SourceCodePro", "Ubuntu", "IosevkaTerm", "AnonymousPro"]. Defaults to the first font in the list. +- `--custom-font-regular ` → Path to a custom regular font. +- `--custom-font-bold ` → Path to a custom bold font. +- `--custom-font-italic ` → Path to a custom italic font. +- `--custom-font-bold_italic ` → Path to a custom bold italic font. +- `--custom-theme-fg ` → Custom foreground color in hex format (e.g., `#FFFFFF` for white). +- `--custom-theme-bg ` → Custom background color in hex format (e.g., `#00000000` for transparent). +- `--custom-theme-black ` → Custom black color in hex format (e.g., `#1C1C1C`). +- `--custom-theme-red ` → Custom red color in hex format (e.g., `#FF0000`). +- `--custom-theme-green ` → Custom green color in hex format (e.g., `#00FF00`). +- `--custom-theme-yellow ` → Custom yellow color in hex format (e.g., `#FFFF00`). +- `--custom-theme-blue ` → Custom blue color in hex format (e.g., `#0000FF`). +- `--custom-theme-magenta ` → Custom magenta color in hex format (e.g., `#FF00FF`). +- `--custom-theme-cyan ` → Custom cyan color in hex format (e.g., `#00FFFF`). +- `--custom-theme-white ` → Custom white color in hex format (e.g., `#FFFFFF`). +- `--custom-theme-bright_black ` → Custom bright black color in hex format (e.g., `#808080`). +- `--custom-theme-bright_red ` → Custom bright red color in hex format (e.g., `#FF5555`). +- `--custom-theme-bright_green ` → Custom bright green color in hex format (e.g., `#55FF55`). +- `--custom-theme-bright_yellow ` → Custom bright yellow color in hex format (e.g., `#FFFF55`). +- `--custom-theme-bright_blue ` → Custom bright blue color in hex format (e.g., `#5555FF`). +- `--custom-theme-bright_magenta ` → Custom bright magenta color in hex format (e.g., `#FF55FF`). +- `--custom-theme-bright_cyan ` → Custom bright cyan color in hex format (e.g., `#55FFFF`). +- `--custom-theme-bright_white ` → Custom bright white color in hex format (e.g., `#FFFFFF`). +- `--log-level ` → Set log level. Options: `CRITICAL (c)`, `ERROR (e)`, `WARN (w)`, `INFO (i)`, `DEBUG (d)`, `TRACE (t)`. Defaults to `INFO`. + +#### 📊 Example: Convert ANSI String to PNG with Custom Theme + +```bash +> to png --theme "xterm" --custom-theme-fg "#FF00FF" --custom-theme-bg "#00000000" output.png +``` + +--- + +### **`from png`** – Create ANSI Text from an Image + +The `from png` command converts an image into its corresponding ANSI text representation. + +#### 📌 Usage + +```bash +> from png {flags} +``` + +#### ⚙️ Available Flags + +- `-h, --help` → Display the help message for this command. +- `-x, --width ` → Output width, in characters. +- `-y, --height ` → Output height, in characters. +- `--log-level ` → Set log level. Options: `CRITICAL (c)`, `ERROR (e)`, `WARN (w)`, `INFO (i)`, `DEBUG (d)`, `TRACE (t)`. Defaults to `INFO`. + +#### 📊 Example: Convert PNG Image to ANSI Text + +```bash +> from png --width 80 --height 20 image.png +``` + +--- + +## 🔧 Installation + +### 🚀 Recommended: Using [nupm](https://github.com/nushell/nupm) + +This method automatically handles dependencies and features. + +```bash +git clone https://github.com/FMotalleb/nu_plugin_image.git +nupm install --path nu_plugin_image -f +``` + +### 🛠️ Manual Compilation + +```bash +git clone https://github.com/FMotalleb/nu_plugin_image.git +cd nu_plugin_image +cargo build -r +plugin add target/release/nu_plugin_image +``` + +### 📦 Install via Cargo (using git) + +```bash +cargo install --git https://github.com/FMotalleb/nu_plugin_image.git +plugin add ~/.cargo/bin/nu_plugin_image +``` + diff --git a/nu_plugin_image/build.nu b/nu_plugin_image/build.nu new file mode 100644 index 0000000..dacc7fa --- /dev/null +++ b/nu_plugin_image/build.nu @@ -0,0 +1,45 @@ +use std log + + +# TODO add licenses +let fonts = [ + [name, feature]; + [ + "AnonymousPro Font", + font-anonymous_pro + ], + [ + "IosevkaTerm Font", + font-iosevka_term + ], + [ + "Ubuntu Font", + font-ubuntu + ], + [ + "Debug log level (only used for debuging)", + with-debug + ], + [ + "Trace log level (only used for advanced debuging)", + with-trace + ], +] + + +def main [package_file: path] { + let repo_root = $package_file | path dirname + let install_root = $env.NUPM_HOME | path join "plugins" + let selected_fonts = $fonts + | input list -d name -m "select features to install" + | get feature + + let name = open ($repo_root | path join "Cargo.toml") | get package.name + let ext = if ($nu.os-info.name == 'windows') { '.exe' } else { '' } + let command = $"cargo install --path ($repo_root) --root ($install_root) --features=\"($selected_fonts | str join ',')\"" + log info $"building using `($command)`" + nu --commands $"($command)" + plugin add $"($install_root | path join "bin" $name)($ext)" + log info "do not forget to restart Nushell for the plugin to be fully available!" + nu ($repo_root | path join scripts theme_exporter.nu) +} diff --git a/nu_plugin_image/nupm.nuon b/nu_plugin_image/nupm.nuon new file mode 100644 index 0000000..f34f2e7 --- /dev/null +++ b/nu_plugin_image/nupm.nuon @@ -0,0 +1,7 @@ +{ + "name": "nu_plugin_image", + "version": "0.104.0", + "description": "A nushell plugin to open png images in the shell and save ansi string as images (like tables or ...)", + "license": "LICENSE", + "type": "custom" +} \ No newline at end of file diff --git a/nu_plugin_image/resources/fonts/Anonymous_Pro/Bold.ttf b/nu_plugin_image/resources/fonts/Anonymous_Pro/Bold.ttf new file mode 100644 index 0000000..985bd40 Binary files /dev/null and b/nu_plugin_image/resources/fonts/Anonymous_Pro/Bold.ttf differ diff --git a/nu_plugin_image/resources/fonts/Anonymous_Pro/BoldItalic.ttf b/nu_plugin_image/resources/fonts/Anonymous_Pro/BoldItalic.ttf new file mode 100644 index 0000000..838f2d1 Binary files /dev/null and b/nu_plugin_image/resources/fonts/Anonymous_Pro/BoldItalic.ttf differ diff --git a/nu_plugin_image/resources/fonts/Anonymous_Pro/Italic.ttf b/nu_plugin_image/resources/fonts/Anonymous_Pro/Italic.ttf new file mode 100644 index 0000000..43505c1 Binary files /dev/null and b/nu_plugin_image/resources/fonts/Anonymous_Pro/Italic.ttf differ diff --git a/nu_plugin_image/resources/fonts/Anonymous_Pro/Regular.ttf b/nu_plugin_image/resources/fonts/Anonymous_Pro/Regular.ttf new file mode 100644 index 0000000..06aafc0 Binary files /dev/null and b/nu_plugin_image/resources/fonts/Anonymous_Pro/Regular.ttf differ diff --git a/nu_plugin_image/resources/fonts/IosevkaTerm/Bold.ttf b/nu_plugin_image/resources/fonts/IosevkaTerm/Bold.ttf new file mode 100644 index 0000000..56cce1a Binary files /dev/null and b/nu_plugin_image/resources/fonts/IosevkaTerm/Bold.ttf differ diff --git a/nu_plugin_image/resources/fonts/IosevkaTerm/BoldItalic.ttf b/nu_plugin_image/resources/fonts/IosevkaTerm/BoldItalic.ttf new file mode 100644 index 0000000..272ac75 Binary files /dev/null and b/nu_plugin_image/resources/fonts/IosevkaTerm/BoldItalic.ttf differ diff --git a/nu_plugin_image/resources/fonts/IosevkaTerm/Italic.ttf b/nu_plugin_image/resources/fonts/IosevkaTerm/Italic.ttf new file mode 100644 index 0000000..6f0938c Binary files /dev/null and b/nu_plugin_image/resources/fonts/IosevkaTerm/Italic.ttf differ diff --git a/nu_plugin_image/resources/fonts/IosevkaTerm/Medium.ttf b/nu_plugin_image/resources/fonts/IosevkaTerm/Medium.ttf new file mode 100644 index 0000000..faa9149 Binary files /dev/null and b/nu_plugin_image/resources/fonts/IosevkaTerm/Medium.ttf differ diff --git a/nu_plugin_image/resources/fonts/SourceCodePro/Bold.otf b/nu_plugin_image/resources/fonts/SourceCodePro/Bold.otf new file mode 100644 index 0000000..f4e576c Binary files /dev/null and b/nu_plugin_image/resources/fonts/SourceCodePro/Bold.otf differ diff --git a/nu_plugin_image/resources/fonts/SourceCodePro/BoldItalic.otf b/nu_plugin_image/resources/fonts/SourceCodePro/BoldItalic.otf new file mode 100644 index 0000000..681a937 Binary files /dev/null and b/nu_plugin_image/resources/fonts/SourceCodePro/BoldItalic.otf differ diff --git a/nu_plugin_image/resources/fonts/SourceCodePro/Italic.otf b/nu_plugin_image/resources/fonts/SourceCodePro/Italic.otf new file mode 100644 index 0000000..0ab9eea Binary files /dev/null and b/nu_plugin_image/resources/fonts/SourceCodePro/Italic.otf differ diff --git a/nu_plugin_image/resources/fonts/SourceCodePro/Regular.otf b/nu_plugin_image/resources/fonts/SourceCodePro/Regular.otf new file mode 100644 index 0000000..4e3b9d0 Binary files /dev/null and b/nu_plugin_image/resources/fonts/SourceCodePro/Regular.otf differ diff --git a/nu_plugin_image/resources/fonts/Ubuntu/Bold.ttf b/nu_plugin_image/resources/fonts/Ubuntu/Bold.ttf new file mode 100644 index 0000000..7bd6665 Binary files /dev/null and b/nu_plugin_image/resources/fonts/Ubuntu/Bold.ttf differ diff --git a/nu_plugin_image/resources/fonts/Ubuntu/BoldItalic.ttf b/nu_plugin_image/resources/fonts/Ubuntu/BoldItalic.ttf new file mode 100644 index 0000000..6c5b8ba Binary files /dev/null and b/nu_plugin_image/resources/fonts/Ubuntu/BoldItalic.ttf differ diff --git a/nu_plugin_image/resources/fonts/Ubuntu/Italic.ttf b/nu_plugin_image/resources/fonts/Ubuntu/Italic.ttf new file mode 100644 index 0000000..18f81a2 Binary files /dev/null and b/nu_plugin_image/resources/fonts/Ubuntu/Italic.ttf differ diff --git a/nu_plugin_image/resources/fonts/Ubuntu/Regular.ttf b/nu_plugin_image/resources/fonts/Ubuntu/Regular.ttf new file mode 100644 index 0000000..fdd309d Binary files /dev/null and b/nu_plugin_image/resources/fonts/Ubuntu/Regular.ttf differ diff --git a/nu_plugin_image/rust-toolchain.toml b/nu_plugin_image/rust-toolchain.toml new file mode 100644 index 0000000..29171b0 --- /dev/null +++ b/nu_plugin_image/rust-toolchain.toml @@ -0,0 +1,3 @@ +[toolchain] +profile = "default" +channel = "stable" diff --git a/nu_plugin_image/scripts/theme_exporter.nu b/nu_plugin_image/scripts/theme_exporter.nu new file mode 100644 index 0000000..6ce7683 --- /dev/null +++ b/nu_plugin_image/scripts/theme_exporter.nu @@ -0,0 +1,78 @@ +use std log +def confirm [message: string] : any -> bool { + ["yes","no"] | input list $message | $in == "yes" +} +def "from binary" [] : binary -> string { + $in | encode base64 | base64 -d +} + +def get-terminal-colors [] { + + let colors = (0..15 | each {|i| $"4;($i);?" + | (term query $"(ansi osc)(ansi -o $in)(ansi st)" --terminator "\e\\" + | from binary + | split row : + | get 1 + | split row /) + }) + + let env_vars = [ + [NU_PLUGIN_IMAGE_FG, ($colors | get 07)] + [NU_PLUGIN_IMAGE_BG , ($colors | get 00)] + [NU_PLUGIN_IMAGE_BLACK , ($colors | get 00)] + [NU_PLUGIN_IMAGE_RED, ($colors | get 01)] + [NU_PLUGIN_IMAGE_GREEN, ($colors | get 02)] + [NU_PLUGIN_IMAGE_YELLOW, ($colors | get 03)] + [NU_PLUGIN_IMAGE_BLUE, ($colors | get 04)] + [NU_PLUGIN_IMAGE_MAGENTA, ($colors | get 05)] + [NU_PLUGIN_IMAGE_CYAN, ($colors | get 06)] + [NU_PLUGIN_IMAGE_WHITE, ($colors | get 07)] + [NU_PLUGIN_IMAGE_BRIGHT_BLACK, ($colors | get 08)] + [NU_PLUGIN_IMAGE_BRIGHT_RED, ($colors | get 09)] + [NU_PLUGIN_IMAGE_BRIGHT_GREEN, ($colors | get 10)] + [NU_PLUGIN_IMAGE_BRIGHT_YELLOW, ($colors | get 11)] + [NU_PLUGIN_IMAGE_BRIGHT_BLUE, ($colors | get 12)] + [NU_PLUGIN_IMAGE_BRIGHT_MAGENTA, ($colors | get 13)] + [NU_PLUGIN_IMAGE_BRIGHT_CYAN, ($colors | get 14)] + [NU_PLUGIN_IMAGE_BRIGHT_WHITE, ($colors | get 15)] + ] | each {|col| + let rgb = $col | get 1 + # 16bit rgb to 8bit = 0xe7e7 | bits and 0x00ff + let red = ($"0x($rgb | get 0)" | into int | bits and 0x00ff) + let green = ($"0x($rgb | get 1)" | into int | bits and 0x00ff) + let blue = ($"0x($rgb | get 2)" | into int | bits and 0x00ff) + let red_hx = ($red | fmt).lowerhex | str substring 2.. + let green_hx = ($green | fmt).lowerhex | str substring 2.. + let blue_hx = ($blue | fmt).lowerhex | str substring 2.. + $"$env.($col | first) = 0x($red_hx)($green_hx)($blue_hx)" + } + + if (confirm "write config to the env file?") { + + let default = ($nu.env-path | path dirname | path join nu_image_plugin_conf.nu) + let config_path = input $"where should i save the env file? \(default: ($default)\)\n~> " + | if (not ($in | is-empty)) { + $in + } else { + ($default) + } + + + if (not ( $config_path | path exists)) { + $"source ($config_path)" | save $nu.env-path --append + } + + $"# Auto generated code\n($env_vars | str join "\n")" | save $config_path -f + + log info "Please restart the shell" + } else { + for i in $env_vars { + print $"($i)\n" + } + print "add thse values to environment variables using `config env`" + } +} + +if (confirm "do you want to save your current shell's theme as default for `to png`?") { + print (get-terminal-colors) +} \ No newline at end of file diff --git a/nu_plugin_image/src/ansi_to_image/ansi_to_image.rs b/nu_plugin_image/src/ansi_to_image/ansi_to_image.rs new file mode 100644 index 0000000..5a4db89 --- /dev/null +++ b/nu_plugin_image/src/ansi_to_image/ansi_to_image.rs @@ -0,0 +1,71 @@ +use image::RgbaImage; +use std::{ + io::{BufReader, Read}, + path::Path, +}; +use vte::Parser; + +use crate::{ + ansi_to_image::{ + font_family::FontFamily, + palette::Palette, + printer::{self, Settings}, + }, + warn, +}; + +use super::internal_scale::InternalScale; + +pub fn make_image( + output_path: &Path, + font_family: FontFamily, + png_width: Option, + input: &[u8], + palette: Palette, +) { + // let = FontFamily::default(); + + let font = font_family.regular; + let font_bold = font_family.bold; + let font_italic = font_family.italic; + let font_italic_bold = font_family.bold_italic; + + let font_height = 50.0; + let scale = InternalScale { + x: font_height, + y: font_height, + }; + + // let palette = Palette::Vscode; + + let mut state_machine = Parser::new(); + let mut performer = printer::new(Settings { + font, + font_bold, + font_italic, + font_italic_bold, + font_height, + scale, + palette, + png_width, + }); + let reader = &mut BufReader::new(input); + let mut buf = [0; 2048]; + + loop { + match reader.read(&mut buf) { + Ok(0) => break, + + Ok(n) => state_machine.advance(&mut performer, &buf[..n]), + + Err(err) => { + warn!("{err}"); + break; + } + } + } + + let image: RgbaImage = performer.into(); + + image.save(output_path).unwrap(); +} diff --git a/nu_plugin_image/src/ansi_to_image/color.rs b/nu_plugin_image/src/ansi_to_image/color.rs new file mode 100644 index 0000000..0b5085a --- /dev/null +++ b/nu_plugin_image/src/ansi_to_image/color.rs @@ -0,0 +1,21 @@ +#[derive(Debug, Clone, Copy)] +pub(super) enum ColorType { + PrimaryForeground, + PrimaryBackground, + Normal(Color), + Bright(Color), + Fixed(u8), + Rgb { field1: (u8, u8, u8) }, +} + +#[derive(Debug, Clone, Copy)] +pub(super) enum Color { + Black, + Red, + Green, + Yellow, + Blue, + Magenta, + Cyan, + White, +} diff --git a/nu_plugin_image/src/ansi_to_image/escape.rs b/nu_plugin_image/src/ansi_to_image/escape.rs new file mode 100644 index 0000000..3b7af5f --- /dev/null +++ b/nu_plugin_image/src/ansi_to_image/escape.rs @@ -0,0 +1,206 @@ +//! From https://en.wikipedia.org/wiki/ANSI_escape_code#SGR_(Select_Graphic_Rendition)_parameters + +use crate::ansi_to_image::color::{Color, ColorType}; + +#[derive(Debug)] +pub(super) enum EscapeSequence { + Reset, + + BlackLetterFont, + Bold, + Faint, + Italic, + RapidBlink, + SlowBlink, + Underline, + + NotBold, + NotUnderline, + NormalIntensity, + NotItalicNorBlackLetter, + NotBlinking, + + ReverseVideo, + Conceal, + CrossedOut, + + DefaultForegroundColor, + DefaultBackgroundColor, + + PrimaryFont, + SetAlternativeFont, + + ForegroundColor(ColorType), + BackgroundColor(ColorType), + + DisableProportionalSpacing, + NeitherSuperscriptNorSubscript, + + NotReserved, + + Unimplemented(Vec), +} + +impl EscapeSequence { + pub(super) fn parse_params(params: Vec<&u16>) -> Vec { + // let params_slice: Vec<&u16> = ; + + match params.as_slice() { + // Set foreground (38) or background (48) color + [fg_or_bg, 5, n] => { + let color = match n { + 0 => ColorType::Normal(Color::Black), + 1 => ColorType::Normal(Color::Red), + 2 => ColorType::Normal(Color::Green), + 3 => ColorType::Normal(Color::Yellow), + 4 => ColorType::Normal(Color::Blue), + 5 => ColorType::Normal(Color::Magenta), + 6 => ColorType::Normal(Color::Cyan), + 7 => ColorType::Normal(Color::White), + + 8 => ColorType::Bright(Color::Black), + 9 => ColorType::Bright(Color::Red), + 10 => ColorType::Bright(Color::Green), + 11 => ColorType::Bright(Color::Yellow), + 12 => ColorType::Bright(Color::Blue), + 13 => ColorType::Bright(Color::Magenta), + 14 => ColorType::Bright(Color::Cyan), + 15 => ColorType::Bright(Color::White), + + // These are fixed colors and could be used like ansi 38;5;numberm or 48;5;numberm + 16..=255 => ColorType::Fixed(**n as u8), + + _ => return vec![Self::Unimplemented(vec![0, **fg_or_bg, 5, **n])], + }; + + match fg_or_bg { + // foreground + 38 => vec![Self::ForegroundColor(color)], + + // background + 48 => vec![Self::BackgroundColor(color)], + + _ => vec![Self::Unimplemented(vec![1, **fg_or_bg, 5, **n])], + } + } + + [fg_or_bg, 2, r, g, b] => { + let color = ColorType::Rgb { + field1: (**r as u8, **g as u8, **b as u8), + }; + match fg_or_bg { + // foreground + 38 => vec![Self::ForegroundColor(color)], + + // background + 48 => vec![Self::BackgroundColor(color)], + + _ => vec![Self::Unimplemented(vec![2, **fg_or_bg, 2, **r, **g, **b])], + } + } + + v => { + if v.len() > 0 { + match v.split_at(1) { + ([item, ..], rest) => { + // let ve = Vec::from(rest); + let mut result = vec![Self::parse_single(item)]; + let next = Vec::from(rest); + for value in Self::parse_params(next) { + result.push(value); + } + return result; + } + _ => { + return vec![]; + } + } + } + return vec![]; + } + } + } + + fn parse_single(value: &&u16) -> Self { + match value { + 0 => Self::Reset, + 1 => Self::Bold, + 2 => Self::Faint, + 3 => Self::Italic, + 4 => Self::Underline, + 5 => Self::SlowBlink, + 6 => Self::RapidBlink, + + 7 => Self::ReverseVideo, + 8 => Self::Conceal, + 9 => Self::CrossedOut, + + 10 => Self::PrimaryFont, + + 11 => Self::SetAlternativeFont, + 12 => Self::SetAlternativeFont, + 13 => Self::SetAlternativeFont, + 14 => Self::SetAlternativeFont, + 15 => Self::SetAlternativeFont, + 16 => Self::SetAlternativeFont, + 17 => Self::SetAlternativeFont, + 18 => Self::SetAlternativeFont, + 19 => Self::SetAlternativeFont, + + 20 => Self::BlackLetterFont, + 21 => Self::NotBold, + 22 => Self::NormalIntensity, + 23 => Self::NotItalicNorBlackLetter, + 24 => Self::NotUnderline, + 25 => Self::NotBlinking, + + 27 => Self::NotReserved, + + 30 => Self::ForegroundColor(ColorType::Normal(Color::Black)), + 31 => Self::ForegroundColor(ColorType::Normal(Color::Red)), + 32 => Self::ForegroundColor(ColorType::Normal(Color::Green)), + 33 => Self::ForegroundColor(ColorType::Normal(Color::Yellow)), + 34 => Self::ForegroundColor(ColorType::Normal(Color::Blue)), + 35 => Self::ForegroundColor(ColorType::Normal(Color::Magenta)), + 36 => Self::ForegroundColor(ColorType::Normal(Color::Cyan)), + 37 => Self::ForegroundColor(ColorType::Normal(Color::White)), + + 39 => Self::DefaultForegroundColor, + + 40 => Self::BackgroundColor(ColorType::Normal(Color::Black)), + 41 => Self::BackgroundColor(ColorType::Normal(Color::Red)), + 42 => Self::BackgroundColor(ColorType::Normal(Color::Green)), + 43 => Self::BackgroundColor(ColorType::Normal(Color::Yellow)), + 44 => Self::BackgroundColor(ColorType::Normal(Color::Blue)), + 45 => Self::BackgroundColor(ColorType::Normal(Color::Magenta)), + 46 => Self::BackgroundColor(ColorType::Normal(Color::Cyan)), + 47 => Self::BackgroundColor(ColorType::Normal(Color::White)), + + 49 => Self::DefaultBackgroundColor, + 50 => Self::DisableProportionalSpacing, + 53 => Self::CrossedOut, + + 75 => Self::NeitherSuperscriptNorSubscript, + + 90 => Self::BackgroundColor(ColorType::Bright(Color::Black)), + 91 => Self::BackgroundColor(ColorType::Bright(Color::Red)), + 92 => Self::BackgroundColor(ColorType::Bright(Color::Green)), + 93 => Self::BackgroundColor(ColorType::Bright(Color::Yellow)), + 94 => Self::BackgroundColor(ColorType::Bright(Color::Blue)), + 95 => Self::BackgroundColor(ColorType::Bright(Color::Magenta)), + 96 => Self::BackgroundColor(ColorType::Bright(Color::Cyan)), + 97 => Self::BackgroundColor(ColorType::Bright(Color::White)), + + 100 => Self::BackgroundColor(ColorType::Bright(Color::Black)), + 101 => Self::BackgroundColor(ColorType::Bright(Color::Red)), + 102 => Self::BackgroundColor(ColorType::Bright(Color::Green)), + 103 => Self::BackgroundColor(ColorType::Bright(Color::Yellow)), + 104 => Self::BackgroundColor(ColorType::Bright(Color::Blue)), + 105 => Self::BackgroundColor(ColorType::Bright(Color::Magenta)), + 106 => Self::BackgroundColor(ColorType::Bright(Color::Cyan)), + 107 => Self::BackgroundColor(ColorType::Bright(Color::White)), + + v => Self::Unimplemented(vec![3, **v]), + } + } +} diff --git a/nu_plugin_image/src/ansi_to_image/escape_parser.rs b/nu_plugin_image/src/ansi_to_image/escape_parser.rs new file mode 100644 index 0000000..3497d98 --- /dev/null +++ b/nu_plugin_image/src/ansi_to_image/escape_parser.rs @@ -0,0 +1,231 @@ +//! From https://en.wikipedia.org/wiki/ANSI_escape_code#SGR_(Select_Graphic_Rendition)_parameters + +use std::slice::Iter; + +use crate::warn; + +use crate::ansi_to_image::color::{Color, ColorType}; + +#[derive(Debug)] +pub(super) enum EscapeSequence { + Reset, + + BlackLetterFont, + Bold, + Faint, + Italic, + RapidBlink, + SlowBlink, + Underline, + + NotBold, + NotUnderline, + NormalIntensity, + NotItalicNorBlackLetter, + NotBlinking, + + ReverseVideo, + Conceal, + CrossedOut, + + DefaultForegroundColor, + DefaultBackgroundColor, + + PrimaryFont, + SetAlternativeFont, + + ForegroundColor(ColorType), + BackgroundColor(ColorType), + + DisableProportionalSpacing, + NeitherSuperscriptNorSubscript, + + NotReserved, + + Unimplemented(Vec), + Ignore, +} + +impl EscapeSequence { + pub(super) fn parse_params(params: Vec<&u16>) -> Vec { + let iter = &mut params.iter(); + let mut result = vec![]; + while iter.len() > 0 { + result.push(Self::consume_and_parse(iter)) + } + result + } + fn consume_and_parse(iter: &mut Iter<&u16>) -> Self { + if let Some(current) = iter.next() { + return match *current { + 0 => Self::Reset, + 1 => Self::Bold, + 2 => Self::Faint, + 3 => Self::Italic, + 4 => Self::Underline, + 5 => Self::SlowBlink, + 6 => Self::RapidBlink, + + 7 => Self::ReverseVideo, + 8 => Self::Conceal, + 9 => Self::CrossedOut, + + 10 => Self::PrimaryFont, + + 11 => Self::SetAlternativeFont, + 12 => Self::SetAlternativeFont, + 13 => Self::SetAlternativeFont, + 14 => Self::SetAlternativeFont, + 15 => Self::SetAlternativeFont, + 16 => Self::SetAlternativeFont, + 17 => Self::SetAlternativeFont, + 18 => Self::SetAlternativeFont, + 19 => Self::SetAlternativeFont, + + 20 => Self::BlackLetterFont, + 21 => Self::NotBold, + 22 => Self::NormalIntensity, + 23 => Self::NotItalicNorBlackLetter, + 24 => Self::NotUnderline, + 25 => Self::NotBlinking, + + 26 => Self::Ignore, // Proportional spacing + + 27 => Self::NotReserved, + 28 => Self::Ignore, // Reveal + 29 => Self::Ignore, // Not crossed out + + 30 => Self::ForegroundColor(ColorType::Normal(Color::Black)), + 31 => Self::ForegroundColor(ColorType::Normal(Color::Red)), + 32 => Self::ForegroundColor(ColorType::Normal(Color::Green)), + 33 => Self::ForegroundColor(ColorType::Normal(Color::Yellow)), + 34 => Self::ForegroundColor(ColorType::Normal(Color::Blue)), + 35 => Self::ForegroundColor(ColorType::Normal(Color::Magenta)), + 36 => Self::ForegroundColor(ColorType::Normal(Color::Cyan)), + 37 => Self::ForegroundColor(ColorType::Normal(Color::White)), + 38 => match iter.next() { + Some(mode) => Self::ForegroundColor(parse_color(mode, iter)), + None => { + warn!( + "[SEQUENCE_PARSER] foreground color mode is not supplied, parse_color(null, ...)", + ); + Self::Ignore + } + }, + 39 => Self::DefaultForegroundColor, + + 40 => Self::BackgroundColor(ColorType::Normal(Color::Black)), + 41 => Self::BackgroundColor(ColorType::Normal(Color::Red)), + 42 => Self::BackgroundColor(ColorType::Normal(Color::Green)), + 43 => Self::BackgroundColor(ColorType::Normal(Color::Yellow)), + 44 => Self::BackgroundColor(ColorType::Normal(Color::Blue)), + 45 => Self::BackgroundColor(ColorType::Normal(Color::Magenta)), + 46 => Self::BackgroundColor(ColorType::Normal(Color::Cyan)), + 47 => Self::BackgroundColor(ColorType::Normal(Color::White)), + 48 => match iter.next() { + Some(mode) => Self::BackgroundColor(parse_color(mode, iter)), + None => { + warn!( + "[SEQUENCE_PARSER] background color mode is not supplied, parse_color(null, ...)", + ); + Self::Ignore + } + }, + 49 => Self::DefaultBackgroundColor, + 50 => Self::DisableProportionalSpacing, + 53 => Self::CrossedOut, + + 75 => Self::NeitherSuperscriptNorSubscript, + + 90 => Self::ForegroundColor(ColorType::Bright(Color::Black)), + 91 => Self::ForegroundColor(ColorType::Bright(Color::Red)), + 92 => Self::ForegroundColor(ColorType::Bright(Color::Green)), + 93 => Self::ForegroundColor(ColorType::Bright(Color::Yellow)), + 94 => Self::ForegroundColor(ColorType::Bright(Color::Blue)), + 95 => Self::ForegroundColor(ColorType::Bright(Color::Magenta)), + 96 => Self::ForegroundColor(ColorType::Bright(Color::Cyan)), + 97 => Self::ForegroundColor(ColorType::Bright(Color::White)), + + 100 => Self::BackgroundColor(ColorType::Bright(Color::Black)), + 101 => Self::BackgroundColor(ColorType::Bright(Color::Red)), + 102 => Self::BackgroundColor(ColorType::Bright(Color::Green)), + 103 => Self::BackgroundColor(ColorType::Bright(Color::Yellow)), + 104 => Self::BackgroundColor(ColorType::Bright(Color::Blue)), + 105 => Self::BackgroundColor(ColorType::Bright(Color::Magenta)), + 106 => Self::BackgroundColor(ColorType::Bright(Color::Cyan)), + 107 => Self::BackgroundColor(ColorType::Bright(Color::White)), + + v => Self::Unimplemented(vec![3, *v]), + }; + } + Self::Ignore + } +} + +fn parse_color(mode: &u16, iter: &mut Iter<&u16>) -> ColorType { + match mode { + 5 => { + let color = iter.next(); + if let Some(color) = color { + let color = match color { + 0 => ColorType::Normal(Color::Black), + 1 => ColorType::Normal(Color::Red), + 2 => ColorType::Normal(Color::Green), + 3 => ColorType::Normal(Color::Yellow), + 4 => ColorType::Normal(Color::Blue), + 5 => ColorType::Normal(Color::Magenta), + 6 => ColorType::Normal(Color::Cyan), + 7 => ColorType::Normal(Color::White), + + 8 => ColorType::Bright(Color::Black), + 9 => ColorType::Bright(Color::Red), + 10 => ColorType::Bright(Color::Green), + 11 => ColorType::Bright(Color::Yellow), + 12 => ColorType::Bright(Color::Blue), + 13 => ColorType::Bright(Color::Magenta), + 14 => ColorType::Bright(Color::Cyan), + 15 => ColorType::Bright(Color::White), + + // These are fixed colors and could be used like ansi 38;5;numberm or 48;5;numberm + 16..=255 => ColorType::Fixed(**color as u8), + + v => { + warn!("[COLOR_PARSER] fixed color value out of range, parse_fixed_color(code: {})",v); + return ColorType::PrimaryForeground; + } + }; + return color; + } else { + warn!( + "[COLOR_PARSER] fixed color value not supplied, parse_fixed_color(code: null)" + ); + + return ColorType::PrimaryForeground; + } + } + 2 => match (iter.next(), iter.next(), iter.next()) { + (Some(r), Some(g), Some(b)) => { + let color = ColorType::Rgb { + field1: (**r as u8, **g as u8, **b as u8), + }; + return color; + } + (r, g, b) => { + warn!( + "[COLOR_PARSER] rgb color value not supplied (correctly), parse_rgb_color({}, {}, {})", + r.map(|i| i.to_string() ).unwrap_or("null".to_string()), + g.map(|i| i.to_string() ).unwrap_or("null".to_string()), + b.map(|i| i.to_string() ).unwrap_or("null".to_string()) + ); + return ColorType::PrimaryForeground; + } + }, + v => { + warn!( + "[COLOR_PARSER] color mode is not supplied correctly, parse_color({}, ...)", + v + ); + return ColorType::PrimaryForeground; + } + } +} diff --git a/nu_plugin_image/src/ansi_to_image/font_family.rs b/nu_plugin_image/src/ansi_to_image/font_family.rs new file mode 100644 index 0000000..ced1e27 --- /dev/null +++ b/nu_plugin_image/src/ansi_to_image/font_family.rs @@ -0,0 +1,154 @@ +use std::fmt; +use std::fmt::{Display, Formatter}; + +use ab_glyph::FontRef; +use include_flate::flate; +type FontBuilder = fn() -> FontFamily<'static>; +#[derive(Debug)] +pub struct FontFamily<'a> { + pub name: String, + pub regular: FontRef<'a>, + pub bold: FontRef<'a>, + pub italic: FontRef<'a>, + pub bold_italic: FontRef<'a>, +} + +impl FontFamily<'static> { + fn all_fonts() -> Vec<(String, FontBuilder)> { + let mut result: Vec<(String, FontBuilder)> = vec![]; + result.push(("SourceCodePro".to_string(), Self::source_code_pro)); + #[cfg(feature = "font-ubuntu")] + result.push(("Ubuntu".to_string(), Self::ubuntu)); + #[cfg(feature = "font-iosevka_term")] + result.push(("IosevkaTerm".to_string(), Self::iosevka_term)); + #[cfg(feature = "font-anonymous_pro")] + result.push(("AnonymousPro".to_string(), Self::anonymous_pro)); + result + } + pub fn list() -> Vec { + Self::all_fonts().into_iter().map(|i| i.0).collect() + } + + pub fn from_name(name: String) -> Self { + for value in Self::all_fonts() { + if name == value.0 { + return value.1(); + } + } + return Self::default(); + } + pub fn try_from_bytes( + name: Option, + regular: &'static [u8], + bold: &'static [u8], + italic: &'static [u8], + bold_italic: &'static [u8], + ) -> Option> { + let regular = FontRef::try_from_slice(regular); + let bold = FontRef::try_from_slice(bold); + let italic = FontRef::try_from_slice(italic); + let bold_italic = FontRef::try_from_slice(bold_italic); + match (regular, bold, italic, bold_italic) { + (Ok(regular), Ok(bold), Ok(italic), Ok(bold_italic)) => { + return Some(FontFamily { + name: name.unwrap_or("Custom".to_string()), + regular, + bold, + italic, + bold_italic, + }) + } + _ => None, + } + } + pub fn source_code_pro() -> Self { + flate!(static REGULAR: [u8] from + "resources/fonts/SourceCodePro/Regular.otf"); + flate!(static BOLD: [u8] from + "resources/fonts/SourceCodePro/Bold.otf"); + flate!(static ITALIC: [u8] from + "resources/fonts/SourceCodePro/Italic.otf"); + flate!(static BOLD_ITALIC: [u8] from + "resources/fonts/SourceCodePro/BoldItalic.otf"); + FontFamily::try_from_bytes( + Some("SourceCodePro".to_string()), + ®ULAR, + &BOLD, + &ITALIC, + &BOLD_ITALIC, + ) + .unwrap() + } + + #[cfg(feature = "font-ubuntu")] + pub fn ubuntu() -> Self { + flate!(static REGULAR: [u8] from + "resources/fonts/Ubuntu/Regular.ttf"); + flate!(static BOLD: [u8] from + "resources/fonts/Ubuntu/Bold.ttf"); + flate!(static ITALIC: [u8] from + "resources/fonts/Ubuntu/Italic.ttf"); + flate!(static BOLD_ITALIC: [u8] from + "resources/fonts/Ubuntu/BoldItalic.ttf"); + FontFamily::try_from_bytes( + Some("Ubunto".to_string()), + ®ULAR, + &BOLD, + &ITALIC, + &BOLD_ITALIC, + ) + .unwrap() + } + + #[cfg(feature = "font-iosevka_term")] + pub fn iosevka_term() -> Self { + flate!(static REGULAR: [u8] from + "resources/fonts/IosevkaTerm/Medium.ttf"); + flate!(static BOLD: [u8] from + "resources/fonts/IosevkaTerm/Bold.ttf"); + flate!(static ITALIC: [u8] from + "resources/fonts/IosevkaTerm/Italic.ttf"); + flate!(static BOLD_ITALIC: [u8] from + "resources/fonts/IosevkaTerm/BoldItalic.ttf"); + FontFamily::try_from_bytes( + Some("IosevkaTerm".to_string()), + ®ULAR, + &BOLD, + &ITALIC, + &BOLD_ITALIC, + ) + .unwrap() + } + + #[cfg(feature = "font-anonymous_pro")] + pub fn anonymous_pro() -> Self { + flate!(static REGULAR: [u8] from + "resources/fonts/Anonymous_Pro/Regular.ttf"); + flate!(static BOLD: [u8] from + "resources/fonts/Anonymous_Pro/Bold.ttf"); + flate!(static ITALIC: [u8] from + "resources/fonts/Anonymous_Pro/Italic.ttf"); + flate!(static BOLD_ITALIC: [u8] from + "resources/fonts/Anonymous_Pro/BoldItalic.ttf"); + FontFamily::try_from_bytes( + Some("AnonymousPro".to_string()), + ®ULAR, + &BOLD, + &ITALIC, + &BOLD_ITALIC, + ) + .unwrap() + } +} + +impl Default for FontFamily<'static> { + fn default() -> Self { + Self::source_code_pro() + } +} + +impl Display for FontFamily<'_> { + fn fmt(&self, f: &mut Formatter) -> fmt::Result { + write!(f, "{}", self.name) + } +} diff --git a/nu_plugin_image/src/ansi_to_image/internal_scale.rs b/nu_plugin_image/src/ansi_to_image/internal_scale.rs new file mode 100644 index 0000000..e422657 --- /dev/null +++ b/nu_plugin_image/src/ansi_to_image/internal_scale.rs @@ -0,0 +1,27 @@ +use ab_glyph::PxScale; + +#[derive(Clone, Copy)] +pub struct InternalScale { + /// Horizontal scale, in pixels. + pub x: f32, + /// Vertical scale, in pixels. + pub y: f32, +} + +// impl Into for InternalScale { +// fn into(self) -> Scale { +// Scale { +// x: self.x, +// y: self.y, +// } +// } +// } + +impl Into for InternalScale { + fn into(self) -> PxScale { + PxScale { + x: self.x, + y: self.y, + } + } +} diff --git a/nu_plugin_image/src/ansi_to_image/mod.rs b/nu_plugin_image/src/ansi_to_image/mod.rs new file mode 100644 index 0000000..621b9da --- /dev/null +++ b/nu_plugin_image/src/ansi_to_image/mod.rs @@ -0,0 +1,12 @@ +mod ansi_to_image; +mod color; +// mod escape; +mod escape_parser; +mod font_family; +mod internal_scale; +mod nu_plugin; +mod palette; +mod printer; +pub use font_family::FontFamily; +pub use nu_plugin::ansi_to_image; +pub use palette::Palette; diff --git a/nu_plugin_image/src/ansi_to_image/nu_plugin.rs b/nu_plugin_image/src/ansi_to_image/nu_plugin.rs new file mode 100644 index 0000000..a371617 --- /dev/null +++ b/nu_plugin_image/src/ansi_to_image/nu_plugin.rs @@ -0,0 +1,189 @@ +use std::{fs::File, io::Read, path::PathBuf, time::SystemTime}; + +use crate::{debug, error, warn}; +use ab_glyph::FontRef; +use nu_plugin::EvaluatedCall; +use nu_protocol::{LabeledError, Span, Value}; + +use crate::FontFamily; + +use super::{ + ansi_to_image::make_image, + palette::{strhex_to_rgba, Palette}, +}; + +pub fn ansi_to_image( + engine: &nu_plugin::EngineInterface, + call: &EvaluatedCall, + input: &Value, +) -> Result { + let i: &[u8] = match input { + Value::String { + val, + internal_span: _, + } => val.as_bytes(), + Value::Binary { + val, + internal_span: _, + } => val, + _ => { + return Err(make_params_err( + "cannot read input as binary data (maybe its empty)".to_string(), + input.span(), + )) + } + }; + let size = match call.get_flag_value("width") { + Some(val) => match val.as_int().ok() { + Some(value) => Some(value as u32), + _ => None, + }, + _ => None, + }; + let font: FontFamily<'_> = resolve_font(call); + let out_path = call.opt::(0); + + let out = match out_path { + Ok(Some(path)) => { + debug!("received output name `{}`", path); + if let Ok(value) = engine.get_current_dir() { + let mut absolute = PathBuf::from(value); + absolute.extend(PathBuf::from(path).iter()); + debug!( + "absolute output name `{}`", + absolute.to_str().unwrap_or("cannot convert path to string") + ); + Some(absolute) + } else { + warn!("failed to fetch current directories path"); + Some(PathBuf::from(path)) + } + } + _ => { + let now = SystemTime::now().duration_since(SystemTime::UNIX_EPOCH); + let current = engine.get_current_dir().map(|p| PathBuf::from(p)); + if let (Ok(now), Ok(current)) = (now, current) { + let current = &mut current.clone(); + current.push(PathBuf::from(format!("nu-image-{}.png", now.as_secs()))); + Some(current.to_owned()) + } else { + None + } + } + }; + if let None = out { + return Err(make_params_err( + format!("cannot use time stamp as the file name timestamp please provide output path explicitly"), + call.head, + )); + } + let theme = match call + .get_flag_value("theme") + .map(|i| i.as_str().map(|f| f.to_string())) + { + Some(Ok(name)) => { + if let Some(theme) = Palette::from_name(name.to_string()) { + theme + } else { + error!("No theme found that matches the given name"); + Palette::default() + } + } + _ => Palette::default(), + }; + let theme = load_custom_theme(call, theme); + + let path = PathBuf::from(out.unwrap()); + make_image(path.as_path(), font, size, i, theme); + + Ok(Value::string( + path.to_str().unwrap_or("error reading path").to_owned(), + call.head, + )) +} + +fn resolve_font(call: &EvaluatedCall) -> FontFamily<'static> { + let mut font: FontFamily<'static> = match call.get_flag_value("font").map(|value| match value { + Value::String { val, .. } => Some(FontFamily::from_name(val)), + _ => None, + }) { + Some(value) => { + if let Some(font) = value { + font + } else { + FontFamily::default() + } + } + None => FontFamily::default(), + }; + // TODO custom fonts disabled for now + if let Some(path) = call.get_flag_value("font-regular") { + let buffer = load_file(path); + font.regular = FontRef::try_from_slice(buffer).unwrap(); + } + if let Some(path) = call.get_flag_value("font-bold") { + let buffer = load_file(path); + font.bold = FontRef::try_from_slice(buffer).unwrap(); + } + if let Some(path) = call.get_flag_value("font-italic") { + let buffer = load_file(path); + font.italic = FontRef::try_from_slice(buffer).unwrap(); + } + if let Some(path) = call.get_flag_value("bold-italic") { + let buffer = load_file(path); + font.bold_italic = FontRef::try_from_slice(buffer).unwrap(); + } + font +} + +// fn load_file<'a>(path: Value) -> &'a [u8] { +// let path = path.as_str().unwrap(); +// let mut file = File::open(PathBuf::from(path)).unwrap(); +// let mut buffer = Vec::new(); + +// // read the whole file +// let _ = file.read_to_end(&mut buffer); +// buffer.as_slice() +// } + +fn load_file<'a>(path: Value) -> &'a [u8] { + let path = path.as_str().unwrap(); + let mut file = File::open(PathBuf::from(path)).unwrap(); + let mut buffer: Box> = Box::new(vec![]); + file.read_to_end(&mut *buffer).unwrap(); + Box::leak(buffer) +} + +fn make_params_err(text: String, span: Span) -> LabeledError { + LabeledError::new(text).with_label("faced an error when tried to parse the params", span) +} +fn load_custom_theme(call: &EvaluatedCall, theme: Palette) -> Palette { + let result = theme.palette().copy_with( + read_hex_to_array(call, "custom-theme-fg"), + read_hex_to_array(call, "custom-theme-bg"), + read_hex_to_array(call, "custom-theme-black"), + read_hex_to_array(call, "custom-theme-red"), + read_hex_to_array(call, "custom-theme-green"), + read_hex_to_array(call, "custom-theme-yellow"), + read_hex_to_array(call, "custom-theme-blue"), + read_hex_to_array(call, "custom-theme-magenta"), + read_hex_to_array(call, "custom-theme-cyan"), + read_hex_to_array(call, "custom-theme-white"), + read_hex_to_array(call, "custom-theme-bright_black"), + read_hex_to_array(call, "custom-theme-bright_red"), + read_hex_to_array(call, "custom-theme-bright_green"), + read_hex_to_array(call, "custom-theme-bright_yellow"), + read_hex_to_array(call, "custom-theme-bright_blue"), + read_hex_to_array(call, "custom-theme-bright_magenta"), + read_hex_to_array(call, "custom-theme-bright_cyan"), + read_hex_to_array(call, "custom-theme-bright_white"), + ); + Palette::Custom(result) +} + +fn read_hex_to_array(call: &EvaluatedCall, name: &str) -> Option<[u8; 4]> { + if let Some(Value::String { val, .. }) = call.get_flag_value(name) { + return strhex_to_rgba(val); + } + None +} diff --git a/nu_plugin_image/src/ansi_to_image/palette.rs b/nu_plugin_image/src/ansi_to_image/palette.rs new file mode 100644 index 0000000..c96551d --- /dev/null +++ b/nu_plugin_image/src/ansi_to_image/palette.rs @@ -0,0 +1,881 @@ +use std::fmt::Debug; + +use crate::warn; + +use crate::ansi_to_image::color::{Color, ColorType}; +type ColorOption = Option<[u8; 4]>; +#[allow(dead_code)] +#[derive(Debug)] +pub enum Palette { + Vscode, + Xterm, + Eclipse, + Ubuntu, + MIRC, + Putty, + WinXp, + WinTerminal, + Win10, + WinPs, + Env, + Custom(PaletteData), + Test, +} + +impl Default for Palette { + fn default() -> Self { + if let Ok(_) = std::env::var("NU_PLUGIN_IMAGE_FG") { + return Palette::Env; + } + return Palette::Vscode; + } +} + +#[derive(Debug, Clone, Copy)] +pub struct PaletteData { + pub primary_foreground: [u8; 4], + pub primary_background: [u8; 4], + + pub black: [u8; 4], + pub red: [u8; 4], + pub green: [u8; 4], + pub yellow: [u8; 4], + pub blue: [u8; 4], + pub magenta: [u8; 4], + pub cyan: [u8; 4], + pub white: [u8; 4], + + pub bright_black: [u8; 4], + pub bright_red: [u8; 4], + pub bright_green: [u8; 4], + pub bright_yellow: [u8; 4], + pub bright_blue: [u8; 4], + pub bright_magenta: [u8; 4], + pub bright_cyan: [u8; 4], + pub bright_white: [u8; 4], + + pub fixed: [[u8; 4]; 256], +} +impl PaletteData { + pub fn copy_with( + &self, + primary_foreground: ColorOption, + primary_background: ColorOption, + + black: ColorOption, + red: ColorOption, + green: ColorOption, + yellow: ColorOption, + blue: ColorOption, + magenta: ColorOption, + cyan: ColorOption, + white: ColorOption, + + bright_black: ColorOption, + bright_red: ColorOption, + bright_green: ColorOption, + bright_yellow: ColorOption, + bright_blue: ColorOption, + bright_magenta: ColorOption, + bright_cyan: ColorOption, + bright_white: ColorOption, + ) -> PaletteData { + let result = &mut self.clone(); + if let Some(fg) = primary_foreground { + result.primary_foreground = fg; + } + + if let Some(bg) = primary_background { + result.primary_background = bg; + } + + if let Some(color) = black { + result.black = color; + } + + if let Some(color) = red { + result.red = color; + } + + if let Some(color) = green { + result.green = color; + } + + if let Some(color) = yellow { + result.yellow = color; + } + + if let Some(color) = blue { + result.blue = color; + } + + if let Some(color) = magenta { + result.magenta = color; + } + + if let Some(color) = cyan { + result.cyan = color; + } + + if let Some(color) = white { + result.white = color; + } + + if let Some(color) = bright_black { + result.bright_black = color; + } + + if let Some(color) = bright_red { + result.bright_red = color; + } + + if let Some(color) = bright_green { + result.bright_green = color; + } + + if let Some(color) = bright_yellow { + result.bright_yellow = color; + } + + if let Some(color) = bright_blue { + result.bright_blue = color; + } + + if let Some(color) = bright_magenta { + result.bright_magenta = color; + } + + if let Some(color) = bright_cyan { + result.bright_cyan = color; + } + + if let Some(color) = bright_white { + result.bright_white = color; + } + + result.to_owned() + } +} + +impl Palette { + pub(super) fn palette(&self) -> PaletteData { + match self { + Palette::Vscode => palette_vscode(), + Palette::Xterm => palette_xterm(), + Palette::Ubuntu => palette_ubuntu(), + Palette::Eclipse => palette_eclipse(), + Palette::MIRC => palette_mirc(), + Palette::Putty => palette_putty(), + Palette::WinXp => palette_win_xp(), + Palette::WinTerminal => palette_terminal_app(), + Palette::Win10 => palette_win_10(), + Palette::WinPs => palette_win_power_shell(), + Palette::Test => palette_test(), + Palette::Env => palette_env(), + Palette::Custom(p) => *p, + } + } + pub(super) fn from_name(name: String) -> Option { + match name.to_lowercase().as_str() { + "vscode" => Some(Palette::Vscode), + "xterm" => Some(Palette::Xterm), + "eclipse" => Some(Palette::Eclipse), + "ubuntu" => Some(Palette::Ubuntu), + "mirc" => Some(Palette::MIRC), + "putty" => Some(Palette::Putty), + "winxp" => Some(Palette::WinXp), + "terminal" => Some(Palette::WinTerminal), + "winterm" => Some(Palette::WinTerminal), + "win10" => Some(Palette::Win10), + "win_power-shell" => Some(Palette::WinPs), + "win_ps" => Some(Palette::WinPs), + _ => None, + } + } + pub fn list() -> Vec { + vec![ + "vscode".to_string(), + "xterm".to_string(), + "ubuntu".to_string(), + "eclipse".to_string(), + "mirc".to_string(), + "putty".to_string(), + "winxp".to_string(), + "terminal".to_string(), + "win10".to_string(), + "win_power-shell".to_string(), + "win_ps".to_string(), + ] + } + + pub(super) fn get_color(&self, color: ColorType) -> [u8; 4] { + let palette = self.palette(); + + match color { + ColorType::PrimaryForeground => palette.primary_foreground, + ColorType::PrimaryBackground => palette.primary_background, + ColorType::Rgb { field1: rgb } => [rgb.0, rgb.1, rgb.2, 255], + ColorType::Normal(color) => match color { + Color::Black => palette.black, + Color::Red => palette.red, + Color::Green => palette.green, + Color::Yellow => palette.yellow, + Color::Blue => palette.blue, + Color::Magenta => palette.magenta, + Color::Cyan => palette.cyan, + Color::White => palette.white, + }, + + ColorType::Bright(color) => match color { + Color::Black => palette.bright_black, + Color::Red => palette.bright_red, + Color::Green => palette.bright_green, + Color::Yellow => palette.bright_yellow, + Color::Blue => palette.bright_blue, + Color::Magenta => palette.bright_magenta, + Color::Cyan => palette.bright_cyan, + Color::White => palette.bright_white, + }, + + ColorType::Fixed(num) => palette.fixed[num as usize], + } + } +} +fn palette_env() -> PaletteData { + PaletteData { + primary_foreground: hex_from_env("NU_PLUGIN_IMAGE_FG"), + primary_background: hex_from_env("NU_PLUGIN_IMAGE_BG"), + + black: hex_from_env("NU_PLUGIN_IMAGE_BLACK"), + red: hex_from_env("NU_PLUGIN_IMAGE_RED"), + green: hex_from_env("NU_PLUGIN_IMAGE_GREEN"), + yellow: hex_from_env("NU_PLUGIN_IMAGE_YELLOW"), + blue: hex_from_env("NU_PLUGIN_IMAGE_BLUE"), + magenta: hex_from_env("NU_PLUGIN_IMAGE_MAGENTA"), + cyan: hex_from_env("NU_PLUGIN_IMAGE_CYAN"), + white: hex_from_env("NU_PLUGIN_IMAGE_WHITE"), + + bright_black: hex_from_env("NU_PLUGIN_IMAGE_BRIGHT_BLACK"), + bright_red: hex_from_env("NU_PLUGIN_IMAGE_BRIGHT_RED"), + bright_green: hex_from_env("NU_PLUGIN_IMAGE_BRIGHT_GREEN"), + bright_yellow: hex_from_env("NU_PLUGIN_IMAGE_BRIGHT_YELLOW"), + bright_blue: hex_from_env("NU_PLUGIN_IMAGE_BRIGHT_BLUE"), + bright_magenta: hex_from_env("NU_PLUGIN_IMAGE_BRIGHT_MAGENTA"), + bright_cyan: hex_from_env("NU_PLUGIN_IMAGE_BRIGHT_CYAN"), + bright_white: hex_from_env("NU_PLUGIN_IMAGE_BRIGHT_WHITE"), + + fixed: fixed_colors(), + } +} +fn palette_vscode() -> PaletteData { + PaletteData { + // primary_background: "0x161616".parse().unwrap() + // primary_foreground: "0xf2f2f2".parse().unwrap() + primary_foreground: [229, 229, 229, 255], + primary_background: [24, 24, 24, 255], + + black: [0, 0, 0, 255], + red: [205, 49, 49, 255], + green: [13, 188, 121, 255], + yellow: [229, 229, 16, 255], + blue: [36, 114, 200, 255], + magenta: [188, 63, 188, 255], + cyan: [17, 168, 205, 255], + white: [229, 229, 229, 255], + + bright_black: [102, 102, 102, 255], + bright_red: [241, 76, 76, 255], + bright_green: [35, 209, 139, 255], + bright_yellow: [245, 245, 67, 255], + bright_blue: [59, 142, 234, 255], + bright_magenta: [214, 112, 214, 255], + bright_cyan: [41, 184, 219, 255], + bright_white: [229, 229, 229, 255], + + fixed: fixed_colors(), + } +} +fn palette_xterm() -> PaletteData { + PaletteData { + // primary_background: "0x161616".parse().unwrap() + // primary_foreground: "0xf2f2f2".parse().unwrap() + primary_foreground: [229, 229, 229, 255], + primary_background: [0, 0, 0, 255], + + black: [0, 0, 0, 255], + red: [205, 0, 0, 255], + green: [0, 205, 0, 255], + yellow: [205, 205, 0, 255], + blue: [0, 0, 238, 255], + magenta: [205, 0, 205, 255], + cyan: [0, 205, 205, 255], + white: [229, 229, 229, 255], + + bright_black: [127, 127, 127, 255], + bright_red: [255, 0, 0, 255], + bright_green: [0, 255, 0, 255], + bright_yellow: [255, 255, 0, 255], + bright_blue: [0, 0, 252, 255], + bright_magenta: [255, 0, 255, 255], + bright_cyan: [0, 255, 255, 255], + bright_white: [255, 255, 255, 255], + + fixed: fixed_colors(), + } +} +fn palette_eclipse() -> PaletteData { + PaletteData { + // primary_background: "0x161616".parse().unwrap() + // primary_foreground: "0xf2f2f2".parse().unwrap() + primary_foreground: [229, 229, 229, 255], + primary_background: [0, 0, 0, 255], + + black: [0, 0, 0, 255], + red: [205, 0, 0, 255], + green: [0, 205, 0, 255], + yellow: [205, 205, 0, 255], + blue: [0, 0, 238, 255], + magenta: [205, 0, 205, 255], + cyan: [0, 205, 205, 255], + white: [229, 229, 229, 255], + + bright_black: [0, 0, 0, 255], + bright_red: [255, 0, 0, 255], + bright_green: [0, 255, 0, 255], + bright_yellow: [255, 255, 0, 255], + bright_blue: [0, 0, 252, 255], + bright_magenta: [255, 0, 255, 255], + bright_cyan: [0, 255, 255, 255], + bright_white: [255, 255, 255, 255], + + fixed: fixed_colors(), + } +} +fn palette_ubuntu() -> PaletteData { + PaletteData { + // primary_background: "0x161616".parse().unwrap() + // primary_foreground: "0xf2f2f2".parse().unwrap() + primary_foreground: [204, 204, 204, 255], + primary_background: [1, 1, 1, 255], + + black: [1, 1, 1, 255], + red: [222, 56, 43, 255], + green: [57, 181, 74, 255], + yellow: [255, 199, 6, 255], + blue: [0, 111, 184, 255], + magenta: [118, 38, 113, 255], + cyan: [44, 181, 233, 255], + white: [204, 204, 204, 255], + + bright_black: [128, 128, 128, 255], + bright_red: [255, 0, 0, 255], + bright_green: [0, 255, 0, 255], + bright_yellow: [255, 255, 0, 255], + bright_blue: [0, 0, 255, 255], + bright_magenta: [255, 0, 255, 255], + bright_cyan: [0, 255, 255, 255], + bright_white: [255, 255, 255, 255], + + fixed: fixed_colors(), + } +} +fn palette_mirc() -> PaletteData { + PaletteData { + // primary_background: "0x161616".parse().unwrap() + // primary_foreground: "0xf2f2f2".parse().unwrap() + primary_foreground: [210, 210, 210, 255], + primary_background: [0, 0, 0, 255], + + black: [0, 0, 0, 255], + red: [127, 0, 0, 255], + green: [0, 147, 0, 255], + yellow: [252, 127, 0, 255], + blue: [0, 0, 127, 255], + magenta: [156, 0, 156, 255], + cyan: [0, 147, 147, 255], + white: [210, 210, 210, 255], + + bright_black: [127, 127, 127, 255], + bright_red: [255, 0, 0, 255], + bright_green: [0, 252, 0, 255], + bright_yellow: [255, 255, 0, 255], + bright_blue: [0, 0, 252, 255], + bright_magenta: [255, 0, 255, 255], + bright_cyan: [0, 255, 255, 255], + bright_white: [255, 255, 255, 255], + + fixed: fixed_colors(), + } +} +fn palette_putty() -> PaletteData { + PaletteData { + // primary_background: "0x161616".parse().unwrap() + // primary_foreground: "0xf2f2f2".parse().unwrap() + primary_foreground: [187, 187, 187, 255], + primary_background: [0, 0, 0, 255], + + black: [0, 0, 0, 255], + red: [187, 0, 0, 255], + green: [0, 187, 0, 255], + yellow: [187, 187, 0, 255], + blue: [0, 0, 187, 255], + magenta: [187, 0, 187, 255], + cyan: [0, 187, 187, 255], + white: [187, 187, 187, 255], + + bright_black: [85, 85, 85, 255], + bright_red: [255, 85, 85, 255], + bright_green: [85, 255, 85, 255], + bright_yellow: [255, 255, 85, 255], + bright_blue: [85, 85, 255, 255], + bright_magenta: [255, 85, 255, 255], + bright_cyan: [85, 255, 255, 255], + bright_white: [255, 255, 255, 255], + + fixed: fixed_colors(), + } +} +fn palette_terminal_app() -> PaletteData { + PaletteData { + // primary_background: "0x161616".parse().unwrap() + // primary_foreground: "0xf2f2f2".parse().unwrap() + primary_foreground: [203, 204, 205, 255], + primary_background: [0, 0, 0, 255], + + black: [0, 0, 0, 255], + red: [194, 54, 33, 255], + green: [37, 188, 36, 255], + yellow: [173, 173, 39, 255], + blue: [73, 46, 225, 255], + magenta: [211, 56, 211, 255], + cyan: [51, 187, 200, 255], + white: [203, 204, 205, 255], + + bright_black: [129, 131, 131, 255], + bright_red: [252, 57, 31, 255], + bright_green: [49, 231, 34, 255], + bright_yellow: [234, 236, 35, 255], + bright_blue: [88, 51, 255, 255], + bright_magenta: [249, 53, 248, 255], + bright_cyan: [20, 240, 240, 255], + bright_white: [233, 235, 235, 255], + + fixed: fixed_colors(), + } +} +fn palette_win_10() -> PaletteData { + PaletteData { + // primary_background: "0x161616".parse().unwrap() + // primary_foreground: "0xf2f2f2".parse().unwrap() + primary_foreground: [204, 204, 204, 255], + primary_background: [12, 12, 12, 255], + + black: [12, 12, 12, 255], + red: [197, 15, 31, 255], + green: [19, 161, 14, 255], + yellow: [193, 156, 0, 255], + blue: [0, 55, 218, 255], + magenta: [136, 23, 152, 255], + cyan: [58, 150, 221, 255], + white: [204, 204, 204, 255], + + bright_black: [118, 118, 118, 255], + bright_red: [231, 72, 86, 255], + bright_green: [22, 198, 12, 255], + bright_yellow: [249, 241, 165, 255], + bright_blue: [59, 120, 255, 255], + bright_magenta: [180, 0, 158, 255], + bright_cyan: [97, 214, 214, 255], + bright_white: [242, 242, 242, 255], + + fixed: fixed_colors(), + } +} +fn palette_win_xp() -> PaletteData { + PaletteData { + // primary_background: "0x161616".parse().unwrap() + // primary_foreground: "0xf2f2f2".parse().unwrap() + primary_foreground: [192, 192, 192, 255], + primary_background: [0, 0, 0, 255], + + black: [0, 0, 0, 255], + red: [128, 0, 0, 255], + green: [0, 128, 0, 255], + yellow: [128, 128, 0, 255], + blue: [0, 0, 128, 255], + magenta: [128, 0, 128, 255], + cyan: [0, 128, 128, 255], + white: [192, 192, 192, 255], + + bright_black: [128, 128, 128, 255], + bright_red: [255, 0, 0, 255], + bright_green: [0, 255, 0, 255], + bright_yellow: [255, 255, 0, 255], + bright_blue: [0, 0, 255, 255], + bright_magenta: [255, 0, 255, 255], + bright_cyan: [0, 255, 255, 255], + bright_white: [255, 255, 255, 255], + + fixed: fixed_colors(), + } +} +fn palette_win_power_shell() -> PaletteData { + PaletteData { + // primary_background: "0x161616".parse().unwrap() + // primary_foreground: "0xf2f2f2".parse().unwrap() + primary_foreground: [192, 192, 192, 255], + primary_background: [1, 36, 86, 255], + + black: [0, 0, 0, 255], + red: [128, 0, 0, 255], + green: [0, 128, 0, 255], + yellow: [238, 237, 240, 255], + blue: [0, 0, 128, 255], + magenta: [1, 36, 86, 255], + cyan: [0, 128, 128, 255], + white: [192, 192, 192, 255], + + bright_black: [128, 128, 128, 255], + bright_red: [255, 0, 0, 255], + bright_green: [0, 255, 0, 255], + bright_yellow: [255, 255, 0, 255], + bright_blue: [0, 0, 255, 255], + bright_magenta: [255, 0, 255, 255], + bright_cyan: [0, 255, 255, 255], + bright_white: [255, 255, 255, 255], + + fixed: fixed_colors(), + } +} + +fn palette_test() -> PaletteData { + PaletteData { + // primary_background: "0x161616".parse().unwrap() + // primary_foreground: "0xf2f2f2".parse().unwrap() + primary_foreground: [0, 0, 0, 255], + primary_background: [255, 255, 255, 255], + + black: [0, 0, 0, 255], + red: [255, 0, 0, 255], + green: [0, 255, 0, 255], + yellow: [249, 168, 37, 255], + blue: [0, 0, 255, 255], + magenta: [168, 37, 191, 255], + cyan: [0, 131, 143, 255], + white: [255, 255, 255, 255], + + bright_black: [44, 44, 44, 255], + bright_red: [198, 40, 40, 255], + bright_green: [85, 139, 46, 255], + bright_yellow: [249, 168, 37, 255], + bright_blue: [21, 101, 193, 255], + bright_magenta: [168, 37, 191, 255], + bright_cyan: [0, 131, 143, 255], + bright_white: [255, 255, 255, 255], + + fixed: fixed_colors(), + } +} + +fn fixed_colors() -> [[u8; 4]; 256] { + [ + [0, 0, 0, 255], + [128, 0, 0, 255], + [0, 128, 0, 255], + [128, 128, 0, 255], + [0, 0, 128, 255], + [128, 0, 128, 255], + [0, 128, 128, 255], + [192, 192, 192, 255], + [128, 128, 128, 255], + [255, 0, 0, 255], + [0, 255, 0, 255], + [255, 255, 0, 255], + [0, 0, 255, 255], + [255, 0, 255, 255], + [0, 255, 255, 255], + [255, 255, 255, 255], + [0, 0, 0, 255], + [0, 0, 95, 255], + [0, 0, 135, 255], + [0, 0, 175, 255], + [0, 0, 215, 255], + [0, 0, 255, 255], + [0, 95, 0, 255], + [0, 95, 95, 255], + [0, 95, 135, 255], + [0, 95, 175, 255], + [0, 95, 215, 255], + [0, 95, 255, 255], + [0, 135, 0, 255], + [0, 135, 95, 255], + [0, 135, 135, 255], + [0, 135, 175, 255], + [0, 135, 215, 255], + [0, 135, 255, 255], + [0, 175, 0, 255], + [0, 175, 95, 255], + [0, 175, 135, 255], + [0, 175, 175, 255], + [0, 175, 215, 255], + [0, 175, 255, 255], + [0, 215, 0, 255], + [0, 215, 95, 255], + [0, 215, 135, 255], + [0, 215, 175, 255], + [0, 215, 215, 255], + [0, 215, 255, 255], + [0, 255, 0, 255], + [0, 255, 95, 255], + [0, 255, 135, 255], + [0, 255, 175, 255], + [0, 255, 215, 255], + [0, 255, 255, 255], + [95, 0, 0, 255], + [95, 0, 95, 255], + [95, 0, 135, 255], + [95, 0, 175, 255], + [95, 0, 215, 255], + [95, 0, 255, 255], + [95, 95, 0, 255], + [95, 95, 95, 255], + [95, 95, 135, 255], + [95, 95, 175, 255], + [95, 95, 215, 255], + [95, 95, 255, 255], + [95, 135, 0, 255], + [95, 135, 95, 255], + [95, 135, 135, 255], + [95, 135, 175, 255], + [95, 135, 215, 255], + [95, 135, 255, 255], + [95, 175, 0, 255], + [95, 175, 95, 255], + [95, 175, 135, 255], + [95, 175, 175, 255], + [95, 175, 215, 255], + [95, 175, 255, 255], + [95, 215, 0, 255], + [95, 215, 95, 255], + [95, 215, 135, 255], + [95, 215, 175, 255], + [95, 215, 215, 255], + [95, 215, 255, 255], + [95, 255, 0, 255], + [95, 255, 95, 255], + [95, 255, 135, 255], + [95, 255, 175, 255], + [95, 255, 215, 255], + [95, 255, 255, 255], + [135, 0, 0, 255], + [135, 0, 95, 255], + [135, 0, 135, 255], + [135, 0, 175, 255], + [135, 0, 215, 255], + [135, 0, 255, 255], + [135, 95, 0, 255], + [135, 95, 95, 255], + [135, 95, 135, 255], + [135, 95, 175, 255], + [135, 95, 215, 255], + [135, 95, 255, 255], + [135, 135, 0, 255], + [135, 135, 95, 255], + [135, 135, 135, 255], + [135, 135, 175, 255], + [135, 135, 215, 255], + [135, 135, 255, 255], + [135, 175, 0, 255], + [135, 175, 95, 255], + [135, 175, 135, 255], + [135, 175, 175, 255], + [135, 175, 215, 255], + [135, 175, 255, 255], + [135, 215, 0, 255], + [135, 215, 95, 255], + [135, 215, 135, 255], + [135, 215, 175, 255], + [135, 215, 215, 255], + [135, 215, 255, 255], + [135, 255, 0, 255], + [135, 255, 95, 255], + [135, 255, 135, 255], + [135, 255, 175, 255], + [135, 255, 215, 255], + [135, 255, 255, 255], + [175, 0, 0, 255], + [175, 0, 95, 255], + [175, 0, 135, 255], + [175, 0, 175, 255], + [175, 0, 215, 255], + [175, 0, 255, 255], + [175, 95, 0, 255], + [175, 95, 95, 255], + [175, 95, 135, 255], + [175, 95, 175, 255], + [175, 95, 215, 255], + [175, 95, 255, 255], + [175, 135, 0, 255], + [175, 135, 95, 255], + [175, 135, 135, 255], + [175, 135, 175, 255], + [175, 135, 215, 255], + [175, 135, 255, 255], + [175, 175, 0, 255], + [175, 175, 95, 255], + [175, 175, 135, 255], + [175, 175, 175, 255], + [175, 175, 215, 255], + [175, 175, 255, 255], + [175, 215, 0, 255], + [175, 215, 95, 255], + [175, 215, 135, 255], + [175, 215, 175, 255], + [175, 215, 215, 255], + [175, 215, 255, 255], + [175, 255, 0, 255], + [175, 255, 95, 255], + [175, 255, 135, 255], + [175, 255, 175, 255], + [175, 255, 215, 255], + [175, 255, 255, 255], + [215, 0, 0, 255], + [215, 0, 95, 255], + [215, 0, 135, 255], + [215, 0, 175, 255], + [215, 0, 215, 255], + [215, 0, 255, 255], + [215, 95, 0, 255], + [215, 95, 95, 255], + [215, 95, 135, 255], + [215, 95, 175, 255], + [215, 95, 215, 255], + [215, 95, 255, 255], + [215, 135, 0, 255], + [215, 135, 95, 255], + [215, 135, 135, 255], + [215, 135, 175, 255], + [215, 135, 215, 255], + [215, 135, 255, 255], + [215, 175, 0, 255], + [215, 175, 95, 255], + [215, 175, 135, 255], + [215, 175, 175, 255], + [215, 175, 215, 255], + [215, 175, 255, 255], + [215, 215, 0, 255], + [215, 215, 95, 255], + [215, 215, 135, 255], + [215, 215, 175, 255], + [215, 215, 215, 255], + [215, 215, 255, 255], + [215, 255, 0, 255], + [215, 255, 95, 255], + [215, 255, 135, 255], + [215, 255, 175, 255], + [215, 255, 215, 255], + [215, 255, 255, 255], + [255, 0, 0, 255], + [255, 0, 95, 255], + [255, 0, 135, 255], + [255, 0, 175, 255], + [255, 0, 215, 255], + [255, 0, 255, 255], + [255, 95, 0, 255], + [255, 95, 95, 255], + [255, 95, 135, 255], + [255, 95, 175, 255], + [255, 95, 215, 255], + [255, 95, 255, 255], + [255, 135, 0, 255], + [255, 135, 95, 255], + [255, 135, 135, 255], + [255, 135, 175, 255], + [255, 135, 215, 255], + [255, 135, 255, 255], + [255, 175, 0, 255], + [255, 175, 95, 255], + [255, 175, 135, 255], + [255, 175, 175, 255], + [255, 175, 215, 255], + [255, 175, 255, 255], + [255, 215, 0, 255], + [255, 215, 95, 255], + [255, 215, 135, 255], + [255, 215, 175, 255], + [255, 215, 215, 255], + [255, 215, 255, 255], + [255, 255, 0, 255], + [255, 255, 95, 255], + [255, 255, 135, 255], + [255, 255, 175, 255], + [255, 255, 215, 255], + [255, 255, 255, 255], + [8, 8, 8, 255], + [18, 18, 18, 255], + [28, 28, 28, 255], + [38, 38, 38, 255], + [48, 48, 48, 255], + [58, 58, 58, 255], + [68, 68, 68, 255], + [78, 78, 78, 255], + [88, 88, 88, 255], + [98, 98, 98, 255], + [108, 108, 108, 255], + [118, 118, 118, 255], + [128, 128, 128, 255], + [138, 138, 138, 255], + [148, 148, 148, 255], + [158, 158, 158, 255], + [168, 168, 168, 255], + [178, 178, 178, 255], + [188, 188, 188, 255], + [198, 198, 198, 255], + [208, 208, 208, 255], + [218, 218, 218, 255], + [228, 228, 228, 255], + [238, 238, 238, 255], + ] +} + +fn hex_from_env(var_name: &str) -> [u8; 4] { + let val = std::env::var(var_name); + match val { + Ok(code) => match strhex_to_rgba(code) { + Some(color) => color, + None => { + warn!("invalid hex value for env var {}", var_name); + [0, 0, 0, 0] + } + }, + Err(err) => { + warn!("cannot read env var {}, err: {}", var_name, err.to_string()); + [0, 0, 0, 0] + } + } +} +pub(crate) fn hex_to_rgba(hex: i64, alpha: Option) -> [u8; 4] { + let r = ((hex >> 16) & 0xFF) as u8; + let g = ((hex >> 8) & 0xFF) as u8; + let b = (hex & 0xFF) as u8; + let a = alpha.unwrap_or(255); // Default alpha to 255 (full) if not provided + [r, g, b, a] +} + +pub(crate) fn strhex_to_rgba(hex: String) -> Option<[u8; 4]> { + let hex = hex.trim_start_matches("0x").trim_start_matches("#"); + + let has_alpha = hex.len() == 8; + + if let Ok(hex) = i64::from_str_radix(&hex, 16) { + let alpha = if has_alpha { + Some((hex >> 24) as u8) + } else { + None + }; + Some(hex_to_rgba(hex, alpha)) + } else { + warn!("invalid hex {}", hex); + None + } +} diff --git a/nu_plugin_image/src/ansi_to_image/printer.rs b/nu_plugin_image/src/ansi_to_image/printer.rs new file mode 100644 index 0000000..0276822 --- /dev/null +++ b/nu_plugin_image/src/ansi_to_image/printer.rs @@ -0,0 +1,374 @@ +use crate::{trace, warn}; +use ab_glyph::{Font, FontRef, Glyph, Point}; +use image::{Rgba, RgbaImage}; +use imageproc::drawing::draw_text_mut; +use std::collections::BTreeMap; +use vte::{Params, Perform}; + +use crate::ansi_to_image::{color::ColorType, escape_parser::EscapeSequence, palette::Palette}; + +use super::internal_scale::InternalScale; + +pub(super) struct Settings<'a> { + pub(super) font: FontRef<'a>, + pub(super) font_bold: FontRef<'a>, + pub(super) font_italic: FontRef<'a>, + pub(super) font_italic_bold: FontRef<'a>, + pub(super) font_height: f32, + pub(super) scale: InternalScale, + pub(super) palette: Palette, + pub(super) png_width: Option, +} + +#[derive(Debug, Default)] +struct SettingsInternal { + glyph_advance_width: f32, + new_line_distance: u32, + png_width: Option, +} + +#[derive(Debug)] +struct TextEntry { + character: char, + foreground_color: ColorType, + background_color: ColorType, + font: FontState, + underline: bool, +} + +#[derive(Debug, Clone, Copy)] +enum FontState { + Normal, + Bold, + Italic, + ItalicBold, +} + +#[derive(Debug)] +struct State { + text: BTreeMap<(u32, u32), TextEntry>, + current_x: u32, + current_y: u32, + foreground_color: ColorType, + background_color: ColorType, + font: FontState, + last_execute_byte: Option, + underline: bool, +} + +pub(super) struct Printer<'a> { + settings: Settings<'a>, + settings_internal: SettingsInternal, + state: State, +} + +pub(super) fn new(settings: Settings) -> Printer { + let glyph_advance_width = settings + .font + .glyph_bounds(&Glyph { + id: settings.font.glyph_id('_'), + scale: settings.scale.into(), + position: Point { x: 0.0, y: 0.0 }, + }) + .width(); + + let new_line_distance = settings.font_height as u32; + + let png_width = settings.png_width; + + let settings_internal = SettingsInternal { + glyph_advance_width, + new_line_distance, + png_width, + }; + + Printer { + settings, + settings_internal, + state: State::default(), + } +} + +impl Default for State { + fn default() -> Self { + Self { + text: BTreeMap::new(), + current_x: 0, + current_y: 0, + foreground_color: ColorType::PrimaryForeground, + background_color: ColorType::PrimaryBackground, + font: FontState::Normal, + last_execute_byte: None, + underline: false, + } + } +} + +impl<'a> Perform for Printer<'a> { + fn print(&mut self, character: char) { + self.state.text.insert( + (self.state.current_x, self.state.current_y), + TextEntry { + character, + foreground_color: self.state.foreground_color, + background_color: self.state.background_color, + font: self.state.font, + underline: self.state.underline, + }, + ); + + self.state.current_x += self.settings_internal.glyph_advance_width as u32; + + if let Some(png_width) = self.settings_internal.png_width { + if self.state.current_x > png_width { + self.state.current_x = 0; + self.state.current_y += self.settings_internal.new_line_distance; + } + } + } + + fn execute(&mut self, byte: u8) { + match byte { + // ^M 0x0D CR Carriage Return Moves the cursor to column zero. + 0x0d => { + self.state.current_x = 0; + } + + // ^J 0x0A LF Line Feed Moves to next line, scrolls the display up if at bottom of the + // screen. Usually does not move horizontally, though programs should not rely on this. + 0x0a => { + self.state.current_x = 0; + self.state.current_y += self.settings_internal.new_line_distance; + } + + _ => trace!("[execute] {byte}, {byte:02x}"), + } + + self.state.last_execute_byte = Some(byte) + } + + fn hook(&mut self, params: &Params, intermediates: &[u8], ignore: bool, c: char) { + trace!( + "[hook] params={params:?}, intermediates={intermediates:?}, ignore={ignore:?}, \ + char={c:?}" + ); + } + + fn put(&mut self, byte: u8) { + trace!("[put] {byte:02x}"); + } + + fn unhook(&mut self) { + trace!("[unhook]"); + } + + fn osc_dispatch(&mut self, params: &[&[u8]], bell_terminated: bool) { + trace!("[osc_dispatch] params={params:?} bell_terminated={bell_terminated}2"); + } + + fn csi_dispatch(&mut self, params: &Params, _intermediates: &[u8], _ignore: bool, _c: char) { + // trace!( + // "[csi_dispatch] params={params:?}, intermediates={intermediates:?}, ignore={ignore:?}, char={c:?}" + // ); + let actions = EscapeSequence::parse_params(params.iter().flatten().collect::>()); + + for action in actions { + match action { + EscapeSequence::Reset => { + let defaults = State::default(); + + self.state.foreground_color = defaults.foreground_color; + self.state.background_color = defaults.background_color; + self.state.font = defaults.font; + self.state.underline = false; + } + + EscapeSequence::Bold => self.state.font += FontState::Bold, + EscapeSequence::Italic => self.state.font += FontState::Italic, + EscapeSequence::Underline => self.state.underline = true, + + EscapeSequence::NotBold => self.state.font -= FontState::Bold, + EscapeSequence::NotItalicNorBlackLetter => self.state.font -= FontState::Italic, + EscapeSequence::NotUnderline => self.state.underline = false, + + EscapeSequence::ForegroundColor(color_type) => { + self.state.foreground_color = color_type + } + EscapeSequence::BackgroundColor(color_type) => { + self.state.background_color = color_type + } + + EscapeSequence::DefaultForegroundColor => { + self.state.foreground_color = ColorType::PrimaryForeground + } + + EscapeSequence::DefaultBackgroundColor => { + self.state.background_color = ColorType::PrimaryBackground + } + + EscapeSequence::BlackLetterFont + | EscapeSequence::Faint + | EscapeSequence::SlowBlink + | EscapeSequence::NotBlinking + | EscapeSequence::ReverseVideo + | EscapeSequence::Conceal + | EscapeSequence::CrossedOut + | EscapeSequence::PrimaryFont + | EscapeSequence::SetAlternativeFont + | EscapeSequence::DisableProportionalSpacing + | EscapeSequence::NeitherSuperscriptNorSubscript + | EscapeSequence::NotReserved + | EscapeSequence::NormalIntensity + | EscapeSequence::RapidBlink => { + warn!("not implemented for action: {action:?}") + } + EscapeSequence::Unimplemented(value) => { + warn!("not implemented for value: {value:?}") + } + EscapeSequence::Ignore => trace!("ignored sequence"), + } + } + } + + fn esc_dispatch(&mut self, _intermediates: &[u8], _ignore: bool, _byte: u8) {} +} + +impl<'a> From> for RgbaImage { + fn from(printer: Printer) -> Self { + let width = printer + .state + .text + .keys() + .map(|(x, _)| x) + .max() + .unwrap_or(&0) + + printer.settings_internal.glyph_advance_width as u32; + + let height = printer + .state + .text + .keys() + .map(|(_, y)| y) + .max() + .unwrap_or(&0) + + printer.settings_internal.new_line_distance; + + let mut image = RgbaImage::new(width, height); + + // Set primary background + for (_x, _y, pixel) in image.enumerate_pixels_mut() { + *pixel = image::Rgba( + printer + .settings + .palette + .get_color(ColorType::PrimaryBackground), + ); + } + + // Render background before foreground from bottom to top to make it look better + printer.state.text.iter().rev().for_each(|((x, y), entry)| { + let background_end_x = x + printer.settings_internal.glyph_advance_width as u32; + let background_end_y = y + printer.settings.font_height as u32; + + for x in *x..background_end_x { + for y in *y..background_end_y { + let pixel = + image::Rgba(printer.settings.palette.get_color(entry.background_color)); + + image.put_pixel(x, y, pixel); + } + } + }); + + printer.state.text.iter().for_each(|((x, y), entry)| { + let font = match entry.font { + FontState::Normal => &printer.settings.font, + FontState::Bold => &printer.settings.font_bold, + FontState::Italic => &printer.settings.font_italic, + FontState::ItalicBold => &printer.settings.font_italic_bold, + }; + + draw_text_mut( + &mut image, + Rgba(printer.settings.palette.get_color(entry.foreground_color)), + (*x).try_into().unwrap(), + (*y).try_into().unwrap(), + printer.settings.scale, + font, + &entry.character.to_string(), + ); + + if entry.underline { + // let underline_start = *x; + // let underline_end = x + printer.settings_internal.glyph_advance_width as u32; + // let underline_y = (y - 6) + printer.settings.font_height as u32; + + // for underline_x in underline_start..underline_end { + // let pixel = + // image::Rgb(printer.settings.palette.get_color(entry.foreground_color)); + + // image.put_pixel(underline_x, underline_y - 1, pixel); + // image.put_pixel(underline_x, underline_y, pixel); + // } + } + }); + + image + } +} + +impl std::ops::AddAssign for FontState { + fn add_assign(&mut self, other: Self) { + let new_self = match (&self, other) { + (Self::Normal, Self::Normal) => Self::Normal, + + (Self::Bold, Self::Bold) | (Self::Bold, Self::Normal) | (Self::Normal, Self::Bold) => { + Self::Bold + } + + (Self::Italic, Self::Italic) + | (Self::Italic, Self::Normal) + | (Self::Normal, Self::Italic) => Self::Italic, + + (Self::Bold, Self::Italic) + | (Self::Bold, Self::ItalicBold) + | (Self::ItalicBold, Self::Bold) + | (Self::ItalicBold, Self::Italic) + | (Self::ItalicBold, Self::ItalicBold) + | (Self::ItalicBold, Self::Normal) + | (Self::Italic, Self::Bold) + | (Self::Italic, Self::ItalicBold) + | (Self::Normal, Self::ItalicBold) => Self::ItalicBold, + }; + + *self = new_self + } +} + +impl std::ops::SubAssign for FontState { + fn sub_assign(&mut self, other: Self) { + let new_self = match (&self, other) { + (Self::Italic, Self::Italic) + | (Self::ItalicBold, Self::ItalicBold) + | (Self::Bold, Self::Bold) + | (Self::Normal, Self::Normal) + | (Self::Normal, Self::Bold) + | (Self::Normal, Self::Italic) + | (Self::Bold, Self::ItalicBold) + | (Self::Italic, Self::ItalicBold) + | (Self::Normal, Self::ItalicBold) => Self::Normal, + + (Self::Bold, Self::Normal) + | (Self::Bold, Self::Italic) + | (Self::ItalicBold, Self::Italic) => Self::Bold, + + (Self::Italic, Self::Normal) + | (Self::Italic, Self::Bold) + | (Self::ItalicBold, Self::Bold) => Self::Italic, + + (Self::ItalicBold, Self::Normal) => Self::ItalicBold, + }; + + *self = new_self + } +} diff --git a/nu_plugin_image/src/image_to_ansi/mod.rs b/nu_plugin_image/src/image_to_ansi/mod.rs new file mode 100644 index 0000000..4679f7f --- /dev/null +++ b/nu_plugin_image/src/image_to_ansi/mod.rs @@ -0,0 +1,3 @@ +mod nu_plugin; +mod writer; +pub use nu_plugin::image_to_ansi; diff --git a/nu_plugin_image/src/image_to_ansi/nu_plugin.rs b/nu_plugin_image/src/image_to_ansi/nu_plugin.rs new file mode 100644 index 0000000..ff3fcc2 --- /dev/null +++ b/nu_plugin_image/src/image_to_ansi/nu_plugin.rs @@ -0,0 +1,92 @@ +use std::{env, io::Cursor}; + +use image::codecs::png::PngDecoder; +use nu_plugin::EvaluatedCall; +use nu_protocol::{LabeledError, Span, Value}; + +pub fn image_to_ansi(call: &EvaluatedCall, input: &Value) -> Result { + match build_params(call, input) { + Ok(params) => { + let img = PngDecoder::new(Cursor::new(params.file.as_slice())) + .map(|img| image::DynamicImage::from_decoder(img)); + match img { + Ok(img) => { + let result = super::writer::lib::to_ansi(&img.unwrap(), ¶ms); + + return result + .map(|value| Value::string(value, call.head)) + .map_err(|err| response_error(err, call.head)); + } + Err(er) => Err(response_error(er.to_string(), call.head)), + } + } + Err(err) => Err(err), + } +} + +pub(super) struct IntoAnsiParams { + file: Vec, + pub width: Option, + pub height: Option, + pub truecolor: bool, +} + +pub fn truecolor_available() -> bool { + if let Ok(value) = env::var("COLORTERM") { + value.contains("truecolor") || value.contains("24bit") + } else { + false + } +} + +fn build_params(call: &EvaluatedCall, input: &Value) -> Result { + let mut params = IntoAnsiParams { + file: [].to_vec(), + // verbose: false, + height: None, + width: None, + truecolor: truecolor_available(), + }; + match input.as_binary() { + Ok(file) => params.file = file.to_owned(), + Err(err) => return Err(make_params_err(err.to_string(), call.head)), + }; + params.width = match load_u32(call, "width") { + Ok(value) => Some(value), + Err(_) => None, + }; + params.height = match load_u32(call, "height") { + Ok(value) => Some(value), + Err(_) => None, + }; + + Ok(params) +} + +fn load_u32(call: &EvaluatedCall, flag_name: &str) -> Result { + match call.get_flag_value(flag_name) { + Some(val) => match val { + Value::Int { .. } => match val.as_int().unwrap().try_into() { + Ok(value) => Ok(value), + Err(err) => Err(make_params_err(err.to_string(), call.head)), + }, + _ => Err(make_params_err( + format!("value of `{}` is not an integer", flag_name), + call.head, + )), + }, + None => Err(make_params_err( + format!("cannot find `{}` parameter", flag_name), + call.head, + )), + } +} + +fn make_params_err(text: String, span: Span) -> LabeledError { + return LabeledError::new(text) + .with_label("faced an error when tried to parse the params", span); +} + +fn response_error(text: String, span: Span) -> LabeledError { + return LabeledError::new(text).with_label("cannot create image", span); +} diff --git a/nu_plugin_image/src/image_to_ansi/writer/block.rs b/nu_plugin_image/src/image_to_ansi/writer/block.rs new file mode 100644 index 0000000..f66cbab --- /dev/null +++ b/nu_plugin_image/src/image_to_ansi/writer/block.rs @@ -0,0 +1,164 @@ +use std::io::Error; + +use crate::image_to_ansi::nu_plugin::IntoAnsiParams; + +use ansi_colours::ansi256_from_rgb; +use image::{DynamicImage, GenericImageView, Rgba}; +use termcolor::{Color, ColorSpec, WriteColor}; + +use crossterm::cursor::MoveRight; +use crossterm::execute; + +const UPPER_HALF_BLOCK: &str = "\u{2580}"; +const LOWER_HALF_BLOCK: &str = "\u{2584}"; + +// const CHECKERBOARD_BACKGROUND_LIGHT: (u8, u8, u8) = (153, 153, 153); +// const CHECKERBOARD_BACKGROUND_DARK: (u8, u8, u8) = (102, 102, 102); + +pub fn make_ansi( + stdout: &mut impl WriteColor, + img: &DynamicImage, + config: &IntoAnsiParams, +) -> Result<(), Error> { + print_to_writecolor(stdout, img, config) +} + +fn print_to_writecolor( + stdout: &mut impl WriteColor, + img: &DynamicImage, + config: &IntoAnsiParams, +) -> Result<(), Error> { + // adjust with x=0 and handle horizontal offset entirely below + // adjust_offset(stdout, &Config { x: 0, ..*config })?; + + // resize the image so that it fits in the constraints, if any + let img = super::resize(img, config.width, config.height); + let (width, height) = img.dimensions(); + + let mut row_color_buffer: Vec = vec![ColorSpec::new(); width as usize]; + let img_buffer = img.to_rgba8(); //TODO: Can conversion be avoided? + + for (curr_row, img_row) in img_buffer.enumerate_rows() { + let is_even_row = curr_row % 2 == 0; + let is_last_row = curr_row == height - 1; + + for pixel in img_row { + // choose the half block's color + let color = if is_pixel_transparent(pixel) { + // TODO bg color + // if config.transparent { + None + // } else { + // Some(get_transparency_color(curr_row, pixel.0, config.truecolor)) + // } + } else { + Some(get_color_from_pixel(pixel, config.truecolor)) + }; + + // Even rows modify the background, odd rows the foreground + // because lower half blocks are used by default + let colorspec = &mut row_color_buffer[pixel.0 as usize]; + if is_even_row { + colorspec.set_bg(color); + if is_last_row { + write_colored_character(stdout, colorspec, true)?; + } + } else { + colorspec.set_fg(color); + write_colored_character(stdout, colorspec, false)?; + } + } + + if !is_even_row && !is_last_row { + stdout.reset()?; + writeln!(stdout, "\r")?; + } + } + + stdout.reset()?; + writeln!(stdout)?; + stdout.flush()?; + Ok(()) +} + +fn write_colored_character( + stdout: &mut impl WriteColor, + c: &ColorSpec, + is_last_row: bool, +) -> Result<(), Error> { + let out_color; + let out_char; + let mut new_color; + + // On the last row use upper blocks and leave the bottom half empty (transparent) + if is_last_row { + new_color = ColorSpec::new(); + if let Some(bg) = c.bg() { + new_color.set_fg(Some(*bg)); + out_char = UPPER_HALF_BLOCK; + } else { + execute!(stdout, MoveRight(1))?; + return Ok(()); + } + out_color = &new_color; + } else { + match (c.fg(), c.bg()) { + (None, None) => { + // completely transparent + execute!(stdout, MoveRight(1))?; + return Ok(()); + } + (Some(bottom), None) => { + // only top transparent + new_color = ColorSpec::new(); + new_color.set_fg(Some(*bottom)); + out_color = &new_color; + out_char = LOWER_HALF_BLOCK; + } + (None, Some(top)) => { + // only bottom transparent + new_color = ColorSpec::new(); + new_color.set_fg(Some(*top)); + out_color = &new_color; + out_char = UPPER_HALF_BLOCK; + } + (Some(_top), Some(_bottom)) => { + // both parts have a color + out_color = c; + out_char = LOWER_HALF_BLOCK; + } + } + } + stdout.set_color(out_color)?; + write!(stdout, "{}", out_char)?; + + Ok(()) +} + +fn is_pixel_transparent(pixel: (u32, u32, &Rgba)) -> bool { + pixel.2[3] == 0 +} + +// fn get_transparency_color(row: u32, col: u32, truecolor: bool) -> Color { +// //imitate the transparent chess board pattern +// let rgb = if row % 2 == col % 2 { +// CHECKERBOARD_BACKGROUND_DARK +// } else { +// CHECKERBOARD_BACKGROUND_LIGHT +// }; +// if truecolor { +// Color::Rgb(rgb.0, rgb.1, rgb.2) +// } else { +// Color::Ansi256(ansi256_from_rgb(rgb)) +// } +// } + +fn get_color_from_pixel(pixel: (u32, u32, &Rgba), truecolor: bool) -> Color { + let (_x, _y, data) = pixel; + let rgb = (data[0], data[1], data[2]); + if truecolor { + Color::Rgb(rgb.0, rgb.1, rgb.2) + } else { + Color::Ansi256(ansi256_from_rgb(rgb)) + } +} diff --git a/nu_plugin_image/src/image_to_ansi/writer/lib.rs b/nu_plugin_image/src/image_to_ansi/writer/lib.rs new file mode 100644 index 0000000..d1f910b --- /dev/null +++ b/nu_plugin_image/src/image_to_ansi/writer/lib.rs @@ -0,0 +1,16 @@ +use image::DynamicImage; + +use crate::image_to_ansi::nu_plugin::IntoAnsiParams; + +use super::{make_ansi, string_writer::StringWriter}; + +pub fn to_ansi(img: &DynamicImage, config: &IntoAnsiParams) -> Result { + let stdout = &mut StringWriter::new(); + let _ = make_ansi(stdout, img, config); + + // if config.restore_cursor { + // execute!(&mut stdout, RestorePosition)?; + // }; + + Ok(stdout.read().to_string()) +} diff --git a/nu_plugin_image/src/image_to_ansi/writer/mod.rs b/nu_plugin_image/src/image_to_ansi/writer/mod.rs new file mode 100644 index 0000000..6b11f6c --- /dev/null +++ b/nu_plugin_image/src/image_to_ansi/writer/mod.rs @@ -0,0 +1,110 @@ +pub mod lib; +mod string_writer; + +use image::{DynamicImage, GenericImageView}; + +mod block; +pub use block::make_ansi; + +/// Resize a [image::DynamicImage] so that it fits within optional width and height bounds. +/// If none are provided, terminal size is used instead. +pub fn resize(img: &DynamicImage, width: Option, height: Option) -> DynamicImage { + let (w, h) = find_best_fit(img, width, height); + + // find_best_fit returns values in terminal cells. Hence, we multiply by two + // because a 5x10 image can fit in 5x5 cells. However, a 5x9 image will also + // fit in 5x5 and 1 is deducted in such cases. + img.resize_exact( + w, + 2 * h - img.height() % 2, + image::imageops::FilterType::Triangle, + ) +} + +/// Find the best dimensions for the printed image, based on user's input. +/// Returns the dimensions of how the image should be printed in **terminal cells**. +/// +/// The behaviour is different based on the provided width and height: +/// - If both are None, the image will be resized to fit in the terminal. Aspect ratio is preserved. +/// - If only one is provided and the other is None, it will fit the image in the provided boundary. Aspect ratio is preserved. +/// - If both are provided, the image will be resized to match the new size. Aspect ratio is **not** preserved. +/// +/// Example: +/// Use None for both dimensions to use terminal size (80x24) instead. +/// The image ratio is 2:1, the terminal can be split into 80x46 squares. +/// The best fit would be to use the whole width (80) and 40 vertical squares, +/// which is equivalent to 20 terminal cells. +/// +/// let img = image::DynamicImage::ImageRgba8(image::RgbaImage::new(160, 80)); +/// let (w, h) = find_best_fit(&img, None, None); +/// assert_eq!(w, 80); +/// assert_eq!(h, 20); +//TODO: it might make more sense to change signiture from img to (width, height) +fn find_best_fit(img: &DynamicImage, width: Option, height: Option) -> (u32, u32) { + let (img_width, img_height) = img.dimensions(); + + // Match user's width and height preferences + match (width, height) { + (None, None) => { + let (term_w, term_h) = terminal_size(); + let (w, h) = fit_dimensions(img_width, img_height, term_w as u32, term_h as u32); + + // One less row because two reasons: + // - the prompt after executing the command will take a line + // - gifs flicker + let h = if h == term_h as u32 { h - 1 } else { h }; + (w, h) + } + // Either width or height is specified, will fit and preserve aspect ratio. + (Some(w), None) => fit_dimensions(img_width, img_height, w, img_height), + (None, Some(h)) => fit_dimensions(img_width, img_height, img_width, h), + + // Both width and height are specified, will resize to match exactly + (Some(w), Some(h)) => (w, h), + } +} + +/// Given width & height of an image, scale the size so that it can fit within given bounds +/// while preserving aspect ratio. Will only scale down - if dimensions are smaller than the +/// bounds, they will be returned unmodified. +/// +/// Note: input bounds are meant to hold dimensions of a terminal, where the height of a cell is +/// twice it's width. It is best illustrated in an example: +/// +/// Trying to fit a 100x100 image in 40x15 terminal cells. The best fit, while having an aspect +/// ratio of 1:1, would be to use all of the available height, 15, which is +/// equivalent in size to 30 vertical cells. Hence, the returned dimensions will be 30x15. +/// +/// assert_eq!((30, 15), viuer::fit_dimensions(100, 100, 40, 15)); +fn fit_dimensions(width: u32, height: u32, bound_width: u32, bound_height: u32) -> (u32, u32) { + let bound_height = 2 * bound_height; + + if width <= bound_width && height <= bound_height { + return (width, std::cmp::max(1, height / 2 + height % 2)); + } + + let ratio = width * bound_height; + let nratio = bound_width * height; + + let use_width = nratio <= ratio; + let intermediate = if use_width { + height * bound_width / width + } else { + width * bound_height / height + }; + + if use_width { + (bound_width, std::cmp::max(1, intermediate / 2)) + } else { + (intermediate, std::cmp::max(1, bound_height / 2)) + } +} + +const DEFAULT_TERM_SIZE: (u16, u16) = (80, 24); + +pub fn terminal_size() -> (u16, u16) { + match crossterm::terminal::size() { + Ok(s) => s, + Err(_) => DEFAULT_TERM_SIZE, + } +} diff --git a/nu_plugin_image/src/image_to_ansi/writer/string_writer.rs b/nu_plugin_image/src/image_to_ansi/writer/string_writer.rs new file mode 100644 index 0000000..fc2c35f --- /dev/null +++ b/nu_plugin_image/src/image_to_ansi/writer/string_writer.rs @@ -0,0 +1,177 @@ +use std::io::{self, Write}; + +use termcolor::{Color, ColorSpec, WriteColor}; + +/// Override Output stream +pub struct StringWriter { + inner_buf: Vec, +} + +impl StringWriter { + pub fn new() -> StringWriter { + StringWriter { inner_buf: vec![] } + } + pub fn read(&mut self) -> String { + let result = String::from_utf8_lossy(self.inner_buf.as_slice()); + return result.to_string(); + } + + fn write_str(&mut self, s: &str) -> io::Result<()> { + self.write(s.as_bytes()).map(|_| ()) + } + + fn write_color(&mut self, fg: bool, c: &Color, intense: bool) -> io::Result<()> { + macro_rules! write_intense { + ($clr:expr) => { + if fg { + self.write_str(concat!("\x1B[38;5;", $clr, "m")) + } else { + self.write_str(concat!("\x1B[48;5;", $clr, "m")) + } + }; + } + macro_rules! write_normal { + ($clr:expr) => { + if fg { + self.write_str(concat!("\x1B[3", $clr, "m")) + } else { + self.write_str(concat!("\x1B[4", $clr, "m")) + } + }; + } + macro_rules! write_var_ansi_code { + ($pre:expr, $($code:expr),+) => {{ + // The loop generates at worst a literal of the form + // '255,255,255m' which is 12-bytes. + // The largest `pre` expression we currently use is 7 bytes. + // This gives us the maximum of 19-bytes for our work buffer. + let pre_len = $pre.len(); + assert!(pre_len <= 7); + let mut fmt = [0u8; 19]; + fmt[..pre_len].copy_from_slice($pre); + let mut i = pre_len - 1; + $( + let c1: u8 = ($code / 100) % 10; + let c2: u8 = ($code / 10) % 10; + let c3: u8 = $code % 10; + let mut printed = false; + + if c1 != 0 { + printed = true; + i += 1; + fmt[i] = b'0' + c1; + } + if c2 != 0 || printed { + i += 1; + fmt[i] = b'0' + c2; + } + // If we received a zero value we must still print a value. + i += 1; + fmt[i] = b'0' + c3; + i += 1; + fmt[i] = b';'; + )+ + + fmt[i] = b'm'; + self.write_all(&fmt[0..i+1]) + }} + } + macro_rules! write_custom { + ($ansi256:expr) => { + if fg { + write_var_ansi_code!(b"\x1B[38;5;", $ansi256) + } else { + write_var_ansi_code!(b"\x1B[48;5;", $ansi256) + } + }; + + ($r:expr, $g:expr, $b:expr) => {{ + if fg { + write_var_ansi_code!(b"\x1B[38;2;", $r, $g, $b) + } else { + write_var_ansi_code!(b"\x1B[48;2;", $r, $g, $b) + } + }}; + } + if intense { + match *c { + Color::Black => write_intense!("8"), + Color::Blue => write_intense!("12"), + Color::Green => write_intense!("10"), + Color::Red => write_intense!("9"), + Color::Cyan => write_intense!("14"), + Color::Magenta => write_intense!("13"), + Color::Yellow => write_intense!("11"), + Color::White => write_intense!("15"), + Color::Ansi256(c) => write_custom!(c), + Color::Rgb(r, g, b) => write_custom!(r, g, b), + Color::__Nonexhaustive => unreachable!(), + } + } else { + match *c { + Color::Black => write_normal!("0"), + Color::Blue => write_normal!("4"), + Color::Green => write_normal!("2"), + Color::Red => write_normal!("1"), + Color::Cyan => write_normal!("6"), + Color::Magenta => write_normal!("5"), + Color::Yellow => write_normal!("3"), + Color::White => write_normal!("7"), + Color::Ansi256(c) => write_custom!(c), + Color::Rgb(r, g, b) => write_custom!(r, g, b), + Color::__Nonexhaustive => unreachable!(), + } + } + } +} + +impl Write for StringWriter { + fn write(&mut self, buf: &[u8]) -> std::io::Result { + self.inner_buf.write(buf) + } + + fn flush(&mut self) -> std::io::Result<()> { + self.inner_buf.flush() + } +} + +impl WriteColor for StringWriter { + fn supports_color(&self) -> bool { + return true; + } + + fn set_color(&mut self, spec: &ColorSpec) -> io::Result<()> { + if spec.reset() { + self.reset()?; + } + if spec.bold() { + self.write_str("\x1B[1m")?; + } + if spec.dimmed() { + self.write_str("\x1B[2m")?; + } + if spec.italic() { + self.write_str("\x1B[3m")?; + } + if spec.underline() { + self.write_str("\x1B[4m")?; + } + if spec.strikethrough() { + self.write_str("\x1B[9m")?; + } + if let Some(ref c) = spec.fg() { + self.write_color(true, c, spec.intense())?; + } + if let Some(ref c) = spec.bg() { + self.write_color(false, c, spec.intense())?; + } + Ok(()) + } + fn reset(&mut self) -> io::Result<()> { + self.write_str("\x1B[0m") + } + + fn is_synchronous(&self) -> bool { + false + } +} diff --git a/nu_plugin_image/src/lib.rs b/nu_plugin_image/src/lib.rs new file mode 100644 index 0000000..8508e13 --- /dev/null +++ b/nu_plugin_image/src/lib.rs @@ -0,0 +1,5 @@ +mod ansi_to_image; +mod image_to_ansi; +pub mod logging; +pub use ansi_to_image::*; +pub use image_to_ansi::*; diff --git a/nu_plugin_image/src/logging/logger.rs b/nu_plugin_image/src/logging/logger.rs new file mode 100644 index 0000000..c16e9c4 --- /dev/null +++ b/nu_plugin_image/src/logging/logger.rs @@ -0,0 +1,39 @@ +use include_flate::lazy_static; +use slog::{Drain, Logger}; +use slog_async::Async; +use slog_term::{CompactFormat, TermDecorator}; +use std::sync::{ + atomic::{self, AtomicU8}, + Arc, +}; + +use crate::logging::runtime_filter::RuntimeLevelFilter; + +lazy_static! { + pub static ref INTERNAL_LOGGER: Logger = { + let decorator = TermDecorator::new().build(); + let drain = CompactFormat::new(decorator).build().fuse(); + let drain = RuntimeLevelFilter { + drain: drain, + on: LOG_LEVEL.clone(), + } + .fuse(); + let drain = Async::new(drain).build().fuse(); + Logger::root(drain, slog::o!()) + }; + pub static ref LOG_LEVEL: Arc = Arc::new(AtomicU8::new(0)); +} + +pub fn set_verbose(level: String) { + let level_id = match level.as_str() { + "TRACE" | "trace" | "t" => 0, + "DEBUG" | "debug" | "d" => 1, + "INFO" | "info" | "i" => 2, + "WARNING" | "warning" | "w" => 3, + "ERROR" | "error" | "e" => 4, + "CRITICAL" | "critical" | "c" => 5, + _ => 2, + }; + + LOG_LEVEL.store(level_id, atomic::Ordering::SeqCst); +} diff --git a/nu_plugin_image/src/logging/macros.rs b/nu_plugin_image/src/logging/macros.rs new file mode 100644 index 0000000..42cad05 --- /dev/null +++ b/nu_plugin_image/src/logging/macros.rs @@ -0,0 +1,55 @@ +#[macro_export] +macro_rules! trace { + ( #$tag:expr, $($args:tt)+) => { + slog::log!(crate::logging::logger::INTERNAL_LOGGER, slog::Level::Trace, $tag, $($args)+) + }; + ( $($args:tt)+) => { + slog::log!(crate::logging::logger::INTERNAL_LOGGER, slog::Level::Trace, "", $($args)+) + }; +} + +#[macro_export] +macro_rules! debug { + ( #$tag:expr, $($args:tt)+) => { + slog::log!(crate::logging::logger::INTERNAL_LOGGER, slog::Level::Debug, $tag, $($args)+) + }; + ( $($args:tt)+) => { + slog::log!(crate::logging::logger::INTERNAL_LOGGER, slog::Level::Debug, "", $($args)+) + }; +} +#[macro_export] +macro_rules! info { + ( #$tag:expr, $($args:tt)+) => { + slog::log!(crate::logging::logger::INTERNAL_LOGGER, slog::Level::Info, $tag, $($args)+) + }; + ( $($args:tt)+) => { + slog::log!(crate::logging::logger::INTERNAL_LOGGER, slog::Level::Info, "", $($args)+) + }; +} +#[macro_export] +macro_rules! warn( + ( #$tag:expr, $($args:tt)+) => { + slog::log!(crate::logging::logger::INTERNAL_LOGGER, slog::Level::Warning, $tag, $($args)+) + }; + ( $($args:tt)+) => { + slog::log!(crate::logging::logger::INTERNAL_LOGGER, slog::Level::Warning, "", $($args)+) + }; +); +#[macro_export] +macro_rules! error { + ( #$tag:expr, $($args:tt)+) => { + slog::log!(crate::logging::logger::INTERNAL_LOGGER, slog::Level::Error, $tag, $($args)+) + }; + ( $($args:tt)+) => { + slog::log!(crate::logging::logger::INTERNAL_LOGGER, slog::Level::Error, "", $($args)+) + }; +} +#[macro_export] +macro_rules! critical { + ( #$tag:expr, $($args:tt)+) => { + slog::log!(crate::logging::logger::INTERNAL_LOGGER, slog::Level::Critical, $tag, $($args)+) + }; + ( $($args:tt)+) => { + slog::log!(crate::logging::logger::INTERNAL_LOGGER, slog::Level::Critical, "", $($args)+) + }; +} diff --git a/nu_plugin_image/src/logging/mod.rs b/nu_plugin_image/src/logging/mod.rs new file mode 100644 index 0000000..4a1093e --- /dev/null +++ b/nu_plugin_image/src/logging/mod.rs @@ -0,0 +1,3 @@ +pub mod logger; +mod macros; +mod runtime_filter; diff --git a/nu_plugin_image/src/logging/runtime_filter.rs b/nu_plugin_image/src/logging/runtime_filter.rs new file mode 100644 index 0000000..9ab33a0 --- /dev/null +++ b/nu_plugin_image/src/logging/runtime_filter.rs @@ -0,0 +1,46 @@ +use std::{ + result, + sync::{ + atomic::{self, Ordering}, + Arc, + }, +}; + +use slog::Drain; + +/// Custom Drain logic +pub struct RuntimeLevelFilter { + pub drain: D, + pub on: Arc, +} + +unsafe impl Sync for RuntimeLevelFilter {} +impl Drain for RuntimeLevelFilter +where + D: Drain, +{ + type Ok = Option; + type Err = Option; + + fn log( + &self, + record: &slog::Record, + values: &slog::OwnedKVList, + ) -> result::Result { + let level_id = self.on.load(Ordering::SeqCst); + let current_level = match level_id { + 0 => slog::Level::Trace, + 1 => slog::Level::Debug, + 2 => slog::Level::Info, + 3 => slog::Level::Warning, + 4 => slog::Level::Error, + 5 => slog::Level::Critical, + _ => slog::Level::Info, + }; + if record.level().is_at_least(current_level) { + self.drain.log(record, values).map(Some).map_err(Some) + } else { + Ok(None) + } + } +} diff --git a/nu_plugin_image/src/main.rs b/nu_plugin_image/src/main.rs new file mode 100644 index 0000000..21a29b7 --- /dev/null +++ b/nu_plugin_image/src/main.rs @@ -0,0 +1,177 @@ +use nu_plugin::{self, EvaluatedCall, Plugin, PluginCommand, SimplePluginCommand}; +use nu_plugin_image::{ansi_to_image, image_to_ansi, logging::logger, FontFamily, Palette}; +use nu_protocol::{Category, Signature, SyntaxShape, Type, Value}; + +pub struct ImageConversionPlugin; + +impl Plugin for ImageConversionPlugin { + fn commands(&self) -> Vec>> { + vec![ + Box::new(FromPngCommand::new()), + Box::new(ToPngCommand::new()), + ] + } + + fn version(&self) -> String { + env!("CARGO_PKG_VERSION").into() + } +} +struct FromPngCommand; + +impl FromPngCommand { + pub fn new() -> FromPngCommand { + FromPngCommand {} + } +} +impl SimplePluginCommand for FromPngCommand { + type Plugin = ImageConversionPlugin; + + fn name(&self) -> &str { + "from png" + } + + fn signature(&self) -> Signature { + Signature::build("from png") + .named( + "width", + SyntaxShape::Int, + "Output width, in characters.", + Some('x'), + ) + .named( + "height", + SyntaxShape::Int, + "Output height, in characters.", + Some('y'), + ) + .named( + "log-level", + SyntaxShape::String, + "sets log level (CRITICAL (c) ERROR (e) WARN (w) INFO (i) DEBUG (d) TRACE (t)) defaults to INFO", + None, + ) + .input_output_type(Type::Binary, Type::String) + .category(Category::Conversions) + } + + fn description(&self) -> &str { + "create ansi text from an image" + } + + fn run( + &self, + _plugin: &Self::Plugin, + _engine: &nu_plugin::EngineInterface, + call: &EvaluatedCall, + input: &Value, + ) -> Result { + if let Some(Value::String { val, .. }) = call.get_flag_value("log-level") { + logger::set_verbose(val); + } + image_to_ansi(call, input) + } +} +struct ToPngCommand; +impl ToPngCommand { + pub fn new() -> ToPngCommand { + ToPngCommand {} + } +} +impl SimplePluginCommand for ToPngCommand { + type Plugin = ImageConversionPlugin; + + fn name(&self) -> &str { + "to png" + } + + fn signature(&self) -> nu_protocol::Signature { + Signature::build("to png") + .optional( + "output-path", + SyntaxShape::Filepath, + "output file path (by default uses current timestamp)", + ) + .named("width", SyntaxShape::Int, "output width", Some('w')) + .named("theme",SyntaxShape::String,format!("select theme of the output, one of: {:?}\n\t\tby default uses `vscode` theme and you can mix this flag with custom theme colors every other colors will be from the selected theme",Palette::list()),Some('t')) + .named( + "font", + SyntaxShape::String, + format!( + "Select the font from one of {:?}, by default the first font in the list will be used", + FontFamily::list() + ), + None, + ) + .named("custom-font-regular", SyntaxShape::Filepath, "custom font Regular font path", None) + .named("custom-font-bold", SyntaxShape::Filepath, "custom font Bold font path", None) + .named("custom-font-italic", SyntaxShape::Filepath, "custom font Italic font path", None) + .named("custom-font-bold_italic", SyntaxShape::Filepath, "custom font Bold Italic font path", None) + .named("custom-theme-fg", SyntaxShape::String, "custom foreground color in hex format (0x040404)", None) + .named("custom-theme-bg", SyntaxShape::String, "custom background color in hex format (0x040404)", None) + .named("custom-theme-black", SyntaxShape::String, "custom black color in hex format (0x040404)", None) + .named("custom-theme-red", SyntaxShape::String, "custom red color in hex format (0x040404)", None) + .named("custom-theme-green", SyntaxShape::String, "custom green color in hex format (0x040404)", None) + .named("custom-theme-yellow", SyntaxShape::String, "custom yellow color in hex format (0x040404)", None) + .named("custom-theme-blue", SyntaxShape::String, "custom blue color in hex format (0x040404)", None) + .named("custom-theme-magenta", SyntaxShape::String, "custom magenta color in hex format (0x040404)", None) + .named("custom-theme-cyan", SyntaxShape::String, "custom cyan color in hex format (0x040404)", None) + .named("custom-theme-white", SyntaxShape::String, "custom white color in hex format (0x040404)", None) + .named("custom-theme-bright_black", SyntaxShape::String, "custom bright black color in hex format (0x040404)", None) + .named("custom-theme-bright_red", SyntaxShape::String, "custom bright red color in hex format (0x040404)", None) + .named("custom-theme-bright_green", SyntaxShape::String, "custom bright green color in hex format (0x040404)", None) + .named("custom-theme-bright_yellow", SyntaxShape::String, "custom bright yellow color in hex format (0x040404)", None) + .named("custom-theme-bright_blue", SyntaxShape::String, "custom bright blue color in hex format (0x040404)", None) + .named("custom-theme-bright_magenta", SyntaxShape::String, "custom bright magenta color in hex format (0x040404)", None) + .named("custom-theme-bright_cyan", SyntaxShape::String, "custom bright cyan color in hex format (0x040404)", None) + .named("custom-theme-bright_white", SyntaxShape::String, "custom bright white color in hex format (0x040404)", None) + .named( + "log-level", + SyntaxShape::String, + "sets log level (CRITICAL (c) ERROR (e) WARN (w) INFO (i) DEBUG (d) TRACE (t)) defaults to INFO", + None, + ) + .input_output_type(Type::String, Type::String) + // .plugin_examples( + // vec![ + // PluginExample{ + // description: "creates image of `ls` command's output and save it in the `ls.png` file".to_string(), + // example: "ls | table -c | to png --theme ubuntu --font Ubuntu --output-path ls.png".to_string(), + // result: None, + // }, + // PluginExample{ + // description: "creates image of `ls` command's output and save it in the `ls.png` file with custom greenish background color".to_string(), + // example: "ls | table -c | to png --theme ubuntu --font Ubuntu --custom-theme-bg 0x112411 --output-path ls.png".to_string(), + // result: None, + // }, + // ] + // ) + .category(Category::Conversions) + } + + fn description(&self) -> &str { + "converts ansi string into png image" + } + fn extra_description(&self) -> &str { + "if you change font and theme they will be used as base theme of the output and every custom flag you provide will override the selected theme or font" + } + + fn run( + &self, + _plugin: &Self::Plugin, + engine: &nu_plugin::EngineInterface, + call: &EvaluatedCall, + input: &Value, + ) -> Result { + if let Some(Value::String { val, .. }) = call.get_flag_value("log-level") { + logger::set_verbose(val); + } + ansi_to_image(engine, call, input) + } +} + +fn main() { + nu_plugin::serve_plugin( + &mut ImageConversionPlugin {}, + nu_plugin::MsgPackSerializer {}, + ) +} diff --git a/nu_plugin_port_extension/.gitignore b/nu_plugin_port_extension/.gitignore new file mode 100644 index 0000000..ea8c4bf --- /dev/null +++ b/nu_plugin_port_extension/.gitignore @@ -0,0 +1 @@ +/target diff --git a/nu_plugin_port_extension/Cargo.lock b/nu_plugin_port_extension/Cargo.lock new file mode 100644 index 0000000..1ce202d --- /dev/null +++ b/nu_plugin_port_extension/Cargo.lock @@ -0,0 +1,2268 @@ +# This file is automatically @generated by Cargo. +# It is not intended for manual editing. +version = 4 + +[[package]] +name = "adler2" +version = "2.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "320119579fcad9c21884f5c4861d16174d0e06250625266f50fe6898340abefa" + +[[package]] +name = "aho-corasick" +version = "1.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8e60d3430d3a69478ad0993f19238d2df97c507009a52b3c10addcd7f6bcb916" +dependencies = [ + "memchr", +] + +[[package]] +name = "alloc-no-stdlib" +version = "2.0.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cc7bb162ec39d46ab1ca8c77bf72e890535becd1751bb45f64c597edb4c8c6b3" + +[[package]] +name = "alloc-stdlib" +version = "0.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "94fb8275041c72129eb51b7d0322c29b8387a0386127718b096429201a5d6ece" +dependencies = [ + "alloc-no-stdlib", +] + +[[package]] +name = "allocator-api2" +version = "0.2.21" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "683d7910e743518b0e34f1186f92494becacb047c7b6bf616c96772180fef923" + +[[package]] +name = "android-tzdata" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e999941b234f3131b00bc13c22d06e8c5ff726d1b6318ac7eb276997bbb4fef0" + +[[package]] +name = "android_system_properties" +version = "0.1.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "819e7219dbd41043ac279b19830f2efc897156490d7fd6ea916720117ee66311" +dependencies = [ + "libc", +] + +[[package]] +name = "anyhow" +version = "1.0.98" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e16d2d3311acee920a9eb8d33b8cbc1787ce4a264e85f964c2404b969bdcd487" + +[[package]] +name = "arrayvec" +version = "0.7.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7c02d123df017efcdfbd739ef81735b36c5ba83ec3c59c80a9d7ecc718f92e50" + +[[package]] +name = "autocfg" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c08606f8c3cbf4ce6ec8e28fb0014a2c086708fe954eaa885384a6165172e7e8" + +[[package]] +name = "bindgen" +version = "0.70.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f49d8fed880d473ea71efb9bf597651e77201bdd4893efe54c9e5d65ae04ce6f" +dependencies = [ + "bitflags 2.9.1", + "cexpr", + "clang-sys", + "itertools 0.13.0", + "proc-macro2", + "quote", + "regex", + "rustc-hash 1.1.0", + "shlex", + "syn 2.0.104", +] + +[[package]] +name = "bindgen" +version = "0.71.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5f58bf3d7db68cfbac37cfc485a8d711e87e064c3d0fe0435b92f7a407f9d6b3" +dependencies = [ + "bitflags 2.9.1", + "cexpr", + "clang-sys", + "itertools 0.13.0", + "log", + "prettyplease", + "proc-macro2", + "quote", + "regex", + "rustc-hash 2.1.1", + "shlex", + "syn 2.0.104", +] + +[[package]] +name = "bit-set" +version = "0.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "08807e080ed7f9d5433fa9b275196cfc35414f66a0c79d864dc51a0d825231a3" +dependencies = [ + "bit-vec", +] + +[[package]] +name = "bit-vec" +version = "0.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5e764a1d40d510daf35e07be9eb06e75770908c27d411ee6c92109c9840eaaf7" + +[[package]] +name = "bitflags" +version = "1.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a" + +[[package]] +name = "bitflags" +version = "2.9.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1b8e56985ec62d17e9c1001dc89c88ecd7dc08e47eba5ec7c29c7b5eeecde967" + +[[package]] +name = "brotli" +version = "7.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cc97b8f16f944bba54f0433f07e30be199b6dc2bd25937444bbad560bcea29bd" +dependencies = [ + "alloc-no-stdlib", + "alloc-stdlib", + "brotli-decompressor", +] + +[[package]] +name = "brotli-decompressor" +version = "4.0.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a334ef7c9e23abf0ce748e8cd309037da93e606ad52eb372e4ce327a0dcfbdfd" +dependencies = [ + "alloc-no-stdlib", + "alloc-stdlib", +] + +[[package]] +name = "bumpalo" +version = "3.19.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "46c5e41b57b8bba42a04676d81cb89e9ee8e859a1a66f80a5a72e1cb76b34d43" + +[[package]] +name = "byteorder" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1fd0f2584146f6f2ef48085050886acf353beff7305ebd1ae69500e27c67f64b" + +[[package]] +name = "bytes" +version = "1.10.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d71b6127be86fdcfddb610f7182ac57211d4b18a3e9c82eb2d17662f2227ad6a" + +[[package]] +name = "cc" +version = "1.2.27" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d487aa071b5f64da6f19a3e848e3578944b726ee5a4854b82172f02aa876bfdc" +dependencies = [ + "shlex", +] + +[[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.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9555578bc9e57714c812a1f84e4fc5b4d21fcb063490c624de019f7464c91268" + +[[package]] +name = "cfg_aliases" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "613afe47fcd5fac7ccf1db93babcb082c5994d996f20b8b159f2ad1658eb5724" + +[[package]] +name = "chrono" +version = "0.4.41" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c469d952047f47f91b68d1cba3f10d63c11d73e4636f24f08daf0278abf01c4d" +dependencies = [ + "android-tzdata", + "iana-time-zone", + "num-traits", + "pure-rust-locales", + "serde", + "windows-link", +] + +[[package]] +name = "chrono-humanize" +version = "0.2.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "799627e6b4d27827a814e837b9d8a504832086081806d45b1afa34dc982b023b" +dependencies = [ + "chrono", +] + +[[package]] +name = "clang-sys" +version = "1.8.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0b023947811758c97c59bf9d1c188fd619ad4718dcaa767947df1cadb14f39f4" +dependencies = [ + "glob", + "libc", + "libloading", +] + +[[package]] +name = "core-foundation-sys" +version = "0.8.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "773648b94d0e5d620f64f280777445740e61fe701025087ec8b57f45c791888b" + +[[package]] +name = "crc32fast" +version = "1.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a97769d94ddab943e4510d138150169a2758b5ef3eb191a9ee688de3e23ef7b3" +dependencies = [ + "cfg-if", +] + +[[package]] +name = "crossbeam-deque" +version = "0.8.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9dd111b7b7f7d55b72c0a6ae361660ee5853c9af73f70c3c2ef6858b950e2e51" +dependencies = [ + "crossbeam-epoch", + "crossbeam-utils", +] + +[[package]] +name = "crossbeam-epoch" +version = "0.9.18" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5b82ac4a3c2ca9c3460964f020e1402edd5753411d7737aa39c3714ad1b5420e" +dependencies = [ + "crossbeam-utils", +] + +[[package]] +name = "crossbeam-utils" +version = "0.8.21" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d0a5c400df2834b80a4c3327b3aad3a4c4cd4de0629063962b03235697506a28" + +[[package]] +name = "crossterm" +version = "0.28.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "829d955a0bb380ef178a640b91779e3987da38c9aea133b20614cfed8cdea9c6" +dependencies = [ + "bitflags 2.9.1", + "crossterm_winapi", + "mio", + "parking_lot", + "rustix 0.38.44", + "signal-hook", + "signal-hook-mio", + "winapi", +] + +[[package]] +name = "crossterm_winapi" +version = "0.9.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "acdd7c62a3665c7f6830a51635d9ac9b23ed385797f70a83bb8bafe9c572ab2b" +dependencies = [ + "winapi", +] + +[[package]] +name = "darling" +version = "0.20.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fc7f46116c46ff9ab3eb1597a45688b6715c6e628b5c133e288e709a29bcb4ee" +dependencies = [ + "darling_core", + "darling_macro", +] + +[[package]] +name = "darling_core" +version = "0.20.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0d00b9596d185e565c2207a0b01f8bd1a135483d02d9b7b0a54b11da8d53412e" +dependencies = [ + "fnv", + "ident_case", + "proc-macro2", + "quote", + "strsim", + "syn 2.0.104", +] + +[[package]] +name = "darling_macro" +version = "0.20.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fc34b93ccb385b40dc71c6fceac4b2ad23662c7eeb248cf10d529b7e055b6ead" +dependencies = [ + "darling_core", + "quote", + "syn 2.0.104", +] + +[[package]] +name = "derive-getters" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "74ef43543e701c01ad77d3a5922755c6a1d71b22d942cb8042be4994b380caff" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.104", +] + +[[package]] +name = "derive_builder" +version = "0.20.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "507dfb09ea8b7fa618fcf76e953f4f5e192547945816d5358edffe39f6f94947" +dependencies = [ + "derive_builder_macro", +] + +[[package]] +name = "derive_builder_core" +version = "0.20.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2d5bcf7b024d6835cfb3d473887cd966994907effbe9227e8c8219824d06c4e8" +dependencies = [ + "darling", + "proc-macro2", + "quote", + "syn 2.0.104", +] + +[[package]] +name = "derive_builder_macro" +version = "0.20.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ab63b0e2bf4d5928aff72e83a7dace85d7bba5fe12dcc3c5a572d78caffd3f3c" +dependencies = [ + "derive_builder_core", + "syn 2.0.104", +] + +[[package]] +name = "dirs" +version = "5.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "44c45a9d03d6676652bcb5e724c7e988de1acad23a711b5217ab9cbecbec2225" +dependencies = [ + "dirs-sys", +] + +[[package]] +name = "dirs-sys" +version = "0.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "520f05a5cbd335fae5a99ff7a6ab8627577660ee5cfd6a94a6a929b52ff0321c" +dependencies = [ + "libc", + "option-ext", + "redox_users", + "windows-sys 0.48.0", +] + +[[package]] +name = "doctest-file" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "aac81fa3e28d21450aa4d2ac065992ba96a1d7303efbce51a95f4fd175b67562" + +[[package]] +name = "either" +version = "1.15.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "48c757948c5ede0e46177b7add2e67155f70e33c07fea8284df6576da70b3719" + +[[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.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e004d887f51fcb9fef17317a2f3525c887d8aa3f4f50fed920816a688284a5b7" +dependencies = [ + "serde", + "typeid", +] + +[[package]] +name = "errno" +version = "0.3.13" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "778e2ac28f6c47af28e4907f13ffd1e1ddbd400980a9abd7c8df189bf578a5ad" +dependencies = [ + "libc", + "windows-sys 0.60.2", +] + +[[package]] +name = "fancy-regex" +version = "0.14.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6e24cb5a94bcae1e5408b0effca5cd7172ea3c5755049c5f3af4cd283a165298" +dependencies = [ + "bit-set", + "regex-automata", + "regex-syntax", +] + +[[package]] +name = "flate2" +version = "1.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4a3d7db9596fecd151c5f638c0ee5d5bd487b6e0ea232e5dc96d5250f6f94b1d" +dependencies = [ + "crc32fast", + "miniz_oxide", +] + +[[package]] +name = "fnv" +version = "1.0.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3f9eec918d3f24069decb9af1554cad7c880e2da24a9afd88aca000531ab82c1" + +[[package]] +name = "foldhash" +version = "0.1.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d9c4f5dac5e15c24eb999c26181a6ca40b39fe946cbe4c263c7209467bc83af2" + +[[package]] +name = "getrandom" +version = "0.2.16" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "335ff9f135e4384c8150d6f27c6daed433577f86b4750418338c01a1a2528592" +dependencies = [ + "cfg-if", + "libc", + "wasi", +] + +[[package]] +name = "glob" +version = "0.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a8d1add55171497b4705a648c6b583acafb01d58050a51727785f0b2c8e0a2b2" + +[[package]] +name = "hashbrown" +version = "0.15.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5971ac85611da7067dbfcabef3c70ebb5606018acd9e2a3903a0da507521e0d5" +dependencies = [ + "allocator-api2", + "equivalent", + "foldhash", +] + +[[package]] +name = "heck" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2304e00983f87ffb38b55b444b5e3b60a884b5d30c0fca7d82fe33449bbe55ea" + +[[package]] +name = "hex" +version = "0.4.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7f24254aa9a54b5c858eaee2f5bccdb46aaf0e486a595ed5fd8f86ba55232a70" + +[[package]] +name = "iana-time-zone" +version = "0.1.63" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b0c919e5debc312ad217002b8048a17b7d83f80703865bbfcfebb0458b0b27d8" +dependencies = [ + "android_system_properties", + "core-foundation-sys", + "iana-time-zone-haiku", + "js-sys", + "log", + "wasm-bindgen", + "windows-core 0.61.2", +] + +[[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 = "ident_case" +version = "1.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b9e0384b61958566e926dc50660321d12159025e767c18e043daf26b70104c39" + +[[package]] +name = "indexmap" +version = "2.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cea70ddb795996207ad57735b50c5982d8844f38ba9ee5f1aedcfb708a2aa11e" +dependencies = [ + "equivalent", + "hashbrown", +] + +[[package]] +name = "interprocess" +version = "2.2.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d941b405bd2322993887859a8ee6ac9134945a24ec5ec763a8a962fc64dfec2d" +dependencies = [ + "doctest-file", + "libc", + "recvmsg", + "widestring", + "windows-sys 0.52.0", +] + +[[package]] +name = "inventory" +version = "0.3.20" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ab08d7cd2c5897f2c949e5383ea7c7db03fb19130ffcfbf7eda795137ae3cb83" +dependencies = [ + "rustversion", +] + +[[package]] +name = "is_ci" +version = "1.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7655c9839580ee829dfacba1d1278c2b7883e50a277ff7541299489d6bdfdc45" + +[[package]] +name = "itertools" +version = "0.13.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "413ee7dfc52ee1a4949ceeb7dbc8a33f2d6c088194d9f922fb8318faf1f01186" +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.15" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4a5f13b858c8d314ee3e8f639011f7ccefe71f97f96e50151fb991f267928e2c" + +[[package]] +name = "js-sys" +version = "0.3.77" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1cfaf33c695fc6e08064efbc1f72ec937429614f25eef83af942d0e227c3a28f" +dependencies = [ + "once_cell", + "wasm-bindgen", +] + +[[package]] +name = "libc" +version = "0.2.174" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1171693293099992e19cddea4e8b849964e9846f4acee11b3948bcc337be8776" + +[[package]] +name = "libloading" +version = "0.8.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "07033963ba89ebaf1584d767badaa2e8fcec21aedea6b8c0346d487d49c28667" +dependencies = [ + "cfg-if", + "windows-targets 0.53.2", +] + +[[package]] +name = "libproc" +version = "0.14.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e78a09b56be5adbcad5aa1197371688dc6bb249a26da3bca2011ee2fb987ebfb" +dependencies = [ + "bindgen 0.70.1", + "errno", + "libc", +] + +[[package]] +name = "libredox" +version = "0.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c0ff37bd590ca25063e35af745c343cb7a0271906fb7b37e4813e8f79f00268d" +dependencies = [ + "bitflags 2.9.1", + "libc", +] + +[[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.9.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cd945864f07fe9f5371a27ad7b52a172b4b499999f1d97574c9fa68373937e12" + +[[package]] +name = "lock_api" +version = "0.4.13" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "96936507f153605bddfcda068dd804796c84324ed2510809e5b2a624c81da765" +dependencies = [ + "autocfg", + "scopeguard", +] + +[[package]] +name = "log" +version = "0.4.27" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "13dc2df351e3202783a1fe0d44375f7295ffb4049267b0f3018346dc122a1d94" + +[[package]] +name = "lru" +version = "0.12.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "234cf4f4a04dc1f57e24b96cc0cd600cf2af460d4161ac5ecdd0af8e1f3b2a38" +dependencies = [ + "hashbrown", +] + +[[package]] +name = "lscolors" +version = "0.20.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "61183da5de8ba09a58e330d55e5ea796539d8443bd00fdeb863eac39724aa4ab" +dependencies = [ + "aho-corasick", + "nu-ansi-term", +] + +[[package]] +name = "mach2" +version = "0.4.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d640282b302c0bb0a2a8e0233ead9035e3bed871f0b7e81fe4a1ec829765db44" +dependencies = [ + "libc", +] + +[[package]] +name = "memchr" +version = "2.7.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "32a282da65faaf38286cf3be983213fcf1d2e2a58700e808f83f4ea9a4804bc0" + +[[package]] +name = "miette" +version = "7.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5f98efec8807c63c752b5bd61f862c165c115b0a35685bdcfd9238c7aeb592b7" +dependencies = [ + "cfg-if", + "miette-derive", + "owo-colors", + "supports-color", + "supports-hyperlinks", + "supports-unicode", + "terminal_size", + "textwrap", + "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.104", +] + +[[package]] +name = "minimal-lexical" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "68354c5c6bd36d73ff3feceb05efa59b6acb7626617f4962be322a825e61f79a" + +[[package]] +name = "miniz_oxide" +version = "0.8.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1fa76a2c86f704bdb222d66965fb3d63269ce38518b83cb0575fca855ebb6316" +dependencies = [ + "adler2", +] + +[[package]] +name = "mio" +version = "1.0.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "78bed444cc8a2160f01cbcf811ef18cac863ad68ae8ca62092e8db51d51c761c" +dependencies = [ + "libc", + "log", + "wasi", + "windows-sys 0.59.0", +] + +[[package]] +name = "netlink-packet-core" +version = "0.7.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "72724faf704479d67b388da142b186f916188505e7e0b26719019c525882eda4" +dependencies = [ + "anyhow", + "byteorder", + "netlink-packet-utils", +] + +[[package]] +name = "netlink-packet-sock-diag" +version = "0.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a495cb1de50560a7cd12fdcf023db70eec00e340df81be31cedbbfd4aadd6b76" +dependencies = [ + "anyhow", + "bitflags 1.3.2", + "byteorder", + "libc", + "netlink-packet-core", + "netlink-packet-utils", + "smallvec", +] + +[[package]] +name = "netlink-packet-utils" +version = "0.5.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0ede8a08c71ad5a95cdd0e4e52facd37190977039a4704eb82a283f713747d34" +dependencies = [ + "anyhow", + "byteorder", + "paste", + "thiserror 1.0.69", +] + +[[package]] +name = "netlink-sys" +version = "0.8.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "16c903aa70590cb93691bf97a767c8d1d6122d2cc9070433deb3bbf36ce8bd23" +dependencies = [ + "bytes", + "libc", + "log", +] + +[[package]] +name = "netstat2" +version = "0.11.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6422b6a8c7635e8a82323e4cdf07a90e91901e07f4c1f0f3a245d54b4637e55c" +dependencies = [ + "bindgen 0.71.1", + "bitflags 2.9.1", + "byteorder", + "netlink-packet-core", + "netlink-packet-sock-diag", + "netlink-packet-utils", + "netlink-sys", + "num-derive", + "num-traits", + "thiserror 2.0.12", +] + +[[package]] +name = "nix" +version = "0.29.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "71e2746dc3a24dd78b3cfcb7be93368c6de9963d30f43a6a73998a9cf4b17b46" +dependencies = [ + "bitflags 2.9.1", + "cfg-if", + "cfg_aliases", + "libc", +] + +[[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 = "ntapi" +version = "0.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e8a3895c6391c39d7fe7ebc444a87eb2991b2a0bc718fdabd071eec617fc68e4" +dependencies = [ + "winapi", +] + +[[package]] +name = "nu-ansi-term" +version = "0.50.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d4a28e057d01f97e61255210fcff094d74ed0466038633e95017f5beb68e4399" +dependencies = [ + "windows-sys 0.52.0", +] + +[[package]] +name = "nu-derive-value" +version = "0.105.2" +dependencies = [ + "heck", + "proc-macro-error2", + "proc-macro2", + "quote", + "syn 2.0.104", +] + +[[package]] +name = "nu-engine" +version = "0.105.2" +dependencies = [ + "log", + "nu-glob", + "nu-path", + "nu-protocol", + "nu-utils", +] + +[[package]] +name = "nu-glob" +version = "0.105.2" + +[[package]] +name = "nu-path" +version = "0.105.2" +dependencies = [ + "dirs", + "omnipath", + "pwd", + "ref-cast", +] + +[[package]] +name = "nu-plugin" +version = "0.105.2" +dependencies = [ + "log", + "nix", + "nu-engine", + "nu-plugin-core", + "nu-plugin-protocol", + "nu-protocol", + "nu-utils", + "thiserror 2.0.12", +] + +[[package]] +name = "nu-plugin-core" +version = "0.105.2" +dependencies = [ + "interprocess", + "log", + "nu-plugin-protocol", + "nu-protocol", + "rmp-serde", + "serde", + "serde_json", + "windows 0.56.0", +] + +[[package]] +name = "nu-plugin-protocol" +version = "0.105.2" +dependencies = [ + "nu-protocol", + "nu-utils", + "rmp-serde", + "semver", + "serde", + "typetag", +] + +[[package]] +name = "nu-protocol" +version = "0.105.2" +dependencies = [ + "brotli", + "bytes", + "chrono", + "chrono-humanize", + "dirs", + "dirs-sys", + "fancy-regex", + "heck", + "indexmap", + "log", + "lru", + "memchr", + "miette", + "nix", + "nu-derive-value", + "nu-glob", + "nu-path", + "nu-system", + "nu-utils", + "num-format", + "os_pipe", + "rmp-serde", + "serde", + "serde_json", + "strum", + "strum_macros", + "thiserror 2.0.12", + "typetag", + "web-time", + "windows 0.56.0", + "windows-sys 0.48.0", +] + +[[package]] +name = "nu-system" +version = "0.105.2" +dependencies = [ + "chrono", + "itertools 0.14.0", + "libc", + "libproc", + "log", + "mach2", + "nix", + "ntapi", + "procfs", + "sysinfo 0.33.1", + "web-time", + "windows 0.56.0", +] + +[[package]] +name = "nu-utils" +version = "0.105.2" +dependencies = [ + "crossterm", + "crossterm_winapi", + "fancy-regex", + "log", + "lscolors", + "nix", + "num-format", + "serde", + "serde_json", + "strip-ansi-escapes", + "sys-locale", + "unicase", +] + +[[package]] +name = "nu_plugin_port_extension" +version = "0.105.2" +dependencies = [ + "derive-getters", + "derive_builder", + "netstat2", + "nu-plugin", + "nu-protocol", + "sysinfo 0.35.2", +] + +[[package]] +name = "num-derive" +version = "0.3.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "876a53fff98e03a936a674b29568b0e605f06b29372c2489ff4de23f1949743d" +dependencies = [ + "proc-macro2", + "quote", + "syn 1.0.109", +] + +[[package]] +name = "num-format" +version = "0.4.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a652d9771a63711fd3c3deb670acfbe5c30a4072e664d7a3bf5a9e1056ac72c3" +dependencies = [ + "arrayvec", + "itoa", +] + +[[package]] +name = "num-traits" +version = "0.2.19" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "071dfc062690e90b734c0b2273ce72ad0ffa95f0c74596bc250dcfd960262841" +dependencies = [ + "autocfg", +] + +[[package]] +name = "objc2-core-foundation" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1c10c2894a6fed806ade6027bcd50662746363a9589d3ec9d9bef30a4e4bc166" +dependencies = [ + "bitflags 2.9.1", +] + +[[package]] +name = "objc2-io-kit" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "71c1c64d6120e51cd86033f67176b1cb66780c2efe34dec55176f77befd93c0a" +dependencies = [ + "libc", + "objc2-core-foundation", +] + +[[package]] +name = "omnipath" +version = "0.1.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "80adb31078122c880307e9cdfd4e3361e6545c319f9b9dcafcb03acd3b51a575" + +[[package]] +name = "once_cell" +version = "1.21.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "42f5e15c9953c5e4ccceeb2e7382a716482c34515315f7b03532b8b4e8393d2d" + +[[package]] +name = "option-ext" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "04744f49eae99ab78e0d5c0b603ab218f515ea8cfe5a456d7629ad883a3b6e7d" + +[[package]] +name = "os_pipe" +version = "1.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "db335f4760b14ead6290116f2427bf33a14d4f0617d49f78a246de10c1831224" +dependencies = [ + "libc", + "windows-sys 0.59.0", +] + +[[package]] +name = "owo-colors" +version = "4.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "48dd4f4a2c8405440fd0462561f0e5806bd0f77e86f51c761481bdd4018b545e" + +[[package]] +name = "parking_lot" +version = "0.12.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "70d58bf43669b5795d1576d0641cfb6fbb2057bf629506267a92807158584a13" +dependencies = [ + "lock_api", + "parking_lot_core", +] + +[[package]] +name = "parking_lot_core" +version = "0.9.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bc838d2a56b5b1a6c25f55575dfc605fabb63bb2365f6c2353ef9159aa69e4a5" +dependencies = [ + "cfg-if", + "libc", + "redox_syscall", + "smallvec", + "windows-targets 0.52.6", +] + +[[package]] +name = "paste" +version = "1.0.15" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "57c0d7b74b563b49d38dae00a0c37d4d6de9b432382b2892f0574ddcae73fd0a" + +[[package]] +name = "prettyplease" +version = "0.2.35" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "061c1221631e079b26479d25bbf2275bfe5917ae8419cd7e34f13bfc2aa7539a" +dependencies = [ + "proc-macro2", + "syn 2.0.104", +] + +[[package]] +name = "proc-macro-error-attr2" +version = "2.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "96de42df36bb9bba5542fe9f1a054b8cc87e172759a1868aa05c1f3acc89dfc5" +dependencies = [ + "proc-macro2", + "quote", +] + +[[package]] +name = "proc-macro-error2" +version = "2.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "11ec05c52be0a07b08061f7dd003e7d7092e0472bc731b4af7bb1ef876109802" +dependencies = [ + "proc-macro-error-attr2", + "proc-macro2", + "quote", + "syn 2.0.104", +] + +[[package]] +name = "proc-macro2" +version = "1.0.95" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "02b3e5e68a3a1a02aad3ec490a98007cbc13c37cbe84a3cd7b8e406d76e7f778" +dependencies = [ + "unicode-ident", +] + +[[package]] +name = "procfs" +version = "0.17.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cc5b72d8145275d844d4b5f6d4e1eef00c8cd889edb6035c21675d1bb1f45c9f" +dependencies = [ + "bitflags 2.9.1", + "chrono", + "flate2", + "hex", + "procfs-core", + "rustix 0.38.44", +] + +[[package]] +name = "procfs-core" +version = "0.17.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "239df02d8349b06fc07398a3a1697b06418223b1c7725085e801e7c0fc6a12ec" +dependencies = [ + "bitflags 2.9.1", + "chrono", + "hex", +] + +[[package]] +name = "pure-rust-locales" +version = "0.8.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1190fd18ae6ce9e137184f207593877e70f39b015040156b1e05081cdfe3733a" + +[[package]] +name = "pwd" +version = "1.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "72c71c0c79b9701efe4e1e4b563b2016dd4ee789eb99badcb09d61ac4b92e4a2" +dependencies = [ + "libc", + "thiserror 1.0.69", +] + +[[package]] +name = "quote" +version = "1.0.40" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1885c039570dc00dcb4ff087a89e185fd56bae234ddc7f056a945bf36467248d" +dependencies = [ + "proc-macro2", +] + +[[package]] +name = "rayon" +version = "1.10.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b418a60154510ca1a002a752ca9714984e21e4241e804d32555251faf8b78ffa" +dependencies = [ + "either", + "rayon-core", +] + +[[package]] +name = "rayon-core" +version = "1.12.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1465873a3dfdaa8ae7cb14b4383657caab0b3e8a0aa9ae8e04b044854c8dfce2" +dependencies = [ + "crossbeam-deque", + "crossbeam-utils", +] + +[[package]] +name = "recvmsg" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d3edd4d5d42c92f0a659926464d4cce56b562761267ecf0f469d85b7de384175" + +[[package]] +name = "redox_syscall" +version = "0.5.13" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0d04b7d0ee6b4a0207a0a7adb104d23ecb0b47d6beae7152d0fa34b692b29fd6" +dependencies = [ + "bitflags 2.9.1", +] + +[[package]] +name = "redox_users" +version = "0.4.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ba009ff324d1fc1b900bd1fdb31564febe58a8ccc8a6fdbb93b543d33b13ca43" +dependencies = [ + "getrandom", + "libredox", + "thiserror 1.0.69", +] + +[[package]] +name = "ref-cast" +version = "1.0.24" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4a0ae411dbe946a674d89546582cea4ba2bb8defac896622d6496f14c23ba5cf" +dependencies = [ + "ref-cast-impl", +] + +[[package]] +name = "ref-cast-impl" +version = "1.0.24" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1165225c21bff1f3bbce98f5a1f889949bc902d3575308cc7b0de30b4f6d27c7" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.104", +] + +[[package]] +name = "regex" +version = "1.11.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b544ef1b4eac5dc2db33ea63606ae9ffcfac26c1416a2806ae0bf5f56b201191" +dependencies = [ + "aho-corasick", + "memchr", + "regex-automata", + "regex-syntax", +] + +[[package]] +name = "regex-automata" +version = "0.4.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "809e8dc61f6de73b46c85f4c96486310fe304c434cfa43669d7b40f711150908" +dependencies = [ + "aho-corasick", + "memchr", + "regex-syntax", +] + +[[package]] +name = "regex-syntax" +version = "0.8.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2b15c43186be67a4fd63bee50d0303afffcef381492ebe2c5d87f324e1b8815c" + +[[package]] +name = "rmp" +version = "0.8.14" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "228ed7c16fa39782c3b3468e974aec2795e9089153cd08ee2e9aefb3613334c4" +dependencies = [ + "byteorder", + "num-traits", + "paste", +] + +[[package]] +name = "rmp-serde" +version = "1.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "52e599a477cf9840e92f2cde9a7189e67b42c57532749bf90aea6ec10facd4db" +dependencies = [ + "byteorder", + "rmp", + "serde", +] + +[[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.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "357703d41365b4b27c590e3ed91eabb1b663f07c4c084095e60cbed4362dff0d" + +[[package]] +name = "rustix" +version = "0.38.44" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fdb5bc1ae2baa591800df16c9ca78619bf65c0488b41b96ccec5d11220d8c154" +dependencies = [ + "bitflags 2.9.1", + "errno", + "libc", + "linux-raw-sys 0.4.15", + "windows-sys 0.59.0", +] + +[[package]] +name = "rustix" +version = "1.0.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c71e83d6afe7ff64890ec6b71d6a69bb8a610ab78ce364b3352876bb4c801266" +dependencies = [ + "bitflags 2.9.1", + "errno", + "libc", + "linux-raw-sys 0.9.4", + "windows-sys 0.59.0", +] + +[[package]] +name = "rustversion" +version = "1.0.21" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8a0d197bd2c9dc6e53b84da9556a69ba4cdfab8619eb41a8bd1cc2027a0f6b1d" + +[[package]] +name = "ryu" +version = "1.0.20" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "28d3b2b1366ec20994f1fd18c3c594f05c5dd4bc44d8bb0c1c632c8d6829481f" + +[[package]] +name = "scopeguard" +version = "1.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "94143f37725109f92c262ed2cf5e59bce7498c01bcc1502d7b9afe439a4e9f49" + +[[package]] +name = "semver" +version = "1.0.26" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "56e6fa9c48d24d85fb3de5ad847117517440f6beceb7798af16b4a87d616b8d0" + +[[package]] +name = "serde" +version = "1.0.219" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5f0e2c6ed6606019b4e29e69dbaba95b11854410e5347d525002456dbbb786b6" +dependencies = [ + "serde_derive", +] + +[[package]] +name = "serde_derive" +version = "1.0.219" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5b0276cf7f2c73365f7157c8123c21cd9a50fbbd844757af28ca1f5925fc2a00" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.104", +] + +[[package]] +name = "serde_json" +version = "1.0.140" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "20068b6e96dc6c9bd23e01df8827e6c7e1f2fddd43c21810382803c136b99373" +dependencies = [ + "itoa", + "memchr", + "ryu", + "serde", +] + +[[package]] +name = "shlex" +version = "1.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0fda2ff0d084019ba4d7c6f371c95d8fd75ce3524c3cb8fb653a3023f6323e64" + +[[package]] +name = "signal-hook" +version = "0.3.18" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d881a16cf4426aa584979d30bd82cb33429027e42122b169753d6ef1085ed6e2" +dependencies = [ + "libc", + "signal-hook-registry", +] + +[[package]] +name = "signal-hook-mio" +version = "0.2.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "34db1a06d485c9142248b7a054f034b349b212551f3dfd19c94d45a754a217cd" +dependencies = [ + "libc", + "mio", + "signal-hook", +] + +[[package]] +name = "signal-hook-registry" +version = "1.4.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9203b8055f63a2a00e2f593bb0510367fe707d7ff1e5c872de2f537b339e5410" +dependencies = [ + "libc", +] + +[[package]] +name = "smallvec" +version = "1.15.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "67b1b7a3b5fe4f1376887184045fcf45c69e92af734b7aaddc05fb777b6fbd03" + +[[package]] +name = "strip-ansi-escapes" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2a8f8038e7e7969abb3f1b7c2a811225e9296da208539e0f79c5251d6cac0025" +dependencies = [ + "vte", +] + +[[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" + +[[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.104", +] + +[[package]] +name = "supports-color" +version = "3.0.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c64fc7232dd8d2e4ac5ce4ef302b1d81e0b80d055b9d77c7c4f51f6aa4c867d6" +dependencies = [ + "is_ci", +] + +[[package]] +name = "supports-hyperlinks" +version = "3.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "804f44ed3c63152de6a9f90acbea1a110441de43006ea51bcce8f436196a288b" + +[[package]] +name = "supports-unicode" +version = "3.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b7401a30af6cb5818bb64852270bb722533397edcfc7344954a38f420819ece2" + +[[package]] +name = "syn" +version = "1.0.109" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "72b64191b275b66ffe2469e8af2c1cfe3bafa67b529ead792a6d0160888b4237" +dependencies = [ + "proc-macro2", + "quote", + "unicode-ident", +] + +[[package]] +name = "syn" +version = "2.0.104" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "17b6f705963418cdb9927482fa304bc562ece2fdd4f616084c50b7023b435a40" +dependencies = [ + "proc-macro2", + "quote", + "unicode-ident", +] + +[[package]] +name = "sys-locale" +version = "0.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8eab9a99a024a169fe8a903cf9d4a3b3601109bcc13bd9e3c6fff259138626c4" +dependencies = [ + "libc", +] + +[[package]] +name = "sysinfo" +version = "0.33.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4fc858248ea01b66f19d8e8a6d55f41deaf91e9d495246fd01368d99935c6c01" +dependencies = [ + "core-foundation-sys", + "libc", + "memchr", + "ntapi", + "rayon", + "windows 0.57.0", +] + +[[package]] +name = "sysinfo" +version = "0.35.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3c3ffa3e4ff2b324a57f7aeb3c349656c7b127c3c189520251a648102a92496e" +dependencies = [ + "libc", + "memchr", + "ntapi", + "objc2-core-foundation", + "objc2-io-kit", + "windows 0.61.3", +] + +[[package]] +name = "terminal_size" +version = "0.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "45c6481c4829e4cc63825e62c49186a34538b7b2750b73b266581ffb612fb5ed" +dependencies = [ + "rustix 1.0.7", + "windows-sys 0.59.0", +] + +[[package]] +name = "textwrap" +version = "0.16.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c13547615a44dc9c452a8a534638acdf07120d4b6847c8178705da06306a3057" +dependencies = [ + "unicode-linebreak", + "unicode-width 0.2.1", +] + +[[package]] +name = "thiserror" +version = "1.0.69" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b6aaf5339b578ea85b50e080feb250a3e8ae8cfcdff9a461c9ec2904bc923f52" +dependencies = [ + "thiserror-impl 1.0.69", +] + +[[package]] +name = "thiserror" +version = "2.0.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "567b8a2dae586314f7be2a752ec7474332959c6460e02bde30d702a66d488708" +dependencies = [ + "thiserror-impl 2.0.12", +] + +[[package]] +name = "thiserror-impl" +version = "1.0.69" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4fee6c4efc90059e10f81e6d42c60a18f76588c3d74cb83a0b242a2b6c7504c1" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.104", +] + +[[package]] +name = "thiserror-impl" +version = "2.0.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7f7cf42b4507d8ea322120659672cf1b9dbb93f8f2d4ecfd6e51350ff5b17a1d" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.104", +] + +[[package]] +name = "typeid" +version = "1.0.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bc7d623258602320d5c55d1bc22793b57daff0ec7efc270ea7d55ce1d5f5471c" + +[[package]] +name = "typetag" +version = "0.2.20" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "73f22b40dd7bfe8c14230cf9702081366421890435b2d625fa92b4acc4c3de6f" +dependencies = [ + "erased-serde", + "inventory", + "once_cell", + "serde", + "typetag-impl", +] + +[[package]] +name = "typetag-impl" +version = "0.2.20" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "35f5380909ffc31b4de4f4bdf96b877175a016aa2ca98cee39fcfd8c4d53d952" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.104", +] + +[[package]] +name = "unicase" +version = "2.8.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "75b844d17643ee918803943289730bec8aac480150456169e647ed0b576ba539" + +[[package]] +name = "unicode-ident" +version = "1.0.18" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5a5f39404a5da50712a4c1eecf25e90dd62b613502b7e925fd4e4d19b5c96512" + +[[package]] +name = "unicode-linebreak" +version = "0.1.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3b09c83c3c29d37506a3e260c08c03743a6bb66a9cd432c6934ab501a190571f" + +[[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.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4a1a07cc7db3810833284e8d372ccdc6da29741639ecc70c9ec107df0fa6154c" + +[[package]] +name = "vte" +version = "0.14.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "231fdcd7ef3037e8330d8e17e61011a2c244126acc0a982f4040ac3f9f0bc077" +dependencies = [ + "memchr", +] + +[[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.100" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1edc8929d7499fc4e8f0be2262a241556cfc54a0bea223790e71446f2aab1ef5" +dependencies = [ + "cfg-if", + "once_cell", + "rustversion", + "wasm-bindgen-macro", +] + +[[package]] +name = "wasm-bindgen-backend" +version = "0.2.100" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2f0a0651a5c2bc21487bde11ee802ccaf4c51935d0d3d42a6101f98161700bc6" +dependencies = [ + "bumpalo", + "log", + "proc-macro2", + "quote", + "syn 2.0.104", + "wasm-bindgen-shared", +] + +[[package]] +name = "wasm-bindgen-macro" +version = "0.2.100" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7fe63fc6d09ed3792bd0897b314f53de8e16568c2b3f7982f468c0bf9bd0b407" +dependencies = [ + "quote", + "wasm-bindgen-macro-support", +] + +[[package]] +name = "wasm-bindgen-macro-support" +version = "0.2.100" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8ae87ea40c9f689fc23f209965b6fb8a99ad69aeeb0231408be24920604395de" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.104", + "wasm-bindgen-backend", + "wasm-bindgen-shared", +] + +[[package]] +name = "wasm-bindgen-shared" +version = "0.2.100" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1a05d73b933a847d6cccdda8f838a22ff101ad9bf93e33684f39c1f5f0eece3d" +dependencies = [ + "unicode-ident", +] + +[[package]] +name = "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 = "widestring" +version = "1.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dd7cf3379ca1aac9eea11fba24fd7e315d621f8dfe35c8d7d2be8b793726e07d" + +[[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" +version = "0.56.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1de69df01bdf1ead2f4ac895dc77c9351aefff65b2f3db429a343f9cbf05e132" +dependencies = [ + "windows-core 0.56.0", + "windows-targets 0.52.6", +] + +[[package]] +name = "windows" +version = "0.57.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "12342cb4d8e3b046f3d80effd474a7a02447231330ef77d71daa6fbc40681143" +dependencies = [ + "windows-core 0.57.0", + "windows-targets 0.52.6", +] + +[[package]] +name = "windows" +version = "0.61.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9babd3a767a4c1aef6900409f85f5d53ce2544ccdfaa86dad48c91782c6d6893" +dependencies = [ + "windows-collections", + "windows-core 0.61.2", + "windows-future", + "windows-link", + "windows-numerics", +] + +[[package]] +name = "windows-collections" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3beeceb5e5cfd9eb1d76b381630e82c4241ccd0d27f1a39ed41b2760b255c5e8" +dependencies = [ + "windows-core 0.61.2", +] + +[[package]] +name = "windows-core" +version = "0.56.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4698e52ed2d08f8658ab0c39512a7c00ee5fe2688c65f8c0a4f06750d729f2a6" +dependencies = [ + "windows-implement 0.56.0", + "windows-interface 0.56.0", + "windows-result 0.1.2", + "windows-targets 0.52.6", +] + +[[package]] +name = "windows-core" +version = "0.57.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d2ed2439a290666cd67ecce2b0ffaad89c2a56b976b736e6ece670297897832d" +dependencies = [ + "windows-implement 0.57.0", + "windows-interface 0.57.0", + "windows-result 0.1.2", + "windows-targets 0.52.6", +] + +[[package]] +name = "windows-core" +version = "0.61.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c0fdd3ddb90610c7638aa2b3a3ab2904fb9e5cdbecc643ddb3647212781c4ae3" +dependencies = [ + "windows-implement 0.60.0", + "windows-interface 0.59.1", + "windows-link", + "windows-result 0.3.4", + "windows-strings", +] + +[[package]] +name = "windows-future" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fc6a41e98427b19fe4b73c550f060b59fa592d7d686537eebf9385621bfbad8e" +dependencies = [ + "windows-core 0.61.2", + "windows-link", + "windows-threading", +] + +[[package]] +name = "windows-implement" +version = "0.56.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f6fc35f58ecd95a9b71c4f2329b911016e6bec66b3f2e6a4aad86bd2e99e2f9b" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.104", +] + +[[package]] +name = "windows-implement" +version = "0.57.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9107ddc059d5b6fbfbffdfa7a7fe3e22a226def0b2608f72e9d552763d3e1ad7" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.104", +] + +[[package]] +name = "windows-implement" +version = "0.60.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a47fddd13af08290e67f4acabf4b459f647552718f683a7b415d290ac744a836" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.104", +] + +[[package]] +name = "windows-interface" +version = "0.56.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "08990546bf4edef8f431fa6326e032865f27138718c587dc21bc0265bbcb57cc" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.104", +] + +[[package]] +name = "windows-interface" +version = "0.57.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "29bee4b38ea3cde66011baa44dba677c432a78593e202392d1e9070cf2a7fca7" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.104", +] + +[[package]] +name = "windows-interface" +version = "0.59.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bd9211b69f8dcdfa817bfd14bf1c97c9188afa36f4750130fcdf3f400eca9fa8" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.104", +] + +[[package]] +name = "windows-link" +version = "0.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5e6ad25900d524eaabdbbb96d20b4311e1e7ae1699af4fb28c17ae66c80d798a" + +[[package]] +name = "windows-numerics" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9150af68066c4c5c07ddc0ce30421554771e528bde427614c61038bc2c92c2b1" +dependencies = [ + "windows-core 0.61.2", + "windows-link", +] + +[[package]] +name = "windows-result" +version = "0.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5e383302e8ec8515204254685643de10811af0ed97ea37210dc26fb0032647f8" +dependencies = [ + "windows-targets 0.52.6", +] + +[[package]] +name = "windows-result" +version = "0.3.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "56f42bd332cc6c8eac5af113fc0c1fd6a8fd2aa08a0119358686e5160d0586c6" +dependencies = [ + "windows-link", +] + +[[package]] +name = "windows-strings" +version = "0.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "56e6c93f3a0c3b36176cb1327a4958a0353d5d166c2a35cb268ace15e91d3b57" +dependencies = [ + "windows-link", +] + +[[package]] +name = "windows-sys" +version = "0.48.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "677d2418bec65e3338edb076e806bc1ec15693c5d0104683f2efe857f61056a9" +dependencies = [ + "windows-targets 0.48.5", +] + +[[package]] +name = "windows-sys" +version = "0.52.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "282be5f36a8ce781fad8c8ae18fa3f9beff57ec1b52cb3de0789201425d9a33d" +dependencies = [ + "windows-targets 0.52.6", +] + +[[package]] +name = "windows-sys" +version = "0.59.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1e38bc4d79ed67fd075bcc251a1c39b32a1776bbe92e5bef1f0bf1f8c531853b" +dependencies = [ + "windows-targets 0.52.6", +] + +[[package]] +name = "windows-sys" +version = "0.60.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f2f500e4d28234f72040990ec9d39e3a6b950f9f22d3dba18416c35882612bcb" +dependencies = [ + "windows-targets 0.53.2", +] + +[[package]] +name = "windows-targets" +version = "0.48.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9a2fa6e2155d7247be68c096456083145c183cbbbc2764150dda45a87197940c" +dependencies = [ + "windows_aarch64_gnullvm 0.48.5", + "windows_aarch64_msvc 0.48.5", + "windows_i686_gnu 0.48.5", + "windows_i686_msvc 0.48.5", + "windows_x86_64_gnu 0.48.5", + "windows_x86_64_gnullvm 0.48.5", + "windows_x86_64_msvc 0.48.5", +] + +[[package]] +name = "windows-targets" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9b724f72796e036ab90c1021d4780d4d3d648aca59e491e6b98e725b84e99973" +dependencies = [ + "windows_aarch64_gnullvm 0.52.6", + "windows_aarch64_msvc 0.52.6", + "windows_i686_gnu 0.52.6", + "windows_i686_gnullvm 0.52.6", + "windows_i686_msvc 0.52.6", + "windows_x86_64_gnu 0.52.6", + "windows_x86_64_gnullvm 0.52.6", + "windows_x86_64_msvc 0.52.6", +] + +[[package]] +name = "windows-targets" +version = "0.53.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c66f69fcc9ce11da9966ddb31a40968cad001c5bedeb5c2b82ede4253ab48aef" +dependencies = [ + "windows_aarch64_gnullvm 0.53.0", + "windows_aarch64_msvc 0.53.0", + "windows_i686_gnu 0.53.0", + "windows_i686_gnullvm 0.53.0", + "windows_i686_msvc 0.53.0", + "windows_x86_64_gnu 0.53.0", + "windows_x86_64_gnullvm 0.53.0", + "windows_x86_64_msvc 0.53.0", +] + +[[package]] +name = "windows-threading" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b66463ad2e0ea3bbf808b7f1d371311c80e115c0b71d60efc142cafbcfb057a6" +dependencies = [ + "windows-link", +] + +[[package]] +name = "windows_aarch64_gnullvm" +version = "0.48.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2b38e32f0abccf9987a4e3079dfb67dcd799fb61361e53e2882c3cbaf0d905d8" + +[[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_gnullvm" +version = "0.53.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "86b8d5f90ddd19cb4a147a5fa63ca848db3df085e25fee3cc10b39b6eebae764" + +[[package]] +name = "windows_aarch64_msvc" +version = "0.48.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dc35310971f3b2dbbf3f0690a219f40e2d9afcf64f9ab7cc1be722937c26b4bc" + +[[package]] +name = "windows_aarch64_msvc" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "09ec2a7bb152e2252b53fa7803150007879548bc709c039df7627cabbd05d469" + +[[package]] +name = "windows_aarch64_msvc" +version = "0.53.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c7651a1f62a11b8cbd5e0d42526e55f2c99886c77e007179efff86c2b137e66c" + +[[package]] +name = "windows_i686_gnu" +version = "0.48.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a75915e7def60c94dcef72200b9a8e58e5091744960da64ec734a6c6e9b3743e" + +[[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_gnu" +version = "0.53.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c1dc67659d35f387f5f6c479dc4e28f1d4bb90ddd1a5d3da2e5d97b42d6272c3" + +[[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_gnullvm" +version = "0.53.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9ce6ccbdedbf6d6354471319e781c0dfef054c81fbc7cf83f338a4296c0cae11" + +[[package]] +name = "windows_i686_msvc" +version = "0.48.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8f55c233f70c4b27f66c523580f78f1004e8b5a8b659e05a4eb49d4166cca406" + +[[package]] +name = "windows_i686_msvc" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "240948bc05c5e7c6dabba28bf89d89ffce3e303022809e73deaefe4f6ec56c66" + +[[package]] +name = "windows_i686_msvc" +version = "0.53.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "581fee95406bb13382d2f65cd4a908ca7b1e4c2f1917f143ba16efe98a589b5d" + +[[package]] +name = "windows_x86_64_gnu" +version = "0.48.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "53d40abd2583d23e4718fddf1ebec84dbff8381c07cae67ff7768bbf19c6718e" + +[[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_gnu" +version = "0.53.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2e55b5ac9ea33f2fc1716d1742db15574fd6fc8dadc51caab1c16a3d3b4190ba" + +[[package]] +name = "windows_x86_64_gnullvm" +version = "0.48.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0b7b52767868a23d5bab768e390dc5f5c55825b6d30b86c844ff2dc7414044cc" + +[[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_gnullvm" +version = "0.53.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0a6e035dd0599267ce1ee132e51c27dd29437f63325753051e71dd9e42406c57" + +[[package]] +name = "windows_x86_64_msvc" +version = "0.48.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ed94fce61571a4006852b7389a063ab983c02eb1bb37b47f8272ce92d06d9538" + +[[package]] +name = "windows_x86_64_msvc" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "589f6da84c646204747d1270a2a5661ea66ed1cced2631d546fdfb155959f9ec" + +[[package]] +name = "windows_x86_64_msvc" +version = "0.53.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "271414315aff87387382ec3d271b52d7ae78726f5d44ac98b4f4030c91880486" diff --git a/nu_plugin_port_extension/Cargo.toml b/nu_plugin_port_extension/Cargo.toml new file mode 100644 index 0000000..14ee38d --- /dev/null +++ b/nu_plugin_port_extension/Cargo.toml @@ -0,0 +1,22 @@ +[package] +name = "nu_plugin_port_extension" +version = "0.105.2" +description = "A nushell plugin to list all active connections and scanning ports on a target address" +homepage = "https://github.com/FMotalleb/nu_plugin_port_list" +keywords = ["nushell", "network", "plugin"] +license = "MIT" +readme = "README.md" +repository = "https://github.com/FMotalleb/nu_plugin_port_list" +edition = "2024" + +[dependencies] +derive_builder = "0.20.2" +derive-getters = "0.5.0" +netstat2 = "0.11.1" +nu-plugin = { version = "0.105.2", path = "../nushell/crates/nu-plugin" } +sysinfo = "0.35.2" + +[dependencies.nu-protocol] +features = ["plugin"] +version = "0.105.2" +path = "../nushell/crates/nu-protocol" diff --git a/nu_plugin_port_extension/LICENSE b/nu_plugin_port_extension/LICENSE new file mode 100644 index 0000000..d3cf1fb --- /dev/null +++ b/nu_plugin_port_extension/LICENSE @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) 2025 Motalleb Fallahnezhad + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/nu_plugin_port_extension/README.md b/nu_plugin_port_extension/README.md new file mode 100644 index 0000000..6080fb3 --- /dev/null +++ b/nu_plugin_port_extension/README.md @@ -0,0 +1,111 @@ +# 🔌 nu_plugin_port_extension + +A [Nushell](https://www.nushell.sh/) plugin for inspecting open ports and scanning network services. It introduces two subcommands: + +- **`port list`**: Lists all open network connections, similar to `netstat`. +- **`port scan`**: Scans a target IP and port to determine if it is open. + +--- + +## ✨ Features + +### **`port list`** – List Active Connections +The `port list` command retrieves all open connections on the network interface. It supports filtering by protocol, IP version, and listening state. + +#### 📌 Usage +```bash +port list {flags} +``` + +#### ⚙️ Available Flags +- `-h, --help` → Show help message. +- `-6, --disable-ipv4` → Exclude IPv4 connections (only show IPv6). +- `-4, --disable-ipv6` → Exclude IPv6 connections (only show IPv4). +- `-t, --disable-udp` → Exclude UDP connections (only show TCP). +- `-u, --disable-tcp` → Exclude TCP connections (only show UDP). +- `-l, --listeners` → Show only listening connections (`state == "LISTEN"`). +- `-p, --process-info` → Include process details (name, command, binary path). + +#### 🔍 Example: Show Active Processes +```bash +port list -p | take 1 +``` + +#### 📊 Example Output +|pid |type|ip_version|local_address|local_port|remote_address|remote_port|state |process_name|cmd |exe_path | +|-----|----|----------|-------------|----------|--------------|----------|-----------|------------|--------------------------------------------------|--------------------------------------| +|11536|tcp |4 |127.0.0.1 |1093 |127.0.0.1 |1108 |ESTABLISHED|steam.exe |[C:\Program Files (x86)\Steam\steam.exe, -silent]|C:\Program Files (x86)\Steam\steam.exe| + +--- + +### **`port scan`** – Scan Open Ports +The `port scan` command checks if a specific port is open on a target IP, similar to `nc -vz {ip} {port}`. + +> **⚠️ Note:** Only **TCP** scanning is supported at the moment. + +#### 📌 Usage +```bash +port scan {flags} +``` + +#### ⚙️ Available Flags +- `-h, --help` → Show help message. +- `-t, --timeout ` → Set timeout before giving up (default: 60s). +- `-s, --send ` → Send data to the target upon connection. +- `-b, --receive-byte-count ` → Number of bytes to receive before confirming the connection is open. + +#### 🎯 Parameters +- **`target IP`** *(string)* – The IP address to scan. +- **`port`** *(integer)* – The port number to check. + +#### 🔍 Example: Check if Google's Public DNS (8.8.8.8) has Port 53 Open +```bash +port scan 8.8.8.8 53 -t 1sec +``` + +#### 📊 Example Output +``` +╭─────────┬─────────╮ +│ address │ 8.8.8.8 │ +│ port │ 53 │ +│ is_open │ true │ +│ elapsed │ 40ms │ +╰─────────┴─────────╯ +``` + +#### 🔄 Example: Scan a Range of Ports on `127.0.0.1` and Filter Open Ports +```bash +7880..8000 | each { |it| port scan 127.0.0.1 $it -t 1ms } | where result == Open +``` + +--- + +## 🔧 Installation + +### 🚀 Recommended: Using [nupm](https://github.com/nushell/nupm) +This method automatically handles dependencies and features. +```bash +git clone https://github.com/FMotalleb/nu_plugin_port_extension.git +nupm install --path nu_plugin_port_extension -f +``` + +### 🛠️ Manual Compilation +```bash +git clone https://github.com/FMotalleb/nu_plugin_port_extension.git +cd nu_plugin_port_extension +cargo build -r +plugin add target/release/nu_plugin_port_extension +``` + +### 📦 Install via Cargo (using git) +```bash +cargo install --git https://github.com/FMotalleb/nu_plugin_port_extension.git +plugin add ~/.cargo/bin/nu_plugin_port_extension +``` + +### 📦 Install via Cargo (crates.io) _Not Recommended_ +> *Since I live in Iran and crates.io often restricts package updates, the version there might be outdated.* +```bash +cargo install nu_plugin_port_extension +plugin add ~/.cargo/bin/nu_plugin_port_extension +``` diff --git a/nu_plugin_port_extension/build.nu b/nu_plugin_port_extension/build.nu new file mode 100644 index 0000000..f88592d --- /dev/null +++ b/nu_plugin_port_extension/build.nu @@ -0,0 +1,41 @@ +use std log + +def addcap [binpath: path] { + if ($nu.os-info.name == "linux") { + print $"(ansi red)Warning(ansi reset): To access the PIDs of applications running as root or other users, you need to add the following capabilities to the plugin binary: net_admin, sys_ptrace, dac_read_search." + print $"(ansi red)sudo setcap 'cap_net_admin,cap_sys_ptrace,cap_dac_read_search=ep' '($binpath)'(ansi reset)" + print "Do you want to run this command with sudo? [y/N]" + + match (input listen --types [key]) { + {code: $key} if ($key | str downcase) == "y" => { + let caps = (['cap_net_admin', 'cap_sys_ptrace', 'cap_dac_read_search'] | input list --multi "Choose which specific capabilities you want to add" | str join ",") + let cmd = $"setcap '($caps)=ep' '($binpath)'" + print $"Executing `($cmd)` with sudo." + sh -c $"sudo ($cmd)" + } + _ => { + print "If you prefer to add the capabilities manually, use the following command:" + print $"sudo setcap 'cap_net_admin,cap_sys_ptrace,cap_dac_read_search=ep' '($binpath)'" + } + } + } else if ($nu.os-info.name == "windows") { + print $"(ansi red)For Windows Users(ansi reset): The plugin is installed successfully but keep in mind in order to fetch all executables information you must run nushell as administrator" + } +} + +def main [package_file: path] { + + let repo_root = $package_file | path dirname + let install_root = $env.NUPM_HOME | path join "plugins" + + let name = open ($repo_root | path join "Cargo.toml") | get package.name + let cmd = $"cargo install --path ($repo_root) --root ($install_root)" + log info $"building plugin using: (ansi blue)($cmd)(ansi reset)" + nu -c $cmd + let ext: string = if ($nu.os-info.name == 'windows') { '.exe' } else { '' } + let bin_path = $"($install_root | path join "bin" $name)($ext)" + plugin add $bin_path + addcap $bin_path + + log info "do not forget to restart Nushell for the plugin to be fully available!" +} diff --git a/nu_plugin_port_extension/nupm.nuon b/nu_plugin_port_extension/nupm.nuon new file mode 100644 index 0000000..e78081f --- /dev/null +++ b/nu_plugin_port_extension/nupm.nuon @@ -0,0 +1,7 @@ +{ + "name": "nu_plugin_port_extension", + "version": "0.104.0", + "description": "A nushell plugin to list all active connections and test tcp+udp ports accessibility on a remote server", + "license": "LICENSE", + "type": "custom" +} \ No newline at end of file diff --git a/nu_plugin_port_extension/rust-toolchain.toml b/nu_plugin_port_extension/rust-toolchain.toml new file mode 100644 index 0000000..29171b0 --- /dev/null +++ b/nu_plugin_port_extension/rust-toolchain.toml @@ -0,0 +1,3 @@ +[toolchain] +profile = "default" +channel = "stable" diff --git a/nu_plugin_port_extension/src/commands/list/config.rs b/nu_plugin_port_extension/src/commands/list/config.rs new file mode 100644 index 0000000..156ae85 --- /dev/null +++ b/nu_plugin_port_extension/src/commands/list/config.rs @@ -0,0 +1,57 @@ +use derive_builder::Builder; +use derive_getters::Getters; +use netstat2::{AddressFamilyFlags, ProtocolFlags}; +use nu_plugin::EvaluatedCall; +use nu_protocol::LabeledError; + +use crate::helpers::FlagHelper; + +#[derive(Default, Clone, Copy, Builder, Debug, Getters)] +pub struct PortListConfig { + v4: bool, + v6: bool, + tcp: bool, + udp: bool, + listeners_only: bool, + process_info: bool, +} + +impl PortListConfig { + pub fn address_family_flags(self) -> AddressFamilyFlags { + let mut flags = AddressFamilyFlags::empty(); + if self.v4 { + flags |= AddressFamilyFlags::IPV4; + } + if self.v6 { + flags |= AddressFamilyFlags::IPV6; + } + return flags; + } + pub fn protocol_flags(self) -> ProtocolFlags { + let mut flags = ProtocolFlags::empty(); + if self.tcp { + flags |= ProtocolFlags::TCP; + } + if self.udp { + flags |= ProtocolFlags::UDP; + } + return flags; + } +} + +impl TryFrom<&EvaluatedCall> for PortListConfig { + type Error = LabeledError; + + fn try_from(value: &EvaluatedCall) -> Result { + let mut builder = PortListConfigBuilder::create_empty(); + builder.v4(value.missing_flag_or("disable-ipv4", true)); + builder.v6(value.missing_flag_or("disable-ipv6", true)); + builder.udp(value.missing_flag_or("disable-udp", true)); + builder.tcp(value.missing_flag_or("disable-tcp", true)); + builder.listeners_only(value.has_flag_or("listeners", false)); + builder.process_info(value.has_flag_or("process-info", false)); + return builder + .build() + .map_err(|e| LabeledError::new(e.to_string())); + } +} diff --git a/nu_plugin_port_extension/src/commands/list/connection_info.rs b/nu_plugin_port_extension/src/commands/list/connection_info.rs new file mode 100644 index 0000000..a878fed --- /dev/null +++ b/nu_plugin_port_extension/src/commands/list/connection_info.rs @@ -0,0 +1,93 @@ +use derive_builder::Builder; +use derive_getters::Getters; +use nu_protocol::{Record, Span, record}; +use sysinfo::Process; + +use crate::helpers::{AsValue, ToStr}; + +#[derive(Default, Clone, Builder, Debug, Getters)] +pub struct ConnectionInfo { + pub r#type: String, + pub ip_version: u32, + pub local_address: String, + pub local_port: u16, + pub remote_address: Option, + pub remote_port: Option, + pub state: String, + pub pid: u32, + pub process_info: Option, +} +impl Into for ConnectionInfo { + fn into(self) -> Record { + let span = Span::unknown(); + let result = &mut record! { + "pid"=>self.pid.as_value(span), + "type" => self.r#type().as_value(span), + "ip_version" => self.ip_version.as_value(span), + "local_address" =>self.local_address.as_value(span), + "local_port" => self.local_port.as_value(span), + "remote_address" => self.remote_address.as_value(span), + "remote_port" => self.remote_port.as_value(span), + "state" => self.state.as_value(span), + }; + if let Some(pf) = self.process_info { + result.insert("process_name", pf.process_name.as_value(span)); + result.insert("cmd", pf.cmd.as_value(span)); + result.insert("exe_path", pf.exe_path.as_value(span)); + result.insert("process_status", pf.process_status.as_value(span)); + result.insert("process_user", pf.process_user.as_value(span)); + result.insert("process_group", pf.process_group.as_value(span)); + result.insert( + "process_effective_user", + pf.process_effective_user.as_value(span), + ); + result.insert( + "process_effective_group", + pf.process_effective_group.as_value(span), + ); + result.insert( + "process_environments", + pf.process_environments.as_value(span), + ); + } + return result.to_owned(); + } +} + +#[derive(Default, Clone, Builder, Debug)] +pub struct ProcessInfo { + pub process_name: String, + pub cmd: Vec, + pub exe_path: Option, + pub process_status: String, + pub process_user: Option, + pub process_group: Option, + pub process_effective_user: Option, + pub process_effective_group: Option, + pub process_environments: Vec, +} + +impl From<&Process> for ProcessInfo { + fn from(value: &Process) -> Self { + ProcessInfo { + cmd: value + .cmd() + .to_owned() + .iter() + .map(|p| p.to_string()) + .collect::>(), + exe_path: value + .exe() + .map(|p| p.to_str()) + .unwrap_or(None) + .map(|s| s.to_string()), + process_name: value.name().to_string(), + process_status: value.status().to_string(), + process_user: value.user_id().map(|id| id.to_string()), + process_group: value.group_id().map(|id| id.to_string()), + process_effective_user: value.effective_user_id().map(|id| id.to_string()), + process_effective_group: value.effective_group_id().map(|id| id.to_string()), + process_environments: value.environ().iter().map(|i| i.to_string()).collect(), + } + } +} diff --git a/nu_plugin_port_extension/src/commands/list/mod.rs b/nu_plugin_port_extension/src/commands/list/mod.rs new file mode 100644 index 0000000..96a1df0 --- /dev/null +++ b/nu_plugin_port_extension/src/commands/list/mod.rs @@ -0,0 +1,6 @@ +mod config; +mod connection_info; +mod plugin; +mod port_list; +pub(super) use config::PortListConfig; +pub(crate) use plugin::PortList; diff --git a/nu_plugin_port_extension/src/commands/list/plugin.rs b/nu_plugin_port_extension/src/commands/list/plugin.rs new file mode 100644 index 0000000..d34ee89 --- /dev/null +++ b/nu_plugin_port_extension/src/commands/list/plugin.rs @@ -0,0 +1,73 @@ +use nu_plugin::{EngineInterface, EvaluatedCall, PluginCommand}; +use nu_protocol::{Category, LabeledError, PipelineData, Signature}; + +use crate::PortExtension; + +use super::{PortListConfig, port_list::collect_socket_info}; + +#[derive(Default)] +pub struct PortList; + +impl PortList { + pub fn new() -> Self { + Self {} + } +} +impl PluginCommand for PortList { + type Plugin = PortExtension; + + fn name(&self) -> &str { + "port list" + } + + fn signature(&self) -> Signature { + Signature::build("port list") + .switch( + "disable-ipv4", + "do not fetch ipv6 connections (ipv6 only)", + Some('6'), + ) + .switch( + "disable-ipv6", + "do not fetch ipv4 connections (ipv4 only)", + Some('4'), + ) + .switch( + "disable-udp", + "do not fetch UDP connections (TCP only)", + Some('t'), + ) + .switch( + "disable-tcp", + "do not fetch TCP connections (UDP only)", + Some('u'), + ) + .switch( + "listeners", + "only listeners (equivalent to state == \"LISTEN\")", + Some('l'), + ) + .switch( + "process-info", + "loads process info (name, cmd, binary path)", + Some('p'), + ) + .category(Category::Network) + } + + fn description(&self) -> &str { + "Like netstat this command will return every open connection on the network interface" + } + + fn run( + &self, + _plugin: &Self::Plugin, + _engine: &EngineInterface, + call: &EvaluatedCall, + _input: PipelineData, + ) -> Result { + let cfg = PortListConfig::try_from(call)?; + let result = collect_socket_info(cfg)?; + Ok(PipelineData::Value(result, None)) + } +} diff --git a/nu_plugin_port_extension/src/commands/list/port_list.rs b/nu_plugin_port_extension/src/commands/list/port_list.rs new file mode 100644 index 0000000..2ae6bb0 --- /dev/null +++ b/nu_plugin_port_extension/src/commands/list/port_list.rs @@ -0,0 +1,143 @@ +use std::{collections::HashMap, net::IpAddr, vec}; + +use netstat2::{ + ProtocolSocketInfo, SocketInfo, TcpSocketInfo, TcpState, UdpSocketInfo, get_sockets_info, +}; +use nu_protocol::{LabeledError, Span, Value}; +use sysinfo::{Process, System}; + +use super::{ + PortListConfig, + connection_info::{ConnectionInfo, ConnectionInfoBuilder, ProcessInfo}, +}; + +pub(super) fn collect_socket_info(cfg: PortListConfig) -> Result { + let system = System::new_all(); + let mut process_list: HashMap = HashMap::new(); + if *cfg.process_info() { + process_list = system + .processes() + .iter() + .map(|(pid, process)| (pid.as_u32(), process)) + .collect(); + } + let connections = sockets(&process_list, cfg)?; + let result = connections + .iter() + .map(|f| Value::record(f.to_owned().into(), Span::unknown())); + + Ok(Value::list(result.collect(), Span::unknown())) +} + +fn sockets( + processes: &HashMap, + cfg: PortListConfig, +) -> Result, LabeledError> { + let af = cfg.address_family_flags(); + let pf = cfg.protocol_flags(); + let sockets_info = get_sockets_info(af, pf).map_err(|e| { + LabeledError::new(e.to_string()).with_code("netstat2::get_sockets_info::error") + })?; + let connections = sockets_info + .iter() + .map(|i| socket2connection_info(cfg, processes, i)) + .flatten(); + let result = connections + .map(|f| f.build().map_err(|e| LabeledError::new(e.to_string()))) + .collect(); + let (answer, errs) = split_results(result); + if let Some(err) = errs.first() { + return Err(err.to_owned()); + } + Ok(answer) +} + +fn split_results(input: Vec>) -> (Vec, Vec) { + let mut ok_vec = vec![]; + let mut err_vec = vec![]; + for item in input { + match item { + Ok(i) => ok_vec.push(i), + Err(e) => err_vec.push(e), + } + } + (ok_vec, err_vec) +} + +fn socket2connection_info( + cfg: PortListConfig, + processes: &HashMap, + si: &SocketInfo, +) -> Vec { + match si.to_owned().protocol_socket_info { + ProtocolSocketInfo::Tcp(tcp_socket_info) + if *cfg.tcp() + && (!cfg.listeners_only() || tcp_socket_info.state == TcpState::Listen) => + { + tcp2connection_info(processes, si, tcp_socket_info) + } + ProtocolSocketInfo::Udp(udp_socket_info) if *cfg.udp() => { + udp2connection_info(processes, si, udp_socket_info) + } + _ => vec![], + } +} +fn tcp2connection_info( + processes: &HashMap, + si: &SocketInfo, + tsi: TcpSocketInfo, +) -> Vec { + si.associated_pids + .iter() + .map(|pid| { + ConnectionInfoBuilder::default() + .pid(pid.to_owned()) + .r#type("tcp".to_string()) + .ip_version(get_ip_version(tsi.local_addr)) + .local_address(tsi.local_addr.to_string()) + .local_port(tsi.local_port) + .remote_address(Some(tsi.remote_addr.to_string())) + .remote_port(Some(tsi.remote_port)) + .state(tsi.state.to_string()) + .process_info( + processes + .get(pid) + .map(|process| ProcessInfo::from(process.to_owned())) + .map_or(None, |f| Some(f)), + ) + .to_owned() + }) + .collect() +} +fn udp2connection_info( + processes: &HashMap, + si: &SocketInfo, + usi: UdpSocketInfo, +) -> Vec { + si.associated_pids + .iter() + .map(|pid| { + ConnectionInfoBuilder::default() + .pid(pid.to_owned()) + .r#type("udp".to_string()) + .ip_version(get_ip_version(usi.local_addr)) + .local_address(usi.local_addr.to_string()) + .local_port(usi.local_port) + .remote_address(None) + .remote_port(None) + .state("LISTEN".to_string()) + .process_info( + processes + .get(pid) + .map(|process| ProcessInfo::from(process.to_owned())), + ) + .to_owned() + }) + .collect() +} +fn get_ip_version(addr: IpAddr) -> u32 { + match addr { + IpAddr::V4(_) => 4, + IpAddr::V6(_) => 6, + } +} diff --git a/nu_plugin_port_extension/src/commands/mod.rs b/nu_plugin_port_extension/src/commands/mod.rs new file mode 100644 index 0000000..782c9fa --- /dev/null +++ b/nu_plugin_port_extension/src/commands/mod.rs @@ -0,0 +1,2 @@ +pub(crate) mod list; +pub(crate) mod scan; diff --git a/nu_plugin_port_extension/src/commands/scan/mod.rs b/nu_plugin_port_extension/src/commands/scan/mod.rs new file mode 100644 index 0000000..12df858 --- /dev/null +++ b/nu_plugin_port_extension/src/commands/scan/mod.rs @@ -0,0 +1,5 @@ +mod plugin; +pub(crate) use plugin::PortScan; +mod scan; +mod scan_config; +mod scan_result; diff --git a/nu_plugin_port_extension/src/commands/scan/plugin.rs b/nu_plugin_port_extension/src/commands/scan/plugin.rs new file mode 100644 index 0000000..6166517 --- /dev/null +++ b/nu_plugin_port_extension/src/commands/scan/plugin.rs @@ -0,0 +1,129 @@ +use crate::PortExtension; +use crate::commands::scan::scan_result::ScanResultBuilder; +use crate::helpers::AsValue; +use nu_plugin::{EngineInterface, EvaluatedCall, PluginCommand}; +use nu_protocol::{Category, Example, LabeledError, PipelineData, Signature, Span, SyntaxShape}; +use std::time::Duration; +use std::vec; + +use super::scan; +use super::scan_config::ScanConfig; + +#[derive(Default)] +pub struct PortScan {} + +impl PortScan { + pub(crate) fn new() -> PortScan { + PortScan {} + } +} + +impl PluginCommand for PortScan { + type Plugin = PortExtension; + + fn name(&self) -> &str { + "port scan" + } + fn signature(&self) -> Signature { + Signature::build("port scan") + .required( + "target IP", + SyntaxShape::String, + "target IP address to check for open port", + ) + .required("port", SyntaxShape::Int, "port to be checked") + .named( + "timeout", + SyntaxShape::Duration, + "time before giving up the connection. (default: 1 Second)", + Some('t'), + ) + .named( + "send", + SyntaxShape::OneOf(vec![SyntaxShape::String,SyntaxShape::Binary]), + "data to send to the target at beginning of the connection", + Some('s'), + ) + .named( + "receive-byte-count", + SyntaxShape::OneOf(vec![SyntaxShape::Filesize,SyntaxShape::Int]), + "bytes to receive from the target (possibly after sending the `send` data) to mark the connection as open", + Some('b'), + ) + .switch("udp", "udp scan mod (send and receive-byte-count flags will be mandatory due to how udp works)", Some('u')) + .category(Category::Network) + } + fn description(&self) -> &str { + "The `port scan` command serves a similar purpose to the `nc -vz {ip} {port}` command,\nIt allows you to detect open ports on a target and provides valuable information about the connection time." + } + + fn examples(&self) -> Vec> { + vec![ + Example { + example: "port scan 8.8.8.8 53 -t 1sec", + description: "this will create a Tcp connection to port 53 on 8.8.8.8 (Google's public dns) and return the connection time", + result: Some( + ScanResultBuilder::default() + .address("8.8.8.8") + .port(53) + .is_open(true) + .elapsed(Duration::from_millis(27)) + .received_data(None) + .build() + .unwrap() + .as_value(Span::unknown()), + ), + }, + Example { + example: "port scan 8.8.8.8 54 -t 1sec", + description: "this will create a Tcp connection to port 54 on 8.8.8.8 (Google's public dns). this will result in an error", + result: Some( + ScanResultBuilder::default() + .address("8.8.8.8") + .port(54) + .is_open(false) + .elapsed(Duration::from_secs(1)) + .received_data(None) + .build() + .unwrap() + .as_value(Span::unknown()), + ), + }, + Example { + example: "port scan 8.8.8.8 53 --udp --receive-byte-count 50 --send ('AAABAAABAAAAAAAAA3d3dwZnb29nbGUDY29tAAABAAEK' | decode base64)", + description: "send a simple dns request to udp port 53 on 8.8.8.8 (Google's public dns) and return the connection time + received data from dns", + result: Some( + ScanResultBuilder::default() + .address("8.8.8.8") + .port(53) + .is_open(true) + .elapsed(Duration::from_millis(27)) + .received_data(Some(vec![ + 0, 0, 129, 128, 0, 1, 0, 1, 0, 0, 0, 0, 3, 119, 119, 119, 6, 103, 111, + 111, 103, 108, 101, 3, 99, 111, 109, 0, 0, 1, 0, 1, 192, 12, 0, 1, 0, + 1, 0, 0, 0, 60, 0, 4, 216, 239, 38, 120, + ])) + .build() + .unwrap() + .as_value(Span::unknown()), + ), + }, + Example { + example: "7880..8000 | each { |it| port scan 127.0.0.1 $it -t 1ms } | where is_open", + description: "This command will scan any port from 7880 to 8000 on localhost and return open ports in range", + result: None, + }, + ] + } + + fn run( + &self, + _plugin: &Self::Plugin, + _engine: &EngineInterface, + call: &EvaluatedCall, + _input: PipelineData, + ) -> Result { + scan::scan(ScanConfig::try_from(call)?) + .map(|r| PipelineData::Value(r.as_value(call.head), None)) + } +} diff --git a/nu_plugin_port_extension/src/commands/scan/scan.rs b/nu_plugin_port_extension/src/commands/scan/scan.rs new file mode 100644 index 0000000..8078ac8 --- /dev/null +++ b/nu_plugin_port_extension/src/commands/scan/scan.rs @@ -0,0 +1,113 @@ +use std::{ + io::{Read, Write}, + net::{SocketAddr, TcpStream}, + time::{Duration, Instant}, +}; + +use nu_protocol::LabeledError; +use std::net::UdpSocket; + +use super::{ + scan_config::ScanConfig, + scan_result::{ScanResult, ScanResultBuilder}, +}; + +pub(super) fn scan(cfg: ScanConfig) -> Result, LabeledError> { + let mut result = ScanResultBuilder::default(); + result.address(cfg.target_address().to_owned()); + result.port(cfg.target_port().to_owned()); + let now = Instant::now(); + let check_method = match cfg.udp() { + true => check_udp, + false => check_tcp, + }; + let (is_open, data) = check_method( + cfg.get_socket_addr()?, + cfg.timeout().to_owned(), + cfg.send().to_owned(), + cfg.receive_byte_count().to_owned(), + ); + result.elapsed(now.elapsed()); + result.is_open(is_open); + result.received_data(data); + + Ok(result.build().unwrap()) +} +fn check_udp( + address: SocketAddr, + timeout: Duration, + send_data: Option>, + receive_byte_count: Option, +) -> (bool, Option>) { + match UdpSocket::bind("0.0.0.0:0") { + Ok(socket) => { + if let Err(err) = socket.set_read_timeout(Some(timeout)) { + eprintln!("Error setting read timeout, {}", err); + return (false, None); + } + + if let Err(err) = socket.set_write_timeout(Some(timeout)) { + eprintln!("Error setting write timeout, {}", err); + return (false, None); + } + if let Err(err) = socket.send_to(&send_data.unwrap(), address) { + eprintln!("Error sending data, {}", err); + return (false, None); + } + + let mut buffer = vec![0; receive_byte_count.unwrap() as usize]; + match socket.peek(&mut buffer) { + Ok(size) => (true, Some(buffer[..size].to_vec())), + Err(err) => { + eprintln!("Error receiving data, {}", err); + (false, None) + } + } + } + Err(err) => { + eprintln!("Error binding UDP socket, {}", err); + (false, None) + } + } +} +fn check_tcp( + address: SocketAddr, + timeout: Duration, + send_data: Option>, + receive_byte_count: Option, +) -> (bool, Option>) { + match TcpStream::connect_timeout(&address, timeout) { + Ok(mut stream) => { + if let Err(err) = stream.set_read_timeout(Some(timeout)) { + eprintln!("Error setting read timeout, {}", err); + return (false, None); + } + if let Err(err) = stream.set_write_timeout(Some(timeout)) { + eprintln!("Error setting read timeout, {}", err); + return (false, None); + } + if let Some(data) = send_data { + if let Err(err) = stream.write_all(&data) { + eprintln!("Error writing to socket stream, {}", err); + return (false, None); + } + } + if let Some(receive_byte_count) = receive_byte_count { + // eprintln!("Wait to read the amount of bytes requested"); + let buffer: Result, std::io::Error> = + stream.bytes().take(receive_byte_count as usize).collect(); + match buffer { + Ok(data) => { + return (true, Some(data)); + } + Err(err) => { + eprintln!("Error reading from socket stream, {}", err); + return (false, None); + } + }; + } + (true, None) + } + Err(_) => (false, None), + } +} diff --git a/nu_plugin_port_extension/src/commands/scan/scan_config.rs b/nu_plugin_port_extension/src/commands/scan/scan_config.rs new file mode 100644 index 0000000..5b56abd --- /dev/null +++ b/nu_plugin_port_extension/src/commands/scan/scan_config.rs @@ -0,0 +1,87 @@ +use std::{net::SocketAddr, str::FromStr, time::Duration}; + +use derive_builder::Builder; +use derive_getters::Getters; +use nu_plugin::EvaluatedCall; +use nu_protocol::{LabeledError, Span, Value}; + +use crate::helpers::FlagHelper; + +const DEFAULT_TIMEOUT: Duration = Duration::from_secs(1); + +#[derive(Default, Clone, Builder, Debug, Getters)] +pub(super) struct ScanConfig { + target_address: String, + target_port: u16, + timeout: Duration, + send: Option>, + receive_byte_count: Option, + udp: bool, +} + +impl ScanConfig { + pub fn get_socket_addr(&self) -> Result { + let addr = format!("{}:{}", self.target_address, self.target_port); + SocketAddr::from_str(&addr).map_err(|e| { + LabeledError::new(format!( + "cannot parse given address as socket address: {}", + e + )) + }) + } +} + +impl TryFrom<&EvaluatedCall> for ScanConfig { + type Error = LabeledError; + + fn try_from(call: &EvaluatedCall) -> Result { + let mut builder = ScanConfigBuilder::create_empty(); + + let addr = call.req::(0).map_err(|e| { + LabeledError::new(e.to_string()).with_label("failed to get target address", call.head) + })?; + builder.target_address(addr); + let port = call.req::(1).map_err(|e| { + LabeledError::new(e.to_string()).with_label("failed to get target port", call.head) + })?; + builder.target_port(port); + + let timeout: u64 = match call.get_flag_value("timeout") { + Some(duration) => duration + .as_duration() + .map_err(|e| LabeledError::new(e.to_string()))? + .try_into() + .unwrap(), + None => DEFAULT_TIMEOUT.as_nanos().try_into().unwrap(), + }; + builder.timeout(Duration::from_nanos(timeout)); + + let send_data = match call.get_flag_value("send") { + Some(Value::String { val, .. }) => Some(val.chars().map(|i| i as u8).collect()), + Some(Value::Binary { val, .. }) => Some(val), + _ => None, + }; + let send_data_exists = send_data.is_some(); + builder.send(send_data); + let receive_byte_count = match call.get_flag_value("receive-byte-count") { + Some(Value::Int { val, .. }) => Some(val), + Some(Value::Filesize { val, .. }) => Some(val.get()), + _ => None, + }; + let udp = call.has_flag_or("udp", false); + builder.udp(udp); + if udp && (receive_byte_count.is_none() || !send_data_exists) { + return Err(LabeledError::new( + "when udp flag is provided receive byte count and send data are mandatory", + ) + .with_label("udp flag is provided but either one of send or receive-byte-count arguments are missing (both are mandatory)", call.get_flag_span("udp").unwrap_or(Span::unknown()))); + } + builder.receive_byte_count(receive_byte_count); + builder.build().map_err(|e| { + LabeledError::new(format!( + "Unable to build config from given arguments: {}", + e.to_string() + )) + }) + } +} diff --git a/nu_plugin_port_extension/src/commands/scan/scan_result.rs b/nu_plugin_port_extension/src/commands/scan/scan_result.rs new file mode 100644 index 0000000..33220c9 --- /dev/null +++ b/nu_plugin_port_extension/src/commands/scan/scan_result.rs @@ -0,0 +1,28 @@ +use std::time::Duration; + +use derive_builder::Builder; +use nu_protocol::record; + +use crate::helpers::AsValue; + +#[derive(Default, Clone, Builder, Debug)] +pub(super) struct ScanResult { + address: T, + port: u16, + is_open: bool, + elapsed: Duration, + received_data: Option>, +} + +impl AsValue for ScanResult { + fn as_value(self, span: nu_protocol::Span) -> nu_protocol::Value { + record! { + "address" => self.address.as_value(span), + "port" => self.port.as_value(span), + "is_open"=> self.is_open.as_value(span), + "elapsed" => self.elapsed.as_value(span), + "received_data" => self.received_data.as_value(span), + } + .as_value(span) + } +} diff --git a/nu_plugin_port_extension/src/helpers/general_value.rs b/nu_plugin_port_extension/src/helpers/general_value.rs new file mode 100644 index 0000000..0409f1f --- /dev/null +++ b/nu_plugin_port_extension/src/helpers/general_value.rs @@ -0,0 +1,79 @@ +use std::time::Duration; + +use nu_protocol::{Record, Span, Value}; + +pub trait AsValue { + fn as_value(self, span: Span) -> Value; +} + +impl AsValue for Option { + fn as_value(self, span: Span) -> Value { + self.unwrap_or(Value::nothing(span)) + } +} +impl AsValue for Option { + fn as_value(self, span: Span) -> Value { + self.map(|f| f.as_value(span)) + .unwrap_or(Value::nothing(span)) + } +} +impl AsValue for &T { + fn as_value(self, span: Span) -> Value { + self.to_owned().as_value(span) + } +} + +impl AsValue for u16 { + fn as_value(self, span: Span) -> Value { + Value::int(self.into(), span) + } +} + +impl AsValue for u32 { + fn as_value(self, span: Span) -> Value { + Value::int(self.into(), span) + } +} + +impl AsValue for String { + fn as_value(self, span: Span) -> Value { + Value::string(self, span) + } +} +impl AsValue for &str { + fn as_value(self, span: Span) -> Value { + Value::string(self, span) + } +} + +impl AsValue for Vec { + fn as_value(self, span: Span) -> Value { + Value::list( + self.into_iter().map(|item| item.as_value(span)).collect(), + span, + ) + } +} +impl AsValue for bool { + fn as_value(self, span: Span) -> Value { + Value::bool(self, span) + } +} + +impl AsValue for Duration { + fn as_value(self, span: Span) -> Value { + Value::duration(self.as_nanos().try_into().unwrap_or_else(|_| -1), span) + } +} + +impl AsValue for Record { + fn as_value(self, span: Span) -> Value { + Value::record(self, span) + } +} + +impl AsValue for Vec { + fn as_value(self, span: Span) -> Value { + Value::binary(self, span) + } +} diff --git a/nu_plugin_port_extension/src/helpers/has_flag_or.rs b/nu_plugin_port_extension/src/helpers/has_flag_or.rs new file mode 100644 index 0000000..9af63f3 --- /dev/null +++ b/nu_plugin_port_extension/src/helpers/has_flag_or.rs @@ -0,0 +1,13 @@ +use nu_plugin::EvaluatedCall; + +pub trait FlagHelper { + fn has_flag_or(&self, flag: &str, default: bool) -> bool; + fn missing_flag_or(&self, flag: &str, default: bool) -> bool { + !self.has_flag_or(flag, !default) + } +} +impl FlagHelper for &EvaluatedCall { + fn has_flag_or(&self, flag: &str, default: bool) -> bool { + self.has_flag(flag).unwrap_or(default) + } +} diff --git a/nu_plugin_port_extension/src/helpers/mod.rs b/nu_plugin_port_extension/src/helpers/mod.rs new file mode 100644 index 0000000..b07250a --- /dev/null +++ b/nu_plugin_port_extension/src/helpers/mod.rs @@ -0,0 +1,8 @@ +mod os_str; +pub(crate) use os_str::ToStr; + +mod has_flag_or; +pub(crate) use has_flag_or::FlagHelper; + +mod general_value; +pub(crate) use general_value::AsValue; diff --git a/nu_plugin_port_extension/src/helpers/os_str.rs b/nu_plugin_port_extension/src/helpers/os_str.rs new file mode 100644 index 0000000..0d41e09 --- /dev/null +++ b/nu_plugin_port_extension/src/helpers/os_str.rs @@ -0,0 +1,9 @@ +pub trait ToStr { + fn to_string(&self) -> String; +} + +impl ToStr for std::ffi::OsStr { + fn to_string(&self) -> String { + self.to_string_lossy().to_string() + } +} diff --git a/nu_plugin_port_extension/src/main.rs b/nu_plugin_port_extension/src/main.rs new file mode 100644 index 0000000..21019a0 --- /dev/null +++ b/nu_plugin_port_extension/src/main.rs @@ -0,0 +1,21 @@ +mod commands; +mod helpers; + +use commands::{list::PortList, scan::PortScan}; + +use nu_plugin::PluginCommand; +pub struct PortExtension; + +impl nu_plugin::Plugin for PortExtension { + fn commands(&self) -> Vec>> { + vec![Box::new(PortList::new()), Box::new(PortScan::new())] + } + + fn version(&self) -> String { + env!("CARGO_PKG_VERSION").into() + } +} + +fn main() { + nu_plugin::serve_plugin(&mut PortExtension {}, nu_plugin::MsgPackSerializer {}) +} diff --git a/nu_plugin_qr_maker/.github/workflows/dependency-update.yaml b/nu_plugin_qr_maker/.github/workflows/dependency-update.yaml new file mode 100644 index 0000000..95c2d97 --- /dev/null +++ b/nu_plugin_qr_maker/.github/workflows/dependency-update.yaml @@ -0,0 +1,49 @@ +on: + workflow_dispatch: + schedule: + - cron: '0 0 */2 * *' + +name: Update dependencies + +jobs: + update: + runs-on: ubuntu-latest + steps: + - name: Setup Nushell + uses: hustcer/setup-nu@main + with: + version: "*" + - uses: actions/checkout@v2 + - name: prepare + shell: nu {0} + run: | + nu -c ' + cargo install cargo-edit cargo-upgrades nu_plugin_inc -f + ' + - name: Update Dependencies + shell: nu {0} + run: | + nu -c ' + register /home/runner/.cargo/bin/nu_plugin_inc + cargo upgrade + let changed = git status -s | is-empty | not $in + if ($changed) { + open Cargo.toml + | upsert package.version ( $in + | get package.version + | inc --patch + ) + | save Cargo.toml -f + + open package.nuon + | upsert version ( open Cargo.toml | get package.version ) + | save package.nuon -f + cargo upgrade + } + + echo { "changed": $changed } + ' + + - uses: EndBug/add-and-commit@v9 + with: + author_name: GitHub-Action diff --git a/nu_plugin_qr_maker/.github/workflows/publish.yml b/nu_plugin_qr_maker/.github/workflows/publish.yml new file mode 100644 index 0000000..bb11d29 --- /dev/null +++ b/nu_plugin_qr_maker/.github/workflows/publish.yml @@ -0,0 +1,16 @@ +--- +on: workflow_dispatch +jobs: + publish: + name: Publish to crates.io + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v3 + + - name: Login + run: cargo login ${{ secrets.CARGO_KEY }} + + - name: Push + run: cargo publish + diff --git a/nu_plugin_qr_maker/.gitignore b/nu_plugin_qr_maker/.gitignore new file mode 100644 index 0000000..9026c77 --- /dev/null +++ b/nu_plugin_qr_maker/.gitignore @@ -0,0 +1,2 @@ +/target +.vscode diff --git a/nu_plugin_qr_maker/.idea/.gitignore b/nu_plugin_qr_maker/.idea/.gitignore new file mode 100644 index 0000000..13566b8 --- /dev/null +++ b/nu_plugin_qr_maker/.idea/.gitignore @@ -0,0 +1,8 @@ +# Default ignored files +/shelf/ +/workspace.xml +# Editor-based HTTP Client requests +/httpRequests/ +# Datasource local storage ignored files +/dataSources/ +/dataSources.local.xml diff --git a/nu_plugin_qr_maker/.idea/modules.xml b/nu_plugin_qr_maker/.idea/modules.xml new file mode 100644 index 0000000..2eda36c --- /dev/null +++ b/nu_plugin_qr_maker/.idea/modules.xml @@ -0,0 +1,8 @@ + + + + + + + + \ No newline at end of file diff --git a/nu_plugin_qr_maker/.idea/nu_plugin_qr_maker.iml b/nu_plugin_qr_maker/.idea/nu_plugin_qr_maker.iml new file mode 100644 index 0000000..cf84ae4 --- /dev/null +++ b/nu_plugin_qr_maker/.idea/nu_plugin_qr_maker.iml @@ -0,0 +1,11 @@ + + + + + + + + + + + \ No newline at end of file diff --git a/nu_plugin_qr_maker/.idea/vcs.xml b/nu_plugin_qr_maker/.idea/vcs.xml new file mode 100644 index 0000000..35eb1dd --- /dev/null +++ b/nu_plugin_qr_maker/.idea/vcs.xml @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/nu_plugin_qr_maker/Cargo.lock b/nu_plugin_qr_maker/Cargo.lock new file mode 100644 index 0000000..4c7531d --- /dev/null +++ b/nu_plugin_qr_maker/Cargo.lock @@ -0,0 +1,1964 @@ +# This file is automatically @generated by Cargo. +# It is not intended for manual editing. +version = 4 + +[[package]] +name = "adler2" +version = "2.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "320119579fcad9c21884f5c4861d16174d0e06250625266f50fe6898340abefa" + +[[package]] +name = "aho-corasick" +version = "1.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8e60d3430d3a69478ad0993f19238d2df97c507009a52b3c10addcd7f6bcb916" +dependencies = [ + "memchr", +] + +[[package]] +name = "alloc-no-stdlib" +version = "2.0.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cc7bb162ec39d46ab1ca8c77bf72e890535becd1751bb45f64c597edb4c8c6b3" + +[[package]] +name = "alloc-stdlib" +version = "0.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "94fb8275041c72129eb51b7d0322c29b8387a0386127718b096429201a5d6ece" +dependencies = [ + "alloc-no-stdlib", +] + +[[package]] +name = "allocator-api2" +version = "0.2.21" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "683d7910e743518b0e34f1186f92494becacb047c7b6bf616c96772180fef923" + +[[package]] +name = "android-tzdata" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e999941b234f3131b00bc13c22d06e8c5ff726d1b6318ac7eb276997bbb4fef0" + +[[package]] +name = "android_system_properties" +version = "0.1.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "819e7219dbd41043ac279b19830f2efc897156490d7fd6ea916720117ee66311" +dependencies = [ + "libc", +] + +[[package]] +name = "arrayvec" +version = "0.7.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7c02d123df017efcdfbd739ef81735b36c5ba83ec3c59c80a9d7ecc718f92e50" + +[[package]] +name = "autocfg" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c08606f8c3cbf4ce6ec8e28fb0014a2c086708fe954eaa885384a6165172e7e8" + +[[package]] +name = "bindgen" +version = "0.70.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f49d8fed880d473ea71efb9bf597651e77201bdd4893efe54c9e5d65ae04ce6f" +dependencies = [ + "bitflags", + "cexpr", + "clang-sys", + "itertools 0.13.0", + "proc-macro2", + "quote", + "regex", + "rustc-hash", + "shlex", + "syn", +] + +[[package]] +name = "bit-set" +version = "0.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "08807e080ed7f9d5433fa9b275196cfc35414f66a0c79d864dc51a0d825231a3" +dependencies = [ + "bit-vec", +] + +[[package]] +name = "bit-vec" +version = "0.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5e764a1d40d510daf35e07be9eb06e75770908c27d411ee6c92109c9840eaaf7" + +[[package]] +name = "bitflags" +version = "2.9.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1b8e56985ec62d17e9c1001dc89c88ecd7dc08e47eba5ec7c29c7b5eeecde967" + +[[package]] +name = "brotli" +version = "7.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cc97b8f16f944bba54f0433f07e30be199b6dc2bd25937444bbad560bcea29bd" +dependencies = [ + "alloc-no-stdlib", + "alloc-stdlib", + "brotli-decompressor", +] + +[[package]] +name = "brotli-decompressor" +version = "4.0.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a334ef7c9e23abf0ce748e8cd309037da93e606ad52eb372e4ce327a0dcfbdfd" +dependencies = [ + "alloc-no-stdlib", + "alloc-stdlib", +] + +[[package]] +name = "bumpalo" +version = "3.19.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "46c5e41b57b8bba42a04676d81cb89e9ee8e859a1a66f80a5a72e1cb76b34d43" + +[[package]] +name = "byteorder" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1fd0f2584146f6f2ef48085050886acf353beff7305ebd1ae69500e27c67f64b" + +[[package]] +name = "bytes" +version = "1.10.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d71b6127be86fdcfddb610f7182ac57211d4b18a3e9c82eb2d17662f2227ad6a" + +[[package]] +name = "cc" +version = "1.2.27" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d487aa071b5f64da6f19a3e848e3578944b726ee5a4854b82172f02aa876bfdc" +dependencies = [ + "shlex", +] + +[[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.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9555578bc9e57714c812a1f84e4fc5b4d21fcb063490c624de019f7464c91268" + +[[package]] +name = "cfg_aliases" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "613afe47fcd5fac7ccf1db93babcb082c5994d996f20b8b159f2ad1658eb5724" + +[[package]] +name = "chrono" +version = "0.4.41" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c469d952047f47f91b68d1cba3f10d63c11d73e4636f24f08daf0278abf01c4d" +dependencies = [ + "android-tzdata", + "iana-time-zone", + "num-traits", + "pure-rust-locales", + "serde", + "windows-link", +] + +[[package]] +name = "chrono-humanize" +version = "0.2.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "799627e6b4d27827a814e837b9d8a504832086081806d45b1afa34dc982b023b" +dependencies = [ + "chrono", +] + +[[package]] +name = "clang-sys" +version = "1.8.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0b023947811758c97c59bf9d1c188fd619ad4718dcaa767947df1cadb14f39f4" +dependencies = [ + "glob", + "libc", + "libloading", +] + +[[package]] +name = "core-foundation-sys" +version = "0.8.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "773648b94d0e5d620f64f280777445740e61fe701025087ec8b57f45c791888b" + +[[package]] +name = "crc32fast" +version = "1.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a97769d94ddab943e4510d138150169a2758b5ef3eb191a9ee688de3e23ef7b3" +dependencies = [ + "cfg-if", +] + +[[package]] +name = "crossbeam-deque" +version = "0.8.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9dd111b7b7f7d55b72c0a6ae361660ee5853c9af73f70c3c2ef6858b950e2e51" +dependencies = [ + "crossbeam-epoch", + "crossbeam-utils", +] + +[[package]] +name = "crossbeam-epoch" +version = "0.9.18" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5b82ac4a3c2ca9c3460964f020e1402edd5753411d7737aa39c3714ad1b5420e" +dependencies = [ + "crossbeam-utils", +] + +[[package]] +name = "crossbeam-utils" +version = "0.8.21" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d0a5c400df2834b80a4c3327b3aad3a4c4cd4de0629063962b03235697506a28" + +[[package]] +name = "crossterm" +version = "0.28.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "829d955a0bb380ef178a640b91779e3987da38c9aea133b20614cfed8cdea9c6" +dependencies = [ + "bitflags", + "crossterm_winapi", + "mio", + "parking_lot", + "rustix 0.38.44", + "signal-hook", + "signal-hook-mio", + "winapi", +] + +[[package]] +name = "crossterm_winapi" +version = "0.9.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "acdd7c62a3665c7f6830a51635d9ac9b23ed385797f70a83bb8bafe9c572ab2b" +dependencies = [ + "winapi", +] + +[[package]] +name = "dirs" +version = "5.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "44c45a9d03d6676652bcb5e724c7e988de1acad23a711b5217ab9cbecbec2225" +dependencies = [ + "dirs-sys", +] + +[[package]] +name = "dirs-sys" +version = "0.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "520f05a5cbd335fae5a99ff7a6ab8627577660ee5cfd6a94a6a929b52ff0321c" +dependencies = [ + "libc", + "option-ext", + "redox_users", + "windows-sys 0.48.0", +] + +[[package]] +name = "doctest-file" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "aac81fa3e28d21450aa4d2ac065992ba96a1d7303efbce51a95f4fd175b67562" + +[[package]] +name = "either" +version = "1.15.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "48c757948c5ede0e46177b7add2e67155f70e33c07fea8284df6576da70b3719" + +[[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.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e004d887f51fcb9fef17317a2f3525c887d8aa3f4f50fed920816a688284a5b7" +dependencies = [ + "serde", + "typeid", +] + +[[package]] +name = "errno" +version = "0.3.13" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "778e2ac28f6c47af28e4907f13ffd1e1ddbd400980a9abd7c8df189bf578a5ad" +dependencies = [ + "libc", + "windows-sys 0.60.2", +] + +[[package]] +name = "fancy-regex" +version = "0.14.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6e24cb5a94bcae1e5408b0effca5cd7172ea3c5755049c5f3af4cd283a165298" +dependencies = [ + "bit-set", + "regex-automata", + "regex-syntax", +] + +[[package]] +name = "flate2" +version = "1.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4a3d7db9596fecd151c5f638c0ee5d5bd487b6e0ea232e5dc96d5250f6f94b1d" +dependencies = [ + "crc32fast", + "miniz_oxide", +] + +[[package]] +name = "foldhash" +version = "0.1.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d9c4f5dac5e15c24eb999c26181a6ca40b39fe946cbe4c263c7209467bc83af2" + +[[package]] +name = "getrandom" +version = "0.2.16" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "335ff9f135e4384c8150d6f27c6daed433577f86b4750418338c01a1a2528592" +dependencies = [ + "cfg-if", + "libc", + "wasi", +] + +[[package]] +name = "glob" +version = "0.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a8d1add55171497b4705a648c6b583acafb01d58050a51727785f0b2c8e0a2b2" + +[[package]] +name = "hashbrown" +version = "0.15.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5971ac85611da7067dbfcabef3c70ebb5606018acd9e2a3903a0da507521e0d5" +dependencies = [ + "allocator-api2", + "equivalent", + "foldhash", +] + +[[package]] +name = "heck" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2304e00983f87ffb38b55b444b5e3b60a884b5d30c0fca7d82fe33449bbe55ea" + +[[package]] +name = "hex" +version = "0.4.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7f24254aa9a54b5c858eaee2f5bccdb46aaf0e486a595ed5fd8f86ba55232a70" + +[[package]] +name = "iana-time-zone" +version = "0.1.63" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b0c919e5debc312ad217002b8048a17b7d83f80703865bbfcfebb0458b0b27d8" +dependencies = [ + "android_system_properties", + "core-foundation-sys", + "iana-time-zone-haiku", + "js-sys", + "log", + "wasm-bindgen", + "windows-core 0.61.2", +] + +[[package]] +name = "iana-time-zone-haiku" +version = "0.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f31827a206f56af32e590ba56d5d2d085f558508192593743f16b2306495269f" +dependencies = [ + "cc", +] + +[[package]] +name = "indexmap" +version = "2.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cea70ddb795996207ad57735b50c5982d8844f38ba9ee5f1aedcfb708a2aa11e" +dependencies = [ + "equivalent", + "hashbrown", +] + +[[package]] +name = "interprocess" +version = "2.2.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d941b405bd2322993887859a8ee6ac9134945a24ec5ec763a8a962fc64dfec2d" +dependencies = [ + "doctest-file", + "libc", + "recvmsg", + "widestring", + "windows-sys 0.52.0", +] + +[[package]] +name = "inventory" +version = "0.3.20" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ab08d7cd2c5897f2c949e5383ea7c7db03fb19130ffcfbf7eda795137ae3cb83" +dependencies = [ + "rustversion", +] + +[[package]] +name = "is_ci" +version = "1.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7655c9839580ee829dfacba1d1278c2b7883e50a277ff7541299489d6bdfdc45" + +[[package]] +name = "itertools" +version = "0.13.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "413ee7dfc52ee1a4949ceeb7dbc8a33f2d6c088194d9f922fb8318faf1f01186" +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.15" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4a5f13b858c8d314ee3e8f639011f7ccefe71f97f96e50151fb991f267928e2c" + +[[package]] +name = "js-sys" +version = "0.3.77" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1cfaf33c695fc6e08064efbc1f72ec937429614f25eef83af942d0e227c3a28f" +dependencies = [ + "once_cell", + "wasm-bindgen", +] + +[[package]] +name = "libc" +version = "0.2.174" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1171693293099992e19cddea4e8b849964e9846f4acee11b3948bcc337be8776" + +[[package]] +name = "libloading" +version = "0.8.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "07033963ba89ebaf1584d767badaa2e8fcec21aedea6b8c0346d487d49c28667" +dependencies = [ + "cfg-if", + "windows-targets 0.53.2", +] + +[[package]] +name = "libproc" +version = "0.14.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e78a09b56be5adbcad5aa1197371688dc6bb249a26da3bca2011ee2fb987ebfb" +dependencies = [ + "bindgen", + "errno", + "libc", +] + +[[package]] +name = "libredox" +version = "0.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c0ff37bd590ca25063e35af745c343cb7a0271906fb7b37e4813e8f79f00268d" +dependencies = [ + "bitflags", + "libc", +] + +[[package]] +name = "linux-raw-sys" +version = "0.4.15" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d26c52dbd32dccf2d10cac7725f8eae5296885fb5703b261f7d0a0739ec807ab" + +[[package]] +name = "linux-raw-sys" +version = "0.9.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cd945864f07fe9f5371a27ad7b52a172b4b499999f1d97574c9fa68373937e12" + +[[package]] +name = "lock_api" +version = "0.4.13" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "96936507f153605bddfcda068dd804796c84324ed2510809e5b2a624c81da765" +dependencies = [ + "autocfg", + "scopeguard", +] + +[[package]] +name = "log" +version = "0.4.27" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "13dc2df351e3202783a1fe0d44375f7295ffb4049267b0f3018346dc122a1d94" + +[[package]] +name = "lru" +version = "0.12.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "234cf4f4a04dc1f57e24b96cc0cd600cf2af460d4161ac5ecdd0af8e1f3b2a38" +dependencies = [ + "hashbrown", +] + +[[package]] +name = "lscolors" +version = "0.20.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "61183da5de8ba09a58e330d55e5ea796539d8443bd00fdeb863eac39724aa4ab" +dependencies = [ + "aho-corasick", + "nu-ansi-term", +] + +[[package]] +name = "mach2" +version = "0.4.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d640282b302c0bb0a2a8e0233ead9035e3bed871f0b7e81fe4a1ec829765db44" +dependencies = [ + "libc", +] + +[[package]] +name = "memchr" +version = "2.7.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "32a282da65faaf38286cf3be983213fcf1d2e2a58700e808f83f4ea9a4804bc0" + +[[package]] +name = "miette" +version = "7.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5f98efec8807c63c752b5bd61f862c165c115b0a35685bdcfd9238c7aeb592b7" +dependencies = [ + "cfg-if", + "miette-derive", + "owo-colors", + "supports-color", + "supports-hyperlinks", + "supports-unicode", + "terminal_size", + "textwrap", + "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", +] + +[[package]] +name = "minimal-lexical" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "68354c5c6bd36d73ff3feceb05efa59b6acb7626617f4962be322a825e61f79a" + +[[package]] +name = "miniz_oxide" +version = "0.8.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1fa76a2c86f704bdb222d66965fb3d63269ce38518b83cb0575fca855ebb6316" +dependencies = [ + "adler2", +] + +[[package]] +name = "mio" +version = "1.0.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "78bed444cc8a2160f01cbcf811ef18cac863ad68ae8ca62092e8db51d51c761c" +dependencies = [ + "libc", + "log", + "wasi", + "windows-sys 0.59.0", +] + +[[package]] +name = "nix" +version = "0.29.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "71e2746dc3a24dd78b3cfcb7be93368c6de9963d30f43a6a73998a9cf4b17b46" +dependencies = [ + "bitflags", + "cfg-if", + "cfg_aliases", + "libc", +] + +[[package]] +name = "nom" +version = "7.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d273983c5a657a70a3e8f2a01329822f3b8c8172b73826411a55751e404a0a4a" +dependencies = [ + "memchr", + "minimal-lexical", +] + +[[package]] +name = "ntapi" +version = "0.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e8a3895c6391c39d7fe7ebc444a87eb2991b2a0bc718fdabd071eec617fc68e4" +dependencies = [ + "winapi", +] + +[[package]] +name = "nu-ansi-term" +version = "0.50.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d4a28e057d01f97e61255210fcff094d74ed0466038633e95017f5beb68e4399" +dependencies = [ + "windows-sys 0.52.0", +] + +[[package]] +name = "nu-derive-value" +version = "0.105.2" +dependencies = [ + "heck", + "proc-macro-error2", + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "nu-engine" +version = "0.105.2" +dependencies = [ + "log", + "nu-glob", + "nu-path", + "nu-protocol", + "nu-utils", +] + +[[package]] +name = "nu-glob" +version = "0.105.2" + +[[package]] +name = "nu-path" +version = "0.105.2" +dependencies = [ + "dirs", + "omnipath", + "pwd", + "ref-cast", +] + +[[package]] +name = "nu-plugin" +version = "0.105.2" +dependencies = [ + "log", + "nix", + "nu-engine", + "nu-plugin-core", + "nu-plugin-protocol", + "nu-protocol", + "nu-utils", + "thiserror 2.0.12", +] + +[[package]] +name = "nu-plugin-core" +version = "0.105.2" +dependencies = [ + "interprocess", + "log", + "nu-plugin-protocol", + "nu-protocol", + "rmp-serde", + "serde", + "serde_json", + "windows 0.56.0", +] + +[[package]] +name = "nu-plugin-protocol" +version = "0.105.2" +dependencies = [ + "nu-protocol", + "nu-utils", + "rmp-serde", + "semver", + "serde", + "typetag", +] + +[[package]] +name = "nu-protocol" +version = "0.105.2" +dependencies = [ + "brotli", + "bytes", + "chrono", + "chrono-humanize", + "dirs", + "dirs-sys", + "fancy-regex", + "heck", + "indexmap", + "log", + "lru", + "memchr", + "miette", + "nix", + "nu-derive-value", + "nu-glob", + "nu-path", + "nu-system", + "nu-utils", + "num-format", + "os_pipe", + "rmp-serde", + "serde", + "serde_json", + "strum", + "strum_macros", + "thiserror 2.0.12", + "typetag", + "web-time", + "windows 0.56.0", + "windows-sys 0.48.0", +] + +[[package]] +name = "nu-system" +version = "0.105.2" +dependencies = [ + "chrono", + "itertools 0.14.0", + "libc", + "libproc", + "log", + "mach2", + "nix", + "ntapi", + "procfs", + "sysinfo", + "web-time", + "windows 0.56.0", +] + +[[package]] +name = "nu-utils" +version = "0.105.2" +dependencies = [ + "crossterm", + "crossterm_winapi", + "fancy-regex", + "log", + "lscolors", + "nix", + "num-format", + "serde", + "serde_json", + "strip-ansi-escapes", + "sys-locale", + "unicase", +] + +[[package]] +name = "nu_plugin_qr_maker" +version = "1.1.0" +dependencies = [ + "nu-plugin", + "nu-protocol", + "qr2term", +] + +[[package]] +name = "num-format" +version = "0.4.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a652d9771a63711fd3c3deb670acfbe5c30a4072e664d7a3bf5a9e1056ac72c3" +dependencies = [ + "arrayvec", + "itoa", +] + +[[package]] +name = "num-traits" +version = "0.2.19" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "071dfc062690e90b734c0b2273ce72ad0ffa95f0c74596bc250dcfd960262841" +dependencies = [ + "autocfg", +] + +[[package]] +name = "omnipath" +version = "0.1.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "80adb31078122c880307e9cdfd4e3361e6545c319f9b9dcafcb03acd3b51a575" + +[[package]] +name = "once_cell" +version = "1.21.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "42f5e15c9953c5e4ccceeb2e7382a716482c34515315f7b03532b8b4e8393d2d" + +[[package]] +name = "option-ext" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "04744f49eae99ab78e0d5c0b603ab218f515ea8cfe5a456d7629ad883a3b6e7d" + +[[package]] +name = "os_pipe" +version = "1.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "db335f4760b14ead6290116f2427bf33a14d4f0617d49f78a246de10c1831224" +dependencies = [ + "libc", + "windows-sys 0.59.0", +] + +[[package]] +name = "owo-colors" +version = "4.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "48dd4f4a2c8405440fd0462561f0e5806bd0f77e86f51c761481bdd4018b545e" + +[[package]] +name = "parking_lot" +version = "0.12.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "70d58bf43669b5795d1576d0641cfb6fbb2057bf629506267a92807158584a13" +dependencies = [ + "lock_api", + "parking_lot_core", +] + +[[package]] +name = "parking_lot_core" +version = "0.9.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bc838d2a56b5b1a6c25f55575dfc605fabb63bb2365f6c2353ef9159aa69e4a5" +dependencies = [ + "cfg-if", + "libc", + "redox_syscall", + "smallvec", + "windows-targets 0.52.6", +] + +[[package]] +name = "paste" +version = "1.0.15" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "57c0d7b74b563b49d38dae00a0c37d4d6de9b432382b2892f0574ddcae73fd0a" + +[[package]] +name = "proc-macro-error-attr2" +version = "2.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "96de42df36bb9bba5542fe9f1a054b8cc87e172759a1868aa05c1f3acc89dfc5" +dependencies = [ + "proc-macro2", + "quote", +] + +[[package]] +name = "proc-macro-error2" +version = "2.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "11ec05c52be0a07b08061f7dd003e7d7092e0472bc731b4af7bb1ef876109802" +dependencies = [ + "proc-macro-error-attr2", + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "proc-macro2" +version = "1.0.95" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "02b3e5e68a3a1a02aad3ec490a98007cbc13c37cbe84a3cd7b8e406d76e7f778" +dependencies = [ + "unicode-ident", +] + +[[package]] +name = "procfs" +version = "0.17.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cc5b72d8145275d844d4b5f6d4e1eef00c8cd889edb6035c21675d1bb1f45c9f" +dependencies = [ + "bitflags", + "chrono", + "flate2", + "hex", + "procfs-core", + "rustix 0.38.44", +] + +[[package]] +name = "procfs-core" +version = "0.17.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "239df02d8349b06fc07398a3a1697b06418223b1c7725085e801e7c0fc6a12ec" +dependencies = [ + "bitflags", + "chrono", + "hex", +] + +[[package]] +name = "pure-rust-locales" +version = "0.8.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1190fd18ae6ce9e137184f207593877e70f39b015040156b1e05081cdfe3733a" + +[[package]] +name = "pwd" +version = "1.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "72c71c0c79b9701efe4e1e4b563b2016dd4ee789eb99badcb09d61ac4b92e4a2" +dependencies = [ + "libc", + "thiserror 1.0.69", +] + +[[package]] +name = "qr2term" +version = "0.3.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6867c60b38e9747a079a19614dbb5981a53f21b9a56c265f3bfdf6011a50a957" +dependencies = [ + "crossterm", + "qrcode", +] + +[[package]] +name = "qrcode" +version = "0.14.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d68782463e408eb1e668cf6152704bd856c78c5b6417adaee3203d8f4c1fc9ec" + +[[package]] +name = "quote" +version = "1.0.40" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1885c039570dc00dcb4ff087a89e185fd56bae234ddc7f056a945bf36467248d" +dependencies = [ + "proc-macro2", +] + +[[package]] +name = "rayon" +version = "1.10.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b418a60154510ca1a002a752ca9714984e21e4241e804d32555251faf8b78ffa" +dependencies = [ + "either", + "rayon-core", +] + +[[package]] +name = "rayon-core" +version = "1.12.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1465873a3dfdaa8ae7cb14b4383657caab0b3e8a0aa9ae8e04b044854c8dfce2" +dependencies = [ + "crossbeam-deque", + "crossbeam-utils", +] + +[[package]] +name = "recvmsg" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d3edd4d5d42c92f0a659926464d4cce56b562761267ecf0f469d85b7de384175" + +[[package]] +name = "redox_syscall" +version = "0.5.13" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0d04b7d0ee6b4a0207a0a7adb104d23ecb0b47d6beae7152d0fa34b692b29fd6" +dependencies = [ + "bitflags", +] + +[[package]] +name = "redox_users" +version = "0.4.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ba009ff324d1fc1b900bd1fdb31564febe58a8ccc8a6fdbb93b543d33b13ca43" +dependencies = [ + "getrandom", + "libredox", + "thiserror 1.0.69", +] + +[[package]] +name = "ref-cast" +version = "1.0.24" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4a0ae411dbe946a674d89546582cea4ba2bb8defac896622d6496f14c23ba5cf" +dependencies = [ + "ref-cast-impl", +] + +[[package]] +name = "ref-cast-impl" +version = "1.0.24" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1165225c21bff1f3bbce98f5a1f889949bc902d3575308cc7b0de30b4f6d27c7" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "regex" +version = "1.11.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b544ef1b4eac5dc2db33ea63606ae9ffcfac26c1416a2806ae0bf5f56b201191" +dependencies = [ + "aho-corasick", + "memchr", + "regex-automata", + "regex-syntax", +] + +[[package]] +name = "regex-automata" +version = "0.4.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "809e8dc61f6de73b46c85f4c96486310fe304c434cfa43669d7b40f711150908" +dependencies = [ + "aho-corasick", + "memchr", + "regex-syntax", +] + +[[package]] +name = "regex-syntax" +version = "0.8.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2b15c43186be67a4fd63bee50d0303afffcef381492ebe2c5d87f324e1b8815c" + +[[package]] +name = "rmp" +version = "0.8.14" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "228ed7c16fa39782c3b3468e974aec2795e9089153cd08ee2e9aefb3613334c4" +dependencies = [ + "byteorder", + "num-traits", + "paste", +] + +[[package]] +name = "rmp-serde" +version = "1.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "52e599a477cf9840e92f2cde9a7189e67b42c57532749bf90aea6ec10facd4db" +dependencies = [ + "byteorder", + "rmp", + "serde", +] + +[[package]] +name = "rustc-hash" +version = "1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "08d43f7aa6b08d49f382cde6a7982047c3426db949b1424bc4b7ec9ae12c6ce2" + +[[package]] +name = "rustix" +version = "0.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.0.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c71e83d6afe7ff64890ec6b71d6a69bb8a610ab78ce364b3352876bb4c801266" +dependencies = [ + "bitflags", + "errno", + "libc", + "linux-raw-sys 0.9.4", + "windows-sys 0.59.0", +] + +[[package]] +name = "rustversion" +version = "1.0.21" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8a0d197bd2c9dc6e53b84da9556a69ba4cdfab8619eb41a8bd1cc2027a0f6b1d" + +[[package]] +name = "ryu" +version = "1.0.20" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "28d3b2b1366ec20994f1fd18c3c594f05c5dd4bc44d8bb0c1c632c8d6829481f" + +[[package]] +name = "scopeguard" +version = "1.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "94143f37725109f92c262ed2cf5e59bce7498c01bcc1502d7b9afe439a4e9f49" + +[[package]] +name = "semver" +version = "1.0.26" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "56e6fa9c48d24d85fb3de5ad847117517440f6beceb7798af16b4a87d616b8d0" + +[[package]] +name = "serde" +version = "1.0.219" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5f0e2c6ed6606019b4e29e69dbaba95b11854410e5347d525002456dbbb786b6" +dependencies = [ + "serde_derive", +] + +[[package]] +name = "serde_derive" +version = "1.0.219" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5b0276cf7f2c73365f7157c8123c21cd9a50fbbd844757af28ca1f5925fc2a00" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "serde_json" +version = "1.0.140" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "20068b6e96dc6c9bd23e01df8827e6c7e1f2fddd43c21810382803c136b99373" +dependencies = [ + "itoa", + "memchr", + "ryu", + "serde", +] + +[[package]] +name = "shlex" +version = "1.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0fda2ff0d084019ba4d7c6f371c95d8fd75ce3524c3cb8fb653a3023f6323e64" + +[[package]] +name = "signal-hook" +version = "0.3.18" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d881a16cf4426aa584979d30bd82cb33429027e42122b169753d6ef1085ed6e2" +dependencies = [ + "libc", + "signal-hook-registry", +] + +[[package]] +name = "signal-hook-mio" +version = "0.2.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "34db1a06d485c9142248b7a054f034b349b212551f3dfd19c94d45a754a217cd" +dependencies = [ + "libc", + "mio", + "signal-hook", +] + +[[package]] +name = "signal-hook-registry" +version = "1.4.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9203b8055f63a2a00e2f593bb0510367fe707d7ff1e5c872de2f537b339e5410" +dependencies = [ + "libc", +] + +[[package]] +name = "smallvec" +version = "1.15.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "67b1b7a3b5fe4f1376887184045fcf45c69e92af734b7aaddc05fb777b6fbd03" + +[[package]] +name = "strip-ansi-escapes" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2a8f8038e7e7969abb3f1b7c2a811225e9296da208539e0f79c5251d6cac0025" +dependencies = [ + "vte", +] + +[[package]] +name = "strum" +version = "0.26.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8fec0f0aef304996cf250b31b5a10dee7980c85da9d759361292b8bca5a18f06" + +[[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", +] + +[[package]] +name = "supports-color" +version = "3.0.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c64fc7232dd8d2e4ac5ce4ef302b1d81e0b80d055b9d77c7c4f51f6aa4c867d6" +dependencies = [ + "is_ci", +] + +[[package]] +name = "supports-hyperlinks" +version = "3.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "804f44ed3c63152de6a9f90acbea1a110441de43006ea51bcce8f436196a288b" + +[[package]] +name = "supports-unicode" +version = "3.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b7401a30af6cb5818bb64852270bb722533397edcfc7344954a38f420819ece2" + +[[package]] +name = "syn" +version = "2.0.104" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "17b6f705963418cdb9927482fa304bc562ece2fdd4f616084c50b7023b435a40" +dependencies = [ + "proc-macro2", + "quote", + "unicode-ident", +] + +[[package]] +name = "sys-locale" +version = "0.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8eab9a99a024a169fe8a903cf9d4a3b3601109bcc13bd9e3c6fff259138626c4" +dependencies = [ + "libc", +] + +[[package]] +name = "sysinfo" +version = "0.33.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4fc858248ea01b66f19d8e8a6d55f41deaf91e9d495246fd01368d99935c6c01" +dependencies = [ + "core-foundation-sys", + "libc", + "memchr", + "ntapi", + "rayon", + "windows 0.57.0", +] + +[[package]] +name = "terminal_size" +version = "0.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "45c6481c4829e4cc63825e62c49186a34538b7b2750b73b266581ffb612fb5ed" +dependencies = [ + "rustix 1.0.7", + "windows-sys 0.59.0", +] + +[[package]] +name = "textwrap" +version = "0.16.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c13547615a44dc9c452a8a534638acdf07120d4b6847c8178705da06306a3057" +dependencies = [ + "unicode-linebreak", + "unicode-width 0.2.1", +] + +[[package]] +name = "thiserror" +version = "1.0.69" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b6aaf5339b578ea85b50e080feb250a3e8ae8cfcdff9a461c9ec2904bc923f52" +dependencies = [ + "thiserror-impl 1.0.69", +] + +[[package]] +name = "thiserror" +version = "2.0.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "567b8a2dae586314f7be2a752ec7474332959c6460e02bde30d702a66d488708" +dependencies = [ + "thiserror-impl 2.0.12", +] + +[[package]] +name = "thiserror-impl" +version = "1.0.69" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4fee6c4efc90059e10f81e6d42c60a18f76588c3d74cb83a0b242a2b6c7504c1" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "thiserror-impl" +version = "2.0.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7f7cf42b4507d8ea322120659672cf1b9dbb93f8f2d4ecfd6e51350ff5b17a1d" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "typeid" +version = "1.0.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bc7d623258602320d5c55d1bc22793b57daff0ec7efc270ea7d55ce1d5f5471c" + +[[package]] +name = "typetag" +version = "0.2.20" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "73f22b40dd7bfe8c14230cf9702081366421890435b2d625fa92b4acc4c3de6f" +dependencies = [ + "erased-serde", + "inventory", + "once_cell", + "serde", + "typetag-impl", +] + +[[package]] +name = "typetag-impl" +version = "0.2.20" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "35f5380909ffc31b4de4f4bdf96b877175a016aa2ca98cee39fcfd8c4d53d952" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "unicase" +version = "2.8.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "75b844d17643ee918803943289730bec8aac480150456169e647ed0b576ba539" + +[[package]] +name = "unicode-ident" +version = "1.0.18" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5a5f39404a5da50712a4c1eecf25e90dd62b613502b7e925fd4e4d19b5c96512" + +[[package]] +name = "unicode-linebreak" +version = "0.1.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3b09c83c3c29d37506a3e260c08c03743a6bb66a9cd432c6934ab501a190571f" + +[[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.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4a1a07cc7db3810833284e8d372ccdc6da29741639ecc70c9ec107df0fa6154c" + +[[package]] +name = "vte" +version = "0.14.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "231fdcd7ef3037e8330d8e17e61011a2c244126acc0a982f4040ac3f9f0bc077" +dependencies = [ + "memchr", +] + +[[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.100" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1edc8929d7499fc4e8f0be2262a241556cfc54a0bea223790e71446f2aab1ef5" +dependencies = [ + "cfg-if", + "once_cell", + "rustversion", + "wasm-bindgen-macro", +] + +[[package]] +name = "wasm-bindgen-backend" +version = "0.2.100" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2f0a0651a5c2bc21487bde11ee802ccaf4c51935d0d3d42a6101f98161700bc6" +dependencies = [ + "bumpalo", + "log", + "proc-macro2", + "quote", + "syn", + "wasm-bindgen-shared", +] + +[[package]] +name = "wasm-bindgen-macro" +version = "0.2.100" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7fe63fc6d09ed3792bd0897b314f53de8e16568c2b3f7982f468c0bf9bd0b407" +dependencies = [ + "quote", + "wasm-bindgen-macro-support", +] + +[[package]] +name = "wasm-bindgen-macro-support" +version = "0.2.100" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8ae87ea40c9f689fc23f209965b6fb8a99ad69aeeb0231408be24920604395de" +dependencies = [ + "proc-macro2", + "quote", + "syn", + "wasm-bindgen-backend", + "wasm-bindgen-shared", +] + +[[package]] +name = "wasm-bindgen-shared" +version = "0.2.100" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1a05d73b933a847d6cccdda8f838a22ff101ad9bf93e33684f39c1f5f0eece3d" +dependencies = [ + "unicode-ident", +] + +[[package]] +name = "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 = "widestring" +version = "1.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dd7cf3379ca1aac9eea11fba24fd7e315d621f8dfe35c8d7d2be8b793726e07d" + +[[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" +version = "0.56.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1de69df01bdf1ead2f4ac895dc77c9351aefff65b2f3db429a343f9cbf05e132" +dependencies = [ + "windows-core 0.56.0", + "windows-targets 0.52.6", +] + +[[package]] +name = "windows" +version = "0.57.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "12342cb4d8e3b046f3d80effd474a7a02447231330ef77d71daa6fbc40681143" +dependencies = [ + "windows-core 0.57.0", + "windows-targets 0.52.6", +] + +[[package]] +name = "windows-core" +version = "0.56.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4698e52ed2d08f8658ab0c39512a7c00ee5fe2688c65f8c0a4f06750d729f2a6" +dependencies = [ + "windows-implement 0.56.0", + "windows-interface 0.56.0", + "windows-result 0.1.2", + "windows-targets 0.52.6", +] + +[[package]] +name = "windows-core" +version = "0.57.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d2ed2439a290666cd67ecce2b0ffaad89c2a56b976b736e6ece670297897832d" +dependencies = [ + "windows-implement 0.57.0", + "windows-interface 0.57.0", + "windows-result 0.1.2", + "windows-targets 0.52.6", +] + +[[package]] +name = "windows-core" +version = "0.61.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c0fdd3ddb90610c7638aa2b3a3ab2904fb9e5cdbecc643ddb3647212781c4ae3" +dependencies = [ + "windows-implement 0.60.0", + "windows-interface 0.59.1", + "windows-link", + "windows-result 0.3.4", + "windows-strings", +] + +[[package]] +name = "windows-implement" +version = "0.56.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f6fc35f58ecd95a9b71c4f2329b911016e6bec66b3f2e6a4aad86bd2e99e2f9b" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "windows-implement" +version = "0.57.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9107ddc059d5b6fbfbffdfa7a7fe3e22a226def0b2608f72e9d552763d3e1ad7" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "windows-implement" +version = "0.60.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a47fddd13af08290e67f4acabf4b459f647552718f683a7b415d290ac744a836" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "windows-interface" +version = "0.56.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "08990546bf4edef8f431fa6326e032865f27138718c587dc21bc0265bbcb57cc" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "windows-interface" +version = "0.57.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "29bee4b38ea3cde66011baa44dba677c432a78593e202392d1e9070cf2a7fca7" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "windows-interface" +version = "0.59.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bd9211b69f8dcdfa817bfd14bf1c97c9188afa36f4750130fcdf3f400eca9fa8" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "windows-link" +version = "0.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5e6ad25900d524eaabdbbb96d20b4311e1e7ae1699af4fb28c17ae66c80d798a" + +[[package]] +name = "windows-result" +version = "0.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5e383302e8ec8515204254685643de10811af0ed97ea37210dc26fb0032647f8" +dependencies = [ + "windows-targets 0.52.6", +] + +[[package]] +name = "windows-result" +version = "0.3.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "56f42bd332cc6c8eac5af113fc0c1fd6a8fd2aa08a0119358686e5160d0586c6" +dependencies = [ + "windows-link", +] + +[[package]] +name = "windows-strings" +version = "0.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "56e6c93f3a0c3b36176cb1327a4958a0353d5d166c2a35cb268ace15e91d3b57" +dependencies = [ + "windows-link", +] + +[[package]] +name = "windows-sys" +version = "0.48.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "677d2418bec65e3338edb076e806bc1ec15693c5d0104683f2efe857f61056a9" +dependencies = [ + "windows-targets 0.48.5", +] + +[[package]] +name = "windows-sys" +version = "0.52.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "282be5f36a8ce781fad8c8ae18fa3f9beff57ec1b52cb3de0789201425d9a33d" +dependencies = [ + "windows-targets 0.52.6", +] + +[[package]] +name = "windows-sys" +version = "0.59.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1e38bc4d79ed67fd075bcc251a1c39b32a1776bbe92e5bef1f0bf1f8c531853b" +dependencies = [ + "windows-targets 0.52.6", +] + +[[package]] +name = "windows-sys" +version = "0.60.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f2f500e4d28234f72040990ec9d39e3a6b950f9f22d3dba18416c35882612bcb" +dependencies = [ + "windows-targets 0.53.2", +] + +[[package]] +name = "windows-targets" +version = "0.48.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9a2fa6e2155d7247be68c096456083145c183cbbbc2764150dda45a87197940c" +dependencies = [ + "windows_aarch64_gnullvm 0.48.5", + "windows_aarch64_msvc 0.48.5", + "windows_i686_gnu 0.48.5", + "windows_i686_msvc 0.48.5", + "windows_x86_64_gnu 0.48.5", + "windows_x86_64_gnullvm 0.48.5", + "windows_x86_64_msvc 0.48.5", +] + +[[package]] +name = "windows-targets" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9b724f72796e036ab90c1021d4780d4d3d648aca59e491e6b98e725b84e99973" +dependencies = [ + "windows_aarch64_gnullvm 0.52.6", + "windows_aarch64_msvc 0.52.6", + "windows_i686_gnu 0.52.6", + "windows_i686_gnullvm 0.52.6", + "windows_i686_msvc 0.52.6", + "windows_x86_64_gnu 0.52.6", + "windows_x86_64_gnullvm 0.52.6", + "windows_x86_64_msvc 0.52.6", +] + +[[package]] +name = "windows-targets" +version = "0.53.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c66f69fcc9ce11da9966ddb31a40968cad001c5bedeb5c2b82ede4253ab48aef" +dependencies = [ + "windows_aarch64_gnullvm 0.53.0", + "windows_aarch64_msvc 0.53.0", + "windows_i686_gnu 0.53.0", + "windows_i686_gnullvm 0.53.0", + "windows_i686_msvc 0.53.0", + "windows_x86_64_gnu 0.53.0", + "windows_x86_64_gnullvm 0.53.0", + "windows_x86_64_msvc 0.53.0", +] + +[[package]] +name = "windows_aarch64_gnullvm" +version = "0.48.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2b38e32f0abccf9987a4e3079dfb67dcd799fb61361e53e2882c3cbaf0d905d8" + +[[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_gnullvm" +version = "0.53.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "86b8d5f90ddd19cb4a147a5fa63ca848db3df085e25fee3cc10b39b6eebae764" + +[[package]] +name = "windows_aarch64_msvc" +version = "0.48.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dc35310971f3b2dbbf3f0690a219f40e2d9afcf64f9ab7cc1be722937c26b4bc" + +[[package]] +name = "windows_aarch64_msvc" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "09ec2a7bb152e2252b53fa7803150007879548bc709c039df7627cabbd05d469" + +[[package]] +name = "windows_aarch64_msvc" +version = "0.53.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c7651a1f62a11b8cbd5e0d42526e55f2c99886c77e007179efff86c2b137e66c" + +[[package]] +name = "windows_i686_gnu" +version = "0.48.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a75915e7def60c94dcef72200b9a8e58e5091744960da64ec734a6c6e9b3743e" + +[[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_gnu" +version = "0.53.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c1dc67659d35f387f5f6c479dc4e28f1d4bb90ddd1a5d3da2e5d97b42d6272c3" + +[[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_gnullvm" +version = "0.53.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9ce6ccbdedbf6d6354471319e781c0dfef054c81fbc7cf83f338a4296c0cae11" + +[[package]] +name = "windows_i686_msvc" +version = "0.48.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8f55c233f70c4b27f66c523580f78f1004e8b5a8b659e05a4eb49d4166cca406" + +[[package]] +name = "windows_i686_msvc" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "240948bc05c5e7c6dabba28bf89d89ffce3e303022809e73deaefe4f6ec56c66" + +[[package]] +name = "windows_i686_msvc" +version = "0.53.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "581fee95406bb13382d2f65cd4a908ca7b1e4c2f1917f143ba16efe98a589b5d" + +[[package]] +name = "windows_x86_64_gnu" +version = "0.48.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "53d40abd2583d23e4718fddf1ebec84dbff8381c07cae67ff7768bbf19c6718e" + +[[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_gnu" +version = "0.53.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2e55b5ac9ea33f2fc1716d1742db15574fd6fc8dadc51caab1c16a3d3b4190ba" + +[[package]] +name = "windows_x86_64_gnullvm" +version = "0.48.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0b7b52767868a23d5bab768e390dc5f5c55825b6d30b86c844ff2dc7414044cc" + +[[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_gnullvm" +version = "0.53.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0a6e035dd0599267ce1ee132e51c27dd29437f63325753051e71dd9e42406c57" + +[[package]] +name = "windows_x86_64_msvc" +version = "0.48.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ed94fce61571a4006852b7389a063ab983c02eb1bb37b47f8272ce92d06d9538" + +[[package]] +name = "windows_x86_64_msvc" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "589f6da84c646204747d1270a2a5661ea66ed1cced2631d546fdfb155959f9ec" + +[[package]] +name = "windows_x86_64_msvc" +version = "0.53.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "271414315aff87387382ec3d271b52d7ae78726f5d44ac98b4f4030c91880486" diff --git a/nu_plugin_qr_maker/Cargo.toml b/nu_plugin_qr_maker/Cargo.toml new file mode 100644 index 0000000..eafa5e0 --- /dev/null +++ b/nu_plugin_qr_maker/Cargo.toml @@ -0,0 +1,16 @@ +[package] +name = "nu_plugin_qr_maker" +license = "MIT" +authors = ["Motalleb Fallahnezhad "] +keywords = ["nushell", "qr-code", "plugin"] +homepage = "https://github.com/FMotalleb/nu_plugin_qr_maker" +repository = "https://github.com/FMotalleb/nu_plugin_qr_maker" +description = "A nushell plugin to create qr code in terminal" +version = "1.1.0" +edition = "2024" +readme = "README.md" + +[dependencies] +nu-plugin = { version = "0.105.2", path = "../nushell/crates/nu-plugin" } +nu-protocol = { version = "0.105.2", features = ["plugin"], path = "../nushell/crates/nu-protocol" } +qr2term = { version = "0.3.1" } diff --git a/nu_plugin_qr_maker/LICENSE b/nu_plugin_qr_maker/LICENSE new file mode 100644 index 0000000..abbd7eb --- /dev/null +++ b/nu_plugin_qr_maker/LICENSE @@ -0,0 +1,7 @@ +Copyright 2023 "Motalleb Fallahnezhad" + +Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/nu_plugin_qr_maker/README.md b/nu_plugin_qr_maker/README.md new file mode 100644 index 0000000..64a4ab9 --- /dev/null +++ b/nu_plugin_qr_maker/README.md @@ -0,0 +1,36 @@ +# nu_plugin_qr_maker + +A [nushell](https://www.nushell.sh/) plugin to create qr code in terminal + +## Examples + +```bash +~> "https://google.com" | to qr +``` + +![image](https://github.com/FMotalleb/nu_plugin_qr_maker/assets/30149519/1771961a-b06b-4310-81ed-63865e8d2f8e) + +## Installing + +* using [nupm](https://github.com/nushell/nupm) + +```bash +git clone https://github.com/FMotalleb/nu_plugin_qr_maker.git +nupm install --path nu_plugin_qr_maker -f +``` + +* or compile manually + +```bash +git clone https://github.com/FMotalleb/nu_plugin_qr_maker.git +cd nu_plugin_qr_maker +cargo build +register target/debug/nu_plugin_qr_maker +``` + +* or using cargo + +```bash +cargo install nu_plugin_qr_maker +register ~/.cargo/bin/nu_plugin_qr_maker +``` diff --git a/nu_plugin_qr_maker/build.nu b/nu_plugin_qr_maker/build.nu new file mode 100644 index 0000000..f2883e7 --- /dev/null +++ b/nu_plugin_qr_maker/build.nu @@ -0,0 +1,13 @@ +use std log + + +def main [package_file: path] { + let repo_root = $package_file | path dirname + let install_root = $env.NUPM_HOME | path join "plugins" + + let name = open ($repo_root | path join "Cargo.toml") | get package.name + let ext = if ($nu.os-info.name == 'windows') { '.exe' } else { '' } + cargo install --path $repo_root --root $install_root + nu --commands $"register ($install_root | path join "bin" $name)($ext)" + log info "do not forget to restart Nushell for the plugin to be fully available!" +} diff --git a/nu_plugin_qr_maker/nupm.nuon b/nu_plugin_qr_maker/nupm.nuon new file mode 100644 index 0000000..240e2b2 --- /dev/null +++ b/nu_plugin_qr_maker/nupm.nuon @@ -0,0 +1,7 @@ +{ + "name": "nu_plugin_qr_maker", + "version": "1.0.2", + "description": "A nushell plugin to create qr code in terminal", + "license": "LICENSE", + "type": "custom" +} \ No newline at end of file diff --git a/nu_plugin_qr_maker/src/main.rs b/nu_plugin_qr_maker/src/main.rs new file mode 100644 index 0000000..82dcab6 --- /dev/null +++ b/nu_plugin_qr_maker/src/main.rs @@ -0,0 +1,19 @@ +mod to_qr; +use crate::to_qr::ToQr; +pub struct QrPlugin; + +impl nu_plugin::Plugin for QrPlugin { + fn commands(&self) -> Vec>> { + vec![Box::new(ToQr::new())] + } + fn version(&self) -> String { + env!("CARGO_PKG_VERSION").into() + } +} + + + +fn main() { + nu_plugin::serve_plugin(&mut QrPlugin {}, nu_plugin::MsgPackSerializer {}) +} + diff --git a/nu_plugin_qr_maker/src/to_qr.rs b/nu_plugin_qr_maker/src/to_qr.rs new file mode 100644 index 0000000..2363f91 --- /dev/null +++ b/nu_plugin_qr_maker/src/to_qr.rs @@ -0,0 +1,54 @@ +use nu_plugin::{EngineInterface, EvaluatedCall, PluginCommand}; +use nu_protocol::{LabeledError, PipelineData, Signature, Type, Value}; +use qr2term::{qr, render}; +use qr2term::render::Renderer; +use crate::QrPlugin; + +pub struct ToQr ; +impl ToQr { + pub fn new() -> ToQr { + ToQr {} + } + fn generate_qr(val: String) -> Result { + let mut matrix = qr::Qr::from(val)?.to_matrix(); + // Padding and theme + matrix.surround(2, render::QrLight); + + // Render QR code to a String + let mut buf = Vec::new(); + Renderer::default() + .render(&matrix, &mut buf) + .expect("failed to generate QR code string"); + Ok(String::from_utf8(buf).unwrap()) + } +} +impl PluginCommand for ToQr { + type Plugin = QrPlugin; + + fn name(&self) -> &str { + "to qr" + } + + fn signature(&self) -> Signature { + Signature::build("to qr",) + .input_output_type(Type::String, Type::String) + } + + fn description(&self) -> &str { + "create qr code from given text. (to convert records into qr you must use `to json` before using `to qr`)" + } + + fn run(&self, _plugin: &Self::Plugin, _engine: &EngineInterface, call: &EvaluatedCall, input: PipelineData) -> Result { + match input { + PipelineData::Value(Value::String { val, .. }, ..) => return match Self::generate_qr(val) { + Ok(res) => Ok(PipelineData::Value(Value::string(res, call.head), None)), + Err(qr_err) => { + Err(LabeledError::new(format!("error when tried to create qr code: {}", qr_err))) + } + }, + _ => {} + } + return Err(LabeledError::new("please provide string in input of you want to export structured data convert them to json before converting to qr code")); + + } +} \ No newline at end of file