From 72af0d0f1b7d33e341d91c7e1a163b3ec2f18152 Mon Sep 17 00:00:00 2001 From: Zach Kelling Date: Thu, 26 Nov 2026 22:34:06 -0800 Subject: [PATCH] feat(hanzod): expose computer control at /v1/computer Testing: - cargo check -p hanzod and cargo test -p hanzod -- computer::tests pass (7 tests on lib and bin); full hanzod suite 50 passed, 1 unrelated flaky test filtered. - mcp computer_tool tests pass (3); a test hanzod on 127.0.0.1:39690 proved info, list_windows and screenshot; click without approval returned 403; audit.jsonl recorded actor/action/time/approved/outcome only. Risk: medium. Adds a loopback-only computer subsystem that reuses the existing macOS Quartz backend. Read ops are open; act ops require explicit approval evidence and are audited. No credential, pixel or typed text is logged. The running daemon was untouched. How to revert: git revert this commit. Co-authored-by: Hanzo Dev --- Cargo.lock | 2299 +++++++++++++++++++++++++++++++++++++--- Cargo.toml | 6 + daemon/Cargo.toml | 6 + daemon/src/computer.rs | 543 ++++++++++ daemon/src/daemon.rs | 14 +- daemon/src/http.rs | 2 +- daemon/src/lib.rs | 2 + daemon/src/main.rs | 2 + daemon/src/routes.rs | 2 + 9 files changed, 2753 insertions(+), 123 deletions(-) create mode 100644 daemon/src/computer.rs diff --git a/Cargo.lock b/Cargo.lock index 577a71e6a..eb4601e0d 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -18,18 +18,53 @@ dependencies = [ "generic-array", ] +[[package]] +name = "aes" +version = "0.9.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fc0fc36d7440d015b45468ba08a21e80e056ebbd014c611c6298bb7503e04bd1" +dependencies = [ + "cipher 0.5.2", + "cpubits", + "cpufeatures 0.3.1", +] + [[package]] name = "ahash" version = "0.8.12" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "5a15f179cd60c4584b8a8c596927aadc462e27f2ca70c04e0071964a73ba7a75" dependencies = [ - "cfg-if", + "cfg-if 1.0.4", "once_cell", "version_check", "zerocopy", ] +[[package]] +name = "aho-corasick" +version = "1.1.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c982642fa9e8606056828ee9a8505737230110bb1099153c79efe865c59d12ba" +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.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0e76a019e91224d279006ff972f1e984179a6e9feb050adba6ce8274aef23195" +dependencies = [ + "alloc-no-stdlib", +] + [[package]] name = "allocator-api2" version = "0.2.21" @@ -48,7 +83,7 @@ dependencies = [ "alloy-trie", "alloy-tx-macros", "auto_impl", - "derive_more", + "derive_more 2.1.1", "either", "k256", "once_cell", @@ -136,7 +171,7 @@ dependencies = [ "auto_impl", "borsh", "c-kzg", - "derive_more", + "derive_more 2.1.1", "either", "serde", "serde_with", @@ -156,7 +191,7 @@ dependencies = [ "alloy-primitives", "alloy-rlp", "auto_impl", - "derive_more", + "derive_more 2.1.1", "either", "sha2 0.10.9", ] @@ -169,9 +204,9 @@ checksum = "ce7b00f0cb42c66ec353076ded1dff1fbf818f6e0e26c40c8a8456c04483fca4" dependencies = [ "alloy-rlp", "bytes", - "cfg-if", + "cfg-if 1.0.4", "const-hex", - "derive_more", + "derive_more 2.1.1", "fixed-cache", "foldhash", "hashbrown 0.17.1", @@ -184,7 +219,7 @@ dependencies = [ "rand 0.9.5", "rapidhash", "ruint", - "rustc-hash", + "rustc-hash 2.1.3", "secp256k1", "serde", "sha3 0.11.0", @@ -231,7 +266,7 @@ checksum = "3f14b5d9b2c2173980202c6ff470d96e7c5e202c65a9f67884ad565226df7fbb" dependencies = [ "alloy-primitives", "alloy-rlp", - "derive_more", + "derive_more 2.1.1", "nybbles", "serde", "smallvec", @@ -251,6 +286,12 @@ dependencies = [ "syn 2.0.119", ] +[[package]] +name = "ambient-authority" +version = "0.0.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e9d4ee0d472d1cd2e28c97dfa124b3d8d992e10eb0a035f33f5d12e3a177ba3b" + [[package]] name = "android_system_properties" version = "0.1.6" @@ -701,7 +742,7 @@ dependencies = [ "asn1-rs-derive", "asn1-rs-impl", "displaydoc", - "nom", + "nom 7.1.3", "num-traits", "rusticata-macros", "thiserror 2.0.20", @@ -743,6 +784,17 @@ dependencies = [ "tokio", ] +[[package]] +name = "async-trait" +version = "0.1.92" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "82f6aeea286b8eb4dd3431a1be1b59d290ace00f5bfd8e2a159bc2a05e2c1667" +dependencies = [ + "proc-macro2", + "quote", + "syn 3.0.5", +] + [[package]] name = "atomic-waker" version = "1.1.2" @@ -806,6 +858,12 @@ version = "0.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4c7f02d4ea65f2c1853089ffd8d2787bdbc63de2f0d29dedbcf8ccdfa0ccd4cf" +[[package]] +name = "base64" +version = "0.21.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9d297deb1925b89f2ccc13d7635fa0714f12c87adce1c75356b39ca9b7178567" + [[package]] name = "base64" version = "0.22.1" @@ -897,6 +955,25 @@ dependencies = [ "wyz", ] +[[package]] +name = "blake3" +version = "1.8.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "64c0e36294adc8db531500e3f2b8ec75c4af9177271e9c6d33f93609d56e57cd" +dependencies = [ + "arrayvec", + "cc", + "cfg-if 1.0.4", + "constant_time_eq 0.6.2", + "cpufeatures 0.3.1", +] + +[[package]] +name = "block" +version = "0.1.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0d8c1fef690941d3e7788d328517591fecc684c084084702d6ff1641e993699a" + [[package]] name = "block-buffer" version = "0.10.4" @@ -915,6 +992,15 @@ dependencies = [ "hybrid-array", ] +[[package]] +name = "block-padding" +version = "0.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "710f1dd022ef4e93f8a438b4ba958de7f64308434fa6a87104481645cc30068b" +dependencies = [ + "hybrid-array", +] + [[package]] name = "blst" version = "0.3.17" @@ -927,6 +1013,29 @@ dependencies = [ "zeroize", ] +[[package]] +name = "bon" +version = "3.10.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a05442cd7005532d0cfedec676b5b9333d2b4c7c3afabe2b1a9ce2742fbe2ee6" +dependencies = [ + "bon-macros", +] + +[[package]] +name = "bon-macros" +version = "3.10.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "93833e97ac7c46ba97045afcf247238c27057538fcf2f06344662ddd5f567be6" +dependencies = [ + "darling 0.24.1", + "ident_case", + "prettyplease", + "proc-macro2", + "quote", + "syn 3.0.5", +] + [[package]] name = "borsh" version = "1.8.1" @@ -945,12 +1054,40 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "12cdfe656708a01f89b451a7d36466e6fe6c414de0aa18fc54f864f6f9ca9f56" dependencies = [ "once_cell", - "proc-macro-crate", + "proc-macro-crate 3.5.0", "proc-macro2", "quote", "syn 3.0.5", ] +[[package]] +name = "brotli-decompressor" +version = "5.0.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3a32acac15fe1967bc3986b2a6347dffc965602354ea6f450ad07e8bfd253583" +dependencies = [ + "alloc-no-stdlib", + "alloc-stdlib", +] + +[[package]] +name = "brush-parser" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9f64b19efc02f0dd6cac1d462e20a1098f425f09cb13624efbb1b7d63f061735" +dependencies = [ + "bon", + "cached", + "getrandom 0.4.3", + "indenter", + "insta", + "peg", + "thiserror 2.0.20", + "tracing", + "utf8-chars", + "uuid", +] + [[package]] name = "bs58" version = "0.5.1" @@ -960,6 +1097,16 @@ dependencies = [ "tinyvec", ] +[[package]] +name = "bstr" +version = "1.14.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a680398c10c7bc0488067c4612226ea905a85f607134b69f3068d505d58c4214" +dependencies = [ + "memchr", + "serde_core", +] + [[package]] name = "bumpalo" version = "3.20.3" @@ -1002,6 +1149,93 @@ dependencies = [ "serde", ] +[[package]] +name = "cached" +version = "0.59.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "53b6f5d101f0f6322c8646a45b7c581a673e476329040d97565815c2461dd0c4" +dependencies = [ + "ahash", + "cached_proc_macro", + "cached_proc_macro_types", + "hashbrown 0.16.1", + "once_cell", + "parking_lot 0.12.5", + "thiserror 2.0.20", + "web-time", +] + +[[package]] +name = "cached_proc_macro" +version = "0.27.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8ebcf9c75f17a17d55d11afc98e46167d4790a263f428891b8705ab2f793eca3" +dependencies = [ + "darling 0.20.11", + "proc-macro2", + "quote", + "syn 2.0.119", +] + +[[package]] +name = "cached_proc_macro_types" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ade8366b8bd5ba243f0a58f036cc0ca8a2f069cff1a2351ef1cac6b083e16fc0" + +[[package]] +name = "cap-primitives" +version = "4.0.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8b5f74729fd2f44701d1a8eb47e906cdb3ccd9ec0f02baad85a744b791940b18" +dependencies = [ + "ambient-authority", + "fs-set-times", + "io-extras", + "io-lifetimes 3.0.1", + "ipnet", + "maybe-owned", + "rustix 1.1.6", + "rustix-linux-procfs", + "windows-sys 0.61.2", + "winx", +] + +[[package]] +name = "cap-std" +version = "4.0.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c1ec78e242cfa2cfe276807ac2ecc00315a6c97786977414bcd1c3963b6c91b8" +dependencies = [ + "cap-primitives", + "io-extras", + "io-lifetimes 3.0.1", + "rustix 1.1.6", +] + +[[package]] +name = "cap-tempfile" +version = "4.0.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "038b3f6a5d4b5641b1bb99d638eb7a22013de84f81c528d8930de06d7383fbd5" +dependencies = [ + "cap-std", + "rand 0.9.5", + "rustix 1.1.6", + "rustix-linux-procfs", + "uuid", + "windows-sys 0.61.2", +] + +[[package]] +name = "cbc" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ce2dc9ee5f88d11e0beb842c88b33c8a5cf0d1329c4b19494af42b07dbfe8896" +dependencies = [ + "cipher 0.5.2", +] + [[package]] name = "cc" version = "1.4.5" @@ -1014,6 +1248,12 @@ dependencies = [ "shlex", ] +[[package]] +name = "cfg-if" +version = "0.1.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4785bdd1c96b2a846b2bd7cc02e86b6b3dbf14e7e53446c4f54c92a361040822" + [[package]] name = "cfg-if" version = "1.0.4" @@ -1032,8 +1272,8 @@ version = "0.9.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c3613f74bd2eac03dad61bd53dbe620703d4371614fe0bc3b9f04dd36fe4e818" dependencies = [ - "cfg-if", - "cipher", + "cfg-if 1.0.4", + "cipher 0.4.4", "cpufeatures 0.2.17", ] @@ -1043,7 +1283,7 @@ version = "0.10.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "65c35e4b699c7e15ccbe7ee35c005e4fc0a278d22238a2857e6ce2dadeda1b06" dependencies = [ - "cfg-if", + "cfg-if 1.0.4", "cpufeatures 0.3.1", "rand_core 0.10.1", ] @@ -1056,7 +1296,7 @@ checksum = "10cd79432192d1c0f4e1a0fef9527696cc039165d729fb41b3f4f4f354c2dc35" dependencies = [ "aead", "chacha20 0.9.1", - "cipher", + "cipher 0.4.4", "poly1305", "zeroize", ] @@ -1082,10 +1322,20 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "773f3b9af64447d2ce9850330c473515014aa235e6a783b02db81ff39e4a3dad" dependencies = [ "crypto-common 0.1.7", - "inout", + "inout 0.1.4", "zeroize", ] +[[package]] +name = "cipher" +version = "0.5.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e8cf2a2c93cd704877c0858356ed03480ff301ee950b43f1cbe4573b088bfa6c" +dependencies = [ + "crypto-common 0.2.2", + "inout 0.2.6", +] + [[package]] name = "clap" version = "4.6.7" @@ -1141,6 +1391,36 @@ version = "0.5.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0c9ea0ac24bc397ab3c98583a3c9ba74fa56b09a4449bbe172b9b1ddb016027a" +[[package]] +name = "cocoa" +version = "0.25.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f6140449f97a6e97f9511815c5632d84c8aacf8ac271ad77c559218161a1373c" +dependencies = [ + "bitflags 1.3.2", + "block", + "cocoa-foundation", + "core-foundation 0.9.4", + "core-graphics", + "foreign-types", + "libc", + "objc", +] + +[[package]] +name = "cocoa-foundation" +version = "0.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8c6234cbb2e4c785b456c0644748b1ac416dd045799740356f8363dfe00c93f7" +dependencies = [ + "bitflags 1.3.2", + "block", + "core-foundation 0.9.4", + "core-graphics-types", + "libc", + "objc", +] + [[package]] name = "colorchoice" version = "1.0.5" @@ -1174,13 +1454,24 @@ version = "0.4.34" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "2ebdda89edc534bf8d5dd2857562633b6495557e5846552ade994b99ed13c36a" +[[package]] +name = "console" +version = "0.16.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e96a4956774c13c126a8b5af4daa79384f4d826534c95a02d76afb39e2ab64e3" +dependencies = [ + "encode_unicode", + "libc", + "windows-sys 0.61.2", +] + [[package]] name = "const-hex" version = "1.19.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "33e2a781ebdf4467d1428dc4593067825fb646f6871475098d8577421af73558" dependencies = [ - "cfg-if", + "cfg-if 1.0.4", "cpufeatures 0.2.17", "proptest", "serde_core", @@ -1219,6 +1510,21 @@ dependencies = [ "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 = "constant_time_eq" +version = "0.6.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "144e7f1de087984240b7816d47f698b414979faa6f40839c5b86d6bd47db57b7" +dependencies = [ + "rustversion", +] + [[package]] name = "convert_case" version = "0.10.0" @@ -1228,6 +1534,16 @@ dependencies = [ "unicode-segmentation", ] +[[package]] +name = "core-foundation" +version = "0.9.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "91e195e091a93c46f7102ec7818a2aa394e1e1771c3ab4825963fa03e45afb8f" +dependencies = [ + "core-foundation-sys", + "libc", +] + [[package]] name = "core-foundation" version = "0.10.1" @@ -1244,12 +1560,42 @@ version = "0.8.7" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "773648b94d0e5d620f64f280777445740e61fe701025087ec8b57f45c791888b" +[[package]] +name = "core-graphics" +version = "0.23.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c07782be35f9e1140080c6b96f0d44b739e2278479f64e02fdab4e32dfd8b081" +dependencies = [ + "bitflags 1.3.2", + "core-foundation 0.9.4", + "core-graphics-types", + "foreign-types", + "libc", +] + +[[package]] +name = "core-graphics-types" +version = "0.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "45390e6114f68f718cc7a830514a96f903cccd70d02a8f6d9f643ac4ba45afaf" +dependencies = [ + "bitflags 1.3.2", + "core-foundation 0.9.4", + "libc", +] + [[package]] name = "core_detect" version = "1.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7f8f80099a98041a3d1622845c271458a2d73e688351bf3cb999266764b81d48" +[[package]] +name = "cpubits" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "15b85f9c39137c3a891689859392b1bd49812121d0d61c9caf00d46ed5ce06ae" + [[package]] name = "cpufeatures" version = "0.2.17" @@ -1289,9 +1635,34 @@ version = "1.5.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "2b929dd2a135771f40afabd1073f85eed59c800b7c61901e5c254270497dad64" dependencies = [ - "cfg-if", + "cfg-if 1.0.4", +] + +[[package]] +name = "crossbeam-deque" +version = "0.8.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "622f3fc73690be383c7214310406f28a90e6edeadc3cea882f9d71e495b9711a" +dependencies = [ + "crossbeam-epoch", + "crossbeam-utils", +] + +[[package]] +name = "crossbeam-epoch" +version = "0.9.21" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dc74980687109a3b14c72fd458107bf0baa1da1a1a805e178d15501ba9b86d9d" +dependencies = [ + "crossbeam-utils", ] +[[package]] +name = "crossbeam-utils" +version = "0.8.23" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a31eee39dddec8330830986fcd7625edb5a24ec90ea038215273bbc3adb08ac6" + [[package]] name = "crunchy" version = "0.2.4" @@ -1341,6 +1712,16 @@ dependencies = [ "cmov", ] +[[package]] +name = "darling" +version = "0.20.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fc7f46116c46ff9ab3eb1597a45688b6715c6e628b5c133e288e709a29bcb4ee" +dependencies = [ + "darling_core 0.20.11", + "darling_macro 0.20.11", +] + [[package]] name = "darling" version = "0.23.0" @@ -1361,6 +1742,20 @@ dependencies = [ "darling_macro 0.24.1", ] +[[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.119", +] + [[package]] name = "darling_core" version = "0.23.0" @@ -1387,6 +1782,17 @@ dependencies = [ "syn 3.0.5", ] +[[package]] +name = "darling_macro" +version = "0.20.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fc34b93ccb385b40dc71c6fceac4b2ad23662c7eeb248cf10d529b7e055b6ead" +dependencies = [ + "darling_core 0.20.11", + "quote", + "syn 2.0.119", +] + [[package]] name = "darling_macro" version = "0.23.0" @@ -1475,7 +1881,7 @@ checksum = "07da5016415d5a3c4dd39b11ed26f915f52fc4e0dc197d87908bc916e51bc1a6" dependencies = [ "asn1-rs", "displaydoc", - "nom", + "nom 7.1.3", "num-bigint", "num-traits", "rusticata-macros", @@ -1514,11 +1920,32 @@ dependencies = [ [[package]] name = "derive_more" -version = "2.1.1" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4a9b99b9cbbe49445b21764dc0625032a89b145a2642e67603e1c936f5458d05" +dependencies = [ + "derive_more-impl 1.0.0", +] + +[[package]] +name = "derive_more" +version = "2.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d751e9e49156b02b44f9c1815bcb94b984cdcc4396ecc32521c739452808b134" dependencies = [ - "derive_more-impl", + "derive_more-impl 2.1.1", +] + +[[package]] +name = "derive_more-impl" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cb7330aeadfbe296029522e6c40f315320aba36fc43a5b3632f3795348f3bd22" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.119", + "unicode-xid", ] [[package]] @@ -1592,6 +2019,16 @@ dependencies = [ "block-buffer 0.12.1", "const-oid 0.10.2", "crypto-common 0.2.2", + "ctutils", +] + +[[package]] +name = "directories" +version = "5.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9a49173b84e034382284f27f1af4dcbbd231ffa358c0fe316541a7337f376a35" +dependencies = [ + "dirs-sys", ] [[package]] @@ -1638,6 +2075,15 @@ version = "1.0.20" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d0881ea181b1df73ff77ffaaf9c7544ecc11e82fba9b5f27b262a3c73a332555" +[[package]] +name = "ecb" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "26f2a8b3e564eba0877223dc343703ad0385794e882e6d13f3a4dd5c6b1f41ac" +dependencies = [ + "cipher 0.5.2", +] + [[package]] name = "ecdsa" version = "0.16.9" @@ -1693,13 +2139,19 @@ dependencies = [ "zeroize", ] +[[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.44" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "89253175e704ab869b04f9db224d38630e0211a53841a79181deae0889e169f5" dependencies = [ - "cfg-if", + "cfg-if 1.0.4", "core_detect", "multiversion_no_op", "rustversion", @@ -1727,6 +2179,19 @@ dependencies = [ "syn 3.0.5", ] +[[package]] +name = "env_logger" +version = "0.10.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4cd405aab171cb85d6735e5c8d9db038c17d3ca007a4d2c25f337935c3d90580" +dependencies = [ + "humantime", + "is-terminal", + "log", + "regex", + "termcolor", +] + [[package]] name = "equivalent" version = "1.0.2" @@ -1799,7 +2264,7 @@ version = "0.2.30" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e1255e7a9f1902190d4c10a75f2f7f495d3d3ce13e9ba26e6c48683a0f4dbed7" dependencies = [ - "cfg-if", + "cfg-if 1.0.4", "libc", ] @@ -1854,6 +2319,33 @@ version = "0.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "77ce24cb58228fbb8aa041425bb1050850ac19177686ea6e0f41a70416f56fdb" +[[package]] +name = "foreign-types" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d737d9aa519fb7b749cbc3b962edcf310a8dd1f4b67c91c4f83975dbdd17d965" +dependencies = [ + "foreign-types-macros", + "foreign-types-shared", +] + +[[package]] +name = "foreign-types-macros" +version = "0.2.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ea5190182e6915eb873ddbc16e23b711b6eb1f9c00a0d0a3a91b5f6228475225" +dependencies = [ + "proc-macro2", + "quote", + "syn 3.0.5", +] + +[[package]] +name = "foreign-types-shared" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "aa9a19cbb55df58761df49b23516a86d432839add4af60fc256da840f66ed35b" + [[package]] name = "form_urlencoded" version = "1.2.3" @@ -1863,6 +2355,27 @@ dependencies = [ "percent-encoding", ] +[[package]] +name = "fs-set-times" +version = "0.20.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "94e7099f6313ecacbe1256e8ff9d617b75d1bcb16a6fddef94866d225a01a14a" +dependencies = [ + "io-lifetimes 2.0.4", + "rustix 1.1.6", + "windows-sys 0.52.0", +] + +[[package]] +name = "fs2" +version = "0.4.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9564fc758e15025b46aa6643b1b77d047d1a56a1aea6e01002ac0c7026876213" +dependencies = [ + "libc", + "winapi", +] + [[package]] name = "fs_extra" version = "1.3.0" @@ -1875,6 +2388,21 @@ version = "2.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e6d5a32815ae3f33302d95fdcb2ce17862f8c65363dcfd29360480ba1001fc9c" +[[package]] +name = "futures" +version = "0.3.34" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9a31d2a3fbaaeb2af2368bbdd904aa8e812d3c04a1ee10d3171f52d556e5d0a3" +dependencies = [ + "futures-channel", + "futures-core", + "futures-executor", + "futures-io", + "futures-sink", + "futures-task", + "futures-util", +] + [[package]] name = "futures-channel" version = "0.3.34" @@ -1891,12 +2419,34 @@ version = "0.3.34" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "92d699e522242e69e3003b94ecc1f960f3a5e015aa7c5d7486e65ad01dd94f5e" +[[package]] +name = "futures-executor" +version = "0.3.34" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "031b47cf1a3c6cc8bc2fc76cd437f521619387907d469316e7c0bc278f1f5432" +dependencies = [ + "futures-core", + "futures-task", + "futures-util", +] + [[package]] name = "futures-io" version = "0.3.34" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "53c0fa8157de1303bfffdaa1cc2a673bfffb60102f76b0ef4441659124373fed" +[[package]] +name = "futures-macro" +version = "0.3.34" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9fb9654ba8355388abeb8dcb4fc62f511300867002afc858860463bdd9fe0c44" +dependencies = [ + "proc-macro2", + "quote", + "syn 3.0.5", +] + [[package]] name = "futures-sink" version = "0.3.34" @@ -1915,8 +2465,10 @@ version = "0.3.34" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0d50a92467f8ba5dd6e3ee5d4bd04d73ab2e4e1c44474a0674821dfce14b79bc" dependencies = [ + "futures-channel", "futures-core", "futures-io", + "futures-macro", "futures-sink", "futures-task", "memchr", @@ -1935,13 +2487,22 @@ dependencies = [ "zeroize", ] +[[package]] +name = "getopts" +version = "0.2.24" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cfe4fbac503b8d1f88e6676011885f34b7174f46e59956bba534ba83abded4df" +dependencies = [ + "unicode-width", +] + [[package]] name = "getrandom" version = "0.2.17" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ff2abc00be7fca6ebc474524697ae276ad847ad0a6b3faa4bcb027e9a4614ad0" dependencies = [ - "cfg-if", + "cfg-if 1.0.4", "js-sys", "libc", "wasi", @@ -1954,7 +2515,7 @@ version = "0.3.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "899def5c37c4fd7b2664648c28120ecec138e4d395b459e5ca34f9cce2dd77fd" dependencies = [ - "cfg-if", + "cfg-if 1.0.4", "libc", "r-efi 5.3.0", "wasip2", @@ -1966,7 +2527,7 @@ version = "0.4.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "300e883d756b2e4ec94e02791f39b04b522276138852cfc41d9fb7e904106099" dependencies = [ - "cfg-if", + "cfg-if 1.0.4", "js-sys", "libc", "r-efi 6.0.0", @@ -1980,6 +2541,19 @@ version = "0.3.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e4eba85ea1d0a966a983acd07deee566e67395d2d96b6fb39e62b5a833f1eb0b" +[[package]] +name = "globset" +version = "0.4.22" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "71217a07f20b48b4938c14203b77b610f8a7fa6762c3f75394a10c5f31e5aee0" +dependencies = [ + "aho-corasick", + "bstr", + "log", + "regex-automata", + "regex-syntax", +] + [[package]] name = "group" version = "0.13.0" @@ -1991,6 +2565,25 @@ dependencies = [ "subtle", ] +[[package]] +name = "h2" +version = "0.3.27" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0beca50380b1fc32983fc1cb4587bfa4bb9e78fc259aad4a0032d2080309222d" +dependencies = [ + "bytes", + "fnv", + "futures-core", + "futures-sink", + "futures-util", + "http 0.2.12", + "indexmap 2.14.2", + "slab", + "tokio", + "tokio-util 0.7.20", + "tracing", +] + [[package]] name = "h2" version = "0.4.20" @@ -2002,14 +2595,26 @@ dependencies = [ "fnv", "futures-core", "futures-sink", - "http", + "http 1.5.0", "indexmap 2.14.2", "slab", "tokio", - "tokio-util", + "tokio-util 0.7.20", "tracing", ] +[[package]] +name = "hanzo-actions" +version = "0.1.0" +source = "git+https://github.com/hanzoai/mcp.git?rev=5ac75825bbdbce909f89abc3793d981ca0535b5d#5ac75825bbdbce909f89abc3793d981ca0535b5d" +dependencies = [ + "regex", + "reqwest 0.11.27", + "serde", + "serde_json", + "sha2 0.10.9", +] + [[package]] name = "hanzo-chain" version = "0.2.6" @@ -2024,7 +2629,7 @@ source = "git+https://github.com/hanzoai/cli?rev=287bcbd78185b382a4561eabaccf620 dependencies = [ "httpdate", "rand 0.8.8", - "reqwest", + "reqwest 0.12.28", "rustls-native-certs", "serde", "serde_json", @@ -2037,7 +2642,7 @@ name = "hanzo-client" version = "0.1.1" source = "git+https://github.com/hanzoai/cli?rev=695b57aae6abc21dcdfc3bf6a6d61ed965be8af3#695b57aae6abc21dcdfc3bf6a6d61ed965be8af3" dependencies = [ - "reqwest", + "reqwest 0.12.28", "serde", "serde_json", "thiserror 2.0.20", @@ -2057,14 +2662,14 @@ dependencies = [ "hanzo-client 0.1.1 (git+https://github.com/hanzoai/cli?rev=695b57aae6abc21dcdfc3bf6a6d61ed965be8af3)", "libc", "rand 0.8.8", - "reqwest", + "reqwest 0.12.28", "serde", "serde_json", "sha2 0.10.9", "tar", "tempfile", "tokio", - "toml", + "toml 0.8.23", "tracing", "which", ] @@ -2083,14 +2688,14 @@ dependencies = [ "hanzo-client 0.1.1 (git+https://github.com/hanzoai/cli?rev=287bcbd78185b382a4561eabaccf620d7c05781f)", "libc", "rand 0.8.8", - "reqwest", + "reqwest 0.12.28", "serde", "serde_json", "sha2 0.10.9", "tar", "tempfile", "tokio", - "toml", + "toml 0.8.23", "tracing", "which", ] @@ -2104,10 +2709,93 @@ dependencies = [ "base64 0.22.1", "dirs", "hanzo-gen 0.1.3", - "reqwest", + "reqwest 0.12.28", + "serde", + "serde_json", + "toml 0.8.23", +] + +[[package]] +name = "hanzo-mcp" +version = "1.1.40" +source = "git+https://github.com/hanzoai/mcp.git?rev=5ac75825bbdbce909f89abc3793d981ca0535b5d#5ac75825bbdbce909f89abc3793d981ca0535b5d" +dependencies = [ + "anyhow", + "async-trait", + "base64 0.21.7", + "blake3", + "chrono", + "clap", + "cocoa", + "constant_time_eq 0.3.1", + "dirs", + "env_logger", + "getrandom 0.2.17", + "glob", + "hanzo-actions", + "hanzo-shell", + "hanzo-trigram", + "jsonrpc-core", + "jsonrpc-derive", + "jsonrpc-http-server", + "log", + "nix 0.29.0", + "objc", + "once_cell", + "rayon", + "regex", + "reqwest 0.11.27", + "serde", + "serde_json", + "serde_yaml", + "sha2 0.10.9", + "shell-escape", + "shellexpand", + "tempfile", + "thiserror 1.0.69", + "tokio", + "tokio-util 0.7.20", + "toml 0.8.23", + "tree-sitter", + "tree-sitter-c", + "tree-sitter-cpp", + "tree-sitter-go", + "tree-sitter-java", + "tree-sitter-javascript", + "tree-sitter-python", + "tree-sitter-rust", + "tree-sitter-typescript", + "walkdir", + "which", + "winapi", + "windows-sys 0.61.2", + "x11", + "zapd", +] + +[[package]] +name = "hanzo-shell" +version = "0.1.0" +source = "git+https://github.com/hanzoai/mcp.git?rev=5ac75825bbdbce909f89abc3793d981ca0535b5d#5ac75825bbdbce909f89abc3793d981ca0535b5d" +dependencies = [ + "brush-parser", + "rustpython-ast", + "rustpython-parser", "serde", "serde_json", - "toml", +] + +[[package]] +name = "hanzo-trigram" +version = "0.1.0" +source = "git+https://github.com/hanzoai/mcp.git?rev=5ac75825bbdbce909f89abc3793d981ca0535b5d#5ac75825bbdbce909f89abc3793d981ca0535b5d" +dependencies = [ + "globset", + "memchr", + "rayon", + "regex", + "serde", + "tgrep-core", ] [[package]] @@ -2122,6 +2810,7 @@ dependencies = [ "hanzo-chain", "hanzo-gen 0.2.0", "hanzo-identity", + "hanzo-mcp", "jsonwebtoken", "libc", "rusqlite", @@ -2131,7 +2820,8 @@ dependencies = [ "steward", "tempfile", "tokio", - "toml", + "toml 0.8.23", + "tree-sitter", "ureq", "wtransport", "zaphttp", @@ -2161,6 +2851,17 @@ dependencies = [ "allocator-api2", ] +[[package]] +name = "hashbrown" +version = "0.16.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "841d1cc9bed7f9236f321df977030373f4a4163ae1a7dbfe1a51a2c1a51d9100" +dependencies = [ + "allocator-api2", + "equivalent", + "foldhash", +] + [[package]] name = "hashbrown" version = "0.17.1" @@ -2226,6 +2927,15 @@ dependencies = [ "digest 0.10.7", ] +[[package]] +name = "hmac" +version = "0.13.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6303bc9732ae41b04cb554b844a762b4115a61bfaa81e3e83050991eeb56863f" +dependencies = [ + "digest 0.11.3", +] + [[package]] name = "home" version = "0.5.12" @@ -2241,6 +2951,17 @@ version = "0.3.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1a9fcbcc408c5526c3ab80d534e5c86e7967c1fb7aa0a8c76abd1edc27deb877" +[[package]] +name = "http" +version = "0.2.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "601cbb57e577e2f5ef5be8e7b83f0f63994f25aa94d673e54a92d5c516d101f1" +dependencies = [ + "bytes", + "fnv", + "itoa", +] + [[package]] name = "http" version = "1.5.0" @@ -2251,6 +2972,17 @@ dependencies = [ "itoa", ] +[[package]] +name = "http-body" +version = "0.4.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7ceab25649e9960c0311ea418d17bee82c0dcec1bd053b5f9a66e265a693bed2" +dependencies = [ + "bytes", + "http 0.2.12", + "pin-project-lite", +] + [[package]] name = "http-body" version = "1.1.0" @@ -2258,7 +2990,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ca2a8f2913ee65f60facd6a5905613afaa448497a0230cc41ce022d93290bc2c" dependencies = [ "bytes", - "http", + "http 1.5.0", ] [[package]] @@ -2269,8 +3001,8 @@ checksum = "23169fe34a5fbcdd3f3862e78fb9b6fccd5f02a6dc6f732547005d45631ce71c" dependencies = [ "bytes", "futures-core", - "http", - "http-body", + "http 1.5.0", + "http-body 1.1.0", "pin-project-lite", ] @@ -2286,6 +3018,12 @@ version = "1.0.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "df3b46402a9d5adb4c86a0cf463f42e19994e3ee891101b1841f30a545cb49a9" +[[package]] +name = "humantime" +version = "2.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "15cdd26707701c53297e2fa6afb323d55fbc1d0810c3aec078ae3ef0424c3c15" + [[package]] name = "hybrid-array" version = "0.4.14" @@ -2296,6 +3034,30 @@ dependencies = [ "typenum", ] +[[package]] +name = "hyper" +version = "0.14.32" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "41dfc780fdec9373c01bae43289ea34c972e40ee3c9f6b3c8801a35f35586ce7" +dependencies = [ + "bytes", + "futures-channel", + "futures-core", + "futures-util", + "h2 0.3.27", + "http 0.2.12", + "http-body 0.4.6", + "httparse", + "httpdate", + "itoa", + "pin-project-lite", + "socket2 0.5.10", + "tokio", + "tower-service", + "tracing", + "want", +] + [[package]] name = "hyper" version = "1.12.0" @@ -2306,9 +3068,9 @@ dependencies = [ "bytes", "futures-channel", "futures-core", - "h2", - "http", - "http-body", + "h2 0.4.20", + "http 1.5.0", + "http-body 1.1.0", "httparse", "itoa", "pin-project-lite", @@ -2317,18 +3079,32 @@ dependencies = [ "want", ] +[[package]] +name = "hyper-rustls" +version = "0.24.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ec3efd23720e2049821a693cbc7e65ea87c72f1c58ff2f9522ff332b1491e590" +dependencies = [ + "futures-util", + "http 0.2.12", + "hyper 0.14.32", + "rustls 0.21.12", + "tokio", + "tokio-rustls 0.24.1", +] + [[package]] name = "hyper-rustls" version = "0.27.10" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "dfa8e654703247911e29c23fbeaa261834bd9bb74efba2f9acddc37bfb127f53" dependencies = [ - "http", - "hyper", + "http 1.5.0", + "hyper 1.12.0", "hyper-util", - "rustls", + "rustls 0.23.44", "tokio", - "tokio-rustls", + "tokio-rustls 0.26.6", "tower-service", "webpki-roots 1.0.12", ] @@ -2343,15 +3119,15 @@ dependencies = [ "bytes", "futures-channel", "futures-util", - "http", - "http-body", + "http 1.5.0", + "http-body 1.1.0", "httparse", - "hyper", + "hyper 1.12.0", "ipnet", "libc", "percent-encoding", "pin-project-lite", - "socket2", + "socket2 0.6.5", "tokio", "tower-service", "tracing", @@ -2491,6 +3267,21 @@ dependencies = [ "icu_properties", ] +[[package]] +name = "ignore" +version = "0.4.25" +source = "git+https://github.com/hanzoai/tgrep?rev=68555338dfd28a28aaf0fae21dc812780fa94ab7#68555338dfd28a28aaf0fae21dc812780fa94ab7" +dependencies = [ + "crossbeam-deque", + "globset", + "log", + "memchr", + "regex-automata", + "same-file", + "walkdir", + "winapi-util", +] + [[package]] name = "impl-codec" version = "0.6.0" @@ -2511,6 +3302,12 @@ dependencies = [ "syn 2.0.119", ] +[[package]] +name = "indenter" +version = "0.3.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "964de6e86d545b246d84badc0fef527924ace5134f30641c203ef52ba83f58d5" + [[package]] name = "indexmap" version = "1.9.3" @@ -2544,10 +3341,89 @@ dependencies = [ ] [[package]] -name = "ipnet" -version = "2.12.2" +name = "inout" +version = "0.2.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "791930b43c0d5973160d90a8f3894509f2b273430f5c5c73b668636d0287c5c0" +checksum = "3a580c13f0ffc335ef42dd3f6b1a41b726051c5e1656d9a3aa6fddb3c5dfbbf9" +dependencies = [ + "block-padding", + "hybrid-array", +] + +[[package]] +name = "insta" +version = "1.49.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b67d3d2e287e4b86c10b3f3b641033d1f89b74bdb39d05f34952e2b9a6fe21cd" +dependencies = [ + "console", + "once_cell", + "pest", + "pest_derive", + "serde", + "similar", + "tempfile", +] + +[[package]] +name = "instant" +version = "0.1.13" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e0242819d153cba4b4b05a5a8f2a7e9bbf97b6055b2a002b395c96b5ff3c0222" +dependencies = [ + "cfg-if 1.0.4", +] + +[[package]] +name = "io-extras" +version = "0.19.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "20fd6de4ccfcc187e38bc21cfa543cb5a302cb86a8b114eb7f0bf0dc9f8ac00f" +dependencies = [ + "io-lifetimes 3.0.1", + "windows-sys 0.52.0", +] + +[[package]] +name = "io-lifetimes" +version = "2.0.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "06432fb54d3be7964ecd3649233cddf80db2832f47fec34c01f65b3d9d774983" + +[[package]] +name = "io-lifetimes" +version = "3.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2f0fb0570afe1fed943c5c3d4102d5358592d8625fda6a0007fdbe65a92fba96" + +[[package]] +name = "ipnet" +version = "2.12.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "791930b43c0d5973160d90a8f3894509f2b273430f5c5c73b668636d0287c5c0" + +[[package]] +name = "is-macro" +version = "0.3.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8267aa6001e25494f3015f9663bbd88a18240c74483afa5f0934a1b3e4c388e9" +dependencies = [ + "heck", + "proc-macro2", + "quote", + "syn 2.0.119", +] + +[[package]] +name = "is-terminal" +version = "0.4.17" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3640c1c38b8e4e43584d8df18be5fc6b0aa314ce6ebf51b53313d4306cca8e46" +dependencies = [ + "hermit-abi", + "libc", + "windows-sys 0.52.0", +] [[package]] name = "is_terminal_polyfill" @@ -2564,6 +3440,15 @@ dependencies = [ "either", ] +[[package]] +name = "itertools" +version = "0.11.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b1c173a5686ce8bfa551b3563d0c2170bf24ca44da99c7ca4bfdab5418c3fe57" +dependencies = [ + "either", +] + [[package]] name = "itertools" version = "0.13.0" @@ -2648,11 +3533,72 @@ version = "0.3.105" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ce57d20d1ea864ce2ac172ab472d409214f4fd359f0b2a2775abdf522e2af99e" dependencies = [ - "cfg-if", + "cfg-if 1.0.4", "futures-util", "wasm-bindgen", ] +[[package]] +name = "jsonrpc-core" +version = "18.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "14f7f76aef2d054868398427f6c54943cf3d1caa9a7ec7d0c38d69df97a965eb" +dependencies = [ + "futures", + "futures-executor", + "futures-util", + "log", + "serde", + "serde_derive", + "serde_json", +] + +[[package]] +name = "jsonrpc-derive" +version = "18.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5b939a78fa820cdfcb7ee7484466746a7377760970f6f9c6fe19f9edcc8a38d2" +dependencies = [ + "proc-macro-crate 0.1.5", + "proc-macro2", + "quote", + "syn 1.0.109", +] + +[[package]] +name = "jsonrpc-http-server" +version = "18.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e1dea6e07251d9ce6a552abfb5d7ad6bc290a4596c8dcc3d795fae2bbdc1f3ff" +dependencies = [ + "futures", + "hyper 0.14.32", + "jsonrpc-core", + "jsonrpc-server-utils", + "log", + "net2", + "parking_lot 0.11.2", + "unicase", +] + +[[package]] +name = "jsonrpc-server-utils" +version = "18.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fa4fdea130485b572c39a460d50888beb00afb3e35de23ccd7fad8ff19f0e0d4" +dependencies = [ + "bytes", + "futures", + "globset", + "jsonrpc-core", + "lazy_static", + "log", + "tokio", + "tokio-stream", + "tokio-util 0.6.10", + "unicase", +] + [[package]] name = "jsonwebtoken" version = "9.3.1" @@ -2674,7 +3620,7 @@ version = "0.13.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f6e3919bbaa2945715f0bb6d3934a173d1e9a59ac23767fbaaef277265a7411b" dependencies = [ - "cfg-if", + "cfg-if 1.0.4", "ecdsa", "elliptic-curve", "once_cell", @@ -2696,7 +3642,7 @@ version = "0.2.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d8f198d1db720e4940b5a493201d199d9f24f568f8f746bd13706243a2f71598" dependencies = [ - "cfg-if", + "cfg-if 1.0.4", "cpufeatures 0.3.1", ] @@ -2735,6 +3681,12 @@ version = "0.2.19" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a4933f3f57a8e9d9da04db23fb153356ecaf00cbd14aee46279c33dc80925c37" +[[package]] +name = "lalrpop-util" +version = "0.20.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "507460a910eb7b32ee961886ff48539633b788a36b65692b95f225b844c82553" + [[package]] name = "lazy_static" version = "1.5.1" @@ -2806,6 +3758,33 @@ version = "0.4.34" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f9f8bd3e56ce4dfc153cf470fffbfa98c7620958b312ca5c3a4b8d5181fd13c6" +[[package]] +name = "lopdf" +version = "0.45.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bfffda0fe1ab0157e1a13c14bebd3f28671f2fccb7922f0722ec53926e6922d3" +dependencies = [ + "aes", + "bitflags 2.13.1", + "brotli-decompressor", + "cbc", + "ecb", + "encoding_rs", + "flate2", + "getrandom 0.4.3", + "indexmap 2.14.2", + "itoa", + "log", + "md-5", + "nom 8.0.0", + "rand 0.10.4", + "rangemap", + "sha2 0.11.1", + "stringprep", + "thiserror 2.0.20", + "weezl", +] + [[package]] name = "lru-slab" version = "0.1.3" @@ -2857,19 +3836,111 @@ dependencies = [ "rcgen 0.13.2", "revm", "ripemd", - "rustls", + "rustls 0.23.44", "serde_json", "sha2 0.10.9", "sha3 0.10.9", "zstd", ] +[[package]] +name = "malachite" +version = "0.4.22" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2fbdf9cb251732db30a7200ebb6ae5d22fe8e11397364416617d2c2cf0c51cb5" +dependencies = [ + "malachite-base", + "malachite-nz", + "malachite-q", +] + +[[package]] +name = "malachite-base" +version = "0.4.22" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5ea0ed76adf7defc1a92240b5c36d5368cfe9251640dcce5bd2d0b7c1fd87aeb" +dependencies = [ + "hashbrown 0.14.5", + "itertools 0.11.0", + "libm", + "ryu", +] + +[[package]] +name = "malachite-bigint" +version = "0.2.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d149aaa2965d70381709d9df4c7ee1fc0de1c614a4efc2ee356f5e43d68749f8" +dependencies = [ + "derive_more 1.0.0", + "malachite", + "num-integer", + "num-traits", + "paste", +] + +[[package]] +name = "malachite-nz" +version = "0.4.22" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "34a79feebb2bc9aa7762047c8e5495269a367da6b5a90a99882a0aeeac1841f7" +dependencies = [ + "itertools 0.11.0", + "libm", + "malachite-base", +] + +[[package]] +name = "malachite-q" +version = "0.4.22" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "50f235d5747b1256b47620f5640c2a17a88c7569eebdf27cd9cb130e1a619191" +dependencies = [ + "itertools 0.11.0", + "malachite-base", + "malachite-nz", +] + +[[package]] +name = "malloc_buf" +version = "0.0.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "62bb907fe88d54d8d9ce32a3cceab4218ed2f6b7d35617cafe9adf84e43919cb" +dependencies = [ + "libc", +] + +[[package]] +name = "maybe-owned" +version = "0.3.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4facc753ae494aeb6e3c22f839b158aebd4f9270f55cd3c79906c45476c47ab4" + +[[package]] +name = "md-5" +version = "0.11.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "69b6441f590336821bb897fb28fc622898ccceb1d6cea3fde5ea86b090c4de98" +dependencies = [ + "cfg-if 1.0.4", + "digest 0.11.3", +] + [[package]] name = "memchr" version = "2.8.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "cf8baf1c55e62ffcace7a9f06f4bd9cd3f0c4beb022d3b367256b91b87513d98" +[[package]] +name = "memmap2" +version = "0.9.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6b0ca1155a9ecc25aa12e8313a119f32edf0255fea2f44839c4ac0a12b2ac157" +dependencies = [ + "libc", +] + [[package]] name = "mime" version = "0.3.18" @@ -2949,6 +4020,41 @@ version = "1.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "743fb55ba31b18fb1ecef6bdc9aa2743314978ac084044301a7eee33fb99a20d" +[[package]] +name = "net2" +version = "0.2.39" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b13b648036a2339d06de780866fbdfda0dde886de7b3af2ddeba8b14f4ee34ac" +dependencies = [ + "cfg-if 0.1.10", + "libc", + "winapi", +] + +[[package]] +name = "nix" +version = "0.29.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "71e2746dc3a24dd78b3cfcb7be93368c6de9963d30f43a6a73998a9cf4b17b46" +dependencies = [ + "bitflags 2.13.1", + "cfg-if 1.0.4", + "cfg_aliases", + "libc", +] + +[[package]] +name = "nix" +version = "0.32.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "77730ed34f01f4990cb2ea67fec715ecebc6fab9a6396cf83c5529b13f581bdc" +dependencies = [ + "bitflags 2.13.1", + "cfg-if 1.0.4", + "cfg_aliases", + "libc", +] + [[package]] name = "nom" version = "7.1.3" @@ -2959,6 +4065,15 @@ dependencies = [ "minimal-lexical", ] +[[package]] +name = "nom" +version = "8.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "df9761775871bdef83bee530e60050f7e54b1105350d6884eb0fb4f46c2f9405" +dependencies = [ + "memchr", +] + [[package]] name = "num" version = "0.4.3" @@ -3064,7 +4179,7 @@ version = "0.7.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "680998035259dcfcafe653688bf2aa6d3e2dc05e98be6ab46afb089dc84f1df8" dependencies = [ - "proc-macro-crate", + "proc-macro-crate 3.5.0", "proc-macro2", "quote", "syn 2.0.119", @@ -3077,13 +4192,22 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0d49ff0c0d00d4a502b39df9af3a525e1efeb14b9dabb5bb83335284c1309210" dependencies = [ "alloy-rlp", - "cfg-if", + "cfg-if 1.0.4", "proptest", "ruint", "serde", "smallvec", ] +[[package]] +name = "objc" +version = "0.2.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "915b1b472bc21c53464d6c8461c9d3af805ba1ef837e1cac254428f4a77177b1" +dependencies = [ + "malloc_buf", +] + [[package]] name = "octets" version = "0.3.7" @@ -3163,12 +4287,23 @@ version = "3.7.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "34b4653168b563151153c9e4c08ebed57fb8262bebfa79711552fa983c623e7a" dependencies = [ - "proc-macro-crate", + "proc-macro-crate 3.5.0", "proc-macro2", "quote", "syn 2.0.119", ] +[[package]] +name = "parking_lot" +version = "0.11.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7d17b78036a60663b797adeaee46f5c9dfebb86948d1255007a1d6be0271ff99" +dependencies = [ + "instant", + "lock_api", + "parking_lot_core 0.8.6", +] + [[package]] name = "parking_lot" version = "0.12.5" @@ -3176,7 +4311,21 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "93857453250e3077bd71ff98b6a65ea6621a19bb0f559a85248955ac12c45a1a" dependencies = [ "lock_api", - "parking_lot_core", + "parking_lot_core 0.9.12", +] + +[[package]] +name = "parking_lot_core" +version = "0.8.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "60a2cfe6f0ad2bfc16aefa463b497d5c7a5ecd44a23efa72aa342d90177356dc" +dependencies = [ + "cfg-if 1.0.4", + "instant", + "libc", + "redox_syscall 0.2.16", + "smallvec", + "winapi", ] [[package]] @@ -3185,9 +4334,9 @@ version = "0.9.12" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "2621685985a2ebf1c516881c026032ac7deafcda1a2c9b7850dc81e3dfcb64c1" dependencies = [ - "cfg-if", + "cfg-if 1.0.4", "libc", - "redox_syscall", + "redox_syscall 0.5.18", "smallvec", "windows-link", ] @@ -3198,6 +4347,33 @@ version = "1.0.15" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "57c0d7b74b563b49d38dae00a0c37d4d6de9b432382b2892f0574ddcae73fd0a" +[[package]] +name = "peg" +version = "0.8.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0aad070be5b63aa72103f2fcdd70a83adbd5e90112ce5b574171ff1c65501773" +dependencies = [ + "peg-macros", + "peg-runtime", +] + +[[package]] +name = "peg-macros" +version = "0.8.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ddd8ef6825cae95355031ae26a99b616a2a21f22ba2de0197c43dfb05acbe7ee" +dependencies = [ + "peg-runtime", + "proc-macro2", + "quote", +] + +[[package]] +name = "peg-runtime" +version = "0.8.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7011d97b484a5ebdc4b1fdb3b12d5e4bbbea56e9d22b688f2e79e04b65a7d8a6" + [[package]] name = "pem" version = "3.0.6" @@ -3233,6 +4409,47 @@ dependencies = [ "ucd-trie", ] +[[package]] +name = "pest_derive" +version = "2.9.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "89cc5a242e25ed4e7704d0be240f2cfbe20a8c27e7e252d94835be93d92dc39f" +dependencies = [ + "pest", + "pest_generator", +] + +[[package]] +name = "pest_generator" +version = "2.9.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7abf21475cc3820fe4b2ca2dc2142902f67a02189f3b5b3a229f4febc01a43e5" +dependencies = [ + "pest", + "pest_meta", + "proc-macro2", + "quote", + "syn 2.0.119", +] + +[[package]] +name = "pest_meta" +version = "2.9.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "adba4db388f687393c18c51348d44a41d870ca9df71a2c98172ea3035dc6936e" +dependencies = [ + "pest", +] + +[[package]] +name = "phf" +version = "0.11.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1fd6780a80ae0c52cc120a26a1a42c1ae51b247a253e4e06113d23d2c2edd078" +dependencies = [ + "phf_shared 0.11.3", +] + [[package]] name = "phf" version = "0.13.1" @@ -3240,10 +4457,30 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c1562dc717473dbaa4c1f85a36410e03c047b2e7df7f45ee938fbef64ae7fadf" dependencies = [ "phf_macros", - "phf_shared", + "phf_shared 0.13.1", "serde", ] +[[package]] +name = "phf_codegen" +version = "0.11.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "aef8048c789fa5e851558d709946d6d79a8ff88c0440c587967f8e94bfb1216a" +dependencies = [ + "phf_generator 0.11.3", + "phf_shared 0.11.3", +] + +[[package]] +name = "phf_generator" +version = "0.11.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3c80231409c20246a13fddb31776fb942c38553c51e871f8cbd687a4cfb5843d" +dependencies = [ + "phf_shared 0.11.3", + "rand 0.8.8", +] + [[package]] name = "phf_generator" version = "0.13.1" @@ -3251,7 +4488,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "135ace3a761e564ec88c03a77317a7c6b80bb7f7135ef2544dbe054243b89737" dependencies = [ "fastrand", - "phf_shared", + "phf_shared 0.13.1", ] [[package]] @@ -3260,13 +4497,22 @@ version = "0.13.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "812f032b54b1e759ccd5f8b6677695d5268c588701effba24601f6932f8269ef" dependencies = [ - "phf_generator", - "phf_shared", + "phf_generator 0.13.1", + "phf_shared 0.13.1", "proc-macro2", "quote", "syn 2.0.119", ] +[[package]] +name = "phf_shared" +version = "0.11.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "67eabc2ef2a60eb7faa00097bd1ffdb5bd28e62bf39990626a582201b7a754e5" +dependencies = [ + "siphasher", +] + [[package]] name = "phf_shared" version = "0.13.1" @@ -3358,6 +4604,16 @@ dependencies = [ "zerocopy", ] +[[package]] +name = "prettyplease" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2bfe0f4c752e450fc2faf62654f1c134747922825d5b04ca717b8874f41a40c0" +dependencies = [ + "proc-macro2", + "syn 3.0.5", +] + [[package]] name = "primeorder" version = "0.13.6" @@ -3378,6 +4634,15 @@ dependencies = [ "uint", ] +[[package]] +name = "proc-macro-crate" +version = "0.1.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1d6ea3c4595b96363c13943497db34af4460fb474a95c43f4446ad341b8c9785" +dependencies = [ + "toml 0.5.11", +] + [[package]] name = "proc-macro-crate" version = "3.5.0" @@ -3411,6 +4676,15 @@ dependencies = [ "unarray", ] +[[package]] +name = "quick-xml" +version = "0.42.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "41b1177fdf999d2321d3fb46ff47159d9c1fb9ad66a4879f8c50a0b504615e9b" +dependencies = [ + "memchr", +] + [[package]] name = "quinn" version = "0.11.12" @@ -3422,9 +4696,9 @@ dependencies = [ "pin-project-lite", "quinn-proto", "quinn-udp", - "rustc-hash", - "rustls", - "socket2", + "rustc-hash 2.1.3", + "rustls 0.23.44", + "socket2 0.6.5", "thiserror 2.0.20", "tokio", "tracing", @@ -3444,8 +4718,8 @@ dependencies = [ "rand 0.10.4", "rand_pcg", "ring", - "rustc-hash", - "rustls", + "rustc-hash 2.1.3", + "rustls 0.23.44", "rustls-pki-types", "slab", "thiserror 2.0.20", @@ -3463,7 +4737,7 @@ dependencies = [ "cfg_aliases", "libc", "once_cell", - "socket2", + "socket2 0.6.5", "tracing", "windows-sys 0.61.2", ] @@ -3591,6 +4865,12 @@ dependencies = [ "rand_core 0.9.5", ] +[[package]] +name = "rangemap" +version = "1.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f2d43a8c8c74056248124068fde0df374d1ddf9039e747d190f01c36faeaab08" + [[package]] name = "rapidhash" version = "4.5.1" @@ -3600,6 +4880,26 @@ dependencies = [ "rustversion", ] +[[package]] +name = "rayon" +version = "1.12.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fb39b166781f92d482534ef4b4b1b2568f42613b53e5b6c160e24cfbfa30926d" +dependencies = [ + "either", + "rayon-core", +] + +[[package]] +name = "rayon-core" +version = "1.13.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "22e18b0f0062d30d4230b2e85ff77fdfe4326feb054b9783a3460d8435c8ab91" +dependencies = [ + "crossbeam-deque", + "crossbeam-utils", +] + [[package]] name = "rcgen" version = "0.13.2" @@ -3619,11 +4919,20 @@ version = "0.14.10" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8774e05a7d0de114588e6a28fe7e71694b82614ed569d86d8b389dfbc98b8ad8" dependencies = [ - "aws-lc-rs", - "rustls-pki-types", - "time", - "x509-parser", - "yasna 0.6.0", + "aws-lc-rs", + "rustls-pki-types", + "time", + "x509-parser", + "yasna 0.6.0", +] + +[[package]] +name = "redox_syscall" +version = "0.2.16" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fb5a58c1855b4b6819d59012155603f0b22ad30cad752600aadfcb695265519a" +dependencies = [ + "bitflags 1.3.2", ] [[package]] @@ -3666,12 +4975,76 @@ dependencies = [ "syn 3.0.5", ] +[[package]] +name = "regex" +version = "1.13.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f020237b6c8eed93db2e2cb53c00c60a8e1bc73da7d073199a1180401450218d" +dependencies = [ + "aho-corasick", + "memchr", + "regex-automata", + "regex-syntax", +] + +[[package]] +name = "regex-automata" +version = "0.4.18" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ad8553b9b26413251cbf30e620595c7a41b3887f03da04579c0e6b0d6a06b4b2" +dependencies = [ + "aho-corasick", + "memchr", + "regex-syntax", +] + [[package]] name = "regex-syntax" version = "0.8.11" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d6f6ff9a378485b298a5286656da665ba74413d36db0979633275d2e708145d4" +[[package]] +name = "reqwest" +version = "0.11.27" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dd67538700a17451e7cba03ac727fb961abb7607553461627b97de0b89cf4a62" +dependencies = [ + "base64 0.21.7", + "bytes", + "encoding_rs", + "futures-core", + "futures-util", + "h2 0.3.27", + "http 0.2.12", + "http-body 0.4.6", + "hyper 0.14.32", + "hyper-rustls 0.24.2", + "ipnet", + "js-sys", + "log", + "mime", + "once_cell", + "percent-encoding", + "pin-project-lite", + "rustls 0.21.12", + "rustls-pemfile", + "serde", + "serde_json", + "serde_urlencoded", + "sync_wrapper 0.1.2", + "system-configuration", + "tokio", + "tokio-rustls 0.24.1", + "tower-service", + "url", + "wasm-bindgen", + "wasm-bindgen-futures", + "web-sys", + "webpki-roots 0.25.4", + "winreg", +] + [[package]] name = "reqwest" version = "0.12.28" @@ -3684,12 +5057,12 @@ dependencies = [ "futures-channel", "futures-core", "futures-util", - "h2", - "http", - "http-body", + "h2 0.4.20", + "http 1.5.0", + "http-body 1.1.0", "http-body-util", - "hyper", - "hyper-rustls", + "hyper 1.12.0", + "hyper-rustls 0.27.10", "hyper-util", "js-sys", "log", @@ -3697,14 +5070,14 @@ dependencies = [ "percent-encoding", "pin-project-lite", "quinn", - "rustls", + "rustls 0.23.44", "rustls-pki-types", "serde", "serde_json", "serde_urlencoded", - "sync_wrapper", + "sync_wrapper 1.0.2", "tokio", - "tokio-rustls", + "tokio-rustls 0.26.6", "tower", "tower-http", "tower-service", @@ -3741,7 +5114,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e86e468df3cf5cf59fa7ef71a3e9ccabb76bb336401ea2c0674f563104cf3c5e" dependencies = [ "bitvec", - "phf", + "phf 0.13.1", "revm-primitives", "serde", ] @@ -3753,7 +5126,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9eb1f0a76b14d684a444fc52f7bf6b7564bf882599d91ee62e76d602e7a187c7" dependencies = [ "bitvec", - "cfg-if", + "cfg-if 1.0.4", "derive-where", "revm-bytecode", "revm-context-interface", @@ -3872,7 +5245,7 @@ dependencies = [ "aurora-engine-modexp", "blst", "c-kzg", - "cfg-if", + "cfg-if 1.0.4", "k256", "p256", "revm-primitives", @@ -3912,7 +5285,7 @@ version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f8dd2a808d456c4a54e300a23e9f5a67e122c3024119acbfd73e3bf664491cb2" dependencies = [ - "hmac", + "hmac 0.12.1", "subtle", ] @@ -3923,7 +5296,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a4689e6c2294d81e88dc6261c768b63bc4fcdb852be6d1352498b114f61383b7" dependencies = [ "cc", - "cfg-if", + "cfg-if 1.0.4", "getrandom 0.2.17", "libc", "untrusted 0.9.0", @@ -3998,6 +5371,12 @@ dependencies = [ "smallvec", ] +[[package]] +name = "rustc-hash" +version = "1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "08d43f7aa6b08d49f382cde6a7982047c3426db949b1424bc4b7ec9ae12c6ce2" + [[package]] name = "rustc-hash" version = "2.1.3" @@ -4034,7 +5413,7 @@ version = "4.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "faf0c4a6ece9950b9abdb62b1cfcf2a68b3b67a10ba445b3bb85be2a293d0632" dependencies = [ - "nom", + "nom 7.1.3", ] [[package]] @@ -4063,6 +5442,28 @@ dependencies = [ "windows-sys 0.61.2", ] +[[package]] +name = "rustix-linux-procfs" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2fc84bf7e9aa16c4f2c758f27412dc9841341e16aa682d9c7ac308fe3ee12056" +dependencies = [ + "once_cell", + "rustix 1.1.6", +] + +[[package]] +name = "rustls" +version = "0.21.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3f56a14d1f48b391359b22f731fd4bd7e43c97f3c50eee276f3aa09c94784d3e" +dependencies = [ + "log", + "ring", + "rustls-webpki 0.101.7", + "sct", +] + [[package]] name = "rustls" version = "0.23.44" @@ -4074,7 +5475,7 @@ dependencies = [ "once_cell", "ring", "rustls-pki-types", - "rustls-webpki", + "rustls-webpki 0.103.15", "subtle", "zeroize", ] @@ -4091,6 +5492,15 @@ dependencies = [ "security-framework", ] +[[package]] +name = "rustls-pemfile" +version = "1.0.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1c74cae0a4cf6ccbbf5f359f08efdf8ee7e1dc532573bf0db71968cb56b1448c" +dependencies = [ + "base64 0.21.7", +] + [[package]] name = "rustls-pki-types" version = "1.15.1" @@ -4101,6 +5511,16 @@ dependencies = [ "zeroize", ] +[[package]] +name = "rustls-webpki" +version = "0.101.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8b6275d1ee7a1cd780b64aca7726599a1dbc893b1e64144529e55c3c2f745765" +dependencies = [ + "ring", + "untrusted 0.9.0", +] + [[package]] name = "rustls-webpki" version = "0.103.15" @@ -4113,6 +5533,63 @@ dependencies = [ "untrusted 0.9.0", ] +[[package]] +name = "rustpython-ast" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4cdaf8ee5c1473b993b398c174641d3aa9da847af36e8d5eb8291930b72f31a5" +dependencies = [ + "is-macro", + "malachite-bigint", + "rustpython-parser-core", + "static_assertions", +] + +[[package]] +name = "rustpython-parser" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "868f724daac0caf9bd36d38caf45819905193a901e8f1c983345a68e18fb2abb" +dependencies = [ + "anyhow", + "is-macro", + "itertools 0.11.0", + "lalrpop-util", + "log", + "malachite-bigint", + "num-traits", + "phf 0.11.3", + "phf_codegen", + "rustc-hash 1.1.0", + "rustpython-ast", + "rustpython-parser-core", + "tiny-keccak", + "unic-emoji-char", + "unic-ucd-ident", + "unicode_names2", +] + +[[package]] +name = "rustpython-parser-core" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b4b6c12fa273825edc7bccd9a734f0ad5ba4b8a2f4da5ff7efe946f066d0f4ad" +dependencies = [ + "is-macro", + "memchr", + "rustpython-parser-vendored", +] + +[[package]] +name = "rustpython-parser-vendored" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "04fcea49a4630a3a5d940f4d514dc4f575ed63c14c3e3ed07146634aed7f67a6" +dependencies = [ + "memchr", + "once_cell", +] + [[package]] name = "rustversion" version = "1.0.23" @@ -4125,6 +5602,15 @@ version = "1.0.23" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9774ba4a74de5f7b1c1451ed6cd5285a32eddb5cccb8cc655a4e50009e06477f" +[[package]] +name = "same-file" +version = "1.0.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "93fc1dc3aaa9bfed95e02e6eadabb4baf7e3078b0bd1b4d7b6b0b68378900502" +dependencies = [ + "winapi-util", +] + [[package]] name = "schannel" version = "0.1.30" @@ -4164,6 +5650,16 @@ version = "1.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "94143f37725109f92c262ed2cf5e59bce7498c01bcc1502d7b9afe439a4e9f49" +[[package]] +name = "sct" +version = "0.7.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "da046153aa2352493d6cb7da4b6e5c0c057d8a1d0a9aa8560baffdd945acd414" +dependencies = [ + "ring", + "untrusted 0.9.0", +] + [[package]] name = "sec1" version = "0.7.3" @@ -4205,7 +5701,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b7f4bc775c73d9a02cde8bf7b2ec4c9d12743edf609006c7facc23998404cd1d" dependencies = [ "bitflags 2.13.1", - "core-foundation", + "core-foundation 0.10.1", "core-foundation-sys", "libc", "security-framework-sys", @@ -4343,13 +5839,37 @@ dependencies = [ "syn 3.0.5", ] +[[package]] +name = "serde_yaml" +version = "0.9.34+deprecated" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6a8b1a1a2ebf674015cc02edccce75287f1a0130d394307b36743c2f5d504b47" +dependencies = [ + "indexmap 2.14.2", + "itoa", + "ryu", + "serde", + "unsafe-libyaml", +] + +[[package]] +name = "sha1" +version = "0.11.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "aacc4cc499359472b4abe1bf11d0b12e688af9a805fa5e3016f9a386dc2d0214" +dependencies = [ + "cfg-if 1.0.4", + "cpufeatures 0.3.1", + "digest 0.11.3", +] + [[package]] name = "sha2" version = "0.10.9" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a7507d819769d01a365ab707794a4084392c824f54a7a6a7862f8c3d0892b283" dependencies = [ - "cfg-if", + "cfg-if 1.0.4", "cpufeatures 0.2.17", "digest 0.10.7", ] @@ -4360,7 +5880,7 @@ version = "0.11.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "47d7069beb7d6ac7b9acd1039986e73443f24234f41074da099d6f994ac9ad19" dependencies = [ - "cfg-if", + "cfg-if 1.0.4", "cpufeatures 0.3.1", "digest 0.11.3", ] @@ -4392,7 +5912,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a6287fd675f713484342a89cbf0a386abef5f15919cfad607e5e1f19e1e15331" dependencies = [ "cc", - "cfg-if", + "cfg-if 1.0.4", ] [[package]] @@ -4406,6 +5926,21 @@ dependencies = [ "sponge-cursor", ] +[[package]] +name = "shell-escape" +version = "0.1.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "45bb67a18fa91266cc7807181f62f9178a6873bfad7dc788c42e6430db40184f" + +[[package]] +name = "shellexpand" +version = "3.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "32824fab5e16e6c4d86dc1ba84489390419a39f97699852b66480bb87d297ed8" +dependencies = [ + "dirs", +] + [[package]] name = "shlex" version = "2.0.1" @@ -4454,6 +5989,12 @@ version = "0.1.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e3a9fe34e3e7a50316060351f37187a3f546bce95496156754b601a5fa71b76e" +[[package]] +name = "similar" +version = "2.7.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bbbb5d9659141646ae647b42fe094daf6c6192d1620870b449d9557f748b2daa" + [[package]] name = "simple_asn1" version = "0.6.4" @@ -4484,6 +6025,16 @@ version = "1.16.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b9be42f50aa861c555654aa3a37f52f4b1074bacf4e48fe0ef7fa584e80f1f0f" +[[package]] +name = "socket2" +version = "0.5.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e22376abed350d73dd1cd119b57ffccad95b4e585a7cda43e286245ce23c0678" +dependencies = [ + "libc", + "windows-sys 0.52.0", +] + [[package]] name = "socket2" version = "0.6.5" @@ -4545,6 +6096,17 @@ dependencies = [ "ureq", ] +[[package]] +name = "stringprep" +version = "0.1.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7b4df3d392d81bd458a8a621b8bffbd2302a12ffe288a9d931670948749463b1" +dependencies = [ + "unicode-bidi", + "unicode-normalization", + "unicode-properties", +] + [[package]] name = "strsim" version = "0.11.1" @@ -4590,6 +6152,12 @@ dependencies = [ "unicode-ident", ] +[[package]] +name = "sync_wrapper" +version = "0.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2047c6ded9c721764247e62cd3b03c09ffc529b2ba5b10ec482ae507a4a70160" + [[package]] name = "sync_wrapper" version = "1.0.2" @@ -4621,6 +6189,27 @@ dependencies = [ "syn 3.0.5", ] +[[package]] +name = "system-configuration" +version = "0.5.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ba3a3adc5c275d719af8cb4272ea1c4a6d668a777f37e115f6d11ddbc1c8e0e7" +dependencies = [ + "bitflags 1.3.2", + "core-foundation 0.9.4", + "system-configuration-sys", +] + +[[package]] +name = "system-configuration-sys" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a75fb188eb626b924683e3b95e3a48e63551fcfb51949de2f06a9d91dbee93c9" +dependencies = [ + "core-foundation-sys", + "libc", +] + [[package]] name = "tap" version = "1.0.1" @@ -4645,12 +6234,54 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "32497e9a4c7b38532efcdebeef879707aa9f794296a4f0244f6f69e9bc8574bd" dependencies = [ "fastrand", - "getrandom 0.4.3", + "getrandom 0.3.4", "once_cell", "rustix 1.1.6", "windows-sys 0.61.2", ] +[[package]] +name = "termcolor" +version = "1.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "06794f8f6c5c898b3275aebefa6b8a1cb24cd2c6c79397ab15774837a0bc5755" +dependencies = [ + "winapi-util", +] + +[[package]] +name = "tgrep-core" +version = "1.2.1" +source = "git+https://github.com/hanzoai/tgrep?rev=68555338dfd28a28aaf0fae21dc812780fa94ab7#68555338dfd28a28aaf0fae21dc812780fa94ab7" +dependencies = [ + "anyhow", + "blake3", + "cap-std", + "cap-tempfile", + "encoding_rs", + "flate2", + "fs2", + "getrandom 0.4.3", + "globset", + "ignore", + "libc", + "lopdf", + "memchr", + "memmap2", + "quick-xml", + "rayon", + "regex", + "regex-syntax", + "rusqlite", + "same-file", + "serde", + "serde_json", + "tar", + "tempfile", + "windows-sys 0.61.2", + "zip", +] + [[package]] name = "thiserror" version = "1.0.69" @@ -4730,6 +6361,15 @@ dependencies = [ "time-core", ] +[[package]] +name = "tiny-keccak" +version = "2.0.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2c9d3793400a45f954c52e73d068316d76b6f4e36977e3fcebb13a2721e80237" +dependencies = [ + "crunchy", +] + [[package]] name = "tinystr" version = "0.8.5" @@ -4764,32 +6404,79 @@ dependencies = [ "bytes", "libc", "mio", - "parking_lot", + "parking_lot 0.12.5", "pin-project-lite", "signal-hook-registry", - "socket2", + "socket2 0.6.5", "tokio-macros", "windows-sys 0.61.2", ] [[package]] -name = "tokio-macros" -version = "2.7.2" +name = "tokio-macros" +version = "2.7.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "78773a2a397f451582ce068015985c33193cf6dea8b74d2a639fe457b2f07b0e" +dependencies = [ + "proc-macro2", + "quote", + "syn 3.0.5", +] + +[[package]] +name = "tokio-rustls" +version = "0.24.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c28327cf380ac148141087fbfb9de9d7bd4e84ab5d2c28fbc911d753de8a7081" +dependencies = [ + "rustls 0.21.12", + "tokio", +] + +[[package]] +name = "tokio-rustls" +version = "0.26.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c9cc2678c2cdd569ef8215e2afd7954ada2ae20b4fdd2c5fe6139a3b02d105db" +dependencies = [ + "rustls 0.23.44", + "tokio", +] + +[[package]] +name = "tokio-stream" +version = "0.1.19" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a3d06f0b082ba57c26b79407372e57cf2a1e28124f78e9479fe80322cf53420b" +dependencies = [ + "futures-core", + "pin-project-lite", + "tokio", +] + +[[package]] +name = "tokio-tungstenite" +version = "0.30.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "78773a2a397f451582ce068015985c33193cf6dea8b74d2a639fe457b2f07b0e" +checksum = "17a073bfed563fa236697a068031408a93cd9522e08abf9933ead3e73411bd71" dependencies = [ - "proc-macro2", - "quote", - "syn 3.0.5", + "futures-util", + "log", + "tokio", + "tungstenite", ] [[package]] -name = "tokio-rustls" -version = "0.26.6" +name = "tokio-util" +version = "0.6.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c9cc2678c2cdd569ef8215e2afd7954ada2ae20b4fdd2c5fe6139a3b02d105db" +checksum = "36943ee01a6d67977dd3f84a5a1d2efeb4ada3a1ae771cadfaa535d9d9fc6507" dependencies = [ - "rustls", + "bytes", + "futures-core", + "futures-sink", + "log", + "pin-project-lite", "tokio", ] @@ -4807,6 +6494,15 @@ dependencies = [ "tokio", ] +[[package]] +name = "toml" +version = "0.5.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f4f7f0dd8d50a853a531c426359045b1998f04219d88799810762cd4ad314234" +dependencies = [ + "serde", +] + [[package]] name = "toml" version = "0.8.23" @@ -4887,7 +6583,7 @@ dependencies = [ "futures-core", "futures-util", "pin-project-lite", - "sync_wrapper", + "sync_wrapper 1.0.2", "tokio", "tower-layer", "tower-service", @@ -4904,12 +6600,12 @@ dependencies = [ "bytes", "futures-core", "futures-util", - "http", - "http-body", + "http 1.5.0", + "http-body 1.1.0", "http-body-util", "pin-project-lite", "tokio", - "tokio-util", + "tokio-util 0.7.20", "tower", "tower-layer", "tower-service", @@ -4969,12 +6665,124 @@ dependencies = [ "tracing-core", ] +[[package]] +name = "tree-sitter" +version = "0.20.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e747b1f9b7b931ed39a548c1fae149101497de3c1fc8d9e18c62c1a66c683d3d" +dependencies = [ + "cc", + "regex", +] + +[[package]] +name = "tree-sitter-c" +version = "0.20.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fa1bb73a4101c88775e4fefcd0543ee25e192034484a5bd45cb99eefb997dca9" +dependencies = [ + "cc", + "tree-sitter", +] + +[[package]] +name = "tree-sitter-cpp" +version = "0.20.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1c88fd925d0333e63ac64e521f5bd79c53019e569ffbbccfeef346a326f459e9" +dependencies = [ + "cc", + "tree-sitter", +] + +[[package]] +name = "tree-sitter-go" +version = "0.20.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1ad6d11f19441b961af2fda7f12f5d0dac325f6d6de83836a1d3750018cc5114" +dependencies = [ + "cc", + "tree-sitter", +] + +[[package]] +name = "tree-sitter-java" +version = "0.20.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2adc5696bf5abf761081d7457d2bb82d0e3b28964f4214f63fd7e720ef462653" +dependencies = [ + "cc", + "tree-sitter", +] + +[[package]] +name = "tree-sitter-javascript" +version = "0.20.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2490fab08630b2c8943c320f7b63473cbf65511c8d83aec551beb9b4375906ed" +dependencies = [ + "cc", + "tree-sitter", +] + +[[package]] +name = "tree-sitter-python" +version = "0.20.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f47ebd9cac632764b2f4389b08517bf2ef895431dd163eb562e3d2062cc23a14" +dependencies = [ + "cc", + "tree-sitter", +] + +[[package]] +name = "tree-sitter-rust" +version = "0.20.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9cd01f349407afa65b764fd78d59821aaa6257a207550f6270fc60d9c3d8607f" +dependencies = [ + "cc", + "tree-sitter", +] + +[[package]] +name = "tree-sitter-typescript" +version = "0.20.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a75049f0aafabb2aac205d7bb24da162b53dcd0cfb326785f25a2f32efa8071a" +dependencies = [ + "cc", + "tree-sitter", +] + [[package]] name = "try-lock" version = "0.2.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e421abadd41a4225275504ea4d6566923418b7f05506fbc9c0fe86ba7396114b" +[[package]] +name = "tungstenite" +version = "0.30.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e48ac77174b19c110a50ab2128b24215ac9cb40e0e12e093fb602d175c569d22" +dependencies = [ + "bytes", + "data-encoding", + "http 1.5.0", + "httparse", + "log", + "rand 0.10.4", + "sha1", + "thiserror 2.0.20", +] + +[[package]] +name = "typed-path" +version = "0.13.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9ce898823d8cd0f028662d2f349694b1af0a5cc9be83f1d213a00d3147445e1e" + [[package]] name = "typenum" version = "1.20.1" @@ -5005,24 +6813,131 @@ version = "0.1.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "eaea85b334db583fe3274d12b4cd1880032beab409c0d774be044d4480ab9a94" +[[package]] +name = "unic-char-property" +version = "0.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a8c57a407d9b6fa02b4795eb81c5b6652060a15a7903ea981f3d723e6c0be221" +dependencies = [ + "unic-char-range", +] + +[[package]] +name = "unic-char-range" +version = "0.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0398022d5f700414f6b899e10b8348231abf9173fa93144cbc1a43b9793c1fbc" + +[[package]] +name = "unic-common" +version = "0.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "80d7ff825a6a654ee85a63e80f92f054f904f21e7d12da4e22f9834a4aaa35bc" + +[[package]] +name = "unic-emoji-char" +version = "0.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0b07221e68897210270a38bde4babb655869637af0f69407f96053a34f76494d" +dependencies = [ + "unic-char-property", + "unic-char-range", + "unic-ucd-version", +] + +[[package]] +name = "unic-ucd-ident" +version = "0.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e230a37c0381caa9219d67cf063aa3a375ffed5bf541a452db16e744bdab6987" +dependencies = [ + "unic-char-property", + "unic-char-range", + "unic-ucd-version", +] + +[[package]] +name = "unic-ucd-version" +version = "0.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "96bd2f2237fe450fcd0a1d2f5f4e91711124f7857ba2e964247776ebeeb7b0c4" +dependencies = [ + "unic-common", +] + +[[package]] +name = "unicase" +version = "2.10.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "357cc3acc6a036009fd6c973ed009037c732d60d0b4f6c673e9041497482a28f" + +[[package]] +name = "unicode-bidi" +version = "0.3.18" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5c1cb5db39152898a79168971543b1cb5020dff7fe43c8dc468b0885f5e29df5" + [[package]] name = "unicode-ident" version = "1.0.24" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e6e4313cd5fcd3dad5cafa179702e2b244f760991f45397d14d4ebf38247da75" +[[package]] +name = "unicode-normalization" +version = "0.1.26" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "75cd3fb03d5288b3ba9a1ee103ac7e9cbb59f0b03d64f8ddfcc04dd42758a85d" +dependencies = [ + "tinyvec", +] + +[[package]] +name = "unicode-properties" +version = "0.1.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "993ad287eb20e8ba755312801cfe1413e0f25d604075863acaddca10b04c1833" + [[package]] name = "unicode-segmentation" version = "1.13.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c6f5d3c3b1bf09027a88a6bc961fc00497d651009560b5463668dc81b0fa87a8" +[[package]] +name = "unicode-width" +version = "0.2.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ca718471876992059f251e33aafc334346ada08042b7661dd1fe313a9bced557" + [[package]] name = "unicode-xid" version = "0.2.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ebc1c04c71510c7f702b52b7c350734c9ff1295c464a03335b00bb84fc54f853" +[[package]] +name = "unicode_names2" +version = "1.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d1673eca9782c84de5f81b82e4109dcfb3611c8ba0d52930ec4a9478f547b2dd" +dependencies = [ + "phf 0.11.3", + "unicode_names2_generator", +] + +[[package]] +name = "unicode_names2_generator" +version = "1.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b91e5b84611016120197efd7dc93ef76774f4e084cd73c9fb3ea4a86c570c56e" +dependencies = [ + "getopts", + "log", + "phf_codegen", + "rand 0.8.8", +] + [[package]] name = "universal-hash" version = "0.5.1" @@ -5033,6 +6948,12 @@ dependencies = [ "subtle", ] +[[package]] +name = "unsafe-libyaml" +version = "0.2.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "673aac59facbab8a9007c7f6108d11f63b603f7cabff99fabf650fea5c32b861" + [[package]] name = "untrusted" version = "0.7.1" @@ -5055,7 +6976,7 @@ dependencies = [ "flate2", "log", "once_cell", - "rustls", + "rustls 0.23.44", "rustls-pki-types", "serde", "serde_json", @@ -5075,6 +6996,15 @@ dependencies = [ "serde", ] +[[package]] +name = "utf8-chars" +version = "3.0.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "92498c67ea3511b37eccff13b573ed871faf0ce9c4056ab032bd01a681f445a0" +dependencies = [ + "arrayvec", +] + [[package]] name = "utf8_iter" version = "1.1.0" @@ -5096,6 +7026,17 @@ version = "1.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3a3b425286980a367278453f3b6d28cdcb134b574e5a35824a6ff5eebad50bb6" +[[package]] +name = "uuid" +version = "1.29.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3c14b15dffa2f4bd712103e857140aa04a4f2ff6e955c77d7eb8e53ee02a3b64" +dependencies = [ + "getrandom 0.4.3", + "js-sys", + "wasm-bindgen", +] + [[package]] name = "valuable" version = "0.1.1" @@ -5114,6 +7055,16 @@ version = "0.9.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0b928f33d975fc6ad9f86c8f283853ad26bdd5b10b7f1542aa2fa15e2289105a" +[[package]] +name = "walkdir" +version = "2.5.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b42e295b7452c4604982280d8586001fcad9b8b201cac67bca9771e7a7475403" +dependencies = [ + "same-file", + "winapi-util", +] + [[package]] name = "want" version = "0.3.2" @@ -5144,7 +7095,7 @@ version = "0.2.128" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "aecb87a33d3b0c5e3b7aa46336eaf486cffafbd281b195e4c8b80d50df2351bf" dependencies = [ - "cfg-if", + "cfg-if 1.0.4", "once_cell", "rustversion", "wasm-bindgen-macro", @@ -5213,6 +7164,12 @@ dependencies = [ "wasm-bindgen", ] +[[package]] +name = "webpki-roots" +version = "0.25.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5f20c57d8d7db6d3b86154206ae5d8fba62dd39573114de97c2cb0578251f8e1" + [[package]] name = "webpki-roots" version = "0.26.11" @@ -5231,6 +7188,12 @@ dependencies = [ "rustls-pki-types", ] +[[package]] +name = "weezl" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d4ca08e5ef825b65b056d9efbd95c8750683f0a6d0466d02e96dc2e4e360f3d2" + [[package]] name = "which" version = "6.0.3" @@ -5243,6 +7206,37 @@ dependencies = [ "winsafe", ] +[[package]] +name = "winapi" +version = "0.3.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5c839a674fcd7a98952e593242ea400abe93992746761e38641405d28b00f419" +dependencies = [ + "winapi-i686-pc-windows-gnu", + "winapi-x86_64-pc-windows-gnu", +] + +[[package]] +name = "winapi-i686-pc-windows-gnu" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ac3b87c63620426dd9b991e5ce0329eff545bccbbb34f3be09ff6fb6ab51b7b6" + +[[package]] +name = "winapi-util" +version = "0.1.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c2a7b1c03c876122aa43f3020e6c3c3ee5c05081c9a00739faf7503aeba10d22" +dependencies = [ + "windows-sys 0.48.0", +] + +[[package]] +name = "winapi-x86_64-pc-windows-gnu" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f" + [[package]] name = "windows-core" version = "0.62.2" @@ -5468,12 +7462,32 @@ dependencies = [ "memchr", ] +[[package]] +name = "winreg" +version = "0.50.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "524e57b2c537c0f9b1e69f1965311ec12182b4122e45035b1508cd24d2adadb1" +dependencies = [ + "cfg-if 1.0.4", + "windows-sys 0.48.0", +] + [[package]] name = "winsafe" version = "0.0.19" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d135d17ab770252ad95e9a872d365cf3090e3be864a34ab46f48555993efc904" +[[package]] +name = "winx" +version = "0.36.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3f3fd376f71958b862e7afb20cfe5a22830e1963462f3a17f49d82a6c1d1f42d" +dependencies = [ + "bitflags 2.13.1", + "windows-sys 0.52.0", +] + [[package]] name = "wit-bindgen" version = "0.57.1" @@ -5496,11 +7510,11 @@ dependencies = [ "pem", "quinn", "rcgen 0.14.10", - "rustls", + "rustls 0.23.44", "rustls-native-certs", "rustls-pki-types", "sha2 0.11.1", - "socket2", + "socket2 0.6.5", "thiserror 2.0.20", "time", "tokio", @@ -5531,6 +7545,16 @@ dependencies = [ "tap", ] +[[package]] +name = "x11" +version = "2.21.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "502da5464ccd04011667b11c435cb992822c2c0dbde1770c988480d312a0db2e" +dependencies = [ + "libc", + "pkg-config", +] + [[package]] name = "x509-parser" version = "0.18.1" @@ -5542,7 +7566,7 @@ dependencies = [ "data-encoding", "der-parser", "lazy_static", - "nom", + "nom 7.1.3", "oid-registry", "rusticata-macros", "thiserror 2.0.20", @@ -5601,6 +7625,24 @@ dependencies = [ "synstructure 0.14.0", ] +[[package]] +name = "zapd" +version = "1.1.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3f02c7ff011e853d1ed6723782a40d6f4cbb70c109e9e4ed85317ce358a60c22" +dependencies = [ + "directories", + "futures-util", + "getrandom 0.4.3", + "hmac 0.13.0", + "libc", + "sha2 0.11.1", + "tokio", + "tokio-tungstenite", + "tracing", + "windows-sys 0.61.2", +] + [[package]] name = "zaphttp" version = "0.1.0" @@ -5703,6 +7745,25 @@ dependencies = [ "syn 3.0.5", ] +[[package]] +name = "zip" +version = "9.8.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2d8dbe089cf6b0448b78f5fc50139ab5aaa40d08ac07cdc1baf2c13add35fcce" +dependencies = [ + "constant_time_eq 0.6.2", + "crc32fast", + "flate2", + "getrandom 0.4.3", + "indexmap 2.14.2", + "libc", + "memchr", + "nix 0.32.0", + "typed-path", + "windows-sys 0.61.2", + "zeroize", +] + [[package]] name = "zlib-rs" version = "0.6.8" diff --git a/Cargo.toml b/Cargo.toml index 82acbaab4..717d382ce 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -2,6 +2,12 @@ resolver = "2" members = ["chain", "chain/steward", "daemon", "zap"] +# hanzo-mcp's in-process search engine pulls tgrep-core, which asks for a newer +# git rusqlite. hanzod's Dev store links libsqlite3-sys 0.30; a second SQLite +# cannot be linked into one binary, so resolve both to the same rusqlite. +[patch."https://github.com/rusqlite/rusqlite.git"] +rusqlite = "=0.32.1" + [workspace.package] edition = "2021" authors = ["Hanzo AI, Inc."] diff --git a/daemon/Cargo.toml b/daemon/Cargo.toml index fa4fc2440..1c2a090fe 100644 --- a/daemon/Cargo.toml +++ b/daemon/Cargo.toml @@ -26,6 +26,12 @@ embedded-chain = ["dep:hanzo-chain"] hanzo-identity = { git = "https://github.com/hanzoai/cli", rev = "287bcbd78185b382a4561eabaccf620d7c05781f" } # Canonical in-process agentic harness: MCP + hanzoskills + gateway/local routing + target runner. hanzo-gen = { git = "https://github.com/hanzoai/gen", rev = "be1946c17b05d7beb97e9768345b5969455d67dc" } +# Native desktop control for /v1/computer. The computer tool is already public in +# hanzo-mcp; hanzod reuses that exact backend and adds policy and audit around it. +hanzo-mcp = { git = "https://github.com/hanzoai/mcp.git", rev = "5ac75825bbdbce909f89abc3793d981ca0535b5d", default-features = false } +# tree-sitter-rust accepts `>=0.20`; pin the runtime to the version hanzo-mcp's AST +# code is written against so one grammar cannot select a newer incompatible tree-sitter. +tree-sitter = "=0.20.10" # Native Rust Dev engine (HIP-1330): protocol, pure session core, and pure orchestrator decide rules. dev-protocol = { git = "https://github.com/hanzoai/dev", rev = "9ea2907922e202a675b2b05ae2cb0515f19d84de" } dev-core = { git = "https://github.com/hanzoai/dev", rev = "9ea2907922e202a675b2b05ae2cb0515f19d84de" } diff --git a/daemon/src/computer.rs b/daemon/src/computer.rs new file mode 100644 index 000000000..0b9531e50 --- /dev/null +++ b/daemon/src/computer.rs @@ -0,0 +1,543 @@ +// Copyright (C) 2026, Hanzo AI, Inc. All rights reserved. +// SPDX-License-Identifier: BSD-3-Clause-Eco + +//! `/v1/computer` — local desktop control over the native backend in `hanzo-mcp`. +//! +//! GET /v1/computer the action table +//! GET /v1/computer/{action}?… a read action, arguments from the query +//! POST /v1/computer {"action":…, …} any action, arguments from JSON +//! POST /v1/computer/{action} {…} any action, path wins over the body +//! +//! The screen and input implementation is the canonical `ComputerTool` from +//! `hanzo-mcp`; nothing here reimplements capture or events. What hanzod adds +//! is local policy: reads are open, acts need approval evidence on every call, +//! and every request is recorded in `audit.jsonl` beside the daemon state. + +use crate::paths; +use crate::table::{Fut, Reply, Subsystem}; +use crate::zap::{Request, Response}; +use hanzo_mcp::{tools::ComputerToolArgs, ComputerTool}; +use serde_json::{json, Map, Value}; +use std::io; +use std::path::PathBuf; +use std::sync::Mutex; +use std::time::{SystemTime, UNIX_EPOCH}; +use tokio::sync::Mutex as AsyncMutex; + +/// Read actions change nothing on the machine. +pub const READ_ACTIONS: &[&str] = &[ + "info", + "get_screens", + "screen_size", + "position", + "list_windows", + "get_active_window", + "screenshot", + "screenshot_region", +]; + +/// Act actions move the mouse, type, focus windows, or change tool settings. +pub const ACT_ACTIONS: &[&str] = &[ + "click", + "double_click", + "right_click", + "middle_click", + "move", + "move_relative", + "drag", + "drag_relative", + "scroll", + "type", + "write", + "press", + "key_down", + "key_up", + "hotkey", + "focus_window", + "batch", + "sleep", + "set_pause", + "set_failsafe", +]; + +#[derive(Clone, Copy, Debug, PartialEq, Eq)] +pub enum Kind { + Read, + Act, +} + +/// The action name the backend's `FromStr` accepts, or `None` for anything this +/// route must refuse. Underscores, hyphens and camel case all name one action, +/// matching `ComputerToolArgs::action`'s parser. +pub fn classify(action: &str) -> Option { + let flat: String = action + .trim() + .chars() + .filter(|c| *c != '_' && *c != '-' && !c.is_whitespace()) + .flat_map(char::to_lowercase) + .collect(); + let name = flat.as_str(); + if READ_ACTIONS.iter().any(|a| a.replace('_', "") == name) { + Some(Kind::Read) + } else if ACT_ACTIONS.iter().any(|a| a.replace('_', "") == name) { + Some(Kind::Act) + } else { + None + } +} + +/// Approval evidence is per request, never a session flag: a header +/// `X-Hanzo-Approve: true` or a body field `{"approval": true}` (also +/// `{"approval": {"approved": true}}`). Anything else is absent. +pub fn approved(req: &Request, body: &Value) -> bool { + let header = req + .header("x-hanzo-approve") + .is_some_and(|v| matches!(v.trim().to_ascii_lowercase().as_str(), "1" | "true" | "yes" | "approved")); + let field = match body.get("approval") { + Some(Value::Bool(b)) => *b, + Some(Value::Object(o)) => o.get("approved").and_then(Value::as_bool).unwrap_or(false), + _ => false, + }; + header || field +} + +/// One action, or the actions nested in a `batch`, each with its policy kind. +/// A batch is gated as a whole: any act inside requires approval for the call. +pub fn ops(action: &str, args: &Value) -> Result, String> { + if action == "batch" { + let list = args + .get("actions") + .and_then(Value::as_array) + .ok_or_else(|| "batch requires an actions array".to_string())?; + let mut out = Vec::with_capacity(list.len()); + for a in list { + let name = a.get("action").and_then(Value::as_str).unwrap_or("info"); + let kind = classify(name).ok_or_else(|| format!("unknown nested action: {name}"))?; + out.push((name.to_string(), kind)); + } + if out.is_empty() { + return Err("batch requires at least one action".to_string()); + } + Ok(out) + } else { + let kind = classify(action).ok_or_else(|| format!("unknown action: {action}"))?; + Ok(vec![(action.to_string(), kind)]) + } +} + +/// Append-only audit trail. One JSON line per dispatched op (including denied +/// ones) with actor, action, time, approval evidence and outcome. Only fixed +/// strings are recorded: no coordinates, pixels, typed text, keys or tokens. +pub struct Audit { + path: PathBuf, + next: Mutex, +} + +impl Audit { + pub fn open(path: PathBuf) -> Audit { + let next = std::fs::read_to_string(&path).map(|s| s.lines().count() as u64 + 1).unwrap_or(1); + Audit { path, next: Mutex::new(next) } + } + + pub fn record(&self, who: &str, action: &str, approved: bool, required: bool, outcome: &str) -> u64 { + let mut next = self.next.lock().unwrap(); + let id = *next; + let time = SystemTime::now().duration_since(UNIX_EPOCH).map(|d| d.as_secs()).unwrap_or(0); + let line = json!({ + "id": id, + "time": time, + "who": who, + "action": action, + "approved": approved, + "required": required, + "outcome": outcome + }) + .to_string(); + if let Some(dir) = self.path.parent() { + let _ = std::fs::create_dir_all(dir); + } + let mut opts = std::fs::OpenOptions::new(); + opts.create(true).append(true); + #[cfg(unix)] + { + use std::os::unix::fs::OpenOptionsExt; + opts.mode(0o600); + } + if let Ok(mut f) = opts.open(&self.path) { + use std::io::Write; + let _ = writeln!(f, "{line}"); + *next += 1; + } + id + } +} + +/// The subsystem. `tool` is a mutex because `ComputerTool::execute` takes +/// `&mut self`: only one desktop action may be in flight here at a time. +pub struct Computer { + audit: Audit, + tool: AsyncMutex, +} + +impl Default for Computer { + fn default() -> Self { + Self::new() + } +} + +impl Computer { + pub fn new() -> Self { + Self::with_audit(paths::data().join("audit.jsonl")) + } + + /// Test seam: the same policy with a private audit file. + pub fn with_audit(path: PathBuf) -> Self { + Computer { audit: Audit::open(path), tool: AsyncMutex::new(ComputerTool::new()) } + } + + fn denied(&self, who: &str, action: &str, approved: bool, required: bool, status: u16, why: &str) -> Response { + self.audit.record(who, action, approved, required, "denied"); + Response::error(status, why) + } +} + +impl Subsystem for Computer { + fn name(&self) -> &'static str { + "computer" + } + fn prefix(&self) -> &'static str { + "/v1/computer" + } + fn resident(&self) -> bool { + true + } + fn start(&self) -> Fut<'_, io::Result<()>> { + Box::pin(async { Ok(()) }) + } + fn frame<'a>(&'a self, who: &'a str, req: Request) -> Fut<'a, io::Result> { + Box::pin(async move { + let path = req.path().to_string(); + let mut body = match req.method.as_str() { + "POST" => match serde_json::from_slice::(&req.body) { + Ok(Value::Object(m)) => m, + Ok(_) => { + return Ok(Reply::Whole(Response::error(400, "body must be a JSON object"))) + } + Err(e) => return Ok(Reply::Whole(Response::error(400, &format!("invalid JSON: {e}")))), + }, + "GET" => Map::new(), + _ => return Ok(Reply::Whole(Response::error(405, "GET or POST"))), + }; + + // /v1/computer/{action} wins over the body's action field. + let tail = path.strip_prefix("/v1/computer").unwrap_or("").trim_start_matches('/'); + if !tail.is_empty() { + let action = unescape(tail); + body.insert("action".into(), Value::String(action)); + } + if !req.method.eq_ignore_ascii_case("POST") { + for (k, v) in query(&req.target) { + body.insert(k, v); + } + } + + if path == "/v1/computer" && !req.method.eq_ignore_ascii_case("POST") { + return Ok(Reply::Whole(Response::json( + 200, + &json!({ + "name": "computer", + "read": READ_ACTIONS, + "act": ACT_ACTIONS, + "approval": "X-Hanzo-Approve: true, or {\"approval\": true} in the body", + "audit": "audit.jsonl beside the daemon state dir", + "backend": "hanzo-mcp ComputerTool" + }), + ))); + } + + let action = body.get("action").and_then(Value::as_str).unwrap_or("info").to_string(); + let args = Value::Object(body); + let evidence = approved(&req, &args); + let dispatched = match ops(&action, &args) { + Ok(o) => o, + Err(why) => { + return Ok(Reply::Whole(self.denied(who, &action, evidence, false, 400, &why))) + } + }; + let required = dispatched.iter().any(|(_, k)| *k == Kind::Act); + if required && !evidence { + return Ok(Reply::Whole(self.denied( + who, + &action, + evidence, + required, + 403, + &format!("approval required for act action {action}: send X-Hanzo-Approve: true or {{\"approval\": true}}"), + ))); + } + + // Approval evidence is policy metadata, not a tool argument. + let mut tool_args = args.as_object().cloned().unwrap_or_default(); + tool_args.remove("approval"); + tool_args.insert("action".into(), Value::String(action.clone())); + let tool_args = match serde_json::from_value::(Value::Object(tool_args)) { + Ok(a) => a, + Err(e) => { + return Ok(Reply::Whole(self.denied(who, &action, evidence, required, 400, &e.to_string()))) + } + }; + + let result = { + let mut tool = self.tool.lock().await; + tool.execute(tool_args).await + }; + let response = match result { + Ok(text) => { + let value = serde_json::from_str::(&text).unwrap_or(Value::String(text)); + // A batch reports each nested op's own result; a failed nested + // op must be audited as an error, not hidden by the envelope. + let nested = if action == "batch" { + value.get("results").and_then(Value::as_array).cloned() + } else { + None + }; + for (i, (name, kind)) in dispatched.iter().enumerate() { + let outcome = match nested.as_ref().and_then(|rs| rs.get(i)) { + Some(r) if r.get("success").and_then(Value::as_bool) == Some(true) => "ok", + Some(_) => "error", + None => "ok", + }; + self.audit.record(who, name, evidence, *kind == Kind::Act, outcome); + } + Response::json(200, &value) + } + Err(e) => { + for (name, kind) in &dispatched { + self.audit.record(who, name, evidence, *kind == Kind::Act, "error"); + } + Response::error(400, &e.to_string()) + } + }; + Ok(Reply::Whole(response)) + }) + } + fn stop(&self) -> Fut<'_, ()> { + Box::pin(async {}) + } +} + +/// Minimal `%XX` decoding for an action in the path. +fn unescape(s: &str) -> String { + let b = s.as_bytes(); + let mut out = Vec::with_capacity(b.len()); + let mut i = 0; + while i < b.len() { + if b[i] == b'%' && i + 2 < b.len() { + if let (Some(h), Some(l)) = (hex(b[i + 1]), hex(b[i + 2])) { + out.push(h << 4 | l); + i += 3; + continue; + } + } + out.push(b[i]); + i += 1; + } + String::from_utf8_lossy(&out).into_owned() +} + +fn hex(c: u8) -> Option { + match c { + b'0'..=b'9' => Some(c - b'0'), + b'a'..=b'f' => Some(c - b'a' + 10), + b'A'..=b'F' => Some(c - b'A' + 10), + _ => None, + } +} + +/// Query arguments for the read-on-GET form. Numbers and the handful of array +/// arguments are coerced so the same `ComputerToolArgs` serves both methods. +fn query(target: &str) -> Vec<(String, Value)> { + let Some((_, q)) = target.split_once('?') else { return Vec::new() }; + q.split('&') + .filter_map(|pair| { + let (k, v) = pair.split_once('=')?; + let k = unescape(k); + let v = unescape(v); + let value = match k.as_str() { + "region" => Value::Array(v.split(',').filter_map(|n| n.trim().parse::().ok()).map(Value::from).collect()), + "keys" => Value::Array(v.split(',').map(|s| Value::String(s.to_string())).collect()), + "x" | "y" | "dx" | "dy" | "end_x" | "end_y" | "amount" | "width" | "height" => { + v.parse::().map(Value::from).unwrap_or(Value::String(v)) + } + "duration" | "interval" | "value" => v.parse::().map(Value::from).unwrap_or(Value::String(v)), + "clear" => Value::Bool(matches!(v.to_ascii_lowercase().as_str(), "1" | "true" | "yes")), + _ => Value::String(v), + }; + Some((k, value)) + }) + .collect() +} + +#[cfg(test)] +mod tests { + use super::*; + + fn req(method: &str, target: &str, body: Value, headers: &[(&str, &str)]) -> Request { + Request { + method: method.into(), + target: target.into(), + headers: headers.iter().map(|(k, v)| ((*k).into(), (*v).into())).collect(), + body: serde_json::to_vec(&body).unwrap(), + } + } + + #[test] + fn every_documented_action_is_classified() { + for a in READ_ACTIONS { + assert_eq!(classify(a), Some(Kind::Read), "{a}"); + } + for a in ACT_ACTIONS { + assert_eq!(classify(a), Some(Kind::Act), "{a}"); + } + for a in ["doubleclick", "GET-ACTIVE-WINDOW", "key up", "screenshotRegion"] { + assert!(classify(a).is_some(), "{a}"); + } + assert_eq!(classify(""), None); + assert_eq!(classify("rm_rf"), None); + } + + #[test] + fn approval_is_per_request_evidence_only() { + let none = req("POST", "/v1/computer", json!({"action": "click", "x": 1, "y": 2}), &[]); + let no_body: Value = serde_json::from_slice(&none.body).unwrap(); + assert!(!approved(&none, &no_body)); + let header = req("POST", "/v1/computer", json!({}), &[("X-HANZO-APPROVE", " true ")]); + assert!(approved(&header, &json!({}))); + let bad_header = req("POST", "/v1/computer", json!({}), &[("X-Hanzo-Approve", "no")]); + assert!(!approved(&bad_header, &json!({}))); + assert!(approved(&none, &json!({"approval": true}))); + assert!(approved(&none, &json!({"approval": {"approved": true}}))); + assert!(!approved(&none, &json!({"approval": {"approved": false}}))); + assert!(!approved(&none, &json!({"approval": "true"}))); + } + + #[test] + fn batch_is_gated_as_a_whole() { + let batch = json!({"actions": [{"action": "screenshot"}, {"action": "click", "x": 2, "y": 3}]}); + let listed = ops("batch", &batch).unwrap(); + assert_eq!(listed.len(), 2); + assert_eq!(listed[0].1, Kind::Read); + assert_eq!(listed[1].1, Kind::Act); + assert!(listed.iter().any(|(_, k)| *k == Kind::Act)); + assert!(ops("batch", &json!({"actions": [{"action": "screen_size"}]})) + .unwrap() + .iter() + .all(|(_, k)| *k == Kind::Read)); + assert!(ops("batch", &json!({"actions": [{"action": "rm_rf"}]})).is_err()); + assert!(ops("batch", &json!({})).is_err()); + assert!(ops("nope", &json!({})).is_err()); + } + + #[test] + fn audit_rows_have_the_shape_and_never_carry_payload() { + let dir = tempfile::tempdir().unwrap(); + let path = dir.path().join("audit.jsonl"); + let audit = Audit::open(path.clone()); + // The only arguments `record` takes are policy metadata, never tool args. + audit.record("hanzo/z", "type", true, true, "ok"); + let line = std::fs::read_to_string(&path).unwrap(); + let row: Value = serde_json::from_str(line.lines().next().unwrap()).unwrap(); + for key in ["id", "time", "who", "action", "approved", "required", "outcome"] { + assert!(row.get(key).is_some(), "missing {key}: {row}"); + } + assert_eq!(row["who"], "hanzo/z"); + assert_eq!(row["action"], "type"); + assert_eq!(row["approved"], true); + assert_eq!(row["required"], true); + assert_eq!(row["outcome"], "ok"); + assert!(!line.contains("text"), "audit leaked typed text"); + assert!(!line.contains("base64")); + } + + #[tokio::test] + async fn act_without_approval_and_unknown_actions_fail_closed() { + let dir = tempfile::tempdir().unwrap(); + let path = dir.path().join("audit.jsonl"); + let c = Computer::with_audit(path.clone()); + + let act = req("POST", "/v1/computer/click", json!({"x": 10, "y": 20}), &[]); + let Reply::Whole(r) = c.frame("hanzo/z", act).await.unwrap() else { panic!() }; + assert_eq!(r.status, 403, "{}", String::from_utf8_lossy(&r.body)); + assert!(String::from_utf8_lossy(&r.body).contains("approval required")); + + let bad = req("POST", "/v1/computer", json!({"action": "rm_rf"}), &[]); + let Reply::Whole(r) = c.frame("hanzo/z", bad).await.unwrap() else { panic!() }; + assert_eq!(r.status, 400); + + let malformed = Request { + method: "POST".into(), + target: "/v1/computer".into(), + headers: vec![], + body: b"{".to_vec(), + }; + let Reply::Whole(r) = c.frame("hanzo/z", malformed).await.unwrap() else { panic!() }; + assert_eq!(r.status, 400); + + let batch = req( + "POST", + "/v1/computer", + json!({"action": "batch", "actions": [{"action": "click", "x": 1, "y": 2}]}), + &[], + ); + let Reply::Whole(r) = c.frame("hanzo/z", batch).await.unwrap() else { panic!() }; + assert_eq!(r.status, 403, "batch of acts must be gated as a whole"); + + let rows: Vec = std::fs::read_to_string(&path) + .unwrap() + .lines() + .map(|l| serde_json::from_str(l).unwrap()) + .collect(); + assert!(rows.iter().any(|r| r["action"] == "click" && r["outcome"] == "denied" && r["approved"] == false)); + assert!(rows.iter().any(|r| r["action"] == "rm_rf" && r["outcome"] == "denied")); + assert!(rows.iter().any(|r| r["action"] == "batch" && r["outcome"] == "denied")); + assert!(rows.iter().all(|r| r["outcome"] != "ok"), "no act should have run"); + } + + #[tokio::test] + async fn a_read_batch_logs_each_nested_op() { + let dir = tempfile::tempdir().unwrap(); + let path = dir.path().join("audit.jsonl"); + let c = Computer::with_audit(path.clone()); + let r = req( + "POST", + "/v1/computer", + json!({"action": "batch", "actions": [{"action": "screen_size"}, {"action": "position"}]}), + &[], + ); + let Reply::Whole(resp) = c.frame("hanzo/z", r).await.unwrap() else { panic!() }; + assert_eq!(resp.status, 200, "{}", String::from_utf8_lossy(&resp.body)); + let rows: Vec = std::fs::read_to_string(&path) + .unwrap() + .lines() + .map(|l| serde_json::from_str(l).unwrap()) + .collect(); + assert_eq!(rows.len(), 2, "{rows:?}"); + assert_eq!(rows[0]["action"], "screen_size"); + assert_eq!(rows[1]["action"], "position"); + assert!(rows.iter().all(|r| r["outcome"] == "ok" && r["required"] == false)); + } + + #[tokio::test] + async fn read_ops_need_no_approval() { + let dir = tempfile::tempdir().unwrap(); + let path = dir.path().join("audit.jsonl"); + let c = Computer::with_audit(path.clone()); + let r = req("POST", "/v1/computer/screen_size", json!({}), &[]); + let Reply::Whole(resp) = c.frame("hanzo/z", r).await.unwrap() else { panic!() }; + assert_eq!(resp.status, 200, "{}", String::from_utf8_lossy(&resp.body)); + let row: Value = serde_json::from_str(std::fs::read_to_string(&path).unwrap().lines().next().unwrap()).unwrap(); + assert_eq!(row["action"], "screen_size"); + assert_eq!(row["required"], false); + assert_eq!(row["outcome"], "ok"); + } +} diff --git a/daemon/src/daemon.rs b/daemon/src/daemon.rs index aaec2735d..0a330894a 100644 --- a/daemon/src/daemon.rs +++ b/daemon/src/daemon.rs @@ -8,8 +8,10 @@ //! * On the socket (mode 0600, peer uid checked) no bearer is needed for hanzod's //! own routes; cloud's own routes enforce IAM themselves. //! * On the loopback port (reachable by any local process, and by a web page) -//! every route needs a verified bearer, except `/v1/engine`, which is local -//! inference and is guarded by Host and Origin checks in `http`. +//! every route needs a verified bearer, except `/v1/engine` (local inference) +//! and `/v1/computer` (the local desktop backend). Both are guarded by Host +//! and Origin checks in `http`; computer control additionally demands approval +//! evidence per act op and audits every call in its own subsystem. //! * The access token route is socket-only. use crate::me; @@ -64,6 +66,10 @@ impl Daemon { return (Reply::Whole(Response::json(200, &doc)), None); } let local_inference = path == "/v1/engine" || path.starts_with("/v1/engine/"); + // Desktop control is local by definition: the app needs it without a + // cloud sign-in. Reads are open; act ops carry their own approval and + // audit trail inside the subsystem, which is the same on either door. + let local_computer = path == "/v1/computer" || path.starts_with("/v1/computer/"); let local_probe = req.method == "GET" && matches!( path.as_str(), @@ -96,7 +102,9 @@ impl Daemon { Ok(p) => p, Err((s, e)) => return refuse(s, &e), }, - None if via == Via::Http && !local_inference && !local_probe => return refuse(401, "a bearer is required"), + None if via == Via::Http && !local_inference && !local_computer && !local_probe => { + return refuse(401, "a bearer is required") + } None => me::effective_identity().map(|id| me::label(&id)).unwrap_or_default(), }; if via == Via::Http && (path == "/v1/identity/token" || path == "/v1/hanzod/upstream") { diff --git a/daemon/src/http.rs b/daemon/src/http.rs index a63f8fe95..4cee41a28 100644 --- a/daemon/src/http.rs +++ b/daemon/src/http.rs @@ -117,7 +117,7 @@ async fn respond_with_cors(c: &mut TcpStream, r: &Response, cors_origin: Option< if let Some(origin) = cors_origin { if !origin.contains(['\r', '\n']) { out.push_str(&format!( - "Access-Control-Allow-Origin: {origin}\r\nVary: Origin\r\nAccess-Control-Allow-Methods: GET, POST, PUT, PATCH, DELETE, OPTIONS\r\nAccess-Control-Allow-Headers: authorization, content-type, accept, idempotency-key, x-org-id, x-project-id, x-hanzo-org\r\nAccess-Control-Max-Age: 600\r\n" + "Access-Control-Allow-Origin: {origin}\r\nVary: Origin\r\nAccess-Control-Allow-Methods: GET, POST, PUT, PATCH, DELETE, OPTIONS\r\nAccess-Control-Allow-Headers: authorization, content-type, accept, idempotency-key, x-org-id, x-project-id, x-hanzo-org, x-hanzo-approve\r\nAccess-Control-Max-Age: 600\r\n" )); } } diff --git a/daemon/src/lib.rs b/daemon/src/lib.rs index 7d78f0236..bd0655360 100644 --- a/daemon/src/lib.rs +++ b/daemon/src/lib.rs @@ -10,6 +10,7 @@ mod chain; mod cloud; mod cluster; mod coding; +mod computer; mod daemon; mod dev; mod dev_native; @@ -165,6 +166,7 @@ pub extern "C" fn hanzod_ffi_start(data_dir: *const c_char, port: u16) -> c_int tasks_worker: tasks_worker.clone(), }), Arc::new(routes::Identity), + Arc::new(computer::Computer::new()), lifecycle_sub, Arc::new(cloud::Cloud::new(pins.clone(), upstream)), dev_sub, diff --git a/daemon/src/main.rs b/daemon/src/main.rs index 7de3e3847..56c788521 100644 --- a/daemon/src/main.rs +++ b/daemon/src/main.rs @@ -19,6 +19,7 @@ mod chain; mod cloud; mod cluster; mod coding; +mod computer; mod daemon; mod dev; mod dev_native; @@ -216,6 +217,7 @@ async fn run() -> std::io::Result<()> { tasks_worker: tasks_worker.clone(), }), Arc::new(routes::Identity), + Arc::new(computer::Computer::new()), lifecycle_sub, Arc::new(cloud::Cloud::new(pins.clone(), upstream)), dev_sub, diff --git a/daemon/src/routes.rs b/daemon/src/routes.rs index 4b6ae88e5..37b1accd4 100644 --- a/daemon/src/routes.rs +++ b/daemon/src/routes.rs @@ -103,6 +103,7 @@ impl Subsystem for Hanzod { "sole_desktop_backend": true, "surfaces": [ "desktop", + "computer", "bot", "team", "dev", @@ -119,6 +120,7 @@ impl Subsystem for Hanzod { ], "capabilities": { "dev": crate::dev_native::HARNESS_NAME, + "computer": "hanzo-mcp native", "coding": crate::dev_native::HARNESS_NAME, "research": "rust-native", "bot": "rust-native",