diff --git a/.gitignore b/.gitignore index 92220a4..1d75aa7 100644 --- a/.gitignore +++ b/.gitignore @@ -1,4 +1,12 @@ -debug/ -target/ +*/target/ +/target +pkg/*.wasm +pkg/*.zip +*.swp +*.swo +*/wasi_snapshot_preview1.wasm +*/wit/ +*/process_env +**/target/ + -.DS_Store \ No newline at end of file diff --git a/Cargo.lock b/Cargo.lock index aa4ba26..5505e0b 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -4,18 +4,18 @@ version = 4 [[package]] name = "addr2line" -version = "0.24.2" +version = "0.21.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dfbe277e56a376000877090da837660b4427aad530e3028d44e0bffe4f89a1c1" +checksum = "8a30b2e23b9e17a9f90641c7ab1549cd9b44f296d3ccbf309d2863cfe398a0cb" dependencies = [ "gimli", ] [[package]] -name = "adler2" -version = "2.0.0" +name = "adler" +version = "1.0.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "512761e0bb2578dd7380c6baaa0f4ce03e84f95e960231d1dec8bf4d7d6e2627" +checksum = "f26201604c87b1e01bd3d98f8d5d9a8fcbb815e8cedb41ffccbeb4bf593a35fe" [[package]] name = "ahash" @@ -30,6 +30,15 @@ dependencies = [ "zerocopy", ] +[[package]] +name = "aho-corasick" +version = "1.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8e60d3430d3a69478ad0993f19238d2df97c507009a52b3c10addcd7f6bcb916" +dependencies = [ + "memchr", +] + [[package]] name = "allocator-api2" version = "0.2.21" @@ -56,9 +65,9 @@ dependencies = [ [[package]] name = "alloy-chains" -version = "0.1.51" +version = "0.1.56" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d4e0f0136c085132939da6b753452ebed4efaa73fe523bb855b10c199c2ebfaf" +checksum = "a725039ef382d1b6b4e2ebcb15b1efff6cde9af48c47a1bdce6fb67b9456c34b" dependencies = [ "alloy-primitives", "num_enum", @@ -98,9 +107,9 @@ dependencies = [ [[package]] name = "alloy-core" -version = "0.8.15" +version = "0.8.19" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c618bd382f0bc2ac26a7e4bfae01c9b015ca8f21b37ca40059ae35a7e62b3dc6" +checksum = "648275bb59110f88cc5fa9a176845e52a554ebfebac2d21220bcda8c9220f797" dependencies = [ "alloy-dyn-abi", "alloy-json-abi", @@ -111,9 +120,9 @@ dependencies = [ [[package]] name = "alloy-dyn-abi" -version = "0.8.15" +version = "0.8.19" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "41056bde53ae10ffbbf11618efbe1e0290859e5eab0fe9ef82ebdb62f12a866f" +checksum = "bc9138f4f0912793642d453523c3116bd5d9e11de73b70177aa7cb3e94b98ad2" dependencies = [ "alloy-json-abi", "alloy-primitives", @@ -181,9 +190,9 @@ dependencies = [ [[package]] name = "alloy-json-abi" -version = "0.8.15" +version = "0.8.19" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c357da577dfb56998d01f574d81ad7a1958d248740a7981b205d69d65a7da404" +checksum = "24acd2f5ba97c7a320e67217274bc81fe3c3174b8e6144ec875d9d54e760e278" dependencies = [ "alloy-primitives", "alloy-sol-type-parser", @@ -201,7 +210,7 @@ dependencies = [ "alloy-sol-types", "serde", "serde_json", - "thiserror 2.0.9", + "thiserror 2.0.11", "tracing", ] @@ -227,7 +236,7 @@ dependencies = [ "futures-utils-wasm", "serde", "serde_json", - "thiserror 2.0.9", + "thiserror 2.0.11", ] [[package]] @@ -245,9 +254,9 @@ dependencies = [ [[package]] name = "alloy-primitives" -version = "0.8.15" +version = "0.8.19" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6259a506ab13e1d658796c31e6e39d2e2ee89243bcc505ddc613b35732e0a430" +checksum = "ec878088ec6283ce1e90d280316aadd3d6ce3de06ff63d68953c855e7e447e92" dependencies = [ "alloy-rlp", "bytes", @@ -256,7 +265,6 @@ dependencies = [ "derive_more", "foldhash", "hashbrown 0.15.2", - "hex-literal", "indexmap", "itoa", "k256", @@ -301,7 +309,7 @@ dependencies = [ "schnellru", "serde", "serde_json", - "thiserror 2.0.9", + "thiserror 2.0.11", "tokio", "tracing", "url", @@ -310,9 +318,9 @@ dependencies = [ [[package]] name = "alloy-rlp" -version = "0.3.10" +version = "0.3.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f542548a609dca89fcd72b3b9f355928cf844d4363c5eed9c5273a3dd225e097" +checksum = "3d6c1d995bff8d011f7cd6c81820d51825e6e06d6db73914c1630ecf544d83d6" dependencies = [ "alloy-rlp-derive", "arrayvec", @@ -321,13 +329,13 @@ dependencies = [ [[package]] name = "alloy-rlp-derive" -version = "0.3.10" +version = "0.3.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5a833d97bf8a5f0f878daf2c8451fff7de7f9de38baa5a45d936ec718d81255a" +checksum = "a40e1ef334153322fd878d07e86af7a529bcb86b2439525920a88eba87bcf943" dependencies = [ "proc-macro2", "quote", - "syn 2.0.91", + "syn 2.0.96", ] [[package]] @@ -418,61 +426,61 @@ dependencies = [ "auto_impl", "elliptic-curve", "k256", - "thiserror 2.0.9", + "thiserror 2.0.11", ] [[package]] name = "alloy-sol-macro" -version = "0.8.15" +version = "0.8.19" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d9d64f851d95619233f74b310f12bcf16e0cbc27ee3762b6115c14a84809280a" +checksum = "8d039d267aa5cbb7732fa6ce1fd9b5e9e29368f580f80ba9d7a8450c794de4b2" dependencies = [ "alloy-sol-macro-expander", "alloy-sol-macro-input", "proc-macro-error2", "proc-macro2", "quote", - "syn 2.0.91", + "syn 2.0.96", ] [[package]] name = "alloy-sol-macro-expander" -version = "0.8.15" +version = "0.8.19" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6bf7ed1574b699f48bf17caab4e6e54c6d12bc3c006ab33d58b1e227c1c3559f" +checksum = "620ae5eee30ee7216a38027dec34e0585c55099f827f92f50d11e3d2d3a4a954" dependencies = [ "alloy-sol-macro-input", "const-hex", - "heck 0.5.0", + "heck", "indexmap", "proc-macro-error2", "proc-macro2", "quote", - "syn 2.0.91", + "syn 2.0.96", "syn-solidity", "tiny-keccak", ] [[package]] name = "alloy-sol-macro-input" -version = "0.8.15" +version = "0.8.19" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8c02997ccef5f34f9c099277d4145f183b422938ed5322dc57a089fe9b9ad9ee" +checksum = "ad9f7d057e00f8c5994e4ff4492b76532c51ead39353aa2ed63f8c50c0f4d52e" dependencies = [ "const-hex", "dunce", - "heck 0.5.0", + "heck", "proc-macro2", "quote", - "syn 2.0.91", + "syn 2.0.96", "syn-solidity", ] [[package]] name = "alloy-sol-type-parser" -version = "0.8.15" +version = "0.8.19" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ce13ff37285b0870d0a0746992a4ae48efaf34b766ae4c2640fa15e5305f8e73" +checksum = "74e60b084fe1aef8acecda2743ff2d93c18ff3eb67a2d3b12f62582a1e66ef5e" dependencies = [ "serde", "winnow", @@ -480,9 +488,9 @@ dependencies = [ [[package]] name = "alloy-sol-types" -version = "0.8.15" +version = "0.8.19" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1174cafd6c6d810711b4e00383037bdb458efc4fe3dbafafa16567e0320c54d8" +checksum = "c1382302752cd751efd275f4d6ef65877ddf61e0e6f5ac84ef4302b79a33a31a" dependencies = [ "alloy-json-abi", "alloy-primitives", @@ -503,7 +511,7 @@ dependencies = [ "futures-utils-wasm", "serde", "serde_json", - "thiserror 2.0.9", + "thiserror 2.0.11", "tokio", "tower", "tracing", @@ -528,9 +536,9 @@ dependencies = [ [[package]] name = "alloy-trie" -version = "0.7.7" +version = "0.7.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1e428104b2445a4f929030891b3dbf8c94433a8349ba6480946bf6af7975c2f6" +checksum = "6917c79e837aa7b77b7a6dae9f89cbe15313ac161c4d3cfaf8909ef21f3d22d8" dependencies = [ "alloy-primitives", "alloy-rlp", @@ -681,6 +689,74 @@ dependencies = [ "serde", ] +[[package]] +name = "async-receiver-a" +version = "0.1.0" +dependencies = [ + "anyhow", + "kinode_app_common", + "kinode_process_lib", + "once_cell", + "proc_macro_send", + "process_macros", + "serde", + "serde_json", + "shared", + "uuid", + "wit-bindgen", +] + +[[package]] +name = "async-receiver-b" +version = "0.1.0" +dependencies = [ + "anyhow", + "kinode_app_common", + "kinode_process_lib", + "once_cell", + "proc_macro_send", + "process_macros", + "serde", + "serde_json", + "shared", + "uuid", + "wit-bindgen", +] + +[[package]] +name = "async-receiver-c" +version = "0.1.0" +dependencies = [ + "anyhow", + "kinode_app_common", + "kinode_process_lib", + "once_cell", + "proc_macro_send", + "process_macros", + "serde", + "serde_json", + "shared", + "uuid", + "wit-bindgen", +] + +[[package]] +name = "async-requester" +version = "0.1.0" +dependencies = [ + "anyhow", + "kinode_app_common", + "kinode_process_lib", + "once_cell", + "proc_macro_send", + "process_macros", + "serde", + "serde_json", + "shared", + "uuid", + "wit-bindgen", +] + [[package]] name = "async-stream" version = "0.3.6" @@ -700,29 +776,29 @@ checksum = "c7c24de15d275a1ecfd47a380fb4d5ec9bfe0933f309ed5e705b775596a3574d" dependencies = [ "proc-macro2", "quote", - "syn 2.0.91", + "syn 2.0.96", ] [[package]] name = "async-trait" -version = "0.1.83" +version = "0.1.85" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "721cae7de5c34fbb2acd27e21e6d2cf7b886dce0c27388d46c4e6c47ea4318dd" +checksum = "3f934833b4b7233644e5848f235df3f57ed8c80f1528a26c3dfa13d2147fa056" dependencies = [ "proc-macro2", "quote", - "syn 2.0.91", + "syn 2.0.96", ] [[package]] name = "auto_impl" -version = "1.2.0" +version = "1.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3c87f3f15e7794432337fc718554eaa4dc8f04c9677a950ffe366f20a162ae42" +checksum = "e12882f59de5360c748c4cbf569a042d5fb0eb515f7bea9c1f470b47f6ffbd73" dependencies = [ "proc-macro2", "quote", - "syn 2.0.91", + "syn 2.0.96", ] [[package]] @@ -733,17 +809,17 @@ checksum = "ace50bade8e6234aa140d9a2f552bbee1db4d353f69b8217bc503490fc1a9f26" [[package]] name = "backtrace" -version = "0.3.74" +version = "0.3.71" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8d82cb332cdfaed17ae235a638438ac4d4839913cc2af585c3c6746e8f8bee1a" +checksum = "26b05800d2e817c8b3b4b54abd461726265fa9789ae34330622f2db9ee696f9d" dependencies = [ "addr2line", + "cc", "cfg-if", "libc", "miniz_oxide", "object", "rustc-demangle", - "windows-targets", ] [[package]] @@ -790,9 +866,9 @@ checksum = "349f9b6a179ed607305526ca489b34ad0a41aed5f7980fa90eb03160b69598fb" [[package]] name = "bitflags" -version = "2.6.0" +version = "2.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b048fb63fd8b5923fc5aa7b340d8e156aec7ec02f0c78fa8a6ddc2613f6f71de" +checksum = "8f68f53c83ab957f72c32642f3868eec03eb974d1fb82e453128456482613d36" [[package]] name = "bitvec" @@ -871,9 +947,9 @@ dependencies = [ [[package]] name = "cc" -version = "1.2.5" +version = "1.2.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c31a0499c1dc64f458ad13872de75c0eb7e3fdb0e67964610c914b034fc5956e" +checksum = "13208fcbb66eaeffe09b99fffbe1af420f00a7b35aa99ad683dfc1aa76145229" dependencies = [ "shlex", ] @@ -884,6 +960,33 @@ version = "1.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" +[[package]] +name = "color-eyre" +version = "0.6.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "55146f5e46f237f7423d74111267d4597b59b0dad0ffaf7303bce9945d843ad5" +dependencies = [ + "backtrace", + "color-spantrace", + "eyre", + "indenter", + "once_cell", + "owo-colors", + "tracing-error", +] + +[[package]] +name = "color-spantrace" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cd6be1b2a7e382e2b98b43b2adcca6bb0e465af0bdd38123873ae61eb17a72c2" +dependencies = [ + "once_cell", + "owo-colors", + "tracing-core", + "tracing-error", +] + [[package]] name = "const-hex" version = "1.14.0" @@ -1014,7 +1117,7 @@ checksum = "cb7330aeadfbe296029522e6c40f315320aba36fc43a5b3632f3795348f3bd22" dependencies = [ "proc-macro2", "quote", - "syn 2.0.91", + "syn 2.0.96", "unicode-xid", ] @@ -1047,7 +1150,7 @@ checksum = "97369cbbc041bc366949bc74d34658d6cda5621039731c6310521892a3a20ae0" dependencies = [ "proc-macro2", "quote", - "syn 2.0.91", + "syn 2.0.96", ] [[package]] @@ -1111,6 +1214,16 @@ dependencies = [ "windows-sys 0.59.0", ] +[[package]] +name = "eyre" +version = "0.6.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7cd915d99f24784cdc19fd37ef22b97e3ff0ae756c7e492e9fbfe897d61e2aec" +dependencies = [ + "indenter", + "once_cell", +] + [[package]] name = "fastrand" version = "2.3.0" @@ -1259,7 +1372,7 @@ checksum = "162ee34ebcb7c64a8abebc059ce0fee27c2262618d7b60ed8faf72fef13c3650" dependencies = [ "proc-macro2", "quote", - "syn 2.0.91", + "syn 2.0.96", ] [[package]] @@ -1322,15 +1435,15 @@ dependencies = [ [[package]] name = "gimli" -version = "0.31.1" +version = "0.28.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "07e28edb80900c19c28f1072f2e8aeca7fa06b23cd4169cefe1af5aa3260783f" +checksum = "4271d37baee1b8c7e4b708028c57d816cf9d2434acb33a549475f78c181f6253" [[package]] name = "glob" -version = "0.3.1" +version = "0.3.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d2fabcfbdc87f4758337ca535fb41a6d701b65693ce38287d856d1674551ec9b" +checksum = "a8d1add55171497b4705a648c6b583acafb01d58050a51727785f0b2c8e0a2b2" [[package]] name = "group" @@ -1370,15 +1483,6 @@ dependencies = [ "serde", ] -[[package]] -name = "heck" -version = "0.4.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "95505c38b4572b2d910cecb0281560f54b440a19336cbbcb27bf6ce6adc6f5a8" -dependencies = [ - "unicode-segmentation", -] - [[package]] name = "heck" version = "0.5.0" @@ -1400,12 +1504,6 @@ dependencies = [ "serde", ] -[[package]] -name = "hex-literal" -version = "0.4.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6fe2267d4ed49bc07b63801559be28c718ea06c4738b7a03c94df7386d2cde46" - [[package]] name = "hmac" version = "0.12.1" @@ -1624,7 +1722,7 @@ checksum = "1ec89e9337638ecdc08744df490b221a7399bf8d164eb52a665454e60e075ad6" dependencies = [ "proc-macro2", "quote", - "syn 2.0.91", + "syn 2.0.96", ] [[package]] @@ -1671,14 +1769,20 @@ checksum = "a0eb5a3343abf848c0984fe4604b2b105da9539376e24fc0a3b0007411ae4fd9" dependencies = [ "proc-macro2", "quote", - "syn 2.0.91", + "syn 2.0.96", ] +[[package]] +name = "indenter" +version = "0.3.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ce23b50ad8242c51a442f3ff322d56b02f08852c77e4c0b4d3fd684abc89c683" + [[package]] name = "indexmap" -version = "2.7.0" +version = "2.7.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "62f822373a4fe84d4bb149bf54e584a7f4abec90e072ed49cda0edea5b95471f" +checksum = "8c9c992b02b5b4c94ea26e32fe5bccb7aa7d9f390ab5c1221ff895bc7ea8b652" dependencies = [ "equivalent", "hashbrown 0.15.2", @@ -1687,9 +1791,9 @@ dependencies = [ [[package]] name = "ipnet" -version = "2.10.1" +version = "2.11.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ddc24109865250148c2e0f3d25d4f0f479571723792d3802153c60922a4fb708" +checksum = "469fb0b9cefa57e3ef31275ee7cacb78f2fdca44e4765491884a2b119d4eb130" [[package]] name = "itertools" @@ -1717,9 +1821,9 @@ checksum = "d75a2a4b1b190afb6f5425f10f6a8f959d2ea0b9c2b1d79553551850539e4674" [[package]] name = "js-sys" -version = "0.3.76" +version = "0.3.77" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6717b6b5b077764fb5966237269cb3c64edddde4b14ce42647430a78ced9e7b7" +checksum = "1cfaf33c695fc6e08064efbc1f72ec937429614f25eef83af942d0e227c3a28f" dependencies = [ "once_cell", "wasm-bindgen", @@ -1758,22 +1862,27 @@ dependencies = [ ] [[package]] -name = "kinode-app-framework" +name = "kinode_app_common" version = "0.1.0" dependencies = [ "anyhow", "kinode_process_lib", + "once_cell", + "paste", "process_macros", + "rmp-serde", "serde", + "serde_derive", "serde_json", - "wit-bindgen 0.24.0", + "uuid", + "wit-bindgen", ] [[package]] name = "kinode_process_lib" -version = "0.10.1" +version = "0.10.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "46830129ca3814865519615f1d4e4c1e9894c9df50be38a6c8069572e9cc1530" +checksum = "832da3db18c1328e3263f41303d34663d8d90217a8c85f778472f59f8397bf85" dependencies = [ "alloy", "alloy-primitives", @@ -1781,15 +1890,20 @@ dependencies = [ "alloy-sol-types", "anyhow", "bincode", + "color-eyre", "http", "mime_guess", "rand", + "regex", "rmp-serde", "serde", "serde_json", "thiserror 1.0.69", + "tracing", + "tracing-error", + "tracing-subscriber", "url", - "wit-bindgen 0.36.0", + "wit-bindgen", ] [[package]] @@ -1818,9 +1932,9 @@ checksum = "8355be11b20d696c8f18f6cc018c4e372165b1fa8126cef092399c9951984ffa" [[package]] name = "linux-raw-sys" -version = "0.4.14" +version = "0.4.15" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "78b3ae25bc7c8c38cec158d1f2757ee79e9b3740fbc7ccf0e59e4b08d793fa89" +checksum = "d26c52dbd32dccf2d10cac7725f8eae5296885fb5703b261f7d0a0739ec807ab" [[package]] name = "litemap" @@ -1840,9 +1954,9 @@ dependencies = [ [[package]] name = "log" -version = "0.4.22" +version = "0.4.25" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a7a70ba024b9dc04c27ea2f0c0548feb474ec5c54bba33a7f72f873a39d07b24" +checksum = "04cbf5b083de1c7e0222a7a51dbfdba1cbe1c6ab0b15e29fff3f6c077fd9cd9f" [[package]] name = "lru" @@ -1853,6 +1967,15 @@ dependencies = [ "hashbrown 0.15.2", ] +[[package]] +name = "matchers" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8263075bb86c5a1b1427b5ae862e8889656f126e9f77c484496e8b47cf5c5558" +dependencies = [ + "regex-automata 0.1.10", +] + [[package]] name = "memchr" version = "2.7.4" @@ -1877,11 +2000,11 @@ dependencies = [ [[package]] name = "miniz_oxide" -version = "0.8.2" +version = "0.7.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4ffbe83022cedc1d264172192511ae958937694cd57ce297164951b8b3568394" +checksum = "b8a240ddb74feaf34a79a7add65a741f3167852fba007066dcac1ca548d89c08" dependencies = [ - "adler2", + "adler", ] [[package]] @@ -1912,6 +2035,16 @@ dependencies = [ "tempfile", ] +[[package]] +name = "nu-ansi-term" +version = "0.46.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "77a8165726e8236064dbb45459242600304b42a5ea24ee2948e18e023bf7ba84" +dependencies = [ + "overload", + "winapi", +] + [[package]] name = "num-bigint" version = "0.4.6" @@ -1968,14 +2101,14 @@ checksum = "af1844ef2428cc3e1cb900be36181049ef3d3193c63e43026cfe202983b27a56" dependencies = [ "proc-macro2", "quote", - "syn 2.0.91", + "syn 2.0.96", ] [[package]] name = "nybbles" -version = "0.3.0" +version = "0.3.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "55a62e678a89501192cc5ebf47dcbc656b608ae5e1c61c9251fe35230f119fe3" +checksum = "8983bb634df7248924ee0c4c3a749609b5abcb082c28fffe3254b3eb3602b307" dependencies = [ "alloy-rlp", "const-hex", @@ -1986,9 +2119,9 @@ dependencies = [ [[package]] name = "object" -version = "0.36.7" +version = "0.32.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "62948e14d923ea95ea2c7c86c71013138b66525b86bdc08d2dcc262bdb497b87" +checksum = "a6a622008b6e321afc04970976f62ee297fdbaa6f95318ca343e3eebb9648441" dependencies = [ "memchr", ] @@ -2022,7 +2155,7 @@ checksum = "a948666b637a0f465e8564c73e89d4dde00d72d4d473cc972f390fc3dcee7d9c" dependencies = [ "proc-macro2", "quote", - "syn 2.0.91", + "syn 2.0.96", ] [[package]] @@ -2043,6 +2176,18 @@ dependencies = [ "vcpkg", ] +[[package]] +name = "overload" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b15813163c1d831bf4a13c3610c05c0d03b39feb07f7e09fa234dac9b15aaf39" + +[[package]] +name = "owo-colors" +version = "3.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c1b04fb49957986fdce4d6ee7a65027d55d4b6d2265e5848bbb507b58ccfdb6f" + [[package]] name = "parity-scale-codec" version = "3.6.12" @@ -2111,35 +2256,35 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8b7cafe60d6cf8e62e1b9b2ea516a089c008945bb5a275416789e7db0bc199dc" dependencies = [ "memchr", - "thiserror 2.0.9", + "thiserror 2.0.11", "ucd-trie", ] [[package]] name = "pin-project" -version = "1.1.7" +version = "1.1.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "be57f64e946e500c8ee36ef6331845d40a93055567ec57e8fae13efd33759b95" +checksum = "1e2ec53ad785f4d35dac0adea7f7dc6f1bb277ad84a680c7afefeae05d1f5916" dependencies = [ "pin-project-internal", ] [[package]] name = "pin-project-internal" -version = "1.1.7" +version = "1.1.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3c0f5fad0874fc7abcd4d750e76917eaebbecaa2c20bde22e1dbeeba8beb758c" +checksum = "d56a66c0c55993aa927429d0f8a0abfd74f084e4d9c192cffed01e418d83eefb" dependencies = [ "proc-macro2", "quote", - "syn 2.0.91", + "syn 2.0.96", ] [[package]] name = "pin-project-lite" -version = "0.2.15" +version = "0.2.16" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "915a1e146535de9163f3987b8944ed8cf49a18bb0056bcebcdcece385cece4ff" +checksum = "3b3cff922bd51709b605d9ead9aa71031d81447142d828eb4a6eba76fe619f9b" [[package]] name = "pin-utils" @@ -2174,12 +2319,12 @@ dependencies = [ [[package]] name = "prettyplease" -version = "0.2.25" +version = "0.2.29" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "64d1ec885c64d0457d564db4ec299b2dae3f9c02808b8ad9c3a089c591b18033" +checksum = "6924ced06e1f7dfe3fa48d57b9f74f55d8915f5036121bef647ef4b204895fac" dependencies = [ "proc-macro2", - "syn 2.0.91", + "syn 2.0.96", ] [[package]] @@ -2221,18 +2366,32 @@ dependencies = [ "proc-macro-error-attr2", "proc-macro2", "quote", - "syn 2.0.91", + "syn 2.0.96", ] [[package]] name = "proc-macro2" -version = "1.0.92" +version = "1.0.93" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "37d3544b3f2748c54e147655edb5025752e2303145b5aefb3c3ea2c78b973bb0" +checksum = "60946a68e5f9d28b0dc1c21bb8a97ee7d018a8b322fa57838ba31cc878e22d99" dependencies = [ "unicode-ident", ] +[[package]] +name = "proc_macro_send" +version = "0.1.0" +dependencies = [ + "anyhow", + "kinode_app_common", + "kinode_process_lib", + "proc-macro2", + "quote", + "serde", + "syn 2.0.96", + "uuid", +] + [[package]] name = "process_macros" version = "0.1.0" @@ -2240,7 +2399,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9ecfcd7b51a1b9249fb47359a9f8d57a9e9dbc71857c5cfd08f98764f7106a3d" dependencies = [ "quote", - "syn 2.0.91", + "syn 2.0.96", ] [[package]] @@ -2257,7 +2416,7 @@ dependencies = [ "rand", "rand_chacha", "rand_xorshift", - "regex-syntax", + "regex-syntax 0.8.5", "rusty-fork", "tempfile", "unarray", @@ -2333,6 +2492,44 @@ dependencies = [ "bitflags", ] +[[package]] +name = "regex" +version = "1.11.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b544ef1b4eac5dc2db33ea63606ae9ffcfac26c1416a2806ae0bf5f56b201191" +dependencies = [ + "aho-corasick", + "memchr", + "regex-automata 0.4.9", + "regex-syntax 0.8.5", +] + +[[package]] +name = "regex-automata" +version = "0.1.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6c230d73fb8d8c1b9c0b3135c5142a8acee3a0558fb8db5cf1cb65f8d7862132" +dependencies = [ + "regex-syntax 0.6.29", +] + +[[package]] +name = "regex-automata" +version = "0.4.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "809e8dc61f6de73b46c85f4c96486310fe304c434cfa43669d7b40f711150908" +dependencies = [ + "aho-corasick", + "memchr", + "regex-syntax 0.8.5", +] + +[[package]] +name = "regex-syntax" +version = "0.6.29" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f162c6dd7b008981e4d40210aca20b4bd0f9b60ca9271061b07f78537722f2e1" + [[package]] name = "regex-syntax" version = "0.8.5" @@ -2341,9 +2538,9 @@ checksum = "2b15c43186be67a4fd63bee50d0303afffcef381492ebe2c5d87f324e1b8815c" [[package]] name = "reqwest" -version = "0.12.9" +version = "0.12.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a77c62af46e79de0a562e1a9849205ffcb7fc1238876e9bd743357570e04046f" +checksum = "43e734407157c3c2034e0258f5e4473ddb361b1e85f95a66690d67264d7cd1da" dependencies = [ "base64", "bytes", @@ -2370,6 +2567,7 @@ dependencies = [ "sync_wrapper", "tokio", "tokio-native-tls", + "tower", "tower-service", "url", "wasm-bindgen", @@ -2485,14 +2683,14 @@ version = "0.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "cfcb3a22ef46e85b45de6ee7e79d063319ebb6594faafcf1c225ea92ab6e9b92" dependencies = [ - "semver 1.0.24", + "semver 1.0.25", ] [[package]] name = "rustix" -version = "0.38.42" +version = "0.38.43" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f93dc38ecbab2eb790ff964bb77fa94faf256fd3e73285fd7ba0903b76bedb85" +checksum = "a78891ee6bf2340288408954ac787aa063d8e8817e9f53abb37c695c6d834ef6" dependencies = [ "bitflags", "errno", @@ -2518,9 +2716,9 @@ checksum = "d2bf47e6ff922db3825eb750c4e2ff784c6ff8fb9e13046ef6a1d1c5401b0b37" [[package]] name = "rustversion" -version = "1.0.18" +version = "1.0.19" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0e819f2bc632f285be6d7cd36e25940d45b2391dd6d9b939e79de557f7014248" +checksum = "f7c45b9784283f1b2e7fb61b42047c2fd678ef0960d4f6f1eba131594cc369d4" [[package]] name = "rusty-fork" @@ -2551,9 +2749,9 @@ dependencies = [ [[package]] name = "schnellru" -version = "0.2.3" +version = "0.2.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c9a8ef13a93c54d20580de1e5c413e624e53121d42fc7e2c11d10ef7f8b02367" +checksum = "356285bbf17bea63d9e52e96bd18f039672ac92b55b8cb997d6162a2a37d1649" dependencies = [ "ahash", "cfg-if", @@ -2595,9 +2793,9 @@ dependencies = [ [[package]] name = "security-framework-sys" -version = "2.13.0" +version = "2.14.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1863fd3768cd83c56a7f60faa4dc0d403f1b6df0a38c3c25f44b7894e45370d5" +checksum = "49db231d56a190491cb4aeda9527f1ad45345af50b0851622a7adb8c03b01c32" dependencies = [ "core-foundation-sys", "libc", @@ -2614,9 +2812,9 @@ dependencies = [ [[package]] name = "semver" -version = "1.0.24" +version = "1.0.25" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3cb6eb87a131f756572d7fb904f6e7b68633f09cca868c5df1c4b8d1a694bbba" +checksum = "f79dfe2d285b0488816f30e700a7438c5a73d816b5b7d3ac72fbc48b0d185e03" [[package]] name = "semver-parser" @@ -2629,29 +2827,29 @@ dependencies = [ [[package]] name = "serde" -version = "1.0.216" +version = "1.0.217" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0b9781016e935a97e8beecf0c933758c97a5520d32930e460142b4cd80c6338e" +checksum = "02fc4265df13d6fa1d00ecff087228cc0a2b5f3c0e87e258d8b94a156e984c70" dependencies = [ "serde_derive", ] [[package]] name = "serde_derive" -version = "1.0.216" +version = "1.0.217" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "46f859dbbf73865c6627ed570e78961cd3ac92407a2d117204c49232485da55e" +checksum = "5a9bf7cf98d04a2b28aead066b7496853d4779c9cc183c440dbac457641e19a0" dependencies = [ "proc-macro2", "quote", - "syn 2.0.91", + "syn 2.0.96", ] [[package]] name = "serde_json" -version = "1.0.134" +version = "1.0.137" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d00f4175c42ee48b15416f6193a959ba3a0d67fc699a0db9ad12df9f83991c7d" +checksum = "930cfb6e6abf99298aaad7d29abbef7a9999a9a8806a40088f55f0dcec03146b" dependencies = [ "itoa", "memchr", @@ -2702,6 +2900,27 @@ dependencies = [ "cfg-if", ] +[[package]] +name = "sharded-slab" +version = "0.1.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f40ca3c46823713e0d4209592e8d6e826aa57e928f09752619fc696c499637f6" +dependencies = [ + "lazy_static", +] + +[[package]] +name = "shared" +version = "0.1.0" +dependencies = [ + "kinode_app_common", + "kinode_process_lib", + "process_macros", + "serde", + "serde_json", + "wit-bindgen", +] + [[package]] name = "shlex" version = "1.3.0" @@ -2748,9 +2967,9 @@ dependencies = [ [[package]] name = "spdx" -version = "0.10.7" +version = "0.10.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bae30cc7bfe3656d60ee99bf6836f472b0c53dddcbf335e253329abb16e535a2" +checksum = "58b69356da67e2fc1f542c71ea7e654a361a79c938e4424392ecf4fa065d2193" dependencies = [ "smallvec", ] @@ -2792,11 +3011,11 @@ version = "0.26.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4c6bee85a5a24955dc440386795aa378cd9cf82acd5f764469152d2270e581be" dependencies = [ - "heck 0.5.0", + "heck", "proc-macro2", "quote", "rustversion", - "syn 2.0.91", + "syn 2.0.96", ] [[package]] @@ -2818,9 +3037,9 @@ dependencies = [ [[package]] name = "syn" -version = "2.0.91" +version = "2.0.96" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d53cbcb5a243bd33b7858b1d7f4aca2153490815872d86d955d6ea29f743c035" +checksum = "d5d0adab1ae378d7f53bdebc67a39f1f151407ef230f0ce2883572f5d8985c80" dependencies = [ "proc-macro2", "quote", @@ -2829,14 +3048,14 @@ dependencies = [ [[package]] name = "syn-solidity" -version = "0.8.15" +version = "0.8.19" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "219389c1ebe89f8333df8bdfb871f6631c552ff399c23cac02480b6088aad8f0" +checksum = "b84e4d83a0a6704561302b917a932484e1cae2d8c6354c64be8b7bac1c1fe057" dependencies = [ "paste", "proc-macro2", "quote", - "syn 2.0.91", + "syn 2.0.96", ] [[package]] @@ -2856,7 +3075,7 @@ checksum = "c8af7666ab7b6390ab78131fb5b0fce11d6b7a6951602017c35fa82800708971" dependencies = [ "proc-macro2", "quote", - "syn 2.0.91", + "syn 2.0.96", ] [[package]] @@ -2867,12 +3086,13 @@ checksum = "55937e1799185b12863d447f42597ed69d9928686b8d88a1df17376a097d8369" [[package]] name = "tempfile" -version = "3.14.0" +version = "3.15.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "28cce251fcbc87fac86a866eeb0d6c2d536fc16d06f184bb61aeae11aa4cee0c" +checksum = "9a8a559c81686f576e8cd0290cd2a24a2a9ad80c98b3478856500fcbd7acd704" dependencies = [ "cfg-if", "fastrand", + "getrandom", "once_cell", "rustix", "windows-sys 0.59.0", @@ -2889,11 +3109,11 @@ dependencies = [ [[package]] name = "thiserror" -version = "2.0.9" +version = "2.0.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f072643fd0190df67a8bab670c20ef5d8737177d6ac6b2e9a236cb096206b2cc" +checksum = "d452f284b73e6d76dd36758a0c8684b1d5be31f92b89d07fd5822175732206fc" dependencies = [ - "thiserror-impl 2.0.9", + "thiserror-impl 2.0.11", ] [[package]] @@ -2904,18 +3124,28 @@ checksum = "4fee6c4efc90059e10f81e6d42c60a18f76588c3d74cb83a0b242a2b6c7504c1" dependencies = [ "proc-macro2", "quote", - "syn 2.0.91", + "syn 2.0.96", ] [[package]] name = "thiserror-impl" -version = "2.0.9" +version = "2.0.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7b50fa271071aae2e6ee85f842e2e28ba8cd2c5fb67f11fcb1fd70b276f9e7d4" +checksum = "26afc1baea8a989337eeb52b6e72a039780ce45c3edfcc9c5b9d112feeb173c2" dependencies = [ "proc-macro2", "quote", - "syn 2.0.91", + "syn 2.0.96", +] + +[[package]] +name = "thread_local" +version = "1.1.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8b9ef9bad013ada3808854ceac7b46812a6465ba368859a37e2100283d2d719c" +dependencies = [ + "cfg-if", + "once_cell", ] [[package]] @@ -2948,9 +3178,9 @@ dependencies = [ [[package]] name = "tokio" -version = "1.42.0" +version = "1.43.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5cec9b21b0450273377fc97bd4c33a8acffc8c996c987a7c5b319a0083707551" +checksum = "3d61fa4ffa3de412bfea335c6ecff681de2b609ba3c77ef3e00e521813a9ed9e" dependencies = [ "backtrace", "bytes", @@ -2964,13 +3194,13 @@ dependencies = [ [[package]] name = "tokio-macros" -version = "2.4.0" +version = "2.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "693d596312e88961bc67d7f1f97af8a70227d9f90c31bba5806eec004978d752" +checksum = "6e06d43f1345a3bcd39f6a56dbb7dcab2ba47e68e8ac134855e7e2bdbaf8cab8" dependencies = [ "proc-macro2", "quote", - "syn 2.0.91", + "syn 2.0.96", ] [[package]] @@ -3035,6 +3265,7 @@ dependencies = [ "futures-util", "pin-project-lite", "sync_wrapper", + "tokio", "tower-layer", "tower-service", ] @@ -3070,7 +3301,7 @@ checksum = "395ae124c09f9e6918a2310af6038fba074bcf474ac352496d5910dd59a2226d" dependencies = [ "proc-macro2", "quote", - "syn 2.0.91", + "syn 2.0.96", ] [[package]] @@ -3080,6 +3311,59 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e672c95779cf947c5311f83787af4fa8fffd12fb27e4993211a84bdfd9610f9c" dependencies = [ "once_cell", + "valuable", +] + +[[package]] +name = "tracing-error" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8b1581020d7a273442f5b45074a6a57d5757ad0a47dac0e9f0bd57b81936f3db" +dependencies = [ + "tracing", + "tracing-subscriber", +] + +[[package]] +name = "tracing-log" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ee855f1f400bd0e5c02d150ae5de3840039a3f54b025156404e34c23c03f47c3" +dependencies = [ + "log", + "once_cell", + "tracing-core", +] + +[[package]] +name = "tracing-serde" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "704b1aeb7be0d0a84fc9828cae51dab5970fee5088f83d1dd7ee6f6246fc6ff1" +dependencies = [ + "serde", + "tracing-core", +] + +[[package]] +name = "tracing-subscriber" +version = "0.3.19" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e8189decb5ac0fa7bc8b96b7cb9b2701d60d48805aca84a238004d665fcc4008" +dependencies = [ + "matchers", + "nu-ansi-term", + "once_cell", + "regex", + "serde", + "serde_json", + "sharded-slab", + "smallvec", + "thread_local", + "tracing", + "tracing-core", + "tracing-log", + "tracing-serde", ] [[package]] @@ -3130,12 +3414,6 @@ version = "1.0.14" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "adb9e6ca4f869e1180728b7950e35922a7fc6397f7b641499e8f3ef06e50dc83" -[[package]] -name = "unicode-segmentation" -version = "1.12.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f6ccf251212114b54433ec949fd6a7841275f9ada20dddd2f29e9ceea4501493" - [[package]] name = "unicode-xid" version = "0.2.6" @@ -3165,11 +3443,20 @@ version = "1.0.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b6c140620e7ffbb22c2dee59cafe6084a59b5ffc27a8859a5f0d494b5d52b6be" +[[package]] +name = "uuid" +version = "1.12.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "744018581f9a3454a9e15beb8a33b017183f1e7c0cd170232a2d1453b23a51c4" +dependencies = [ + "getrandom", +] + [[package]] name = "valuable" -version = "0.1.0" +version = "0.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "830b7e5d4d90034032940e4ace0d9a9a057e7a45cd94e6c007832e39edb82f6d" +checksum = "ba73ea9cf16a25df0c8caa16c51acb937d5712a8429db78a3ee29d5dcacd3a65" [[package]] name = "vcpkg" @@ -3209,34 +3496,35 @@ checksum = "9c8d87e72b64a3b4db28d11ce29237c246188f4f51057d65a7eab63b7987e423" [[package]] name = "wasm-bindgen" -version = "0.2.99" +version = "0.2.100" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a474f6281d1d70c17ae7aa6a613c87fce69a127e2624002df63dcb39d6cf6396" +checksum = "1edc8929d7499fc4e8f0be2262a241556cfc54a0bea223790e71446f2aab1ef5" dependencies = [ "cfg-if", "once_cell", + "rustversion", "wasm-bindgen-macro", ] [[package]] name = "wasm-bindgen-backend" -version = "0.2.99" +version = "0.2.100" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5f89bb38646b4f81674e8f5c3fb81b562be1fd936d84320f3264486418519c79" +checksum = "2f0a0651a5c2bc21487bde11ee802ccaf4c51935d0d3d42a6101f98161700bc6" dependencies = [ "bumpalo", "log", "proc-macro2", "quote", - "syn 2.0.91", + "syn 2.0.96", "wasm-bindgen-shared", ] [[package]] name = "wasm-bindgen-futures" -version = "0.4.49" +version = "0.4.50" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "38176d9b44ea84e9184eff0bc34cc167ed044f816accfe5922e54d84cf48eca2" +checksum = "555d470ec0bc3bb57890405e5d4322cc9ea83cebb085523ced7be4144dac1e61" dependencies = [ "cfg-if", "js-sys", @@ -3247,9 +3535,9 @@ dependencies = [ [[package]] name = "wasm-bindgen-macro" -version = "0.2.99" +version = "0.2.100" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2cc6181fd9a7492eef6fef1f33961e3695e4579b9872a6f7c83aee556666d4fe" +checksum = "7fe63fc6d09ed3792bd0897b314f53de8e16568c2b3f7982f468c0bf9bd0b407" dependencies = [ "quote", "wasm-bindgen-macro-support", @@ -3257,30 +3545,24 @@ dependencies = [ [[package]] name = "wasm-bindgen-macro-support" -version = "0.2.99" +version = "0.2.100" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "30d7a95b763d3c45903ed6c81f156801839e5ee968bb07e534c44df0fcd330c2" +checksum = "8ae87ea40c9f689fc23f209965b6fb8a99ad69aeeb0231408be24920604395de" dependencies = [ "proc-macro2", "quote", - "syn 2.0.91", + "syn 2.0.96", "wasm-bindgen-backend", "wasm-bindgen-shared", ] [[package]] name = "wasm-bindgen-shared" -version = "0.2.99" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "943aab3fdaaa029a6e0271b35ea10b72b943135afe9bffca82384098ad0e06a6" - -[[package]] -name = "wasm-encoder" -version = "0.202.0" +version = "0.2.100" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bfd106365a7f5f7aa3c1916a98cbb3ad477f5ff96ddb130285a91c6e7429e67a" +checksum = "1a05d73b933a847d6cccdda8f838a22ff101ad9bf93e33684f39c1f5f0eece3d" dependencies = [ - "leb128", + "unicode-ident", ] [[package]] @@ -3290,23 +3572,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ebf48234b389415b226a4daef6562933d38c7b28a8b8f64c5c4130dad1561ab7" dependencies = [ "leb128", - "wasmparser 0.220.0", -] - -[[package]] -name = "wasm-metadata" -version = "0.202.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "094aea3cb90e09f16ee25a4c0e324b3e8c934e7fd838bfa039aef5352f44a917" -dependencies = [ - "anyhow", - "indexmap", - "serde", - "serde_derive", - "serde_json", - "spdx", - "wasm-encoder 0.202.0", - "wasmparser 0.202.0", + "wasmparser", ] [[package]] @@ -3321,19 +3587,8 @@ dependencies = [ "serde_derive", "serde_json", "spdx", - "wasm-encoder 0.220.0", - "wasmparser 0.220.0", -] - -[[package]] -name = "wasmparser" -version = "0.202.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d6998515d3cf3f8b980ef7c11b29a9b1017d4cf86b99ae93b546992df9931413" -dependencies = [ - "bitflags", - "indexmap", - "semver 1.0.24", + "wasm-encoder", + "wasmparser", ] [[package]] @@ -3346,7 +3601,7 @@ dependencies = [ "bitflags", "hashbrown 0.14.5", "indexmap", - "semver 1.0.24", + "semver 1.0.25", ] [[package]] @@ -3365,14 +3620,36 @@ dependencies = [ [[package]] name = "web-sys" -version = "0.3.76" +version = "0.3.77" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "04dd7223427d52553d3702c004d3b2fe07c148165faa56313cb00211e31c12bc" +checksum = "33b6dd2ef9186f1f2072e409e99cd22a975331a6b3591b12c764e0e55c60d5d2" dependencies = [ "js-sys", "wasm-bindgen", ] +[[package]] +name = "winapi" +version = "0.3.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5c839a674fcd7a98952e593242ea400abe93992746761e38641405d28b00f419" +dependencies = [ + "winapi-i686-pc-windows-gnu", + "winapi-x86_64-pc-windows-gnu", +] + +[[package]] +name = "winapi-i686-pc-windows-gnu" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ac3b87c63620426dd9b991e5ce0329eff545bccbbb34f3be09ff6fb6ab51b7b6" + +[[package]] +name = "winapi-x86_64-pc-windows-gnu" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f" + [[package]] name = "windows-registry" version = "0.2.0" @@ -3487,41 +3764,21 @@ checksum = "589f6da84c646204747d1270a2a5661ea66ed1cced2631d546fdfb155959f9ec" [[package]] name = "winnow" -version = "0.6.20" +version = "0.6.24" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "36c1fec1a2bb5866f07c25f68c26e565c4c200aebb96d7e55710c19d3e8ac49b" +checksum = "c8d71a593cc5c42ad7876e2c1fda56f314f3754c084128833e64f1345ff8a03a" dependencies = [ "memchr", ] -[[package]] -name = "wit-bindgen" -version = "0.24.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9fb4e7653763780be47e38f479e9aa83c768aa6a3b2ed086dc2826fdbbb7e7f5" -dependencies = [ - "wit-bindgen-rt 0.24.0", - "wit-bindgen-rust-macro 0.24.0", -] - [[package]] name = "wit-bindgen" version = "0.36.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6a2b3e15cd6068f233926e7d8c7c588b2ec4fb7cc7bf3824115e7c7e2a8485a3" dependencies = [ - "wit-bindgen-rt 0.36.0", - "wit-bindgen-rust-macro 0.36.0", -] - -[[package]] -name = "wit-bindgen-core" -version = "0.24.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9b67e11c950041849a10828c7600ea62a4077c01e8af72e8593253575428f91b" -dependencies = [ - "anyhow", - "wit-parser 0.202.0", + "wit-bindgen-rt", + "wit-bindgen-rust-macro", ] [[package]] @@ -3531,17 +3788,8 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b632a5a0fa2409489bd49c9e6d99fcc61bb3d4ce9d1907d44662e75a28c71172" dependencies = [ "anyhow", - "heck 0.5.0", - "wit-parser 0.220.0", -] - -[[package]] -name = "wit-bindgen-rt" -version = "0.24.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3b0780cf7046630ed70f689a098cd8d56c5c3b22f2a7379bbdb088879963ff96" -dependencies = [ - "bitflags", + "heck", + "wit-parser", ] [[package]] @@ -3553,20 +3801,6 @@ dependencies = [ "bitflags", ] -[[package]] -name = "wit-bindgen-rust" -version = "0.24.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "30acbe8fb708c3a830a33c4cb705df82659bf831b492ec6ca1a17a369cfeeafb" -dependencies = [ - "anyhow", - "heck 0.4.1", - "indexmap", - "wasm-metadata 0.202.0", - "wit-bindgen-core 0.24.0", - "wit-component 0.202.0", -] - [[package]] name = "wit-bindgen-rust" version = "0.36.0" @@ -3574,27 +3808,13 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4329de4186ee30e2ef30a0533f9b3c123c019a237a7c82d692807bf1b3ee2697" dependencies = [ "anyhow", - "heck 0.5.0", + "heck", "indexmap", "prettyplease", - "syn 2.0.91", - "wasm-metadata 0.220.0", - "wit-bindgen-core 0.36.0", - "wit-component 0.220.0", -] - -[[package]] -name = "wit-bindgen-rust-macro" -version = "0.24.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2b1b06eae85feaecdf9f2854f7cac124e00d5a6e5014bfb02eb1ecdeb5f265b9" -dependencies = [ - "anyhow", - "proc-macro2", - "quote", - "syn 2.0.91", - "wit-bindgen-core 0.24.0", - "wit-bindgen-rust 0.24.0", + "syn 2.0.96", + "wasm-metadata", + "wit-bindgen-core", + "wit-component", ] [[package]] @@ -3607,28 +3827,9 @@ dependencies = [ "prettyplease", "proc-macro2", "quote", - "syn 2.0.91", - "wit-bindgen-core 0.36.0", - "wit-bindgen-rust 0.36.0", -] - -[[package]] -name = "wit-component" -version = "0.202.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0c836b1fd9932de0431c1758d8be08212071b6bba0151f7bac826dbc4312a2a9" -dependencies = [ - "anyhow", - "bitflags", - "indexmap", - "log", - "serde", - "serde_derive", - "serde_json", - "wasm-encoder 0.202.0", - "wasm-metadata 0.202.0", - "wasmparser 0.202.0", - "wit-parser 0.202.0", + "syn 2.0.96", + "wit-bindgen-core", + "wit-bindgen-rust", ] [[package]] @@ -3644,28 +3845,10 @@ dependencies = [ "serde", "serde_derive", "serde_json", - "wasm-encoder 0.220.0", - "wasm-metadata 0.220.0", - "wasmparser 0.220.0", - "wit-parser 0.220.0", -] - -[[package]] -name = "wit-parser" -version = "0.202.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "744237b488352f4f27bca05a10acb79474415951c450e52ebd0da784c1df2bcc" -dependencies = [ - "anyhow", - "id-arena", - "indexmap", - "log", - "semver 1.0.24", - "serde", - "serde_derive", - "serde_json", - "unicode-xid", - "wasmparser 0.202.0", + "wasm-encoder", + "wasm-metadata", + "wasmparser", + "wit-parser", ] [[package]] @@ -3678,12 +3861,12 @@ dependencies = [ "id-arena", "indexmap", "log", - "semver 1.0.24", + "semver 1.0.25", "serde", "serde_derive", "serde_json", "unicode-xid", - "wasmparser 0.220.0", + "wasmparser", ] [[package]] @@ -3727,7 +3910,7 @@ checksum = "2380878cad4ac9aac1e2435f3eb4020e8374b5f13c296cb75b4620ff8e229154" dependencies = [ "proc-macro2", "quote", - "syn 2.0.91", + "syn 2.0.96", "synstructure", ] @@ -3749,7 +3932,7 @@ checksum = "fa4f8080344d4671fb4e831a13ad1e68092748387dfc4f55e356242fae12ce3e" dependencies = [ "proc-macro2", "quote", - "syn 2.0.91", + "syn 2.0.96", ] [[package]] @@ -3769,7 +3952,7 @@ checksum = "595eed982f7d355beb85837f651fa22e90b3c044842dc7f2c2842c086f295808" dependencies = [ "proc-macro2", "quote", - "syn 2.0.91", + "syn 2.0.96", "synstructure", ] @@ -3790,7 +3973,7 @@ checksum = "ce36e65b0d2999d2aafac989fb249189a141aee1f53c612c1f37d72631959f69" dependencies = [ "proc-macro2", "quote", - "syn 2.0.91", + "syn 2.0.96", ] [[package]] @@ -3812,5 +3995,5 @@ checksum = "6eafa6dfb17584ea3e2bd6e76e0cc15ad7af12b09abdd1ca55961bed9b1063c6" dependencies = [ "proc-macro2", "quote", - "syn 2.0.91", + "syn 2.0.96", ] diff --git a/Cargo.toml b/Cargo.toml index 170354f..ccf7c94 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,13 +1,14 @@ -[package] -name = "kinode-app-framework" -version = "0.1.0" -edition = "2021" -authors = ["dr-frmr "] +[workspace] +resolver = "2" +members = [ + "async-requester", + "async-receiver-a", + "async-receiver-b", + "async-receiver-c", + "lib/shared", +] -[dependencies] -anyhow = "1.0" -kinode_process_lib = "0.10.1" -process_macros = "0.1" -serde = { version = "1.0", features = ["derive"] } -serde_json = "1.0" -wit-bindgen = "0.24.0" +[profile.release] +panic = "abort" +opt-level = "s" +lto = true diff --git a/README.md b/README.md index 313749d..1012176 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,332 @@ -# kinode-app-framework +# πŸ”₯πŸš€πŸ€˜ Kinode Processes 2.0 πŸ”₯πŸš€πŸ€˜ -A crate that provides a framework for building full-stack Kinode apps in Rust. +Shoutout to Doria (@dr-frmr) for the initial app idea, this is just a lot of sugar on top. -WIP. +## Overview + +Key Macros: + +- `erect!` – Defines and exports your process: name, icon, HTTP/WS endpoints, handlers, and initialization logic. +- `declare_types!` – Declares strongly typed request/response enums for your message flows. +- `send_async!` – Sends a request with an optional callback, timeout, and on-timeout behavior. +- `fan_out!` – Sends multiple requests in parallel and aggregates their results into a single callback. +- `timer!` – Creates a timer that will invoke a callback after a specified duration. + +## Declaring and Erecting Your App + +The `erect!` macro is your main entry point. + +```rust +use kinode_app_common::{erect, Binding, State}; +use kinode_process_lib::http::server::{HttpBindingConfig, WsBindingConfig}; +use kinode_process_lib::{Message, kiprintln}; + +fn init_fn(state: &mut MyState) { + kiprintln!("Initializing My Cool Process!"); + // Optionally schedule timers, run initial tasks, etc. +} + +/// Example local handler for messages sent within the same node +fn my_local_handler( + _message: &Message, + _state: &mut MyState, + _server: &mut kinode_process_lib::http::server::HttpServer, + request: SomeLocalRequestType, +) { + kiprintln!("Received local request: {:?}", request); + // ... +} + +erect!( + // The name displayed in logs or UI + name: "My Cool Process", + + // Optional icon for a GUI environment + icon: Some("icon-identifier"), + + // Optional widget name for embedding in a UI + widget: None, + + // Optional HTTP config for serving a UI at path "/" + ui: Some(HttpBindingConfig::default()), + + // HTTP/WS endpoints + endpoints: [ + Binding::Http { + path: "/api", + config: HttpBindingConfig::default(), + }, + Binding::Ws { + path: "/ws", + config: WsBindingConfig::default(), + }, + ], + + // Handlers for different message classes + handlers: { + // For HTTP API calls + api: my_http_handler_function, + + // For local (same-node) messages + local: my_local_handler, + + // For remote messages (from other nodes) + remote: _, + + // For WebSocket messages + ws: _, + }, + + // Initialization function + init: init_fn +); +``` + +### Handler Parameters + +Each handler receives: + +- A Message object for raw metadata. +- A mutable reference to your State. +- A reference to the process’s HTTP server (so you can respond or manipulate connections). +- A typed request object, which you define (e.g., SomeLocalRequestType). +- Use `_` if you have no need for that particular type of message. Just make sure to at least declare one handler, or the macro will crash (and your process does nothing). + +## Defining State + +Every process has some notion of application state. You define a struct that implements the State trait: + +```rust +#[derive(Debug, Serialize, Deserialize)] +pub struct MyState { + pub counter: u64, +} + +impl State for MyState { + fn new() -> Self { + Self { counter: 0 } + } +} +``` + +## Declaring Messaging Types + +The declare_types! macro lets you define strongly typed request-response pairs. For example: + +```rust +use kinode_app_common::declare_types; + +declare_types! { + Async { + StepA String => i32 + StepB i32 => u64 + StepC u64 => String + Gather () => Result + }, + Commodore { + Power SomeStruct => SomeOtherStruct + Excitement i32 => Result + }, +} +``` + +This expands into something like: + +```rust +#[derive(Debug, Serialize, Deserialize, Clone)] +pub enum Req { + Async(AsyncRequest), + Commodore(CommodoreRequest), +} + +#[derive(Debug, Serialize, Deserialize, Clone)] +pub enum AsyncRequest { + StepA(String), + StepB(i32), + StepC(u64), + Gather(()), +} + +#[derive(Debug, Serialize, Deserialize, Clone)] +pub enum AsyncResponse { + StepA(i32), + StepB(u64), + StepC(String), + Gather(Result), +} + +#[derive(Debug, Serialize, Deserialize, Clone)] +pub enum CommodoreRequest { + Power(SomeStruct), + Excitement(i32), +} + +#[derive(Debug, Serialize, Deserialize, Clone)] +pub enum CommodoreResponse { + Power(SomeOtherStruct), + Excitement(Result), +} +``` + +**Convention: If you define Request, the framework expects a corresponding Response. Each request variant has exactly one matching response variant, ensuring your callbacks get the right type automatically.** + +## Async Sends + +Once you have your request/response enums, you can easily invoke another process with send_async!. This macro: + +- Serializes your request. +- Sends it to the target address. +- Registers a callback that is executed when the matching response arrives. +- Optionally sets a timeout (in seconds). +- Optionally runs an on_timeout block if no response is received in time. +- Example (showing partial usage of optional timeout and callback): + +```rust +use kinode_process_lib::Address; +use proc_macro_send::send_async; // re-export from kinode_app_common + +fn message_a(state: &mut MyState) { + // We'll send "StepA" to the remote "Async Receiver A". + // If a response arrives before 20 seconds, run the callback block. + // If it times out, run the `on_timeout` block. + send_async!( + Address::new("our", "async-receiver-a", "async-app", "template.os"), + AsyncRequest::StepA("Mashed Potatoes".to_string()), + (resp, st: MyState) { + // This callback is invoked on success with the typed response + on_step_a(resp, st); + }, + 20, + on_timeout => { + kiprintln!("Request StepA timed out!"); + } + ); +} + +fn on_step_a(response: i32, state: &mut MyState) { + kiprintln!("Sender: Received response: {}", response); + kiprintln!("Sender: State: {}", state.counter); + state.counter += 1; + + // Chain to Step B + send_async!( + Address::new("our", "async-receiver-a", "async-app", "template.os"), + AsyncRequest::StepB(response), + (resp, st: MyState) { + on_step_b(resp, st); + }, + ); +} + +fn on_step_b(response: u64, state: &mut MyState) { + kiprintln!("Sender: StepB response => {}", response); + state.counter += 1; + // ... +} +``` + +## Fan-out / Aggregation + +Sometimes you want to send multiple requests in parallel, gather all responses, and then run a single callback. This is what the fan_out! macro does: + +```rust +use kinode_app_common::fan_out; +use kinode_process_lib::Address; + +fn fanout_message(state: &mut MyState) { + let addresses: Vec
= vec![ + Address::new("our", "async-receiver-a", "async-app", "template.os"), + Address::new("our", "async-receiver-b", "async-app", "template.os"), + ]; + + let requests: Vec = vec![ + AsyncRequest::Gather(()), + AsyncRequest::Gather(()), + ]; + + // We'll wait up to 5 seconds for each sub-request + fan_out!( + addresses, + requests, + (all_results, st: MyState) { + kiprintln!("Fan-out complete => subresponses: {:#?}", all_results); + st.counter += 1; + }, + 5 + ); +} +``` + +Every request in requests is sent to the corresponding item in addresses. +If a request times out or fails to send, it contributes an Err(...) to all_results. +Once all requests are finished (or errored), the (all_results, st: MyState) { ... } block runs. + +## Timers + +Easily schedule recurring or one-off timers with the timer! macro. For example: + +```rust +use kinode_app_common::timer; + +fn repeated_timer(state: &mut MyState) { + // Do something, e.g. log your current counter + kiprintln!("Timer fired! Counter = {}", state.counter); + + // Maybe increment state + state.counter += 1; + + // Schedule the next timer + timer!(3000, (st: MyState) { + // This block will run in 3 seconds + repeated_timer(st); + }); +} +``` + +## Example Flow + +My university teacher that hasn't produced anything meaningful in 25 years always told us that we should always draw diagrams. So here is a diagram. + +```mermaid +sequenceDiagram + participant T as Terminal + participant R as Async Requester + participant Timer as Timer + participant A as Async Receiver A + participant B as Async Receiver B + participant C as Async Receiver C + participant X as Invalid Address + participant Y as Invalid Address + + %% Terminal triggers the requester (via a local handler) + T->>R: Terminal command ("abc") + Note over R: `kino_local_handler` triggers message_a() + + %% Chain of asynchronous sends (StepA -> StepB -> StepC) targeting Receiver A + R->>A: send AsyncRequest::StepA("Mashed Potatoes") + A-->>R: AsyncResponse::StepA(length) + R->>A: send AsyncRequest::StepB(response) + A-->>R: AsyncResponse::StepB(2 x response) + R->>A: send AsyncRequest::StepC(response) + A-->>R: AsyncResponse::StepC(String) + + %% Repeated timer initiated in the Requester + Timer->>R: repeated timer tick\n(log & update counter) + + %% Fan-out: Requester sends Gather requests to multiple addresses + Note over R: Fan-out: sending Gather requests + R->>A: AsyncRequest::Gather(()) + R->>B: AsyncRequest::Gather(()) + R->>C: AsyncRequest::Gather(()) + R->>X: AsyncRequest::Gather(()) %% non-existent receiver + R->>Y: AsyncRequest::Gather(()) %% non-existent receiver + + alt Aggregating Fan-Out Responses + A-->>R: AsyncResponse::Gather(Ok("Hello from A")) + B-->>R: AsyncResponse::Gather(Ok("Hello from B")) + C-->>R: AsyncResponse::Gather(Ok("Hello from C")) + X-->>R: Error/Timeout + Y-->>R: Error/Timeout + end + R->>R: Process aggregated results & update state +``` diff --git a/api/async-app:template.os-v0.wit b/api/async-app:template.os-v0.wit new file mode 100644 index 0000000..a251c07 --- /dev/null +++ b/api/async-app:template.os-v0.wit @@ -0,0 +1,3 @@ +world async-app-template-dot-os-v0 { + include process-v1; +} diff --git a/async-receiver-a/Cargo.toml b/async-receiver-a/Cargo.toml new file mode 100644 index 0000000..3229736 --- /dev/null +++ b/async-receiver-a/Cargo.toml @@ -0,0 +1,25 @@ +[package] +name = "async-receiver-a" +version = "0.1.0" +edition = "2021" +publish = false + +[dependencies] +anyhow = "1.0" +kinode_process_lib = { version = "0.10.2", features = ["logging"] } +process_macros = "0.1.0" +serde = { version = "1.0", features = ["derive"] } +serde_json = "1.0" +wit-bindgen = "0.36.0" +once_cell = "1.20.2" +uuid = { version = "1.0", features = ["v4"] } +kinode_app_common = { path = "../crates/kinode_app_common" } +proc_macro_send = { path = "../crates/proc_macro_send" } +shared = { path = "../lib/shared" } + +[lib] +crate-type = ["cdylib"] + +[package.metadata.component] +package = "kinode:process" + diff --git a/async-receiver-a/src/kino_local_handlers.rs b/async-receiver-a/src/kino_local_handlers.rs new file mode 100644 index 0000000..72246da --- /dev/null +++ b/async-receiver-a/src/kino_local_handlers.rs @@ -0,0 +1,34 @@ +use crate::*; + +/// This will get triggered with a terminal request +/// For example, if you run `m our@async-app:async-app:template.os '"abc"'` +/// Then we will message the async receiver who will sleep 3s then answer. +pub fn kino_local_handler( + _message: &Message, + _state: &mut AppState, + _server: &mut HttpServer, + request: AsyncRequest, +) { + kiprintln!("Receiver: Received request: {:?}", request); + kiprintln!("Receiver: Sleeping for 3 seconds..."); + std::thread::sleep(std::time::Duration::from_secs(3)); + + let response_body = match request { + AsyncRequest::StepA(my_string) => { + kiprintln!("Receiver: Handling StepA"); + AsyncResponse::StepA(my_string.len() as i32) + } + AsyncRequest::StepB(i32_val) => { + kiprintln!("Receiver: Handling StepB"); + AsyncResponse::StepB(i32_val as u64 * 2) + } + AsyncRequest::StepC(u64_val) => { + kiprintln!("Receiver: Handling StepC"); + AsyncResponse::StepC(format!("Hello from the other side C: {}", u64_val)) + } + AsyncRequest::Gather(_) => AsyncResponse::Gather(Ok("Hello from A".to_string())), + }; + + kiprintln!("Receiver: Sending response: {:?}", response_body); + let _ = Response::new().body(response_body).send(); +} diff --git a/async-receiver-a/src/lib.rs b/async-receiver-a/src/lib.rs new file mode 100644 index 0000000..6a3ec89 --- /dev/null +++ b/async-receiver-a/src/lib.rs @@ -0,0 +1,48 @@ +use kinode_process_lib::http::server::HttpServer; +use kinode_process_lib::{kiprintln, Message}; +use serde::{Deserialize, Serialize}; + +use kinode_app_common::{erect, Binding, State}; +use kinode_process_lib::http::server::{HttpBindingConfig, WsBindingConfig}; +use kinode_process_lib::Response; +mod kino_local_handlers; +mod structs; + +use kino_local_handlers::*; +use shared::*; +use structs::*; + +wit_bindgen::generate!({ + path: "target/wit", + world: "async-app-template-dot-os-v0", + generate_unused_types: true, + additional_derives: [serde::Deserialize, serde::Serialize, process_macros::SerdeJsonInto], +}); + +fn init_fn(_state: &mut AppState) { + kiprintln!("Initializing Async Receiver A"); +} + +erect!( + name: "Async Receiver A", + icon: None, + widget: None, + ui: Some(HttpBindingConfig::default()), + endpoints: [ + Binding::Http { + path: "/api", + config: HttpBindingConfig::default(), + }, + Binding::Ws { + path: "/updates", + config: WsBindingConfig::default(), + }, + ], + handlers: { + api: _, + local: kino_local_handler, + remote: _, + ws: _, + }, + init: init_fn +); diff --git a/async-receiver-a/src/structs.rs b/async-receiver-a/src/structs.rs new file mode 100644 index 0000000..7bbb5fa --- /dev/null +++ b/async-receiver-a/src/structs.rs @@ -0,0 +1,12 @@ +use crate::*; + +#[derive(Debug, Serialize, Deserialize)] +pub struct AppState { + pub counter: u64, +} + +impl State for AppState { + fn new() -> Self { + Self { counter: 0 } + } +} diff --git a/async-receiver-b/Cargo.toml b/async-receiver-b/Cargo.toml new file mode 100644 index 0000000..45f6a40 --- /dev/null +++ b/async-receiver-b/Cargo.toml @@ -0,0 +1,25 @@ +[package] +name = "async-receiver-b" +version = "0.1.0" +edition = "2021" +publish = false + +[dependencies] +anyhow = "1.0" +kinode_process_lib = { version = "0.10.2", features = ["logging"] } +process_macros = "0.1.0" +serde = { version = "1.0", features = ["derive"] } +serde_json = "1.0" +wit-bindgen = "0.36.0" +once_cell = "1.20.2" +uuid = { version = "1.0", features = ["v4"] } +kinode_app_common = { path = "../crates/kinode_app_common" } +proc_macro_send = { path = "../crates/proc_macro_send" } +shared = { path = "../lib/shared" } + +[lib] +crate-type = ["cdylib"] + +[package.metadata.component] +package = "kinode:process" + diff --git a/async-receiver-b/src/kino_local_handlers.rs b/async-receiver-b/src/kino_local_handlers.rs new file mode 100644 index 0000000..736ac64 --- /dev/null +++ b/async-receiver-b/src/kino_local_handlers.rs @@ -0,0 +1,34 @@ +use crate::*; + +/// This will get triggered with a terminal request +/// For example, if you run `m our@async-app:async-app:template.os '"abc"'` +/// Then we will message the async receiver who will sleep 3s then answer. +pub fn kino_local_handler( + _message: &Message, + _state: &mut AppState, + _server: &mut HttpServer, + request: AsyncRequest, +) { + kiprintln!("Receiver: Received request: {:?}", request); + kiprintln!("Receiver: Sleeping for 3 seconds..."); + std::thread::sleep(std::time::Duration::from_secs(3)); + + let response_body = match request { + AsyncRequest::StepA(my_string) => { + kiprintln!("Receiver: Handling StepA"); + AsyncResponse::StepA(my_string.len() as i32) + } + AsyncRequest::StepB(i32_val) => { + kiprintln!("Receiver: Handling StepB"); + AsyncResponse::StepB(i32_val as u64 * 2) + } + AsyncRequest::StepC(u64_val) => { + kiprintln!("Receiver: Handling StepC"); + AsyncResponse::StepC(format!("Hello from the other side C: {}", u64_val)) + } + AsyncRequest::Gather(_) => AsyncResponse::Gather(Ok("Hello from B".to_string())), + }; + + kiprintln!("Receiver: Sending response: {:?}", response_body); + let _ = Response::new().body(response_body).send(); +} diff --git a/async-receiver-b/src/lib.rs b/async-receiver-b/src/lib.rs new file mode 100644 index 0000000..469f991 --- /dev/null +++ b/async-receiver-b/src/lib.rs @@ -0,0 +1,48 @@ +use kinode_process_lib::http::server::HttpServer; +use kinode_process_lib::{kiprintln, Message}; +use serde::{Deserialize, Serialize}; + +use kinode_app_common::{erect, Binding, State}; +use kinode_process_lib::http::server::{HttpBindingConfig, WsBindingConfig}; +use kinode_process_lib::Response; +mod kino_local_handlers; +mod structs; + +use kino_local_handlers::*; +use shared::*; +use structs::*; + +wit_bindgen::generate!({ + path: "target/wit", + world: "async-app-template-dot-os-v0", + generate_unused_types: true, + additional_derives: [serde::Deserialize, serde::Serialize, process_macros::SerdeJsonInto], +}); + +fn init_fn(_state: &mut AppState) { + kiprintln!("Initializing Async Receiver B"); +} + +erect!( + name: "Async Receiver B", + icon: None, + widget: None, + ui: Some(HttpBindingConfig::default()), + endpoints: [ + Binding::Http { + path: "/api", + config: HttpBindingConfig::default(), + }, + Binding::Ws { + path: "/updates", + config: WsBindingConfig::default(), + }, + ], + handlers: { + api: _, + local: kino_local_handler, + remote: _, + ws: _, + }, + init: init_fn +); diff --git a/async-receiver-b/src/structs.rs b/async-receiver-b/src/structs.rs new file mode 100644 index 0000000..7bbb5fa --- /dev/null +++ b/async-receiver-b/src/structs.rs @@ -0,0 +1,12 @@ +use crate::*; + +#[derive(Debug, Serialize, Deserialize)] +pub struct AppState { + pub counter: u64, +} + +impl State for AppState { + fn new() -> Self { + Self { counter: 0 } + } +} diff --git a/async-receiver-c/Cargo.toml b/async-receiver-c/Cargo.toml new file mode 100644 index 0000000..cfcc09c --- /dev/null +++ b/async-receiver-c/Cargo.toml @@ -0,0 +1,25 @@ +[package] +name = "async-receiver-c" +version = "0.1.0" +edition = "2021" +publish = false + +[dependencies] +anyhow = "1.0" +kinode_process_lib = { version = "0.10.2", features = ["logging"] } +process_macros = "0.1.0" +serde = { version = "1.0", features = ["derive"] } +serde_json = "1.0" +wit-bindgen = "0.36.0" +once_cell = "1.20.2" +uuid = { version = "1.0", features = ["v4"] } +kinode_app_common = { path = "../crates/kinode_app_common" } +proc_macro_send = { path = "../crates/proc_macro_send" } +shared = { path = "../lib/shared" } + +[lib] +crate-type = ["cdylib"] + +[package.metadata.component] +package = "kinode:process" + diff --git a/async-receiver-c/src/kino_local_handlers.rs b/async-receiver-c/src/kino_local_handlers.rs new file mode 100644 index 0000000..26ae40f --- /dev/null +++ b/async-receiver-c/src/kino_local_handlers.rs @@ -0,0 +1,34 @@ +use crate::*; + +/// This will get triggered with a terminal request +/// For example, if you run `m our@async-app:async-app:template.os '"abc"'` +/// Then we will message the async receiver who will sleep 3s then answer. +pub fn kino_local_handler( + _message: &Message, + _state: &mut AppState, + _server: &mut HttpServer, + request: AsyncRequest, +) { + kiprintln!("Receiver: Received request: {:?}", request); + kiprintln!("Receiver: Sleeping for 3 seconds..."); + std::thread::sleep(std::time::Duration::from_secs(3)); + + let response_body = match request { + AsyncRequest::StepA(my_string) => { + kiprintln!("Receiver: Handling StepA"); + AsyncResponse::StepA(my_string.len() as i32) + } + AsyncRequest::StepB(i32_val) => { + kiprintln!("Receiver: Handling StepB"); + AsyncResponse::StepB(i32_val as u64 * 2) + } + AsyncRequest::StepC(u64_val) => { + kiprintln!("Receiver: Handling StepC"); + AsyncResponse::StepC(format!("Hello from the other side C: {}", u64_val)) + } + AsyncRequest::Gather(_) => AsyncResponse::Gather(Ok("Hello from C".to_string())), + }; + + kiprintln!("Receiver: Sending response: {:?}", response_body); + let _ = Response::new().body(response_body).send(); +} diff --git a/async-receiver-c/src/kino_remote_handlers.rs b/async-receiver-c/src/kino_remote_handlers.rs new file mode 100644 index 0000000..c8910a6 --- /dev/null +++ b/async-receiver-c/src/kino_remote_handlers.rs @@ -0,0 +1,10 @@ +use crate::*; + +pub fn kino_remote_handler( + _message: &Message, + _state: &mut AppState, + _server: &mut HttpServer, + _request: String, +) { + kiprintln!("Hi2"); +} diff --git a/async-receiver-c/src/lib.rs b/async-receiver-c/src/lib.rs new file mode 100644 index 0000000..3e16a8d --- /dev/null +++ b/async-receiver-c/src/lib.rs @@ -0,0 +1,48 @@ +use kinode_process_lib::http::server::HttpServer; +use kinode_process_lib::{kiprintln, Message}; +use serde::{Deserialize, Serialize}; + +use kinode_app_common::{erect, Binding, State}; +use kinode_process_lib::http::server::{HttpBindingConfig, WsBindingConfig}; +use kinode_process_lib::Response; +mod kino_local_handlers; +mod structs; + +use kino_local_handlers::*; +use shared::*; +use structs::*; + +wit_bindgen::generate!({ + path: "target/wit", + world: "async-app-template-dot-os-v0", + generate_unused_types: true, + additional_derives: [serde::Deserialize, serde::Serialize, process_macros::SerdeJsonInto], +}); + +fn init_fn(_state: &mut AppState) { + kiprintln!("Initializing Async Receiver C"); +} + +erect!( + name: "Async Receiver C", + icon: None, + widget: None, + ui: Some(HttpBindingConfig::default()), + endpoints: [ + Binding::Http { + path: "/api", + config: HttpBindingConfig::default(), + }, + Binding::Ws { + path: "/updates", + config: WsBindingConfig::default(), + }, + ], + handlers: { + api: _, + local: kino_local_handler, + remote: _, + ws: _, + }, + init: init_fn +); diff --git a/async-receiver-c/src/structs.rs b/async-receiver-c/src/structs.rs new file mode 100644 index 0000000..7bbb5fa --- /dev/null +++ b/async-receiver-c/src/structs.rs @@ -0,0 +1,12 @@ +use crate::*; + +#[derive(Debug, Serialize, Deserialize)] +pub struct AppState { + pub counter: u64, +} + +impl State for AppState { + fn new() -> Self { + Self { counter: 0 } + } +} diff --git a/async-requester/Cargo.toml b/async-requester/Cargo.toml new file mode 100644 index 0000000..97b383a --- /dev/null +++ b/async-requester/Cargo.toml @@ -0,0 +1,25 @@ +[package] +name = "async-requester" +version = "0.1.0" +edition = "2021" +publish = false + +[dependencies] +anyhow = "1.0" +kinode_process_lib = { version = "0.10.2", features = ["logging"] } +process_macros = "0.1.0" +serde = { version = "1.0", features = ["derive"] } +serde_json = "1.0" +wit-bindgen = "0.36.0" +once_cell = "1.20.2" +uuid = { version = "1.0", features = ["v4"] } +kinode_app_common = { path = "../crates/kinode_app_common" } +proc_macro_send = { path = "../crates/proc_macro_send" } +shared = { path = "../lib/shared" } + +[lib] +crate-type = ["cdylib"] + +[package.metadata.component] +package = "kinode:process" + diff --git a/async-requester/src/helpers.rs b/async-requester/src/helpers.rs new file mode 100644 index 0000000..64d9065 --- /dev/null +++ b/async-requester/src/helpers.rs @@ -0,0 +1,80 @@ +use crate::*; + +pub fn message_a() { + send_async!( + receiver_address_a(), + AsyncRequest::StepA("Mashed Potatoes".to_string()), + (resp, st: ProcessState) { + on_step_a(resp, st); + }, + ); +} + +pub fn on_step_a(response: i32, state: &mut ProcessState) { + kiprintln!("Sender: Received response: {}", response); + kiprintln!("Sender: State: {}", state.counter); + state.counter += 1; + send_async!( + receiver_address_a(), + AsyncRequest::StepB(response), + (resp, st: ProcessState) { + let _ = on_step_b(resp, st); + }, + ); +} + +pub fn on_step_b(response: u64, state: &mut ProcessState) -> anyhow::Result<()> { + kiprintln!("Sender: Received response: {}", response); + kiprintln!("Sender: State: {}", state.counter); + state.counter += 1; + send_async!( + receiver_address_a(), + AsyncRequest::StepC(response), + (resp, st: ProcessState) { + on_step_c(resp, st); + }, + ); + Ok(()) +} + +pub fn on_step_c(response: String, state: &mut ProcessState) { + kiprintln!("Sender: Received response: {}", response); + kiprintln!("Sender: State: {}", state.counter); + state.counter += 1; +} + +pub fn fanout_message() { + let addresses: Vec
= vec![ + ("our", "async-receiver-zzz", "async-app", "uncentered.os").into(), // Doesn't exist + receiver_address_a(), + receiver_address_b(), + receiver_address_c(), + ("our", "async-receiver-zzz123", "async-app", "uncentered.os").into(), // Doesn't exist + ]; + + let requests: Vec = vec![ + AsyncRequest::Gather(()), + AsyncRequest::Gather(()), + AsyncRequest::Gather(()), + AsyncRequest::Gather(()), + AsyncRequest::Gather(()), + ]; + + fan_out!( + addresses, + requests, + (all_results, st: ProcessState) { + kiprintln!("fan_out done => subresponses: {:#?}", all_results); + st.counter += 1; + }, + 5 + ); +} + +pub fn repeated_timer(state: &mut ProcessState) { + kiprintln!("Repeated timer called! Our counter is {}", state.counter); + timer!(3000, (st: ProcessState) { + st.counter += 1; + repeated_timer(st); + }); +} diff --git a/async-requester/src/lib.rs b/async-requester/src/lib.rs new file mode 100644 index 0000000..af29021 --- /dev/null +++ b/async-requester/src/lib.rs @@ -0,0 +1,70 @@ +use kinode_process_lib::http::server::HttpServer; +use kinode_process_lib::{kiprintln, Message}; +use serde::{Deserialize, Serialize}; + +use kinode_app_common::{erect, fan_out, timer, Binding, State}; +use kinode_process_lib::http::server::HttpBindingConfig; +use kinode_process_lib::http::server::WsBindingConfig; +use kinode_process_lib::Address; +use proc_macro_send::send_async; +use shared::receiver_address_a; + +mod helpers; +mod structs; + +use helpers::*; +use shared::*; +use structs::*; + +wit_bindgen::generate!({ + path: "target/wit", + world: "async-app-template-dot-os-v0", + generate_unused_types: true, + additional_derives: [serde::Deserialize, serde::Serialize, process_macros::SerdeJsonInto], +}); + +fn init_fn(state: &mut ProcessState) { + kiprintln!("Initializing Async Requester"); + repeated_timer(state); + + std::thread::sleep(std::time::Duration::from_secs(4)); + fanout_message(); +} + +/// This will get triggered with a terminal request +/// For example, if you run `m our@async-requester:async-app:template.os '"abc"'` +/// Then we will message the async receiver who will sleep 3s then answer. +pub fn kino_local_handler( + _message: &Message, + _state: &mut ProcessState, + _server: &mut HttpServer, + _request: String, +) { + message_a(); +} + +erect!( + name: "Async Requester", + icon: None, + widget: None, + ui: Some(HttpBindingConfig::default()), + endpoints: [ + Binding::Http { + path: "/api", + config: HttpBindingConfig::default(), + }, + Binding::Ws { + path: "/updates", + config: WsBindingConfig::default(), + }, + ], + handlers: { + api: _, + local: kino_local_handler, + remote: _, + ws: _, + }, + init: init_fn +); + +// m our@async-requester:async-app:template.os '"abc"' diff --git a/async-requester/src/structs.rs b/async-requester/src/structs.rs new file mode 100644 index 0000000..5e0a77c --- /dev/null +++ b/async-requester/src/structs.rs @@ -0,0 +1,12 @@ +use crate::*; + +#[derive(Debug, Serialize, Deserialize)] +pub struct ProcessState { + pub counter: u64, +} + +impl State for ProcessState { + fn new() -> Self { + Self { counter: 0 } + } +} diff --git a/crates/kinode_app_common/Cargo.toml b/crates/kinode_app_common/Cargo.toml new file mode 100644 index 0000000..928b798 --- /dev/null +++ b/crates/kinode_app_common/Cargo.toml @@ -0,0 +1,22 @@ +[package] +name = "kinode_app_common" +version = "0.1.0" +edition = "2021" +publish = false + +[dependencies] +anyhow = "1.0" +kinode_process_lib = { version = "0.10.2", features = ["logging"] } +process_macros = "0.1.0" +serde = { version = "1.0", features = ["derive"] } +rmp-serde = "1.0" +serde_json = "1.0" +serde_derive = "1.0" +wit-bindgen = "0.36.0" +once_cell = "1.20.2" +paste = "1.0" +uuid = { version = "1.0", features = ["v4"] } + +[lib] +crate-type = ["lib"] + diff --git a/crates/kinode_app_common/src/lib.rs b/crates/kinode_app_common/src/lib.rs new file mode 100644 index 0000000..23b1a1f --- /dev/null +++ b/crates/kinode_app_common/src/lib.rs @@ -0,0 +1,865 @@ +use kinode_process_lib::get_state; +use kinode_process_lib::http::server::WsMessageType; +use kinode_process_lib::logging::info; +use kinode_process_lib::logging::init_logging; +use kinode_process_lib::logging::Level; +use std::any::Any; +use std::collections::HashMap; + +use std::cell::RefCell; + +use kinode_process_lib::{ + await_message, homepage, http, kiprintln, set_state, LazyLoadBlob, Message, SendError, +}; + +pub mod prelude { + pub use crate::HIDDEN_STATE; + // Add other commonly used items here +} + +thread_local! { + pub static HIDDEN_STATE: RefCell> = RefCell::new(None); +} + +/// The application state containing the callback map plus the user state. This is the actual state. +pub struct HiddenState { + pub pending_callbacks: HashMap, + pub accumulators: HashMap>, +} + +pub struct PendingCallback { + pub on_success: Box anyhow::Result<()> + Send>, + pub on_timeout: Option anyhow::Result<()> + Send>>, +} + +pub struct FanOutAggregator { + total: usize, + results: Vec>>, + completed: usize, + + /// Called once, when completed == total + on_done: + Box>, &mut dyn Any) -> anyhow::Result<()> + Send>, +} + +impl FanOutAggregator { + pub fn new( + total: usize, + on_done: Box< + dyn FnOnce(Vec>, &mut dyn Any) -> anyhow::Result<()> + Send, + >, + ) -> Self { + let mut results = Vec::with_capacity(total); + for _ in 0..total { + results.push(None); + } + + Self { + total, + results, + completed: 0, + on_done, + } + } + + pub fn set_result(&mut self, i: usize, result: Result) { + if i < self.results.len() && self.results[i].is_none() { + self.results[i] = Some(result); + self.completed += 1; + } + } + + pub fn is_done(&self) -> bool { + self.completed >= self.total + } + + /// Finalize => calls on_done(...) with the final vector + pub fn finalize(self, user_state: &mut dyn Any) -> anyhow::Result<()> { + let FanOutAggregator { + results, on_done, .. + } = self; + let final_vec = results + .into_iter() + .map(|item| item.unwrap_or_else(|| Err(anyhow::anyhow!("missing subresponse")))) + .collect(); + + (on_done)(final_vec, user_state) + } +} + +impl HiddenState { + pub fn new() -> Self { + Self { + pending_callbacks: HashMap::new(), + accumulators: HashMap::new(), + } + } +} + +#[macro_export] +macro_rules! timer { + ($duration:expr, ($st:ident : $user_state_ty:ty) $callback_block:block) => {{ + use uuid::Uuid; + + let correlation_id = Uuid::new_v4().to_string(); + + $crate::HIDDEN_STATE.with(|cell| { + let mut hs = cell.borrow_mut(); + if let Some(ref mut hidden_state) = *hs { + hidden_state.pending_callbacks.insert( + correlation_id.clone(), + $crate::PendingCallback { + on_success: Box::new(move |_resp_bytes: &[u8], any_state: &mut dyn std::any::Any| { + let $st = any_state + .downcast_mut::<$user_state_ty>() + .ok_or_else(|| anyhow::anyhow!("Downcast failed!"))?; + $callback_block + Ok(()) + }), + on_timeout: None, + }, + ); + } + }); + + let total_timeout_seconds = ($duration / 1000) + 1; + let _ = kinode_process_lib::Request::to(("our", "timer", "distro", "sys")) + .body(kinode_process_lib::timer::TimerAction::SetTimer($duration)) + .expects_response(total_timeout_seconds) + .context(correlation_id.as_bytes()) + .send(); + }}; +} + +/// Trait that must be implemented by application state types +pub trait State { + /// Creates a new instance of the state. + fn new() -> Self; +} + +/// Initialize state from persisted storage or create new if none exists +fn initialize_state() -> S +where + S: State + for<'de> serde::Deserialize<'de>, +{ + match get_state() { + Some(bytes) => match rmp_serde::from_slice::(&bytes) { + Ok(state) => state, + Err(e) => { + panic!("error deserializing existing state: {e}. We're panicking because we don't want to nuke state by setting it to a new instance."); + } + }, + None => { + info!("no existing state, creating new one"); + S::new() + } + } +} + +fn setup_server( + ui_config: Option<&kinode_process_lib::http::server::HttpBindingConfig>, + endpoints: &[Binding], +) -> http::server::HttpServer { + let mut server = http::server::HttpServer::new(5); + + if let Some(ui) = ui_config { + if let Err(e) = server.serve_ui("ui", vec!["/"], ui.clone()) { + panic!("failed to serve UI: {e}. Make sure that a ui folder is in /pkg"); + } + } + + // Verify no duplicate paths + let mut seen_paths = std::collections::HashSet::new(); + for endpoint in endpoints.iter() { + let path = match endpoint { + Binding::Http { path, .. } => path, + Binding::Ws { path, .. } => path, + }; + if !seen_paths.insert(path) { + panic!("duplicate path found: {}", path); + } + } + + for endpoint in endpoints { + match endpoint { + Binding::Http { path, config } => { + server + .bind_http_path(path.to_string(), config.clone()) + .expect("failed to serve API path"); + } + Binding::Ws { path, config } => { + server + .bind_ws_path(path.to_string(), config.clone()) + .expect("failed to bind WS path"); + } + } + } + + server +} + +fn handle_message( + message: Message, + user_state: &mut S, + server: &mut http::server::HttpServer, + handle_api_call: &impl Fn(&mut S, T1) -> (http::server::HttpResponse, Vec), + handle_local_request: &impl Fn(&Message, &mut S, &mut http::server::HttpServer, T2), + handle_remote_request: &impl Fn(&Message, &mut S, &mut http::server::HttpServer, T3), + handle_ws: &impl Fn(&mut S, &mut http::server::HttpServer, u32, WsMessageType, LazyLoadBlob), +) where + S: State + std::fmt::Debug + serde::Serialize + serde::de::DeserializeOwned + Send + 'static, + T1: serde::Serialize + serde::de::DeserializeOwned, + T2: serde::Serialize + serde::de::DeserializeOwned, + T3: serde::Serialize + serde::de::DeserializeOwned, +{ + // Get the correlation id + let correlation_id = message + .context() + .map(|c| String::from_utf8_lossy(c).to_string()); + + if let Some(cid) = correlation_id { + // -------------------------------------------------------------------------------------------- + // Regular callback case + // -------------------------------------------------------------------------------------------- + let pending = HIDDEN_STATE.with(|cell| { + let mut hs = cell.borrow_mut(); + hs.as_mut() + .and_then(|state| state.pending_callbacks.remove(&cid)) + }); + if let Some(pending) = pending { + // EXECUTE the callback + if let Err(e) = (pending.on_success)(message.body(), user_state) { + kiprintln!("Error in callback: {e}"); + } + // Get a fresh borrow of user_state for serializing: + if let Ok(s_bytes) = rmp_serde::to_vec(user_state) { + let _ = set_state(&s_bytes); + } + return; + } + + // -------------------------------------------------------------------------------------------- + // Fan out case + // -------------------------------------------------------------------------------------------- + if let Some((agg_id, idx)) = parse_aggregator_cid(&cid) { + let result = match serde_json::from_slice::(message.body()) { + Ok(val) => Ok(val), + Err(e) => Err(anyhow::anyhow!(e)), + }; + + aggregator_mark_result(&agg_id, idx, result, user_state); + return; + } + } + + if message.is_local() { + if message.source().process == "http-server:distro:sys" { + http_request(&message, user_state, server, handle_api_call, handle_ws); + } else { + local_request(&message, user_state, server, handle_local_request); + } + } else { + remote_request(&message, user_state, server, handle_remote_request); + } + + // Persist the state with a new temporary borrow. + if let Ok(s_bytes) = rmp_serde::to_vec(user_state) { + let _ = set_state(&s_bytes); + } +} + +pub fn app( + app_name: &str, + app_icon: Option<&str>, + app_widget: Option<&str>, + ui_config: Option, + endpoints: Vec, + handle_api_call: impl Fn(&mut S, T1) -> (http::server::HttpResponse, Vec), + handle_local_request: impl Fn(&Message, &mut S, &mut http::server::HttpServer, T2), + handle_remote_request: impl Fn(&Message, &mut S, &mut http::server::HttpServer, T3), + handle_ws: impl Fn(&mut S, &mut http::server::HttpServer, u32, WsMessageType, LazyLoadBlob), + init_fn: fn(&mut S), +) -> impl Fn() +where + S: State + std::fmt::Debug + serde::Serialize + serde::de::DeserializeOwned + Send + 'static, + T1: serde::Serialize + serde::de::DeserializeOwned, + T2: serde::Serialize + serde::de::DeserializeOwned, + T3: serde::Serialize + serde::de::DeserializeOwned, +{ + HIDDEN_STATE.with(|cell| { + let mut hs = cell.borrow_mut(); + *hs = Some(HiddenState::new()); + }); + + if app_icon.is_some() && app_widget.is_some() { + homepage::add_to_homepage(app_name, app_icon, Some("/"), app_widget); + } + + move || { + init_logging(Level::DEBUG, Level::INFO, None, Some((0, 0, 1, 1)), None).unwrap(); + info!("starting app"); + + let mut server = setup_server(ui_config.as_ref(), &endpoints); + let mut user_state = initialize_state::(); + + // Execute the user specified init function + // Note: It should always be called _after_ the hidden state is initialized, so that + // users can call macros that depend on having the callback map in the hidden state. + { + init_fn(&mut user_state); + } + + loop { + match await_message() { + Err(send_error) => { + handle_send_error::(&send_error, &mut user_state); + } + Ok(message) => { + handle_message( + message, + &mut user_state, + &mut server, + &handle_api_call, + &handle_local_request, + &handle_remote_request, + &handle_ws, + ); + } + } + } + } +} + +fn http_request( + message: &Message, + state: &mut S, + server: &mut http::server::HttpServer, + handle_api_call: impl Fn(&mut S, T1) -> (http::server::HttpResponse, Vec), + handle_ws: impl Fn(&mut S, &mut http::server::HttpServer, u32, WsMessageType, LazyLoadBlob), +) where + T1: serde::Serialize + serde::de::DeserializeOwned, +{ + let http_request = serde_json::from_slice::(message.body()) + .expect("failed to parse HTTP request"); + + let state_ptr: *mut S = state; + let server_ptr: *mut http::server::HttpServer = server; + + server.handle_request( + http_request, + move |_incoming| { + let state_ref: &mut S = unsafe { &mut *state_ptr }; + + let response = http::server::HttpResponse::new(200 as u16); + let Some(blob) = message.blob() else { + return (response.set_status(400), None); + }; + let Ok(call) = serde_json::from_slice::(blob.bytes()) else { + return (response.set_status(400), None); + }; + + let (response, bytes) = handle_api_call(state_ref, call); + + ( + response, + Some(LazyLoadBlob::new(Some("application/json"), bytes)), + ) + }, + move |channel_id, msg_type, blob| { + let state_ref: &mut S = unsafe { &mut *state_ptr }; + let server_ref: &mut http::server::HttpServer = unsafe { &mut *server_ptr }; + + handle_ws(state_ref, server_ref, channel_id, msg_type, blob); + }, + ); +} + +fn local_request( + message: &Message, + state: &mut S, + server: &mut http::server::HttpServer, + handle_local_request: &impl Fn(&Message, &mut S, &mut http::server::HttpServer, T), +) where + S: std::fmt::Debug, + T: serde::Serialize + serde::de::DeserializeOwned, +{ + let Ok(request) = serde_json::from_slice::(message.body()) else { + if message.body() == b"debug" { + kiprintln!("state:\n{:#?}", state); + } + return; + }; + handle_local_request(message, state, server, request); +} + +fn remote_request( + message: &Message, + state: &mut S, + server: &mut http::server::HttpServer, + handle_remote_request: &impl Fn(&Message, &mut S, &mut http::server::HttpServer, T), +) where + T: serde::Serialize + serde::de::DeserializeOwned, +{ + let Ok(request) = serde_json::from_slice::(message.body()) else { + return; + }; + handle_remote_request(message, state, server, request); +} + +/// Pretty prints a SendError in a more readable format +fn pretty_print_send_error(error: &SendError) { + let kind = &error.kind; + let target = &error.target; + + // Try to decode body as UTF-8 string, fall back to showing as bytes + let body = String::from_utf8(error.message.body().to_vec()) + .map(|s| format!("\"{}\"", s)) + .unwrap_or_else(|_| format!("{:?}", error.message.body())); + + // Try to decode context as UTF-8 string + let context = error + .context + .as_ref() + .map(|bytes| String::from_utf8_lossy(bytes).into_owned()); + + kiprintln!( + "SendError {{ + kind: {:?}, + target: {}, + body: {}, + context: {} +}}", + kind, + target, + body, + context + .map(|s| format!("\"{}\"", s)) + .unwrap_or("None".to_string()) + ); +} + +fn handle_send_error(send_error: &SendError, user_state: &mut S) { + // Print the error + pretty_print_send_error(send_error); + + // Get the correlation id + let Some(correlation_id) = send_error + .context + .as_ref() + .map(|bytes| String::from_utf8_lossy(bytes).to_string()) + else { + return; + }; + + // -------------------------------------------------------------------------------------------- + // Handle the single callback case + // -------------------------------------------------------------------------------------------- + let single_callback = HIDDEN_STATE.with(|cell| { + let mut hs = cell.borrow_mut(); + hs.as_mut() + .and_then(|st| st.pending_callbacks.remove(&correlation_id)) + }); + if let Some(single_callback) = single_callback { + if let Some(cb) = single_callback.on_timeout { + if let Err(e) = cb(user_state) { + kiprintln!("Error in on_timeout callback: {e}"); + } + // Persist the state + if let Ok(s_bytes) = rmp_serde::to_vec(&user_state) { + let _ = set_state(&s_bytes); + } + } + } + + // -------------------------------------------------------------------------------------------- + // Handle the fan out case + // -------------------------------------------------------------------------------------------- + if let Some((agg_id, idx)) = parse_aggregator_cid(&correlation_id) { + aggregator_mark_result(&agg_id, idx, Err(anyhow::anyhow!("timeout")), user_state); + + if let Ok(s_bytes) = rmp_serde::to_vec(&user_state) { + let _ = set_state(&s_bytes); + } + } +} + +// Parse a correlation id of the form "agg_id:idx" +fn parse_aggregator_cid(corr: &str) -> Option<(String, usize)> { + let mut parts = corr.split(':'); + let agg_id = parts.next()?.to_owned(); + let idx_str = parts.next()?; + let idx = idx_str.parse::().ok()?; + Some((agg_id, idx)) +} + +#[doc(hidden)] +#[macro_export] +macro_rules! __check_not_all_empty { + (_, _, _, _, _) => { + compile_error!("At least one handler must be defined. Cannot use '_' for all handlers."); + }; + ($($any:tt)*) => {}; +} + +/// # How to Use the `erect!` Macro +/// +/// The `erect!` macro is a powerful tool for defining and exporting a new component in your Kinode application. +/// It allows you to bundle together the component's metadata, UI configuration, endpoints, message handlers, +/// and initialization logic in one concise block. Below is a breakdown of each parameter: +/// +/// - **name**: +/// A string literal that represents the name of the component. This name may be used for display purposes in a UI +/// or in logging. +/// +/// - **icon**: +/// An optional parameter defining the component's icon. Pass `None` if you do not wish to specify one, or use +/// `Some(icon_identifier)` where `icon_identifier` describes your icon. +/// +/// - **widget**: +/// An optional widget attachment for your component. This could be a UI fragment or identifier. Use `None` if not needed. +/// +/// - **ui**: +/// An optional configuration of type `HttpBindingConfig`. This is used for setting up the UI binding for your component. +/// For example, using `Some(HttpBindingConfig::default())` applies the default UI configuration. +/// +/// - **endpoints**: +/// A list (array) of endpoints that your component will expose. Each endpoint is specified as a variant of the +/// `Binding` enum: +/// - `Binding::Http { path, config }`: Defines an HTTP API endpoint. +/// * `path`: A string representing the URL path. +/// * `config`: The associated HTTP binding configuration. +/// - `Binding::Ws { path, config }`: Defines a WebSocket endpoint. +/// * `path`: A string representing the URL path. +/// * `config`: The WebSocket-specific binding configuration. +/// +/// - **handlers**: +/// A block for providing callbacks to handle incoming messages. These handlers correspond to various kinds +/// of requests: +/// - **api**: The handler for HTTP API calls. If your component does not require an API handler, you can +/// simply pass `_`. +/// - **local**: The handler function for processing local (internal) requests. This must be provided if your +/// component deals with internal messages (e.g., `kino_local_handler`). +/// - **remote**: The handler for remote requests. If not applicable, specify `_`. +/// - **ws**: The WebSocket message handler. Use `_` if no WebSocket handling is needed. +/// +/// - **init**: +/// The initialization function that sets up the component's state when the component starts. This function should +/// match the expected signature (taking a mutable reference to your state) and perform any necessary setup tasks. +/// +/// **Example Usage:** +/// +/// The following example creates a component named **"Async Requester"** with one HTTP endpoint and one WebSocket endpoint: +/// +/// ```rust:crates/kinode_app_common/src/lib.rs +/// erect!( +/// name: "Async Requester", +/// icon: None, +/// widget: None, +/// ui: Some(HttpBindingConfig::default()), +/// endpoints: [ +/// Binding::Http { +/// path: "/api", +/// config: HttpBindingConfig::default(), +/// }, +/// Binding::Ws { +/// path: "/updates", +/// config: WsBindingConfig::default(), +/// }, +/// ], +/// handlers: { +/// api: _, +/// local: kino_local_handler, +/// remote: _, +/// ws: _, +/// }, +/// init: init_fn +/// ); +/// ``` +/// +/// **Important:** +/// - Make sure that the signatures of your handler functions (e.g., `kino_local_handler`) and the initialization +/// function (`init_fn`) match the expected types in the Kinode application framework. +/// - Specifying `_` for any handler indicates that the corresponding functionality is not implemented or needed +/// for this component. +#[macro_export] +macro_rules! erect { + ( + name: $name:expr, + icon: $icon:expr, + widget: $widget:expr, + ui: $ui:expr, + endpoints: [ $($endpoints:expr),* $(,)? ], + handlers: { + api: $api:tt, + local: $local:tt, + remote: $remote:tt, + ws: $ws:tt, + }, + init: $init:tt + $(,)? + ) => { + $crate::__check_not_all_empty!($api, $local, $remote, $ws, $init); + + + + struct Component; + impl Guest for Component { + fn init(_our: String) { + use kinode_app_common::prelude::*; + + // Map `_` to the appropriate fallback function + let handle_api_call = $crate::__maybe!($api => $crate::no_http_api_call); + let handle_local_request = $crate::__maybe!($local => $crate::no_local_request); + let handle_remote_request = $crate::__maybe!($remote => $crate::no_remote_request); + let handle_ws = $crate::__maybe!($ws => $crate::no_ws_handler); + let init_fn = $crate::__maybe!($init => $crate::no_init_fn); + + // Build the vector of endpoints from user input + let endpoints_vec = vec![$($endpoints),*]; + + let closure = $crate::app( + $name, + $icon, + $widget, + $ui, + endpoints_vec, + handle_api_call, + handle_local_request, + handle_remote_request, + handle_ws, + init_fn, + ); + closure(); + } + } + export!(Component); + }; +} + +#[doc(hidden)] +#[macro_export] +macro_rules! __declare_types_internal { + ( + $( + $outer:ident { + $( + $variant:ident $req_ty:ty => $res_ty:ty + )* + } + ),* + $(,)? + ) => { + $crate::paste::paste! { + #[derive(Debug, Serialize, Deserialize, SerdeJsonInto, Clone)] + pub enum Req { + $( + $outer([<$outer Request>]), + )* + } + + $( + #[derive(Debug, Serialize, Deserialize, SerdeJsonInto, Clone)] + pub enum [<$outer Request>] { + $( + $variant($req_ty), + )* + } + + #[derive(Debug, Serialize, Deserialize, SerdeJsonInto, Clone)] + pub enum [<$outer Response>] { + $( + $variant($res_ty), + )* + } + )* + } + }; +} + +#[macro_export] +macro_rules! declare_types { + ($($tt:tt)*) => { + $crate::__declare_types_internal! { $($tt)* } + }; +} + +// Re-export paste for use in our macros +pub use paste; + +pub fn aggregator_mark_result( + aggregator_id: &str, + i: usize, + result: anyhow::Result, + user_state_any: &mut dyn Any, +) { + // Indentationmaxxing + HIDDEN_STATE.with(|cell| { + if let Some(ref mut hidden) = *cell.borrow_mut() { + if let Some(acc_any) = hidden.accumulators.get_mut(aggregator_id) { + if let Some(agg) = acc_any.downcast_mut::>() { + agg.set_result(i, result); + if agg.is_done() { + let aggregator_box = hidden.accumulators.remove(aggregator_id).unwrap(); + if let Ok(agg2) = + aggregator_box.downcast::>() + { + let aggregator = *agg2; + if let Err(e) = aggregator.finalize(user_state_any) { + kiprintln!("Error finalizing aggregator: {e}"); + } + } + } + } + } + } + }); +} + +#[macro_export] +macro_rules! fan_out { + ( + $addresses:expr, + $requests:expr, + ($all_results:ident, $st:ident : $st_ty:ty) $done_block:block, + $timeout:expr + ) => {{ + use ::anyhow::{anyhow, Result as AnyResult}; + use ::uuid::Uuid; + use ::serde_json; + + // A unique aggregator ID for this fan-out sequence + let aggregator_id = Uuid::new_v4().to_string(); + let total = $addresses.len(); + + // Build the aggregator that will hold partial results and run your final callback + let aggregator = $crate::FanOutAggregator::new( + total, + Box::new(move |results: Vec>, user_state: &mut dyn std::any::Any| -> AnyResult<()> { + let $st = user_state + .downcast_mut::<$st_ty>() + .ok_or_else(|| anyhow!("Downcast failed!"))?; + + let $all_results = results; + $done_block + Ok(()) + }), + ); + + // Insert this aggregator into HIDDEN_STATE's accumulators + $crate::HIDDEN_STATE.with(|cell| { + if let Some(ref mut hidden_state) = *cell.borrow_mut() { + hidden_state + .accumulators + .insert(aggregator_id.clone(), Box::new(aggregator)); + } + }); + + // For each address+request, serialize/send, and if there's an immediate error, mark aggregator + for (i, address) in $addresses.iter().enumerate() { + let correlation_id = format!("{}:{}", aggregator_id, i); + + // Serialize request + let body = match serde_json::to_vec(&$requests[i]) { + Ok(b) => b, + Err(e) => { + // Mark aggregator's i'th result as an error + $crate::HIDDEN_STATE.with(|cell| { + if let Some(ref mut hidden_st) = *cell.borrow_mut() { + $crate::aggregator_mark_result( + &aggregator_id, + i, + Err(anyhow!("Error serializing request: {}", e)), + hidden_st as &mut dyn std::any::Any, + ); + } + }); + continue; + } + }; + + // Send the request - using fully qualified path + let send_result = kinode_process_lib::Request::to(address) + .body(body) + .expects_response($timeout) + .context(correlation_id.as_bytes()) + .send(); + + // If the immediate send fails, also mark aggregator + if let Err(e) = send_result { + $crate::HIDDEN_STATE.with(|cell| { + if let Some(ref mut hidden_st) = *cell.borrow_mut() { + $crate::aggregator_mark_result( + &aggregator_id, + i, + Err(anyhow!("Send error: {:?}", e)), + hidden_st as &mut dyn std::any::Any, + ); + } + }); + } + } + }}; +} + +#[macro_export] +macro_rules! __maybe { + // If the user wrote `_`, then expand to the default expression + ( _ => $default:expr ) => { + $default + }; + // Otherwise use whatever they passed in + ( $actual:expr => $default:expr ) => { + $actual + }; +} + +// For demonstration, we'll define them all in one place. +// Make sure the signatures match the real function signatures you require! +pub fn no_init_fn(_state: &mut S) { + // does nothing +} + +pub fn no_ws_handler( + _state: &mut S, + _server: &mut http::server::HttpServer, + _channel_id: u32, + _msg_type: http::server::WsMessageType, + _blob: LazyLoadBlob, +) { + // does nothing +} + +pub fn no_http_api_call(_state: &mut S, _req: ()) -> (http::server::HttpResponse, Vec) { + // trivial 200 + (http::server::HttpResponse::new(200 as u16), vec![]) +} + +pub fn no_local_request( + _msg: &Message, + _state: &mut S, + _server: &mut http::server::HttpServer, + _req: (), +) { + // does nothing +} + +pub fn no_remote_request( + _msg: &Message, + _state: &mut S, + _server: &mut http::server::HttpServer, + _req: (), +) { + // does nothing +} + +#[derive(Clone, Debug)] +pub enum Binding { + Http { + path: &'static str, + config: kinode_process_lib::http::server::HttpBindingConfig, + }, + Ws { + path: &'static str, + config: kinode_process_lib::http::server::WsBindingConfig, + }, +} diff --git a/crates/proc_macro_send/Cargo.lock b/crates/proc_macro_send/Cargo.lock new file mode 100644 index 0000000..cc78f45 --- /dev/null +++ b/crates/proc_macro_send/Cargo.lock @@ -0,0 +1,3915 @@ +# This file is automatically @generated by Cargo. +# It is not intended for manual editing. +version = 4 + +[[package]] +name = "addr2line" +version = "0.21.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8a30b2e23b9e17a9f90641c7ab1549cd9b44f296d3ccbf309d2863cfe398a0cb" +dependencies = [ + "gimli", +] + +[[package]] +name = "adler" +version = "1.0.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f26201604c87b1e01bd3d98f8d5d9a8fcbb815e8cedb41ffccbeb4bf593a35fe" + +[[package]] +name = "ahash" +version = "0.8.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e89da841a80418a9b391ebaea17f5c112ffaaa96f621d2c285b5174da76b9011" +dependencies = [ + "cfg-if", + "getrandom", + "once_cell", + "version_check", + "zerocopy", +] + +[[package]] +name = "aho-corasick" +version = "1.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8e60d3430d3a69478ad0993f19238d2df97c507009a52b3c10addcd7f6bcb916" +dependencies = [ + "memchr", +] + +[[package]] +name = "allocator-api2" +version = "0.2.21" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "683d7910e743518b0e34f1186f92494becacb047c7b6bf616c96772180fef923" + +[[package]] +name = "alloy" +version = "0.8.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "59febb24956a41c29bb5f450978fbe825bd6456b3f80586c8bd558dc882e7b6a" +dependencies = [ + "alloy-consensus", + "alloy-core", + "alloy-eips", + "alloy-genesis", + "alloy-json-rpc", + "alloy-provider", + "alloy-rpc-client", + "alloy-rpc-types", + "alloy-serde", + "alloy-transport-http", +] + +[[package]] +name = "alloy-chains" +version = "0.1.56" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a725039ef382d1b6b4e2ebcb15b1efff6cde9af48c47a1bdce6fb67b9456c34b" +dependencies = [ + "alloy-primitives", + "num_enum", + "strum", +] + +[[package]] +name = "alloy-consensus" +version = "0.8.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e88e1edea70787c33e11197d3f32ae380f3db19e6e061e539a5bcf8184a6b326" +dependencies = [ + "alloy-eips", + "alloy-primitives", + "alloy-rlp", + "alloy-serde", + "alloy-trie", + "auto_impl", + "c-kzg", + "derive_more", + "serde", +] + +[[package]] +name = "alloy-consensus-any" +version = "0.8.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "57b1bb53f40c0273cd1975573cd457b39213e68584e36d1401d25fd0398a1d65" +dependencies = [ + "alloy-consensus", + "alloy-eips", + "alloy-primitives", + "alloy-rlp", + "alloy-serde", + "serde", +] + +[[package]] +name = "alloy-core" +version = "0.8.19" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "648275bb59110f88cc5fa9a176845e52a554ebfebac2d21220bcda8c9220f797" +dependencies = [ + "alloy-dyn-abi", + "alloy-json-abi", + "alloy-primitives", + "alloy-rlp", + "alloy-sol-types", +] + +[[package]] +name = "alloy-dyn-abi" +version = "0.8.19" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bc9138f4f0912793642d453523c3116bd5d9e11de73b70177aa7cb3e94b98ad2" +dependencies = [ + "alloy-json-abi", + "alloy-primitives", + "alloy-sol-type-parser", + "alloy-sol-types", + "const-hex", + "itoa", + "serde", + "serde_json", + "winnow", +] + +[[package]] +name = "alloy-eip2930" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0069cf0642457f87a01a014f6dc29d5d893cd4fd8fddf0c3cdfad1bb3ebafc41" +dependencies = [ + "alloy-primitives", + "alloy-rlp", + "serde", +] + +[[package]] +name = "alloy-eip7702" +version = "0.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4c986539255fb839d1533c128e190e557e52ff652c9ef62939e233a81dd93f7e" +dependencies = [ + "alloy-primitives", + "alloy-rlp", + "derive_more", + "serde", +] + +[[package]] +name = "alloy-eips" +version = "0.8.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5f9fadfe089e9ccc0650473f2d4ef0a28bc015bbca5631d9f0f09e49b557fdb3" +dependencies = [ + "alloy-eip2930", + "alloy-eip7702", + "alloy-primitives", + "alloy-rlp", + "alloy-serde", + "c-kzg", + "derive_more", + "once_cell", + "serde", + "sha2", +] + +[[package]] +name = "alloy-genesis" +version = "0.8.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2b2a4cf7b70f3495788e74ce1c765260ffe38820a2a774ff4aacb62e31ea73f9" +dependencies = [ + "alloy-primitives", + "alloy-serde", + "alloy-trie", + "serde", +] + +[[package]] +name = "alloy-json-abi" +version = "0.8.19" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "24acd2f5ba97c7a320e67217274bc81fe3c3174b8e6144ec875d9d54e760e278" +dependencies = [ + "alloy-primitives", + "alloy-sol-type-parser", + "serde", + "serde_json", +] + +[[package]] +name = "alloy-json-rpc" +version = "0.8.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e29040b9d5fe2fb70415531882685b64f8efd08dfbd6cc907120650504821105" +dependencies = [ + "alloy-primitives", + "alloy-sol-types", + "serde", + "serde_json", + "thiserror 2.0.11", + "tracing", +] + +[[package]] +name = "alloy-network" +version = "0.8.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "510cc00b318db0dfccfdd2d032411cfae64fc144aef9679409e014145d3dacc4" +dependencies = [ + "alloy-consensus", + "alloy-consensus-any", + "alloy-eips", + "alloy-json-rpc", + "alloy-network-primitives", + "alloy-primitives", + "alloy-rpc-types-any", + "alloy-rpc-types-eth", + "alloy-serde", + "alloy-signer", + "alloy-sol-types", + "async-trait", + "auto_impl", + "futures-utils-wasm", + "serde", + "serde_json", + "thiserror 2.0.11", +] + +[[package]] +name = "alloy-network-primitives" +version = "0.8.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9081c099e798b8a2bba2145eb82a9a146f01fc7a35e9ab6e7b43305051f97550" +dependencies = [ + "alloy-consensus", + "alloy-eips", + "alloy-primitives", + "alloy-serde", + "serde", +] + +[[package]] +name = "alloy-primitives" +version = "0.8.19" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ec878088ec6283ce1e90d280316aadd3d6ce3de06ff63d68953c855e7e447e92" +dependencies = [ + "alloy-rlp", + "bytes", + "cfg-if", + "const-hex", + "derive_more", + "foldhash", + "hashbrown 0.15.2", + "indexmap", + "itoa", + "k256", + "keccak-asm", + "paste", + "proptest", + "rand", + "ruint", + "rustc-hash", + "serde", + "sha3", + "tiny-keccak", +] + +[[package]] +name = "alloy-provider" +version = "0.8.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dc2dfaddd9a30aa870a78a4e1316e3e115ec1e12e552cbc881310456b85c1f24" +dependencies = [ + "alloy-chains", + "alloy-consensus", + "alloy-eips", + "alloy-json-rpc", + "alloy-network", + "alloy-network-primitives", + "alloy-primitives", + "alloy-rpc-client", + "alloy-rpc-types-eth", + "alloy-transport", + "alloy-transport-http", + "async-stream", + "async-trait", + "auto_impl", + "dashmap", + "futures", + "futures-utils-wasm", + "lru", + "parking_lot", + "pin-project", + "reqwest", + "schnellru", + "serde", + "serde_json", + "thiserror 2.0.11", + "tokio", + "tracing", + "url", + "wasmtimer", +] + +[[package]] +name = "alloy-rlp" +version = "0.3.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3d6c1d995bff8d011f7cd6c81820d51825e6e06d6db73914c1630ecf544d83d6" +dependencies = [ + "alloy-rlp-derive", + "arrayvec", + "bytes", +] + +[[package]] +name = "alloy-rlp-derive" +version = "0.3.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a40e1ef334153322fd878d07e86af7a529bcb86b2439525920a88eba87bcf943" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.96", +] + +[[package]] +name = "alloy-rpc-client" +version = "0.8.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "531137b283547d5b9a5cafc96b006c64ef76810c681d606f28be9781955293b6" +dependencies = [ + "alloy-json-rpc", + "alloy-primitives", + "alloy-transport", + "alloy-transport-http", + "futures", + "pin-project", + "reqwest", + "serde", + "serde_json", + "tokio", + "tokio-stream", + "tower", + "tracing", + "url", + "wasmtimer", +] + +[[package]] +name = "alloy-rpc-types" +version = "0.8.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3410a472ce26c457e9780f708ee6bd540b30f88f1f31fdab7a11d00bd6aa1aee" +dependencies = [ + "alloy-primitives", + "alloy-rpc-types-eth", + "alloy-serde", + "serde", +] + +[[package]] +name = "alloy-rpc-types-any" +version = "0.8.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ed98e1af55a7d856bfa385f30f63d8d56be2513593655c904a8f4a7ec963aa3e" +dependencies = [ + "alloy-consensus-any", + "alloy-rpc-types-eth", + "alloy-serde", +] + +[[package]] +name = "alloy-rpc-types-eth" +version = "0.8.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8737d7a6e37ca7bba9c23e9495c6534caec6760eb24abc9d5ffbaaba147818e1" +dependencies = [ + "alloy-consensus", + "alloy-consensus-any", + "alloy-eips", + "alloy-network-primitives", + "alloy-primitives", + "alloy-rlp", + "alloy-serde", + "alloy-sol-types", + "derive_more", + "itertools 0.13.0", + "serde", + "serde_json", +] + +[[package]] +name = "alloy-serde" +version = "0.8.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5851bf8d5ad33014bd0c45153c603303e730acc8a209450a7ae6b4a12c2789e2" +dependencies = [ + "alloy-primitives", + "serde", + "serde_json", +] + +[[package]] +name = "alloy-signer" +version = "0.8.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7e10ca565da6500cca015ba35ee424d59798f2e1b85bc0dd8f81dafd401f029a" +dependencies = [ + "alloy-primitives", + "async-trait", + "auto_impl", + "elliptic-curve", + "k256", + "thiserror 2.0.11", +] + +[[package]] +name = "alloy-sol-macro" +version = "0.8.19" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8d039d267aa5cbb7732fa6ce1fd9b5e9e29368f580f80ba9d7a8450c794de4b2" +dependencies = [ + "alloy-sol-macro-expander", + "alloy-sol-macro-input", + "proc-macro-error2", + "proc-macro2", + "quote", + "syn 2.0.96", +] + +[[package]] +name = "alloy-sol-macro-expander" +version = "0.8.19" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "620ae5eee30ee7216a38027dec34e0585c55099f827f92f50d11e3d2d3a4a954" +dependencies = [ + "alloy-sol-macro-input", + "const-hex", + "heck", + "indexmap", + "proc-macro-error2", + "proc-macro2", + "quote", + "syn 2.0.96", + "syn-solidity", + "tiny-keccak", +] + +[[package]] +name = "alloy-sol-macro-input" +version = "0.8.19" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ad9f7d057e00f8c5994e4ff4492b76532c51ead39353aa2ed63f8c50c0f4d52e" +dependencies = [ + "const-hex", + "dunce", + "heck", + "proc-macro2", + "quote", + "syn 2.0.96", + "syn-solidity", +] + +[[package]] +name = "alloy-sol-type-parser" +version = "0.8.19" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "74e60b084fe1aef8acecda2743ff2d93c18ff3eb67a2d3b12f62582a1e66ef5e" +dependencies = [ + "serde", + "winnow", +] + +[[package]] +name = "alloy-sol-types" +version = "0.8.19" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c1382302752cd751efd275f4d6ef65877ddf61e0e6f5ac84ef4302b79a33a31a" +dependencies = [ + "alloy-json-abi", + "alloy-primitives", + "alloy-sol-macro", + "const-hex", + "serde", +] + +[[package]] +name = "alloy-transport" +version = "0.8.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "538a04a37221469cac0ce231b737fd174de2fdfcdd843bdd068cb39ed3e066ad" +dependencies = [ + "alloy-json-rpc", + "base64", + "futures-util", + "futures-utils-wasm", + "serde", + "serde_json", + "thiserror 2.0.11", + "tokio", + "tower", + "tracing", + "url", + "wasmtimer", +] + +[[package]] +name = "alloy-transport-http" +version = "0.8.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2ed40eb1e1265b2911512f6aa1dcece9702d078f5a646730c45e39e2be00ac1c" +dependencies = [ + "alloy-json-rpc", + "alloy-transport", + "reqwest", + "serde_json", + "tower", + "tracing", + "url", +] + +[[package]] +name = "alloy-trie" +version = "0.7.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6917c79e837aa7b77b7a6dae9f89cbe15313ac161c4d3cfaf8909ef21f3d22d8" +dependencies = [ + "alloy-primitives", + "alloy-rlp", + "arrayvec", + "derive_more", + "nybbles", + "serde", + "smallvec", + "tracing", +] + +[[package]] +name = "anyhow" +version = "1.0.95" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "34ac096ce696dc2fcabef30516bb13c0a68a11d30131d3df6f04711467681b04" + +[[package]] +name = "ark-ff" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6b3235cc41ee7a12aaaf2c575a2ad7b46713a8a50bda2fc3b003a04845c05dd6" +dependencies = [ + "ark-ff-asm 0.3.0", + "ark-ff-macros 0.3.0", + "ark-serialize 0.3.0", + "ark-std 0.3.0", + "derivative", + "num-bigint", + "num-traits", + "paste", + "rustc_version 0.3.3", + "zeroize", +] + +[[package]] +name = "ark-ff" +version = "0.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ec847af850f44ad29048935519032c33da8aa03340876d351dfab5660d2966ba" +dependencies = [ + "ark-ff-asm 0.4.2", + "ark-ff-macros 0.4.2", + "ark-serialize 0.4.2", + "ark-std 0.4.0", + "derivative", + "digest 0.10.7", + "itertools 0.10.5", + "num-bigint", + "num-traits", + "paste", + "rustc_version 0.4.1", + "zeroize", +] + +[[package]] +name = "ark-ff-asm" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "db02d390bf6643fb404d3d22d31aee1c4bc4459600aef9113833d17e786c6e44" +dependencies = [ + "quote", + "syn 1.0.109", +] + +[[package]] +name = "ark-ff-asm" +version = "0.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3ed4aa4fe255d0bc6d79373f7e31d2ea147bcf486cba1be5ba7ea85abdb92348" +dependencies = [ + "quote", + "syn 1.0.109", +] + +[[package]] +name = "ark-ff-macros" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "db2fd794a08ccb318058009eefdf15bcaaaaf6f8161eb3345f907222bac38b20" +dependencies = [ + "num-bigint", + "num-traits", + "quote", + "syn 1.0.109", +] + +[[package]] +name = "ark-ff-macros" +version = "0.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7abe79b0e4288889c4574159ab790824d0033b9fdcb2a112a3182fac2e514565" +dependencies = [ + "num-bigint", + "num-traits", + "proc-macro2", + "quote", + "syn 1.0.109", +] + +[[package]] +name = "ark-serialize" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1d6c2b318ee6e10f8c2853e73a83adc0ccb88995aa978d8a3408d492ab2ee671" +dependencies = [ + "ark-std 0.3.0", + "digest 0.9.0", +] + +[[package]] +name = "ark-serialize" +version = "0.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "adb7b85a02b83d2f22f89bd5cac66c9c89474240cb6207cb1efc16d098e822a5" +dependencies = [ + "ark-std 0.4.0", + "digest 0.10.7", + "num-bigint", +] + +[[package]] +name = "ark-std" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1df2c09229cbc5a028b1d70e00fdb2acee28b1055dfb5ca73eea49c5a25c4e7c" +dependencies = [ + "num-traits", + "rand", +] + +[[package]] +name = "ark-std" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "94893f1e0c6eeab764ade8dc4c0db24caf4fe7cbbaafc0eba0a9030f447b5185" +dependencies = [ + "num-traits", + "rand", +] + +[[package]] +name = "arrayvec" +version = "0.7.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7c02d123df017efcdfbd739ef81735b36c5ba83ec3c59c80a9d7ecc718f92e50" +dependencies = [ + "serde", +] + +[[package]] +name = "async-stream" +version = "0.3.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0b5a71a6f37880a80d1d7f19efd781e4b5de42c88f0722cc13bcb6cc2cfe8476" +dependencies = [ + "async-stream-impl", + "futures-core", + "pin-project-lite", +] + +[[package]] +name = "async-stream-impl" +version = "0.3.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c7c24de15d275a1ecfd47a380fb4d5ec9bfe0933f309ed5e705b775596a3574d" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.96", +] + +[[package]] +name = "async-trait" +version = "0.1.85" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3f934833b4b7233644e5848f235df3f57ed8c80f1528a26c3dfa13d2147fa056" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.96", +] + +[[package]] +name = "auto_impl" +version = "1.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e12882f59de5360c748c4cbf569a042d5fb0eb515f7bea9c1f470b47f6ffbd73" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.96", +] + +[[package]] +name = "autocfg" +version = "1.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ace50bade8e6234aa140d9a2f552bbee1db4d353f69b8217bc503490fc1a9f26" + +[[package]] +name = "backtrace" +version = "0.3.71" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "26b05800d2e817c8b3b4b54abd461726265fa9789ae34330622f2db9ee696f9d" +dependencies = [ + "addr2line", + "cc", + "cfg-if", + "libc", + "miniz_oxide", + "object", + "rustc-demangle", +] + +[[package]] +name = "base16ct" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4c7f02d4ea65f2c1853089ffd8d2787bdbc63de2f0d29dedbcf8ccdfa0ccd4cf" + +[[package]] +name = "base64" +version = "0.22.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "72b3254f16251a8381aa12e40e3c4d2f0199f8c6508fbecb9d91f575e0fbb8c6" + +[[package]] +name = "base64ct" +version = "1.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8c3c1a368f70d6cf7302d78f8f7093da241fb8e8807c05cc9e51a125895a6d5b" + +[[package]] +name = "bincode" +version = "1.3.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b1f45e9417d87227c7a56d22e471c6206462cba514c7590c09aff4cf6d1ddcad" +dependencies = [ + "serde", +] + +[[package]] +name = "bit-set" +version = "0.5.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0700ddab506f33b20a03b13996eccd309a48e5ff77d0d95926aa0210fb4e95f1" +dependencies = [ + "bit-vec", +] + +[[package]] +name = "bit-vec" +version = "0.6.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "349f9b6a179ed607305526ca489b34ad0a41aed5f7980fa90eb03160b69598fb" + +[[package]] +name = "bitflags" +version = "2.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8f68f53c83ab957f72c32642f3868eec03eb974d1fb82e453128456482613d36" + +[[package]] +name = "bitvec" +version = "1.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1bc2832c24239b0141d5674bb9174f9d68a8b5b3f2753311927c172ca46f7e9c" +dependencies = [ + "funty", + "radium", + "tap", + "wyz", +] + +[[package]] +name = "block-buffer" +version = "0.10.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3078c7629b62d3f0439517fa394996acacc5cbc91c5a20d8c658e77abd503a71" +dependencies = [ + "generic-array", +] + +[[package]] +name = "blst" +version = "0.3.13" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4378725facc195f1a538864863f6de233b500a8862747e7f165078a419d5e874" +dependencies = [ + "cc", + "glob", + "threadpool", + "zeroize", +] + +[[package]] +name = "bumpalo" +version = "3.16.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "79296716171880943b8470b5f8d03aa55eb2e645a4874bdbb28adb49162e012c" + +[[package]] +name = "byte-slice-cast" +version = "1.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c3ac9f8b63eca6fd385229b3675f6cc0dc5c8a5c8a54a59d4f52ffd670d87b0c" + +[[package]] +name = "byteorder" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1fd0f2584146f6f2ef48085050886acf353beff7305ebd1ae69500e27c67f64b" + +[[package]] +name = "bytes" +version = "1.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "325918d6fe32f23b19878fe4b34794ae41fc19ddbe53b10571a4874d44ffd39b" +dependencies = [ + "serde", +] + +[[package]] +name = "c-kzg" +version = "1.0.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f0307f72feab3300336fb803a57134159f6e20139af1357f36c54cb90d8e8928" +dependencies = [ + "blst", + "cc", + "glob", + "hex", + "libc", + "once_cell", + "serde", +] + +[[package]] +name = "cc" +version = "1.2.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "13208fcbb66eaeffe09b99fffbe1af420f00a7b35aa99ad683dfc1aa76145229" +dependencies = [ + "shlex", +] + +[[package]] +name = "cfg-if" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" + +[[package]] +name = "color-eyre" +version = "0.6.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "55146f5e46f237f7423d74111267d4597b59b0dad0ffaf7303bce9945d843ad5" +dependencies = [ + "backtrace", + "color-spantrace", + "eyre", + "indenter", + "once_cell", + "owo-colors", + "tracing-error", +] + +[[package]] +name = "color-spantrace" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cd6be1b2a7e382e2b98b43b2adcca6bb0e465af0bdd38123873ae61eb17a72c2" +dependencies = [ + "once_cell", + "owo-colors", + "tracing-core", + "tracing-error", +] + +[[package]] +name = "const-hex" +version = "1.14.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4b0485bab839b018a8f1723fc5391819fea5f8f0f32288ef8a735fd096b6160c" +dependencies = [ + "cfg-if", + "cpufeatures", + "hex", + "proptest", + "serde", +] + +[[package]] +name = "const-oid" +version = "0.9.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c2459377285ad874054d797f3ccebf984978aa39129f6eafde5cdc8315b612f8" + +[[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-sys" +version = "0.8.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "773648b94d0e5d620f64f280777445740e61fe701025087ec8b57f45c791888b" + +[[package]] +name = "cpufeatures" +version = "0.2.16" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "16b80225097f2e5ae4e7179dd2266824648f3e2f49d9134d584b76389d31c4c3" +dependencies = [ + "libc", +] + +[[package]] +name = "crossbeam-utils" +version = "0.8.21" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d0a5c400df2834b80a4c3327b3aad3a4c4cd4de0629063962b03235697506a28" + +[[package]] +name = "crunchy" +version = "0.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7a81dae078cea95a014a339291cec439d2f232ebe854a9d672b796c6afafa9b7" + +[[package]] +name = "crypto-bigint" +version = "0.5.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0dc92fb57ca44df6db8059111ab3af99a63d5d0f8375d9972e319a379c6bab76" +dependencies = [ + "generic-array", + "rand_core", + "subtle", + "zeroize", +] + +[[package]] +name = "crypto-common" +version = "0.1.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1bfb12502f3fc46cca1bb51ac28df9d618d813cdc3d2f25b9fe775a34af26bb3" +dependencies = [ + "generic-array", + "typenum", +] + +[[package]] +name = "dashmap" +version = "6.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5041cc499144891f3790297212f32a74fb938e5136a14943f338ef9e0ae276cf" +dependencies = [ + "cfg-if", + "crossbeam-utils", + "hashbrown 0.14.5", + "lock_api", + "once_cell", + "parking_lot_core", +] + +[[package]] +name = "der" +version = "0.7.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f55bf8e7b65898637379c1b74eb1551107c8294ed26d855ceb9fd1a09cfc9bc0" +dependencies = [ + "const-oid", + "zeroize", +] + +[[package]] +name = "derivative" +version = "2.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fcc3dd5e9e9c0b295d6e1e4d811fb6f157d5ffd784b8d202fc62eac8035a770b" +dependencies = [ + "proc-macro2", + "quote", + "syn 1.0.109", +] + +[[package]] +name = "derive_more" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4a9b99b9cbbe49445b21764dc0625032a89b145a2642e67603e1c936f5458d05" +dependencies = [ + "derive_more-impl", +] + +[[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.96", + "unicode-xid", +] + +[[package]] +name = "digest" +version = "0.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d3dd60d1080a57a05ab032377049e0591415d2b31afd7028356dbf3cc6dcb066" +dependencies = [ + "generic-array", +] + +[[package]] +name = "digest" +version = "0.10.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9ed9a281f7bc9b7576e61468ba615a66a5c8cfdff42420a70aa82701a3b1e292" +dependencies = [ + "block-buffer", + "const-oid", + "crypto-common", + "subtle", +] + +[[package]] +name = "displaydoc" +version = "0.2.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "97369cbbc041bc366949bc74d34658d6cda5621039731c6310521892a3a20ae0" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.96", +] + +[[package]] +name = "dunce" +version = "1.0.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "92773504d58c093f6de2459af4af33faa518c13451eb8f2b5698ed3d36e7c813" + +[[package]] +name = "ecdsa" +version = "0.16.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ee27f32b5c5292967d2d4a9d7f1e0b0aed2c15daded5a60300e4abb9d8020bca" +dependencies = [ + "der", + "digest 0.10.7", + "elliptic-curve", + "rfc6979", + "signature", + "spki", +] + +[[package]] +name = "either" +version = "1.13.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "60b1af1c220855b6ceac025d3f6ecdd2b7c4894bfe9cd9bda4fbb4bc7c0d4cf0" + +[[package]] +name = "elliptic-curve" +version = "0.13.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b5e6043086bf7973472e0c7dff2142ea0b680d30e18d9cc40f267efbf222bd47" +dependencies = [ + "base16ct", + "crypto-bigint", + "digest 0.10.7", + "ff", + "generic-array", + "group", + "pkcs8", + "rand_core", + "sec1", + "subtle", + "zeroize", +] + +[[package]] +name = "equivalent" +version = "1.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5443807d6dff69373d433ab9ef5378ad8df50ca6298caf15de6e52e24aaf54d5" + +[[package]] +name = "errno" +version = "0.3.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "33d852cb9b869c2a9b3df2f71a3074817f01e1844f839a144f5fcef059a4eb5d" +dependencies = [ + "libc", + "windows-sys 0.59.0", +] + +[[package]] +name = "eyre" +version = "0.6.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7cd915d99f24784cdc19fd37ef22b97e3ff0ae756c7e492e9fbfe897d61e2aec" +dependencies = [ + "indenter", + "once_cell", +] + +[[package]] +name = "fastrand" +version = "2.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "37909eebbb50d72f9059c3b6d82c0463f2ff062c9e95845c43a6c9c0355411be" + +[[package]] +name = "fastrlp" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "139834ddba373bbdd213dffe02c8d110508dcf1726c2be27e8d1f7d7e1856418" +dependencies = [ + "arrayvec", + "auto_impl", + "bytes", +] + +[[package]] +name = "fastrlp" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ce8dba4714ef14b8274c371879b175aa55b16b30f269663f19d576f380018dc4" +dependencies = [ + "arrayvec", + "auto_impl", + "bytes", +] + +[[package]] +name = "ff" +version = "0.13.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ded41244b729663b1e574f1b4fb731469f69f79c17667b5d776b16cda0479449" +dependencies = [ + "rand_core", + "subtle", +] + +[[package]] +name = "fixed-hash" +version = "0.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "835c052cb0c08c1acf6ffd71c022172e18723949c8282f2b9f27efbc51e64534" +dependencies = [ + "byteorder", + "rand", + "rustc-hex", + "static_assertions", +] + +[[package]] +name = "fnv" +version = "1.0.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3f9eec918d3f24069decb9af1554cad7c880e2da24a9afd88aca000531ab82c1" + +[[package]] +name = "foldhash" +version = "0.1.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a0d2fde1f7b3d48b8395d5f2de76c18a528bd6a9cdde438df747bfcba3e05d6f" + +[[package]] +name = "foreign-types" +version = "0.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f6f339eb8adc052cd2ca78910fda869aefa38d22d5cb648e6485e4d3fc06f3b1" +dependencies = [ + "foreign-types-shared", +] + +[[package]] +name = "foreign-types-shared" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "00b0228411908ca8685dba7fc2cdd70ec9990a6e753e89b6ac91a84c40fbaf4b" + +[[package]] +name = "form_urlencoded" +version = "1.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e13624c2627564efccf4934284bdd98cbaa14e79b0b5a141218e507b3a823456" +dependencies = [ + "percent-encoding", +] + +[[package]] +name = "funty" +version = "2.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e6d5a32815ae3f33302d95fdcb2ce17862f8c65363dcfd29360480ba1001fc9c" + +[[package]] +name = "futures" +version = "0.3.31" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "65bc07b1a8bc7c85c5f2e110c476c7389b4554ba72af57d8445ea63a576b0876" +dependencies = [ + "futures-channel", + "futures-core", + "futures-executor", + "futures-io", + "futures-sink", + "futures-task", + "futures-util", +] + +[[package]] +name = "futures-channel" +version = "0.3.31" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2dff15bf788c671c1934e366d07e30c1814a8ef514e1af724a602e8a2fbe1b10" +dependencies = [ + "futures-core", + "futures-sink", +] + +[[package]] +name = "futures-core" +version = "0.3.31" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "05f29059c0c2090612e8d742178b0580d2dc940c837851ad723096f87af6663e" + +[[package]] +name = "futures-executor" +version = "0.3.31" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1e28d1d997f585e54aebc3f97d39e72338912123a67330d723fdbb564d646c9f" +dependencies = [ + "futures-core", + "futures-task", + "futures-util", +] + +[[package]] +name = "futures-io" +version = "0.3.31" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9e5c1b78ca4aae1ac06c48a526a655760685149f0d465d21f37abfe57ce075c6" + +[[package]] +name = "futures-macro" +version = "0.3.31" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "162ee34ebcb7c64a8abebc059ce0fee27c2262618d7b60ed8faf72fef13c3650" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.96", +] + +[[package]] +name = "futures-sink" +version = "0.3.31" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e575fab7d1e0dcb8d0c7bcf9a63ee213816ab51902e6d244a95819acacf1d4f7" + +[[package]] +name = "futures-task" +version = "0.3.31" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f90f7dce0722e95104fcb095585910c0977252f286e354b5e3bd38902cd99988" + +[[package]] +name = "futures-util" +version = "0.3.31" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9fa08315bb612088cc391249efdc3bc77536f16c91f6cf495e6fbe85b20a4a81" +dependencies = [ + "futures-channel", + "futures-core", + "futures-io", + "futures-macro", + "futures-sink", + "futures-task", + "memchr", + "pin-project-lite", + "pin-utils", + "slab", +] + +[[package]] +name = "futures-utils-wasm" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "42012b0f064e01aa58b545fe3727f90f7dd4020f4a3ea735b50344965f5a57e9" + +[[package]] +name = "generic-array" +version = "0.14.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "85649ca51fd72272d7821adaf274ad91c288277713d9c18820d8499a7ff69e9a" +dependencies = [ + "typenum", + "version_check", + "zeroize", +] + +[[package]] +name = "getrandom" +version = "0.2.15" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c4567c8db10ae91089c99af84c68c38da3ec2f087c3f82960bcdbf3656b6f4d7" +dependencies = [ + "cfg-if", + "libc", + "wasi", +] + +[[package]] +name = "gimli" +version = "0.28.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4271d37baee1b8c7e4b708028c57d816cf9d2434acb33a549475f78c181f6253" + +[[package]] +name = "glob" +version = "0.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a8d1add55171497b4705a648c6b583acafb01d58050a51727785f0b2c8e0a2b2" + +[[package]] +name = "group" +version = "0.13.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f0f9ef7462f7c099f518d754361858f86d8a07af53ba9af0fe635bbccb151a63" +dependencies = [ + "ff", + "rand_core", + "subtle", +] + +[[package]] +name = "hashbrown" +version = "0.13.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "43a3c133739dddd0d2990f9a4bdf8eb4b21ef50e4851ca85ab661199821d510e" + +[[package]] +name = "hashbrown" +version = "0.14.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e5274423e17b7c9fc20b6e7e208532f9b19825d82dfd615708b70edd83df41f1" +dependencies = [ + "ahash", +] + +[[package]] +name = "hashbrown" +version = "0.15.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bf151400ff0baff5465007dd2f3e717f3fe502074ca563069ce3a6629d07b289" +dependencies = [ + "allocator-api2", + "equivalent", + "foldhash", + "serde", +] + +[[package]] +name = "heck" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2304e00983f87ffb38b55b444b5e3b60a884b5d30c0fca7d82fe33449bbe55ea" + +[[package]] +name = "hermit-abi" +version = "0.3.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d231dfb89cfffdbc30e7fc41579ed6066ad03abda9e567ccafae602b97ec5024" + +[[package]] +name = "hex" +version = "0.4.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7f24254aa9a54b5c858eaee2f5bccdb46aaf0e486a595ed5fd8f86ba55232a70" +dependencies = [ + "serde", +] + +[[package]] +name = "hmac" +version = "0.12.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6c49c37c09c17a53d937dfbb742eb3a961d65a994e6bcdcf37e7399d0cc8ab5e" +dependencies = [ + "digest 0.10.7", +] + +[[package]] +name = "http" +version = "1.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f16ca2af56261c99fba8bac40a10251ce8188205a4c448fbb745a2e4daa76fea" +dependencies = [ + "bytes", + "fnv", + "itoa", +] + +[[package]] +name = "http-body" +version = "1.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1efedce1fb8e6913f23e0c92de8e62cd5b772a67e7b3946df930a62566c93184" +dependencies = [ + "bytes", + "http", +] + +[[package]] +name = "http-body-util" +version = "0.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "793429d76616a256bcb62c2a2ec2bed781c8307e797e2598c50010f2bee2544f" +dependencies = [ + "bytes", + "futures-util", + "http", + "http-body", + "pin-project-lite", +] + +[[package]] +name = "httparse" +version = "1.9.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7d71d3574edd2771538b901e6549113b4006ece66150fb69c0fb6d9a2adae946" + +[[package]] +name = "hyper" +version = "1.5.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "256fb8d4bd6413123cc9d91832d78325c48ff41677595be797d90f42969beae0" +dependencies = [ + "bytes", + "futures-channel", + "futures-util", + "http", + "http-body", + "httparse", + "itoa", + "pin-project-lite", + "smallvec", + "tokio", + "want", +] + +[[package]] +name = "hyper-tls" +version = "0.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "70206fc6890eaca9fde8a0bf71caa2ddfc9fe045ac9e5c70df101a7dbde866e0" +dependencies = [ + "bytes", + "http-body-util", + "hyper", + "hyper-util", + "native-tls", + "tokio", + "tokio-native-tls", + "tower-service", +] + +[[package]] +name = "hyper-util" +version = "0.1.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "df2dcfbe0677734ab2f3ffa7fa7bfd4706bfdc1ef393f2ee30184aed67e631b4" +dependencies = [ + "bytes", + "futures-channel", + "futures-util", + "http", + "http-body", + "hyper", + "pin-project-lite", + "socket2", + "tokio", + "tower-service", + "tracing", +] + +[[package]] +name = "icu_collections" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "db2fa452206ebee18c4b5c2274dbf1de17008e874b4dc4f0aea9d01ca79e4526" +dependencies = [ + "displaydoc", + "yoke", + "zerofrom", + "zerovec", +] + +[[package]] +name = "icu_locid" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "13acbb8371917fc971be86fc8057c41a64b521c184808a698c02acc242dbf637" +dependencies = [ + "displaydoc", + "litemap", + "tinystr", + "writeable", + "zerovec", +] + +[[package]] +name = "icu_locid_transform" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "01d11ac35de8e40fdeda00d9e1e9d92525f3f9d887cdd7aa81d727596788b54e" +dependencies = [ + "displaydoc", + "icu_locid", + "icu_locid_transform_data", + "icu_provider", + "tinystr", + "zerovec", +] + +[[package]] +name = "icu_locid_transform_data" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fdc8ff3388f852bede6b579ad4e978ab004f139284d7b28715f773507b946f6e" + +[[package]] +name = "icu_normalizer" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "19ce3e0da2ec68599d193c93d088142efd7f9c5d6fc9b803774855747dc6a84f" +dependencies = [ + "displaydoc", + "icu_collections", + "icu_normalizer_data", + "icu_properties", + "icu_provider", + "smallvec", + "utf16_iter", + "utf8_iter", + "write16", + "zerovec", +] + +[[package]] +name = "icu_normalizer_data" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f8cafbf7aa791e9b22bec55a167906f9e1215fd475cd22adfcf660e03e989516" + +[[package]] +name = "icu_properties" +version = "1.5.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "93d6020766cfc6302c15dbbc9c8778c37e62c14427cb7f6e601d849e092aeef5" +dependencies = [ + "displaydoc", + "icu_collections", + "icu_locid_transform", + "icu_properties_data", + "icu_provider", + "tinystr", + "zerovec", +] + +[[package]] +name = "icu_properties_data" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "67a8effbc3dd3e4ba1afa8ad918d5684b8868b3b26500753effea8d2eed19569" + +[[package]] +name = "icu_provider" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6ed421c8a8ef78d3e2dbc98a973be2f3770cb42b606e3ab18d6237c4dfde68d9" +dependencies = [ + "displaydoc", + "icu_locid", + "icu_provider_macros", + "stable_deref_trait", + "tinystr", + "writeable", + "yoke", + "zerofrom", + "zerovec", +] + +[[package]] +name = "icu_provider_macros" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1ec89e9337638ecdc08744df490b221a7399bf8d164eb52a665454e60e075ad6" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.96", +] + +[[package]] +name = "id-arena" +version = "2.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "25a2bc672d1148e28034f176e01fffebb08b35768468cc954630da77a1449005" + +[[package]] +name = "idna" +version = "1.0.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "686f825264d630750a544639377bae737628043f20d38bbc029e8f29ea968a7e" +dependencies = [ + "idna_adapter", + "smallvec", + "utf8_iter", +] + +[[package]] +name = "idna_adapter" +version = "1.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "daca1df1c957320b2cf139ac61e7bd64fed304c5040df000a745aa1de3b4ef71" +dependencies = [ + "icu_normalizer", + "icu_properties", +] + +[[package]] +name = "impl-codec" +version = "0.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ba6a270039626615617f3f36d15fc827041df3b78c439da2cadfa47455a77f2f" +dependencies = [ + "parity-scale-codec", +] + +[[package]] +name = "impl-trait-for-tuples" +version = "0.2.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a0eb5a3343abf848c0984fe4604b2b105da9539376e24fc0a3b0007411ae4fd9" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.96", +] + +[[package]] +name = "indenter" +version = "0.3.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ce23b50ad8242c51a442f3ff322d56b02f08852c77e4c0b4d3fd684abc89c683" + +[[package]] +name = "indexmap" +version = "2.7.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8c9c992b02b5b4c94ea26e32fe5bccb7aa7d9f390ab5c1221ff895bc7ea8b652" +dependencies = [ + "equivalent", + "hashbrown 0.15.2", + "serde", +] + +[[package]] +name = "ipnet" +version = "2.11.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "469fb0b9cefa57e3ef31275ee7cacb78f2fdca44e4765491884a2b119d4eb130" + +[[package]] +name = "itertools" +version = "0.10.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b0fd2260e829bddf4cb6ea802289de2f86d6a7a690192fbe91b3f46e0f2c8473" +dependencies = [ + "either", +] + +[[package]] +name = "itertools" +version = "0.13.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "413ee7dfc52ee1a4949ceeb7dbc8a33f2d6c088194d9f922fb8318faf1f01186" +dependencies = [ + "either", +] + +[[package]] +name = "itoa" +version = "1.0.14" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d75a2a4b1b190afb6f5425f10f6a8f959d2ea0b9c2b1d79553551850539e4674" + +[[package]] +name = "js-sys" +version = "0.3.77" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1cfaf33c695fc6e08064efbc1f72ec937429614f25eef83af942d0e227c3a28f" +dependencies = [ + "once_cell", + "wasm-bindgen", +] + +[[package]] +name = "k256" +version = "0.13.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f6e3919bbaa2945715f0bb6d3934a173d1e9a59ac23767fbaaef277265a7411b" +dependencies = [ + "cfg-if", + "ecdsa", + "elliptic-curve", + "once_cell", + "sha2", +] + +[[package]] +name = "keccak" +version = "0.1.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ecc2af9a1119c51f12a14607e783cb977bde58bc069ff0c3da1095e635d70654" +dependencies = [ + "cpufeatures", +] + +[[package]] +name = "keccak-asm" +version = "0.1.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "505d1856a39b200489082f90d897c3f07c455563880bc5952e38eabf731c83b6" +dependencies = [ + "digest 0.10.7", + "sha3-asm", +] + +[[package]] +name = "kinode_app_common" +version = "0.1.0" +dependencies = [ + "anyhow", + "kinode_process_lib", + "once_cell", + "process_macros", + "serde", + "serde_json", + "uuid", + "wit-bindgen", +] + +[[package]] +name = "kinode_process_lib" +version = "0.10.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "46830129ca3814865519615f1d4e4c1e9894c9df50be38a6c8069572e9cc1530" +dependencies = [ + "alloy", + "alloy-primitives", + "alloy-sol-macro", + "alloy-sol-types", + "anyhow", + "bincode", + "color-eyre", + "http", + "mime_guess", + "rand", + "rmp-serde", + "serde", + "serde_json", + "thiserror 1.0.69", + "tracing", + "tracing-error", + "tracing-subscriber", + "url", + "wit-bindgen", +] + +[[package]] +name = "lazy_static" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bbd2bcb4c963f2ddae06a2efc7e9f3591312473c50c6685e1f298068316e66fe" + +[[package]] +name = "leb128" +version = "0.2.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "884e2677b40cc8c339eaefcb701c32ef1fd2493d71118dc0ca4b6a736c93bd67" + +[[package]] +name = "libc" +version = "0.2.169" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b5aba8db14291edd000dfcc4d620c7ebfb122c613afb886ca8803fa4e128a20a" + +[[package]] +name = "libm" +version = "0.2.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8355be11b20d696c8f18f6cc018c4e372165b1fa8126cef092399c9951984ffa" + +[[package]] +name = "linux-raw-sys" +version = "0.4.15" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d26c52dbd32dccf2d10cac7725f8eae5296885fb5703b261f7d0a0739ec807ab" + +[[package]] +name = "litemap" +version = "0.7.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4ee93343901ab17bd981295f2cf0026d4ad018c7c31ba84549a4ddbb47a45104" + +[[package]] +name = "lock_api" +version = "0.4.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "07af8b9cdd281b7915f413fa73f29ebd5d55d0d3f0155584dade1ff18cea1b17" +dependencies = [ + "autocfg", + "scopeguard", +] + +[[package]] +name = "log" +version = "0.4.25" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "04cbf5b083de1c7e0222a7a51dbfdba1cbe1c6ab0b15e29fff3f6c077fd9cd9f" + +[[package]] +name = "lru" +version = "0.12.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "234cf4f4a04dc1f57e24b96cc0cd600cf2af460d4161ac5ecdd0af8e1f3b2a38" +dependencies = [ + "hashbrown 0.15.2", +] + +[[package]] +name = "matchers" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8263075bb86c5a1b1427b5ae862e8889656f126e9f77c484496e8b47cf5c5558" +dependencies = [ + "regex-automata 0.1.10", +] + +[[package]] +name = "memchr" +version = "2.7.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "78ca9ab1a0babb1e7d5695e3530886289c18cf2f87ec19a575a0abdce112e3a3" + +[[package]] +name = "mime" +version = "0.3.17" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6877bb514081ee2a7ff5ef9de3281f14a4dd4bceac4c09388074a6b5df8a139a" + +[[package]] +name = "mime_guess" +version = "2.0.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f7c44f8e672c00fe5308fa235f821cb4198414e1c77935c1ab6948d3fd78550e" +dependencies = [ + "mime", + "unicase", +] + +[[package]] +name = "miniz_oxide" +version = "0.7.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b8a240ddb74feaf34a79a7add65a741f3167852fba007066dcac1ca548d89c08" +dependencies = [ + "adler", +] + +[[package]] +name = "mio" +version = "1.0.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2886843bf800fba2e3377cff24abf6379b4c4d5c6681eaf9ea5b0d15090450bd" +dependencies = [ + "libc", + "wasi", + "windows-sys 0.52.0", +] + +[[package]] +name = "native-tls" +version = "0.2.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a8614eb2c83d59d1c8cc974dd3f920198647674a0a035e1af1fa58707e317466" +dependencies = [ + "libc", + "log", + "openssl", + "openssl-probe", + "openssl-sys", + "schannel", + "security-framework", + "security-framework-sys", + "tempfile", +] + +[[package]] +name = "nu-ansi-term" +version = "0.46.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "77a8165726e8236064dbb45459242600304b42a5ea24ee2948e18e023bf7ba84" +dependencies = [ + "overload", + "winapi", +] + +[[package]] +name = "num-bigint" +version = "0.4.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a5e44f723f1133c9deac646763579fdb3ac745e418f2a7af9cd0c431da1f20b9" +dependencies = [ + "num-integer", + "num-traits", +] + +[[package]] +name = "num-integer" +version = "0.1.46" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7969661fd2958a5cb096e56c8e1ad0444ac2bbcd0061bd28660485a44879858f" +dependencies = [ + "num-traits", +] + +[[package]] +name = "num-traits" +version = "0.2.19" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "071dfc062690e90b734c0b2273ce72ad0ffa95f0c74596bc250dcfd960262841" +dependencies = [ + "autocfg", + "libm", +] + +[[package]] +name = "num_cpus" +version = "1.16.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4161fcb6d602d4d2081af7c3a45852d875a03dd337a6bfdd6e06407b61342a43" +dependencies = [ + "hermit-abi", + "libc", +] + +[[package]] +name = "num_enum" +version = "0.7.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4e613fc340b2220f734a8595782c551f1250e969d87d3be1ae0579e8d4065179" +dependencies = [ + "num_enum_derive", +] + +[[package]] +name = "num_enum_derive" +version = "0.7.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "af1844ef2428cc3e1cb900be36181049ef3d3193c63e43026cfe202983b27a56" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.96", +] + +[[package]] +name = "nybbles" +version = "0.3.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8983bb634df7248924ee0c4c3a749609b5abcb082c28fffe3254b3eb3602b307" +dependencies = [ + "alloy-rlp", + "const-hex", + "proptest", + "serde", + "smallvec", +] + +[[package]] +name = "object" +version = "0.32.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a6a622008b6e321afc04970976f62ee297fdbaa6f95318ca343e3eebb9648441" +dependencies = [ + "memchr", +] + +[[package]] +name = "once_cell" +version = "1.20.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1261fe7e33c73b354eab43b1273a57c8f967d0391e80353e51f764ac02cf6775" + +[[package]] +name = "openssl" +version = "0.10.68" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6174bc48f102d208783c2c84bf931bb75927a617866870de8a4ea85597f871f5" +dependencies = [ + "bitflags", + "cfg-if", + "foreign-types", + "libc", + "once_cell", + "openssl-macros", + "openssl-sys", +] + +[[package]] +name = "openssl-macros" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a948666b637a0f465e8564c73e89d4dde00d72d4d473cc972f390fc3dcee7d9c" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.96", +] + +[[package]] +name = "openssl-probe" +version = "0.1.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ff011a302c396a5197692431fc1948019154afc178baf7d8e37367442a4601cf" + +[[package]] +name = "openssl-sys" +version = "0.9.104" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "45abf306cbf99debc8195b66b7346498d7b10c210de50418b5ccd7ceba08c741" +dependencies = [ + "cc", + "libc", + "pkg-config", + "vcpkg", +] + +[[package]] +name = "overload" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b15813163c1d831bf4a13c3610c05c0d03b39feb07f7e09fa234dac9b15aaf39" + +[[package]] +name = "owo-colors" +version = "3.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c1b04fb49957986fdce4d6ee7a65027d55d4b6d2265e5848bbb507b58ccfdb6f" + +[[package]] +name = "parity-scale-codec" +version = "3.6.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "306800abfa29c7f16596b5970a588435e3d5b3149683d00c12b699cc19f895ee" +dependencies = [ + "arrayvec", + "bitvec", + "byte-slice-cast", + "impl-trait-for-tuples", + "parity-scale-codec-derive", + "serde", +] + +[[package]] +name = "parity-scale-codec-derive" +version = "3.6.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d830939c76d294956402033aee57a6da7b438f2294eb94864c37b0569053a42c" +dependencies = [ + "proc-macro-crate", + "proc-macro2", + "quote", + "syn 1.0.109", +] + +[[package]] +name = "parking_lot" +version = "0.12.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f1bf18183cf54e8d6059647fc3063646a1801cf30896933ec2311622cc4b9a27" +dependencies = [ + "lock_api", + "parking_lot_core", +] + +[[package]] +name = "parking_lot_core" +version = "0.9.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1e401f977ab385c9e4e3ab30627d6f26d00e2c73eef317493c4ec6d468726cf8" +dependencies = [ + "cfg-if", + "libc", + "redox_syscall", + "smallvec", + "windows-targets", +] + +[[package]] +name = "paste" +version = "1.0.15" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "57c0d7b74b563b49d38dae00a0c37d4d6de9b432382b2892f0574ddcae73fd0a" + +[[package]] +name = "percent-encoding" +version = "2.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e3148f5046208a5d56bcfc03053e3ca6334e51da8dfb19b6cdc8b306fae3283e" + +[[package]] +name = "pest" +version = "2.7.15" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8b7cafe60d6cf8e62e1b9b2ea516a089c008945bb5a275416789e7db0bc199dc" +dependencies = [ + "memchr", + "thiserror 2.0.11", + "ucd-trie", +] + +[[package]] +name = "pin-project" +version = "1.1.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1e2ec53ad785f4d35dac0adea7f7dc6f1bb277ad84a680c7afefeae05d1f5916" +dependencies = [ + "pin-project-internal", +] + +[[package]] +name = "pin-project-internal" +version = "1.1.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d56a66c0c55993aa927429d0f8a0abfd74f084e4d9c192cffed01e418d83eefb" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.96", +] + +[[package]] +name = "pin-project-lite" +version = "0.2.16" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3b3cff922bd51709b605d9ead9aa71031d81447142d828eb4a6eba76fe619f9b" + +[[package]] +name = "pin-utils" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8b870d8c151b6f2fb93e84a13146138f05d02ed11c7e7c54f8826aaaf7c9f184" + +[[package]] +name = "pkcs8" +version = "0.10.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f950b2377845cebe5cf8b5165cb3cc1a5e0fa5cfa3e1f7f55707d8fd82e0a7b7" +dependencies = [ + "der", + "spki", +] + +[[package]] +name = "pkg-config" +version = "0.3.31" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "953ec861398dccce10c670dfeaf3ec4911ca479e9c02154b3a215178c5f566f2" + +[[package]] +name = "ppv-lite86" +version = "0.2.20" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "77957b295656769bb8ad2b6a6b09d897d94f05c41b069aede1fcdaa675eaea04" +dependencies = [ + "zerocopy", +] + +[[package]] +name = "prettyplease" +version = "0.2.29" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6924ced06e1f7dfe3fa48d57b9f74f55d8915f5036121bef647ef4b204895fac" +dependencies = [ + "proc-macro2", + "syn 2.0.96", +] + +[[package]] +name = "primitive-types" +version = "0.12.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0b34d9fd68ae0b74a41b21c03c2f62847aa0ffea044eee893b4c140b37e244e2" +dependencies = [ + "fixed-hash", + "impl-codec", + "uint", +] + +[[package]] +name = "proc-macro-crate" +version = "3.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8ecf48c7ca261d60b74ab1a7b20da18bede46776b2e55535cb958eb595c5fa7b" +dependencies = [ + "toml_edit", +] + +[[package]] +name = "proc-macro-error-attr2" +version = "2.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "96de42df36bb9bba5542fe9f1a054b8cc87e172759a1868aa05c1f3acc89dfc5" +dependencies = [ + "proc-macro2", + "quote", +] + +[[package]] +name = "proc-macro-error2" +version = "2.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "11ec05c52be0a07b08061f7dd003e7d7092e0472bc731b4af7bb1ef876109802" +dependencies = [ + "proc-macro-error-attr2", + "proc-macro2", + "quote", + "syn 2.0.96", +] + +[[package]] +name = "proc-macro2" +version = "1.0.93" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "60946a68e5f9d28b0dc1c21bb8a97ee7d018a8b322fa57838ba31cc878e22d99" +dependencies = [ + "unicode-ident", +] + +[[package]] +name = "proc_macro_send" +version = "0.1.0" +dependencies = [ + "anyhow", + "kinode_app_common", + "kinode_process_lib", + "proc-macro2", + "quote", + "serde", + "syn 2.0.96", + "uuid", +] + +[[package]] +name = "process_macros" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9ecfcd7b51a1b9249fb47359a9f8d57a9e9dbc71857c5cfd08f98764f7106a3d" +dependencies = [ + "quote", + "syn 2.0.96", +] + +[[package]] +name = "proptest" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b4c2511913b88df1637da85cc8d96ec8e43a3f8bb8ccb71ee1ac240d6f3df58d" +dependencies = [ + "bit-set", + "bit-vec", + "bitflags", + "lazy_static", + "num-traits", + "rand", + "rand_chacha", + "rand_xorshift", + "regex-syntax 0.8.5", + "rusty-fork", + "tempfile", + "unarray", +] + +[[package]] +name = "quick-error" +version = "1.2.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a1d01941d82fa2ab50be1e79e6714289dd7cde78eba4c074bc5a4374f650dfe0" + +[[package]] +name = "quote" +version = "1.0.38" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0e4dccaaaf89514f546c693ddc140f729f958c247918a13380cccc6078391acc" +dependencies = [ + "proc-macro2", +] + +[[package]] +name = "radium" +version = "0.7.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dc33ff2d4973d518d823d61aa239014831e521c75da58e3df4840d3f47749d09" + +[[package]] +name = "rand" +version = "0.8.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "34af8d1a0e25924bc5b7c43c079c942339d8f0a8b57c39049bef581b46327404" +dependencies = [ + "libc", + "rand_chacha", + "rand_core", + "serde", +] + +[[package]] +name = "rand_chacha" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e6c10a63a0fa32252be49d21e7709d4d4baf8d231c2dbce1eaa8141b9b127d88" +dependencies = [ + "ppv-lite86", + "rand_core", +] + +[[package]] +name = "rand_core" +version = "0.6.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ec0be4795e2f6a28069bec0b5ff3e2ac9bafc99e6a9a7dc3547996c5c816922c" +dependencies = [ + "getrandom", +] + +[[package]] +name = "rand_xorshift" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d25bf25ec5ae4a3f1b92f929810509a2f53d7dca2f50b794ff57e3face536c8f" +dependencies = [ + "rand_core", +] + +[[package]] +name = "redox_syscall" +version = "0.5.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "03a862b389f93e68874fbf580b9de08dd02facb9a788ebadaf4a3fd33cf58834" +dependencies = [ + "bitflags", +] + +[[package]] +name = "regex" +version = "1.11.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b544ef1b4eac5dc2db33ea63606ae9ffcfac26c1416a2806ae0bf5f56b201191" +dependencies = [ + "aho-corasick", + "memchr", + "regex-automata 0.4.9", + "regex-syntax 0.8.5", +] + +[[package]] +name = "regex-automata" +version = "0.1.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6c230d73fb8d8c1b9c0b3135c5142a8acee3a0558fb8db5cf1cb65f8d7862132" +dependencies = [ + "regex-syntax 0.6.29", +] + +[[package]] +name = "regex-automata" +version = "0.4.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "809e8dc61f6de73b46c85f4c96486310fe304c434cfa43669d7b40f711150908" +dependencies = [ + "aho-corasick", + "memchr", + "regex-syntax 0.8.5", +] + +[[package]] +name = "regex-syntax" +version = "0.6.29" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f162c6dd7b008981e4d40210aca20b4bd0f9b60ca9271061b07f78537722f2e1" + +[[package]] +name = "regex-syntax" +version = "0.8.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2b15c43186be67a4fd63bee50d0303afffcef381492ebe2c5d87f324e1b8815c" + +[[package]] +name = "reqwest" +version = "0.12.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "43e734407157c3c2034e0258f5e4473ddb361b1e85f95a66690d67264d7cd1da" +dependencies = [ + "base64", + "bytes", + "futures-core", + "futures-util", + "http", + "http-body", + "http-body-util", + "hyper", + "hyper-tls", + "hyper-util", + "ipnet", + "js-sys", + "log", + "mime", + "native-tls", + "once_cell", + "percent-encoding", + "pin-project-lite", + "rustls-pemfile", + "serde", + "serde_json", + "serde_urlencoded", + "sync_wrapper", + "tokio", + "tokio-native-tls", + "tower", + "tower-service", + "url", + "wasm-bindgen", + "wasm-bindgen-futures", + "web-sys", + "windows-registry", +] + +[[package]] +name = "rfc6979" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f8dd2a808d456c4a54e300a23e9f5a67e122c3024119acbfd73e3bf664491cb2" +dependencies = [ + "hmac", + "subtle", +] + +[[package]] +name = "rlp" +version = "0.5.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bb919243f34364b6bd2fc10ef797edbfa75f33c252e7998527479c6d6b47e1ec" +dependencies = [ + "bytes", + "rustc-hex", +] + +[[package]] +name = "rmp" +version = "0.8.14" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "228ed7c16fa39782c3b3468e974aec2795e9089153cd08ee2e9aefb3613334c4" +dependencies = [ + "byteorder", + "num-traits", + "paste", +] + +[[package]] +name = "rmp-serde" +version = "1.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "52e599a477cf9840e92f2cde9a7189e67b42c57532749bf90aea6ec10facd4db" +dependencies = [ + "byteorder", + "rmp", + "serde", +] + +[[package]] +name = "ruint" +version = "1.12.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f5ef8fb1dd8de3870cb8400d51b4c2023854bbafd5431a3ac7e7317243e22d2f" +dependencies = [ + "alloy-rlp", + "ark-ff 0.3.0", + "ark-ff 0.4.2", + "bytes", + "fastrlp 0.3.1", + "fastrlp 0.4.0", + "num-bigint", + "num-integer", + "num-traits", + "parity-scale-codec", + "primitive-types", + "proptest", + "rand", + "rlp", + "ruint-macro", + "serde", + "valuable", + "zeroize", +] + +[[package]] +name = "ruint-macro" +version = "1.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "48fd7bd8a6377e15ad9d42a8ec25371b94ddc67abe7c8b9127bec79bebaaae18" + +[[package]] +name = "rustc-demangle" +version = "0.1.24" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "719b953e2095829ee67db738b3bfa9fa368c94900df327b3f07fe6e794d2fe1f" + +[[package]] +name = "rustc-hash" +version = "2.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c7fb8039b3032c191086b10f11f319a6e99e1e82889c5cc6046f515c9db1d497" + +[[package]] +name = "rustc-hex" +version = "2.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3e75f6a532d0fd9f7f13144f392b6ad56a32696bfcd9c78f797f16bbb6f072d6" + +[[package]] +name = "rustc_version" +version = "0.3.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f0dfe2087c51c460008730de8b57e6a320782fbfb312e1f4d520e6c6fae155ee" +dependencies = [ + "semver 0.11.0", +] + +[[package]] +name = "rustc_version" +version = "0.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cfcb3a22ef46e85b45de6ee7e79d063319ebb6594faafcf1c225ea92ab6e9b92" +dependencies = [ + "semver 1.0.25", +] + +[[package]] +name = "rustix" +version = "0.38.43" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a78891ee6bf2340288408954ac787aa063d8e8817e9f53abb37c695c6d834ef6" +dependencies = [ + "bitflags", + "errno", + "libc", + "linux-raw-sys", + "windows-sys 0.59.0", +] + +[[package]] +name = "rustls-pemfile" +version = "2.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dce314e5fee3f39953d46bb63bb8a46d40c2f8fb7cc5a3b6cab2bde9721d6e50" +dependencies = [ + "rustls-pki-types", +] + +[[package]] +name = "rustls-pki-types" +version = "1.10.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d2bf47e6ff922db3825eb750c4e2ff784c6ff8fb9e13046ef6a1d1c5401b0b37" + +[[package]] +name = "rustversion" +version = "1.0.19" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f7c45b9784283f1b2e7fb61b42047c2fd678ef0960d4f6f1eba131594cc369d4" + +[[package]] +name = "rusty-fork" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cb3dcc6e454c328bb824492db107ab7c0ae8fcffe4ad210136ef014458c1bc4f" +dependencies = [ + "fnv", + "quick-error", + "tempfile", + "wait-timeout", +] + +[[package]] +name = "ryu" +version = "1.0.18" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f3cb5ba0dc43242ce17de99c180e96db90b235b8a9fdc9543c96d2209116bd9f" + +[[package]] +name = "schannel" +version = "0.1.27" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1f29ebaa345f945cec9fbbc532eb307f0fdad8161f281b6369539c8d84876b3d" +dependencies = [ + "windows-sys 0.59.0", +] + +[[package]] +name = "schnellru" +version = "0.2.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "356285bbf17bea63d9e52e96bd18f039672ac92b55b8cb997d6162a2a37d1649" +dependencies = [ + "ahash", + "cfg-if", + "hashbrown 0.13.2", +] + +[[package]] +name = "scopeguard" +version = "1.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "94143f37725109f92c262ed2cf5e59bce7498c01bcc1502d7b9afe439a4e9f49" + +[[package]] +name = "sec1" +version = "0.7.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d3e97a565f76233a6003f9f5c54be1d9c5bdfa3eccfb189469f11ec4901c47dc" +dependencies = [ + "base16ct", + "der", + "generic-array", + "pkcs8", + "subtle", + "zeroize", +] + +[[package]] +name = "security-framework" +version = "2.11.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "897b2245f0b511c87893af39b033e5ca9cce68824c4d7e7630b5a1d339658d02" +dependencies = [ + "bitflags", + "core-foundation", + "core-foundation-sys", + "libc", + "security-framework-sys", +] + +[[package]] +name = "security-framework-sys" +version = "2.14.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "49db231d56a190491cb4aeda9527f1ad45345af50b0851622a7adb8c03b01c32" +dependencies = [ + "core-foundation-sys", + "libc", +] + +[[package]] +name = "semver" +version = "0.11.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f301af10236f6df4160f7c3f04eec6dbc70ace82d23326abad5edee88801c6b6" +dependencies = [ + "semver-parser", +] + +[[package]] +name = "semver" +version = "1.0.25" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f79dfe2d285b0488816f30e700a7438c5a73d816b5b7d3ac72fbc48b0d185e03" + +[[package]] +name = "semver-parser" +version = "0.10.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9900206b54a3527fdc7b8a938bffd94a568bac4f4aa8113b209df75a09c0dec2" +dependencies = [ + "pest", +] + +[[package]] +name = "serde" +version = "1.0.217" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "02fc4265df13d6fa1d00ecff087228cc0a2b5f3c0e87e258d8b94a156e984c70" +dependencies = [ + "serde_derive", +] + +[[package]] +name = "serde_derive" +version = "1.0.217" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5a9bf7cf98d04a2b28aead066b7496853d4779c9cc183c440dbac457641e19a0" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.96", +] + +[[package]] +name = "serde_json" +version = "1.0.137" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "930cfb6e6abf99298aaad7d29abbef7a9999a9a8806a40088f55f0dcec03146b" +dependencies = [ + "itoa", + "memchr", + "ryu", + "serde", +] + +[[package]] +name = "serde_urlencoded" +version = "0.7.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d3491c14715ca2294c4d6a88f15e84739788c1d030eed8c110436aafdaa2f3fd" +dependencies = [ + "form_urlencoded", + "itoa", + "ryu", + "serde", +] + +[[package]] +name = "sha2" +version = "0.10.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "793db75ad2bcafc3ffa7c68b215fee268f537982cd901d132f89c6343f3a3dc8" +dependencies = [ + "cfg-if", + "cpufeatures", + "digest 0.10.7", +] + +[[package]] +name = "sha3" +version = "0.10.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "75872d278a8f37ef87fa0ddbda7802605cb18344497949862c0d4dcb291eba60" +dependencies = [ + "digest 0.10.7", + "keccak", +] + +[[package]] +name = "sha3-asm" +version = "0.1.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c28efc5e327c837aa837c59eae585fc250715ef939ac32881bcc11677cd02d46" +dependencies = [ + "cc", + "cfg-if", +] + +[[package]] +name = "sharded-slab" +version = "0.1.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f40ca3c46823713e0d4209592e8d6e826aa57e928f09752619fc696c499637f6" +dependencies = [ + "lazy_static", +] + +[[package]] +name = "shlex" +version = "1.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0fda2ff0d084019ba4d7c6f371c95d8fd75ce3524c3cb8fb653a3023f6323e64" + +[[package]] +name = "signature" +version = "2.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "77549399552de45a898a580c1b41d445bf730df867cc44e6c0233bbc4b8329de" +dependencies = [ + "digest 0.10.7", + "rand_core", +] + +[[package]] +name = "slab" +version = "0.4.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8f92a496fb766b417c996b9c5e57daf2f7ad3b0bebe1ccfca4856390e3d3bb67" +dependencies = [ + "autocfg", +] + +[[package]] +name = "smallvec" +version = "1.13.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3c5e1a9a646d36c3599cd173a41282daf47c44583ad367b8e6837255952e5c67" +dependencies = [ + "serde", +] + +[[package]] +name = "socket2" +version = "0.5.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c970269d99b64e60ec3bd6ad27270092a5394c4e309314b18ae3fe575695fbe8" +dependencies = [ + "libc", + "windows-sys 0.52.0", +] + +[[package]] +name = "spdx" +version = "0.10.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "58b69356da67e2fc1f542c71ea7e654a361a79c938e4424392ecf4fa065d2193" +dependencies = [ + "smallvec", +] + +[[package]] +name = "spki" +version = "0.7.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d91ed6c858b01f942cd56b37a94b3e0a1798290327d1236e4d9cf4eaca44d29d" +dependencies = [ + "base64ct", + "der", +] + +[[package]] +name = "stable_deref_trait" +version = "1.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a8f112729512f8e442d81f95a8a7ddf2b7c6b8a1a6f509a95864142b30cab2d3" + +[[package]] +name = "static_assertions" +version = "1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a2eb9349b6444b326872e140eb1cf5e7c522154d69e7a0ffb0fb81c06b37543f" + +[[package]] +name = "strum" +version = "0.26.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8fec0f0aef304996cf250b31b5a10dee7980c85da9d759361292b8bca5a18f06" +dependencies = [ + "strum_macros", +] + +[[package]] +name = "strum_macros" +version = "0.26.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4c6bee85a5a24955dc440386795aa378cd9cf82acd5f764469152d2270e581be" +dependencies = [ + "heck", + "proc-macro2", + "quote", + "rustversion", + "syn 2.0.96", +] + +[[package]] +name = "subtle" +version = "2.6.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "13c2bddecc57b384dee18652358fb23172facb8a2c51ccc10d74c157bdea3292" + +[[package]] +name = "syn" +version = "1.0.109" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "72b64191b275b66ffe2469e8af2c1cfe3bafa67b529ead792a6d0160888b4237" +dependencies = [ + "proc-macro2", + "quote", + "unicode-ident", +] + +[[package]] +name = "syn" +version = "2.0.96" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d5d0adab1ae378d7f53bdebc67a39f1f151407ef230f0ce2883572f5d8985c80" +dependencies = [ + "proc-macro2", + "quote", + "unicode-ident", +] + +[[package]] +name = "syn-solidity" +version = "0.8.19" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b84e4d83a0a6704561302b917a932484e1cae2d8c6354c64be8b7bac1c1fe057" +dependencies = [ + "paste", + "proc-macro2", + "quote", + "syn 2.0.96", +] + +[[package]] +name = "sync_wrapper" +version = "1.0.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0bf256ce5efdfa370213c1dabab5935a12e49f2c58d15e9eac2870d3b4f27263" +dependencies = [ + "futures-core", +] + +[[package]] +name = "synstructure" +version = "0.13.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c8af7666ab7b6390ab78131fb5b0fce11d6b7a6951602017c35fa82800708971" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.96", +] + +[[package]] +name = "tap" +version = "1.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "55937e1799185b12863d447f42597ed69d9928686b8d88a1df17376a097d8369" + +[[package]] +name = "tempfile" +version = "3.15.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9a8a559c81686f576e8cd0290cd2a24a2a9ad80c98b3478856500fcbd7acd704" +dependencies = [ + "cfg-if", + "fastrand", + "getrandom", + "once_cell", + "rustix", + "windows-sys 0.59.0", +] + +[[package]] +name = "thiserror" +version = "1.0.69" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b6aaf5339b578ea85b50e080feb250a3e8ae8cfcdff9a461c9ec2904bc923f52" +dependencies = [ + "thiserror-impl 1.0.69", +] + +[[package]] +name = "thiserror" +version = "2.0.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d452f284b73e6d76dd36758a0c8684b1d5be31f92b89d07fd5822175732206fc" +dependencies = [ + "thiserror-impl 2.0.11", +] + +[[package]] +name = "thiserror-impl" +version = "1.0.69" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4fee6c4efc90059e10f81e6d42c60a18f76588c3d74cb83a0b242a2b6c7504c1" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.96", +] + +[[package]] +name = "thiserror-impl" +version = "2.0.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "26afc1baea8a989337eeb52b6e72a039780ce45c3edfcc9c5b9d112feeb173c2" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.96", +] + +[[package]] +name = "thread_local" +version = "1.1.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8b9ef9bad013ada3808854ceac7b46812a6465ba368859a37e2100283d2d719c" +dependencies = [ + "cfg-if", + "once_cell", +] + +[[package]] +name = "threadpool" +version = "1.8.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d050e60b33d41c19108b32cea32164033a9013fe3b46cbd4457559bfbf77afaa" +dependencies = [ + "num_cpus", +] + +[[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.7.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9117f5d4db391c1cf6927e7bea3db74b9a1c1add8f7eda9ffd5364f40f57b82f" +dependencies = [ + "displaydoc", + "zerovec", +] + +[[package]] +name = "tokio" +version = "1.43.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3d61fa4ffa3de412bfea335c6ecff681de2b609ba3c77ef3e00e521813a9ed9e" +dependencies = [ + "backtrace", + "bytes", + "libc", + "mio", + "pin-project-lite", + "socket2", + "tokio-macros", + "windows-sys 0.52.0", +] + +[[package]] +name = "tokio-macros" +version = "2.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6e06d43f1345a3bcd39f6a56dbb7dcab2ba47e68e8ac134855e7e2bdbaf8cab8" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.96", +] + +[[package]] +name = "tokio-native-tls" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bbae76ab933c85776efabc971569dd6119c580d8f5d448769dec1764bf796ef2" +dependencies = [ + "native-tls", + "tokio", +] + +[[package]] +name = "tokio-stream" +version = "0.1.17" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "eca58d7bba4a75707817a2c44174253f9236b2d5fbd055602e9d5c07c139a047" +dependencies = [ + "futures-core", + "pin-project-lite", + "tokio", + "tokio-util", +] + +[[package]] +name = "tokio-util" +version = "0.7.13" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d7fcaa8d55a2bdd6b83ace262b016eca0d79ee02818c5c1bcdf0305114081078" +dependencies = [ + "bytes", + "futures-core", + "futures-sink", + "pin-project-lite", + "tokio", +] + +[[package]] +name = "toml_datetime" +version = "0.6.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0dd7358ecb8fc2f8d014bf86f6f638ce72ba252a2c3a2572f2a795f1d23efb41" + +[[package]] +name = "toml_edit" +version = "0.22.22" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4ae48d6208a266e853d946088ed816055e556cc6028c5e8e2b84d9fa5dd7c7f5" +dependencies = [ + "indexmap", + "toml_datetime", + "winnow", +] + +[[package]] +name = "tower" +version = "0.5.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d039ad9159c98b70ecfd540b2573b97f7f52c3e8d9f8ad57a24b916a536975f9" +dependencies = [ + "futures-core", + "futures-util", + "pin-project-lite", + "sync_wrapper", + "tokio", + "tower-layer", + "tower-service", +] + +[[package]] +name = "tower-layer" +version = "0.3.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "121c2a6cda46980bb0fcd1647ffaf6cd3fc79a013de288782836f6df9c48780e" + +[[package]] +name = "tower-service" +version = "0.3.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8df9b6e13f2d32c91b9bd719c00d1958837bc7dec474d94952798cc8e69eeec3" + +[[package]] +name = "tracing" +version = "0.1.41" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "784e0ac535deb450455cbfa28a6f0df145ea1bb7ae51b821cf5e7927fdcfbdd0" +dependencies = [ + "pin-project-lite", + "tracing-attributes", + "tracing-core", +] + +[[package]] +name = "tracing-attributes" +version = "0.1.28" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "395ae124c09f9e6918a2310af6038fba074bcf474ac352496d5910dd59a2226d" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.96", +] + +[[package]] +name = "tracing-core" +version = "0.1.33" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e672c95779cf947c5311f83787af4fa8fffd12fb27e4993211a84bdfd9610f9c" +dependencies = [ + "once_cell", + "valuable", +] + +[[package]] +name = "tracing-error" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8b1581020d7a273442f5b45074a6a57d5757ad0a47dac0e9f0bd57b81936f3db" +dependencies = [ + "tracing", + "tracing-subscriber", +] + +[[package]] +name = "tracing-log" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ee855f1f400bd0e5c02d150ae5de3840039a3f54b025156404e34c23c03f47c3" +dependencies = [ + "log", + "once_cell", + "tracing-core", +] + +[[package]] +name = "tracing-serde" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "704b1aeb7be0d0a84fc9828cae51dab5970fee5088f83d1dd7ee6f6246fc6ff1" +dependencies = [ + "serde", + "tracing-core", +] + +[[package]] +name = "tracing-subscriber" +version = "0.3.19" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e8189decb5ac0fa7bc8b96b7cb9b2701d60d48805aca84a238004d665fcc4008" +dependencies = [ + "matchers", + "nu-ansi-term", + "once_cell", + "regex", + "serde", + "serde_json", + "sharded-slab", + "smallvec", + "thread_local", + "tracing", + "tracing-core", + "tracing-log", + "tracing-serde", +] + +[[package]] +name = "try-lock" +version = "0.2.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e421abadd41a4225275504ea4d6566923418b7f05506fbc9c0fe86ba7396114b" + +[[package]] +name = "typenum" +version = "1.17.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "42ff0bf0c66b8238c6f3b578df37d0b7848e55df8577b3f74f92a69acceeb825" + +[[package]] +name = "ucd-trie" +version = "0.1.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2896d95c02a80c6d6a5d6e953d479f5ddf2dfdb6a244441010e373ac0fb88971" + +[[package]] +name = "uint" +version = "0.9.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "76f64bba2c53b04fcab63c01a7d7427eadc821e3bc48c34dc9ba29c501164b52" +dependencies = [ + "byteorder", + "crunchy", + "hex", + "static_assertions", +] + +[[package]] +name = "unarray" +version = "0.1.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "eaea85b334db583fe3274d12b4cd1880032beab409c0d774be044d4480ab9a94" + +[[package]] +name = "unicase" +version = "2.8.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "75b844d17643ee918803943289730bec8aac480150456169e647ed0b576ba539" + +[[package]] +name = "unicode-ident" +version = "1.0.14" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "adb9e6ca4f869e1180728b7950e35922a7fc6397f7b641499e8f3ef06e50dc83" + +[[package]] +name = "unicode-xid" +version = "0.2.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ebc1c04c71510c7f702b52b7c350734c9ff1295c464a03335b00bb84fc54f853" + +[[package]] +name = "url" +version = "2.5.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "32f8b686cadd1473f4bd0117a5d28d36b1ade384ea9b5069a1c40aefed7fda60" +dependencies = [ + "form_urlencoded", + "idna", + "percent-encoding", +] + +[[package]] +name = "utf16_iter" +version = "1.0.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c8232dd3cdaed5356e0f716d285e4b40b932ac434100fe9b7e0e8e935b9e6246" + +[[package]] +name = "utf8_iter" +version = "1.0.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b6c140620e7ffbb22c2dee59cafe6084a59b5ffc27a8859a5f0d494b5d52b6be" + +[[package]] +name = "uuid" +version = "1.12.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b3758f5e68192bb96cc8f9b7e2c2cfdabb435499a28499a42f8f984092adad4b" +dependencies = [ + "getrandom", +] + +[[package]] +name = "valuable" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ba73ea9cf16a25df0c8caa16c51acb937d5712a8429db78a3ee29d5dcacd3a65" + +[[package]] +name = "vcpkg" +version = "0.2.15" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "accd4ea62f7bb7a82fe23066fb0957d48ef677f6eeb8215f372f52e48bb32426" + +[[package]] +name = "version_check" +version = "0.9.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0b928f33d975fc6ad9f86c8f283853ad26bdd5b10b7f1542aa2fa15e2289105a" + +[[package]] +name = "wait-timeout" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9f200f5b12eb75f8c1ed65abd4b2db8a6e1b138a20de009dacee265a2498f3f6" +dependencies = [ + "libc", +] + +[[package]] +name = "want" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bfa7760aed19e106de2c7c0b581b509f2f25d3dacaf737cb82ac61bc6d760b0e" +dependencies = [ + "try-lock", +] + +[[package]] +name = "wasi" +version = "0.11.0+wasi-snapshot-preview1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9c8d87e72b64a3b4db28d11ce29237c246188f4f51057d65a7eab63b7987e423" + +[[package]] +name = "wasm-bindgen" +version = "0.2.100" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1edc8929d7499fc4e8f0be2262a241556cfc54a0bea223790e71446f2aab1ef5" +dependencies = [ + "cfg-if", + "once_cell", + "rustversion", + "wasm-bindgen-macro", +] + +[[package]] +name = "wasm-bindgen-backend" +version = "0.2.100" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2f0a0651a5c2bc21487bde11ee802ccaf4c51935d0d3d42a6101f98161700bc6" +dependencies = [ + "bumpalo", + "log", + "proc-macro2", + "quote", + "syn 2.0.96", + "wasm-bindgen-shared", +] + +[[package]] +name = "wasm-bindgen-futures" +version = "0.4.50" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "555d470ec0bc3bb57890405e5d4322cc9ea83cebb085523ced7be4144dac1e61" +dependencies = [ + "cfg-if", + "js-sys", + "once_cell", + "wasm-bindgen", + "web-sys", +] + +[[package]] +name = "wasm-bindgen-macro" +version = "0.2.100" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7fe63fc6d09ed3792bd0897b314f53de8e16568c2b3f7982f468c0bf9bd0b407" +dependencies = [ + "quote", + "wasm-bindgen-macro-support", +] + +[[package]] +name = "wasm-bindgen-macro-support" +version = "0.2.100" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8ae87ea40c9f689fc23f209965b6fb8a99ad69aeeb0231408be24920604395de" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.96", + "wasm-bindgen-backend", + "wasm-bindgen-shared", +] + +[[package]] +name = "wasm-bindgen-shared" +version = "0.2.100" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1a05d73b933a847d6cccdda8f838a22ff101ad9bf93e33684f39c1f5f0eece3d" +dependencies = [ + "unicode-ident", +] + +[[package]] +name = "wasm-encoder" +version = "0.220.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ebf48234b389415b226a4daef6562933d38c7b28a8b8f64c5c4130dad1561ab7" +dependencies = [ + "leb128", + "wasmparser", +] + +[[package]] +name = "wasm-metadata" +version = "0.220.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3f3e5f5920c5abfc45573c89b07b38efdaae1515ef86f83dad12d60e50ecd62b" +dependencies = [ + "anyhow", + "indexmap", + "serde", + "serde_derive", + "serde_json", + "spdx", + "wasm-encoder", + "wasmparser", +] + +[[package]] +name = "wasmparser" +version = "0.220.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e246c2772ce3ebc83f89a2d4487ac5794cad6c309b2071818a88c7db7c36d87b" +dependencies = [ + "ahash", + "bitflags", + "hashbrown 0.14.5", + "indexmap", + "semver 1.0.25", +] + +[[package]] +name = "wasmtimer" +version = "0.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0048ad49a55b9deb3953841fa1fc5858f0efbcb7a18868c899a360269fac1b23" +dependencies = [ + "futures", + "js-sys", + "parking_lot", + "pin-utils", + "slab", + "wasm-bindgen", +] + +[[package]] +name = "web-sys" +version = "0.3.77" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "33b6dd2ef9186f1f2072e409e99cd22a975331a6b3591b12c764e0e55c60d5d2" +dependencies = [ + "js-sys", + "wasm-bindgen", +] + +[[package]] +name = "winapi" +version = "0.3.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5c839a674fcd7a98952e593242ea400abe93992746761e38641405d28b00f419" +dependencies = [ + "winapi-i686-pc-windows-gnu", + "winapi-x86_64-pc-windows-gnu", +] + +[[package]] +name = "winapi-i686-pc-windows-gnu" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ac3b87c63620426dd9b991e5ce0329eff545bccbbb34f3be09ff6fb6ab51b7b6" + +[[package]] +name = "winapi-x86_64-pc-windows-gnu" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f" + +[[package]] +name = "windows-registry" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e400001bb720a623c1c69032f8e3e4cf09984deec740f007dd2b03ec864804b0" +dependencies = [ + "windows-result", + "windows-strings", + "windows-targets", +] + +[[package]] +name = "windows-result" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1d1043d8214f791817bab27572aaa8af63732e11bf84aa21a45a78d6c317ae0e" +dependencies = [ + "windows-targets", +] + +[[package]] +name = "windows-strings" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4cd9b125c486025df0eabcb585e62173c6c9eddcec5d117d3b6e8c30e2ee4d10" +dependencies = [ + "windows-result", + "windows-targets", +] + +[[package]] +name = "windows-sys" +version = "0.52.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "282be5f36a8ce781fad8c8ae18fa3f9beff57ec1b52cb3de0789201425d9a33d" +dependencies = [ + "windows-targets", +] + +[[package]] +name = "windows-sys" +version = "0.59.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1e38bc4d79ed67fd075bcc251a1c39b32a1776bbe92e5bef1f0bf1f8c531853b" +dependencies = [ + "windows-targets", +] + +[[package]] +name = "windows-targets" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9b724f72796e036ab90c1021d4780d4d3d648aca59e491e6b98e725b84e99973" +dependencies = [ + "windows_aarch64_gnullvm", + "windows_aarch64_msvc", + "windows_i686_gnu", + "windows_i686_gnullvm", + "windows_i686_msvc", + "windows_x86_64_gnu", + "windows_x86_64_gnullvm", + "windows_x86_64_msvc", +] + +[[package]] +name = "windows_aarch64_gnullvm" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "32a4622180e7a0ec044bb555404c800bc9fd9ec262ec147edd5989ccd0c02cd3" + +[[package]] +name = "windows_aarch64_msvc" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "09ec2a7bb152e2252b53fa7803150007879548bc709c039df7627cabbd05d469" + +[[package]] +name = "windows_i686_gnu" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8e9b5ad5ab802e97eb8e295ac6720e509ee4c243f69d781394014ebfe8bbfa0b" + +[[package]] +name = "windows_i686_gnullvm" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0eee52d38c090b3caa76c563b86c3a4bd71ef1a819287c19d586d7334ae8ed66" + +[[package]] +name = "windows_i686_msvc" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "240948bc05c5e7c6dabba28bf89d89ffce3e303022809e73deaefe4f6ec56c66" + +[[package]] +name = "windows_x86_64_gnu" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "147a5c80aabfbf0c7d901cb5895d1de30ef2907eb21fbbab29ca94c5b08b1a78" + +[[package]] +name = "windows_x86_64_gnullvm" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "24d5b23dc417412679681396f2b49f3de8c1473deb516bd34410872eff51ed0d" + +[[package]] +name = "windows_x86_64_msvc" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "589f6da84c646204747d1270a2a5661ea66ed1cced2631d546fdfb155959f9ec" + +[[package]] +name = "winnow" +version = "0.6.24" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c8d71a593cc5c42ad7876e2c1fda56f314f3754c084128833e64f1345ff8a03a" +dependencies = [ + "memchr", +] + +[[package]] +name = "wit-bindgen" +version = "0.36.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6a2b3e15cd6068f233926e7d8c7c588b2ec4fb7cc7bf3824115e7c7e2a8485a3" +dependencies = [ + "wit-bindgen-rt", + "wit-bindgen-rust-macro", +] + +[[package]] +name = "wit-bindgen-core" +version = "0.36.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b632a5a0fa2409489bd49c9e6d99fcc61bb3d4ce9d1907d44662e75a28c71172" +dependencies = [ + "anyhow", + "heck", + "wit-parser", +] + +[[package]] +name = "wit-bindgen-rt" +version = "0.36.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7947d0131c7c9da3f01dfde0ab8bd4c4cf3c5bd49b6dba0ae640f1fa752572ea" +dependencies = [ + "bitflags", +] + +[[package]] +name = "wit-bindgen-rust" +version = "0.36.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4329de4186ee30e2ef30a0533f9b3c123c019a237a7c82d692807bf1b3ee2697" +dependencies = [ + "anyhow", + "heck", + "indexmap", + "prettyplease", + "syn 2.0.96", + "wasm-metadata", + "wit-bindgen-core", + "wit-component", +] + +[[package]] +name = "wit-bindgen-rust-macro" +version = "0.36.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "177fb7ee1484d113b4792cc480b1ba57664bbc951b42a4beebe573502135b1fc" +dependencies = [ + "anyhow", + "prettyplease", + "proc-macro2", + "quote", + "syn 2.0.96", + "wit-bindgen-core", + "wit-bindgen-rust", +] + +[[package]] +name = "wit-component" +version = "0.220.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "73ccedf54cc65f287da268d64d2bf4f7530d2cfb2296ffbe3ad5f65567e4cf53" +dependencies = [ + "anyhow", + "bitflags", + "indexmap", + "log", + "serde", + "serde_derive", + "serde_json", + "wasm-encoder", + "wasm-metadata", + "wasmparser", + "wit-parser", +] + +[[package]] +name = "wit-parser" +version = "0.220.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5b7117ce3adc0b4354b46dc1cf3190b00b333e65243d244c613ffcc58bdec84d" +dependencies = [ + "anyhow", + "id-arena", + "indexmap", + "log", + "semver 1.0.25", + "serde", + "serde_derive", + "serde_json", + "unicode-xid", + "wasmparser", +] + +[[package]] +name = "write16" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d1890f4022759daae28ed4fe62859b1236caebfc61ede2f63ed4e695f3f6d936" + +[[package]] +name = "writeable" +version = "0.5.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1e9df38ee2d2c3c5948ea468a8406ff0db0b29ae1ffde1bcf20ef305bcc95c51" + +[[package]] +name = "wyz" +version = "0.5.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "05f360fc0b24296329c78fda852a1e9ae82de9cf7b27dae4b7f62f118f77b9ed" +dependencies = [ + "tap", +] + +[[package]] +name = "yoke" +version = "0.7.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "120e6aef9aa629e3d4f52dc8cc43a015c7724194c97dfaf45180d2daf2b77f40" +dependencies = [ + "serde", + "stable_deref_trait", + "yoke-derive", + "zerofrom", +] + +[[package]] +name = "yoke-derive" +version = "0.7.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2380878cad4ac9aac1e2435f3eb4020e8374b5f13c296cb75b4620ff8e229154" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.96", + "synstructure", +] + +[[package]] +name = "zerocopy" +version = "0.7.35" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1b9b4fd18abc82b8136838da5d50bae7bdea537c574d8dc1a34ed098d6c166f0" +dependencies = [ + "byteorder", + "zerocopy-derive", +] + +[[package]] +name = "zerocopy-derive" +version = "0.7.35" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fa4f8080344d4671fb4e831a13ad1e68092748387dfc4f55e356242fae12ce3e" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.96", +] + +[[package]] +name = "zerofrom" +version = "0.1.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cff3ee08c995dee1859d998dea82f7374f2826091dd9cd47def953cae446cd2e" +dependencies = [ + "zerofrom-derive", +] + +[[package]] +name = "zerofrom-derive" +version = "0.1.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "595eed982f7d355beb85837f651fa22e90b3c044842dc7f2c2842c086f295808" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.96", + "synstructure", +] + +[[package]] +name = "zeroize" +version = "1.8.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ced3678a2879b30306d323f4542626697a464a97c0a07c9aebf7ebca65cd4dde" +dependencies = [ + "zeroize_derive", +] + +[[package]] +name = "zeroize_derive" +version = "1.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ce36e65b0d2999d2aafac989fb249189a141aee1f53c612c1f37d72631959f69" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.96", +] + +[[package]] +name = "zerovec" +version = "0.10.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "aa2b893d79df23bfb12d5461018d408ea19dfafe76c2c7ef6d4eba614f8ff079" +dependencies = [ + "yoke", + "zerofrom", + "zerovec-derive", +] + +[[package]] +name = "zerovec-derive" +version = "0.10.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6eafa6dfb17584ea3e2bd6e76e0cc15ad7af12b09abdd1ca55961bed9b1063c6" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.96", +] diff --git a/crates/proc_macro_send/Cargo.toml b/crates/proc_macro_send/Cargo.toml new file mode 100644 index 0000000..97ff333 --- /dev/null +++ b/crates/proc_macro_send/Cargo.toml @@ -0,0 +1,17 @@ +[package] +name = "proc_macro_send" +version = "0.1.0" +edition = "2021" + +[dependencies] +syn = "2.0" +quote = "1" +proc-macro2 = "1" +anyhow = "1" +kinode_app_common = { path = "../kinode_app_common" } +uuid = "1.3" +serde = { version = "1.0", features = ["derive"] } +kinode_process_lib = { version = "0.10.2", features = ["logging"] } + +[lib] +proc-macro = true diff --git a/crates/proc_macro_send/src/lib.rs b/crates/proc_macro_send/src/lib.rs new file mode 100644 index 0000000..c4d07ed --- /dev/null +++ b/crates/proc_macro_send/src/lib.rs @@ -0,0 +1,298 @@ +use proc_macro::TokenStream; +use quote::quote; +use syn::{ + parse::Parse, parse::ParseStream, parse_macro_input, Block, Expr, Expr::Call as ExprCallNode, + Expr::Path as ExprPathNode, ExprCall, ExprPath, Ident, Result, Token, Type, +}; + +/// The main macro entry point +#[proc_macro] +pub fn send_async(input: TokenStream) -> TokenStream { + let invocation = parse_macro_input!(input as SendAsyncInvocation); + invocation.expand_macro().into() +} + +/// Our data structure representing the macro invocation. +struct SendAsyncInvocation { + destination: Expr, + request_expr: Expr, + + /// Optional callback + callback: Option, + + /// Optional timeout expression + timeout: Option, + + /// Optional on-timeout block + on_timeout_block: Option, +} + +/// Holds the pieces of `(resp_ident, st_ident: st_type) { callback_block }`. +struct Callback { + resp_ident: Ident, + st_ident: Ident, + st_type: Type, + callback_block: Block, +} + +impl Parse for SendAsyncInvocation { + fn parse(input: ParseStream) -> Result { + // 1) Parse the required parts: destination expr, request expr + let destination: Expr = input.parse()?; + input.parse::()?; + + let request_expr: Expr = input.parse()?; + + // 2) Look ahead for optional pieces (callback / timeout / on_timeout) + let mut callback: Option = None; + let mut timeout: Option = None; + let mut on_timeout_block: Option = None; + + // If there's a trailing comma, consume it and parse further + if input.peek(Token![,]) { + input.parse::()?; + + while !input.is_empty() { + // If we see `(` => parse (resp, st: MyState) { ... } + if input.peek(syn::token::Paren) { + let content; + syn::parenthesized!(content in input); + let resp_ident: Ident = content.parse()?; + content.parse::()?; + let st_ident: Ident = content.parse()?; + content.parse::()?; + let st_type: Type = content.parse()?; + + // Parse the callback block: `{ ... }` + let callback_block: Block = input.parse()?; + + callback = Some(Callback { + resp_ident, + st_ident, + st_type, + callback_block, + }); + + // Check if there's another trailing comma + if input.peek(Token![,]) { + input.parse::()?; + } + } else if input.peek(syn::LitInt) || input.peek(syn::Lit) || input.peek(syn::Ident) + { + // Probably the timeout expression + if timeout.is_none() { + timeout = Some(input.parse()?); + } else { + // If we already have a timeout, break or error + break; + } + + if input.peek(Token![,]) { + input.parse::()?; + } + } else if input.peek(Ident) { + // Possibly `on_timeout => { ... }` + let ident: Ident = input.parse()?; + if ident == "on_timeout" { + input.parse::]>()?; + let block: Block = input.parse()?; + on_timeout_block = Some(block); + } else { + return Err(syn::Error::new_spanned( + ident, + "Expected `on_timeout => { ... }` or a valid expression.", + )); + } + + if input.peek(Token![,]) { + input.parse::()?; + } + } else { + break; + } + } + } + + Ok(SendAsyncInvocation { + destination, + request_expr, + callback, + timeout, + on_timeout_block, + }) + } +} + +impl SendAsyncInvocation { + fn expand_macro(&self) -> proc_macro2::TokenStream { + // 1) Identify the variant name from request (e.g. Foo in SomeRequest::Foo(...)) + let variant_ident = extract_variant_name(&self.request_expr) + .unwrap_or_else(|| syn::Ident::new("UNKNOWN_VARIANT", proc_macro2::Span::call_site())); + + // 2) Build "response path" => rewrite SomethingRequest -> SomethingResponse + let response_path = build_response_path(&self.request_expr); + + // 3) We'll match on response_path::Variant(inner) => inner + let success_arm = quote! { + #response_path :: #variant_ident(inner) => inner + }; + + // 4) Default timeout is 30 + let timeout_expr = self + .timeout + .clone() + .unwrap_or_else(|| syn::parse_str("30").unwrap()); + + // 5) on_timeout block is optional => `Option>` + let on_timeout_code = if let Some(ref block) = self.on_timeout_block { + quote! { + Some(Box::new(move |any_state: &mut dyn std::any::Any| { + #block + Ok(()) + })) + } + } else { + quote! { None } + }; + + // 6) The user's callback is optional. But the downstream code expects + // a *non-optional* `Box Result<_, _>>`. + // So if we have no callback, produce a no-op closure. + let on_success_code = match &self.callback { + Some(cb) => { + let Callback { + resp_ident, + st_ident, + st_type, + callback_block, + } = cb; + + quote! { + Box::new(move |resp_bytes: &[u8], any_state: &mut dyn std::any::Any| { + let parsed = ::serde_json::from_slice::<#response_path>(resp_bytes) + .map_err(|e| anyhow::anyhow!("Failed to deserialize response: {}", e))?; + + let #resp_ident = match parsed { + #success_arm, + other => { + return Err(anyhow::anyhow!( + "Got the wrong variant (expected {}) => got: {:?}", + stringify!(#variant_ident), + other + )); + } + }; + + let #st_ident = any_state + .downcast_mut::<#st_type>() + .ok_or_else(|| anyhow::anyhow!("Downcast user state failed!"))?; + + #callback_block + Ok(()) + }) + } + } + None => { + // Produce a no-op closure + quote! { + Box::new(move |_resp_bytes: &[u8], _any_state: &mut dyn std::any::Any| { + // No callback was provided, do nothing + Ok(()) + }) + } + } + }; + + // 7) We always insert a PendingCallback, because your "PendingCallback" + // struct expects on_success: Box<...> (not Option). The "on_timeout" is optional. + let dest_expr = &self.destination; + let request_expr = &self.request_expr; + + quote! { + { + // Serialize the request + match ::serde_json::to_vec(&#request_expr) { + Ok(b) => { + let correlation_id = ::uuid::Uuid::new_v4().to_string(); + + // Insert callback into hidden state + ::kinode_app_common::HIDDEN_STATE.with(|cell| { + let mut hs = cell.borrow_mut(); + hs.as_mut().map(|state| { + state.pending_callbacks.insert( + correlation_id.clone(), + kinode_app_common::PendingCallback { + on_success: #on_success_code, + on_timeout: #on_timeout_code, + } + ) + }); + }); + + // Actually send + let _ = ::kinode_process_lib::Request::to(#dest_expr) + .context(correlation_id.as_bytes()) + .body(b) + .expects_response(#timeout_expr) + .send(); + }, + Err(e) => { + ::kinode_process_lib::kiprintln!("Error serializing request: {}", e); + } + } + // Explicitly return unit to make this a statement + () + } + } + } +} + +/// Extract the final variant name from e.g. `SomeRequest::Foo(...)`. +fn extract_variant_name(expr: &Expr) -> Option { + if let ExprCallNode(ExprCall { func, .. }) = expr { + if let ExprPathNode(ExprPath { path, .. }) = &**func { + if let Some(seg) = path.segments.last() { + return Some(seg.ident.clone()); + } + } + } + None +} + +/// Build a "response path" by rewriting `XyzRequest -> XyzResponse`. +fn build_response_path(expr: &Expr) -> proc_macro2::TokenStream { + if let ExprCallNode(ExprCall { func, .. }) = expr { + if let ExprPathNode(ExprPath { path, .. }) = &**func { + let segments = &path.segments; + if segments.len() < 2 { + return quote! { UNKNOWN_RESPONSE }; + } + let enum_seg = &segments[segments.len() - 2]; + + // Convert e.g. "FooRequest" => "FooResponse" + let old_ident_str = enum_seg.ident.to_string(); + let new_ident_str = if let Some(base) = old_ident_str.strip_suffix("Request") { + format!("{}Response", base) + } else { + format!("{}Response", old_ident_str) + }; + let new_ident = syn::Ident::new(&new_ident_str, enum_seg.ident.span()); + + // Rebuild the path + let mut new_segments = syn::punctuated::Punctuated::new(); + for i in 0..segments.len() - 2 { + new_segments.push(segments[i].clone()); + } + let mut replaced_seg = enum_seg.clone(); + replaced_seg.ident = new_ident; + new_segments.push(replaced_seg); + + let new_path = syn::Path { + leading_colon: path.leading_colon, + segments: new_segments, + }; + return quote! { #new_path }; + } + } + quote! { UNKNOWN_RESPONSE } +} diff --git a/lib/shared/Cargo.toml b/lib/shared/Cargo.toml new file mode 100644 index 0000000..e6ba7ed --- /dev/null +++ b/lib/shared/Cargo.toml @@ -0,0 +1,12 @@ +[package] +name = "shared" +version = "0.1.0" +edition = "2021" + +[dependencies] +kinode_app_common = { path = "../../crates/kinode_app_common" } +process_macros = "0.1.0" +serde = { version = "1.0", features = ["derive"] } +serde_json = "1.0" +wit-bindgen = "0.36.0" +kinode_process_lib = { version = "0.10.2", features = ["logging"] } diff --git a/lib/shared/src/lib.rs b/lib/shared/src/lib.rs new file mode 100644 index 0000000..73a9d01 --- /dev/null +++ b/lib/shared/src/lib.rs @@ -0,0 +1,43 @@ +use kinode_app_common::*; +use kinode_process_lib::Address; +use process_macros::SerdeJsonInto; +use serde::{Deserialize, Serialize}; + +pub fn receiver_address_a() -> Address { + ("our", "async-receiver-a", "async-app", "uncentered.os").into() +} + +pub fn receiver_address_b() -> Address { + ("our", "async-receiver-b", "async-app", "uncentered.os").into() +} + +pub fn receiver_address_c() -> Address { + ("our", "async-receiver-c", "async-app", "uncentered.os").into() +} + +pub fn requester_address() -> Address { + ("our", "async-requester", "async-app", "uncentered.os").into() +} + +declare_types! { + // We're redundant here just so we can demo and modify if we want + Async { + StepA String => i32 + StepB i32 => u64 + StepC u64 => String + Gather () => Result + }, + AsyncNoExist { + Gather () => Result + } +} + +#[derive(Debug, Serialize, Deserialize, SerdeJsonInto, Clone)] +pub struct SomeStruct { + pub counter: u64, +} + +#[derive(Debug, Serialize, Deserialize, SerdeJsonInto, Clone)] +pub struct SomeOtherStruct { + pub message: String, +} diff --git a/metadata.json b/metadata.json new file mode 100644 index 0000000..54fd1aa --- /dev/null +++ b/metadata.json @@ -0,0 +1,18 @@ +{ + "name": "async-app", + "description": "", + "image": "", + "properties": { + "package_name": "async-app", + "current_version": "0.1.0", + "publisher": "uncentered.os", + "mirrors": [], + "code_hashes": { + "0.1.0": "" + }, + "wit_version": 1, + "dependencies": [] + }, + "external_url": "", + "animation_url": "" +} diff --git a/pkg/manifest.json b/pkg/manifest.json new file mode 100644 index 0000000..6185421 --- /dev/null +++ b/pkg/manifest.json @@ -0,0 +1,82 @@ +[ + { + "process_name": "async-receiver-a", + "process_wasm_path": "/async-receiver-a.wasm", + "on_exit": "None", + "request_networking": true, + "request_capabilities": [ + "http-server:distro:sys", + "http-client:distro:sys", + "vfs:distro:sys", + "homepage:homepage:sys" + + ], + "grant_capabilities": [ + "http-server:distro:sys", + "http-client:distro:sys", + "vfs:distro:sys", + "homepage:homepage:sys" + ], + "public": true + }, + { + "process_name": "async-receiver-b", + "process_wasm_path": "/async-receiver-b.wasm", + "on_exit": "None", + "request_networking": true, + "request_capabilities": [ + "http-server:distro:sys", + "http-client:distro:sys", + "vfs:distro:sys", + "homepage:homepage:sys" + + ], + "grant_capabilities": [ + "http-server:distro:sys", + "http-client:distro:sys", + "vfs:distro:sys", + "homepage:homepage:sys" + ], + "public": true + }, + { + "process_name": "async-receiver-c", + "process_wasm_path": "/async-receiver-c.wasm", + "on_exit": "None", + "request_networking": true, + "request_capabilities": [ + "http-server:distro:sys", + "http-client:distro:sys", + "vfs:distro:sys", + "homepage:homepage:sys" + + ], + "grant_capabilities": [ + "http-server:distro:sys", + "http-client:distro:sys", + "vfs:distro:sys", + "homepage:homepage:sys" + ], + "public": true + }, + { + "process_name": "async-requester", + "process_wasm_path": "/async-requester.wasm", + "on_exit": "None", + "request_networking": true, + "request_capabilities": [ + "http-server:distro:sys", + "http-client:distro:sys", + "vfs:distro:sys", + "homepage:homepage:sys" + + ], + "grant_capabilities": [ + "http-server:distro:sys", + "http-client:distro:sys", + "vfs:distro:sys", + "homepage:homepage:sys" + ], + "public": true + } +] diff --git a/pkg/scripts.json b/pkg/scripts.json new file mode 100644 index 0000000..b3db353 --- /dev/null +++ b/pkg/scripts.json @@ -0,0 +1,12 @@ +{ + "send.wasm": { + "root": false, + "public": false, + "request_networking": false, + "request_capabilities": [], + "grant_capabilities": [ + "async-app:async-app:template.os" + ], + "wit_version": 1 + } +} diff --git a/src/lib.rs b/src/lib.rs deleted file mode 100644 index 984e88a..0000000 --- a/src/lib.rs +++ /dev/null @@ -1,309 +0,0 @@ -pub use kinode_process_lib::*; -pub use process_macros::*; - -/// Macro for creating a single request enum to handle all request types -/// that this app will receive. -#[macro_export] -macro_rules! req { - ($(($name:ident, $variant:path)),*) => { - #[derive(Debug, Deserialize, Serialize)] - #[serde(untagged)] - enum Req { - $($name($variant)),* - } - } -} - -/// Macro for creating a standard Kinode application structure -/// -/// Takes an app name, icon, widget, and 2 or 3 handler functions to create a basic -/// application component that implements the Guest trait. -/// -/// Three variants are supported: -/// - 5 arguments: name, icon, widget, API handler, remote request handler -/// - 6 arguments: name, icon, widget, API handler, local request handler, remote request handler -/// - 7 arguments: name, icon, widget, API handler, local request handler, remote request handler, error handler -/// -/// `handle_api_call`: `impl Fn(&Message, &mut S, T1) -> (http::server::HttpResponse, Vec)`, -/// `handle_remote_request`: `impl Fn(&Message, &mut S, &mut http::server::HttpServer, T2)`, -/// `handle_send_error`: `impl Fn(&mut S, &mut http::server::HttpServer, SendError)`, -#[macro_export] -macro_rules! app { - ($app_name:expr, $app_icon:expr, $app_widget:expr, $f1:ident, $f2:ident) => { - struct Component; - impl Guest for Component { - fn init(our: String) { - let our: Address = our.parse().unwrap(); - let init = app( - $app_name, - $app_icon, - $app_widget, - $f1, - |_, _, _, _: ()| {}, - $f2, - |_, _, _| {}, - ); - init(our); - } - } - export!(Component); - }; - ($app_name:expr, $app_icon:expr, $app_widget:expr, $f1:ident, $f2:ident, $f3:ident) => { - struct Component; - impl Guest for Component { - fn init(our: String) { - let our: Address = our.parse().unwrap(); - let init = app( - $app_name, - $app_icon, - $app_widget, - $f1, - $f2, - $f3, - |_, _, _| {}, - ); - init(our); - } - } - export!(Component); - }; - ($app_name:expr, $app_icon:expr, $app_widget:expr, $f1:ident, $f2:ident, $f3:ident, $f4:ident) => { - struct Component; - impl Guest for Component { - fn init(our: String) { - let our: Address = our.parse().unwrap(); - let init = app($app_name, $app_icon, $app_widget, $f1, $f2, $f3, $f4); - init(our); - } - } - export!(Component); - }; -} - -/// Trait that must be implemented by application state types -pub trait State { - /// Creates a new instance of the state. - fn new() -> Self; -} - -/// Creates a standard Kinode application with HTTP server and WebSocket support -/// -/// # Type Parameters -/// - `S`: Application state type that implements State + Serialize + Deserialize -/// - `T1`: API call payload type that implements Serialize + Deserialize -/// - `T2`: Remote request payload type that implements Serialize + Deserialize -/// -/// # Arguments -/// * `app_name` - Name of the application -/// * `app_icon` - Optional icon for the application -/// * `app_widget` - Optional widget specification -/// * `handle_api_call` - Function to handle incoming HTTP API calls -/// * `handle_remote_request` - Function to handle incoming remote requests -/// * `handle_send_error` - Function to handle message send errors -pub fn app( - app_name: &str, - app_icon: Option<&str>, - app_widget: Option<&str>, - handle_api_call: impl Fn(&mut S, T1) -> (http::server::HttpResponse, Vec), - handle_local_request: impl Fn(&Message, &mut S, &mut http::server::HttpServer, T2), - handle_remote_request: impl Fn(&Message, &mut S, &mut http::server::HttpServer, T3), - handle_send_error: impl Fn(&mut S, &mut http::server::HttpServer, SendError), -) -> impl Fn(Address) -where - S: State + std::fmt::Debug + serde::Serialize + serde::de::DeserializeOwned, - T1: serde::Serialize + serde::de::DeserializeOwned, - T2: serde::Serialize + serde::de::DeserializeOwned, - T3: serde::Serialize + serde::de::DeserializeOwned, -{ - homepage::add_to_homepage(app_name, app_icon, Some("/"), app_widget); - move |our: Address| { - let mut server = http::server::HttpServer::new(5); - - server - .serve_ui( - &our, - "ui", - vec!["/"], - http::server::HttpBindingConfig::default(), - ) - .expect("failed to serve UI. do you have messaging capabilities to/from http-server:distro:sys?"); - - server - .bind_http_path("/api", http::server::HttpBindingConfig::default()) - .expect("failed to serve API path"); - - server - .bind_ws_path("/updates", http::server::WsBindingConfig::default()) - .expect("failed to bind WS path"); - - let mut state = get_typed_state(|bytes| serde_json::from_slice(bytes)).unwrap_or({ - let state = S::new(); - set_state(&serde_json::to_vec(&state).expect("failed to serialize state to bytes")); - state - }); - - loop { - match await_message() { - Err(send_error) => handle_send_error(&mut state, &mut server, send_error), - Ok(ref message) => handle_message( - &our, - &mut state, - message, - &mut server, - &handle_api_call, - &handle_local_request, - &handle_remote_request, - ), - } - } - } -} - -/// Handles incoming messages by routing them to appropriate handlers -/// -/// Routes local messages from the HTTP server to the API handler and -/// remote messages to the remote request handler. -/// -/// # Arguments -/// * `our` - This process's address -/// * `state` - Mutable reference to application state -/// * `message` - The incoming message to handle -/// * `server` - Mutable reference to the HTTP server -/// * `handle_api_call` - Function to handle API calls -/// * `handle_remote_request` - Function to handle remote requests -fn handle_message( - our: &Address, - state: &mut S, - message: &Message, - server: &mut http::server::HttpServer, - handle_api_call: impl Fn(&mut S, T1) -> (http::server::HttpResponse, Vec), - handle_local_request: impl Fn(&Message, &mut S, &mut http::server::HttpServer, T2), - handle_remote_request: impl Fn(&Message, &mut S, &mut http::server::HttpServer, T3), -) where - S: std::fmt::Debug, - T1: serde::Serialize + serde::de::DeserializeOwned, - T2: serde::Serialize + serde::de::DeserializeOwned, - T3: serde::Serialize + serde::de::DeserializeOwned, -{ - if message.is_local(our) { - // handle local messages - if message.source().process == "http-server:distro:sys" { - http_request(message, state, server, handle_api_call); - } else { - local_request(message, state, server, handle_local_request); - } - } else { - // handle remote messages - remote_request(message, state, server, handle_remote_request); - } -} - -/// Handles incoming HTTP requests by parsing and routing to the API handler -/// -/// Deserializes the request body and passes it to the handler function, -/// then returns the response with appropriate status codes. -/// -/// # Arguments -/// * `message` - The incoming HTTP request message -/// * `state` - Mutable reference to application state -/// * `server` - Mutable reference to the HTTP server -/// * `handle_api_call` - Function to handle the API call -fn http_request( - message: &Message, - state: &mut S, - server: &mut http::server::HttpServer, - handle_api_call: impl Fn(&mut S, T1) -> (http::server::HttpResponse, Vec), -) where - T1: serde::Serialize + serde::de::DeserializeOwned, -{ - let http_request = serde_json::from_slice::(&message.body()) - .expect("failed to parse HTTP request"); - - server.handle_request( - http_request, - |_incoming| { - let response = http::server::HttpResponse::new(200 as u16); - - let Some(blob) = message.blob() else { - return (response.set_status(400), None); - }; - - let Ok(call) = serde_json::from_slice::(blob.bytes()) else { - return (response.set_status(400), None); - }; - - let (response, bytes) = handle_api_call(state, call); - ( - response, - Some(LazyLoadBlob::new(Some("application/json"), bytes)), - ) - }, - |_, _, _| { - // skip incoming ws requests - }, - ); -} - -/// Handles incoming local requests by deserializing and passing to handler -/// -/// # Arguments -/// * `message` - The incoming local request message -/// * `state` - Mutable reference to application state -/// * `server` - Mutable reference to the HTTP server -/// * `handle_local_request` - Function to handle the local request -fn local_request( - message: &Message, - state: &mut S, - server: &mut http::server::HttpServer, - handle_local_request: impl Fn(&Message, &mut S, &mut http::server::HttpServer, T), -) where - S: std::fmt::Debug, - T: serde::Serialize + serde::de::DeserializeOwned, -{ - let Ok(request) = serde_json::from_slice::(&message.body()) else { - // debug command that prints state -- - // more app-level commands can be added here - if message.body() == b"debug" { - kiprintln!("state:\n{:#?}", state); - } - return; - }; - handle_local_request(message, state, server, request); -} - -/// Handles incoming remote requests by deserializing and passing to handler -/// -/// # Arguments -/// * `message` - The incoming remote request message -/// * `state` - Mutable reference to application state -/// * `server` - Mutable reference to the HTTP server -/// * `handle_remote_request` - Function to handle the remote request -fn remote_request( - message: &Message, - state: &mut S, - server: &mut http::server::HttpServer, - handle_remote_request: impl Fn(&Message, &mut S, &mut http::server::HttpServer, T), -) where - T: serde::Serialize + serde::de::DeserializeOwned, -{ - let Ok(request) = serde_json::from_slice::(&message.body()) else { - return; - }; - handle_remote_request(message, state, server, request); -} - -/// Sends a WebSocket update to all connected clients -/// -/// # Arguments -/// * `server` - Reference to the HTTP server -/// * `bytes` - The message payload to send -pub fn send_ws_update(server: &http::server::HttpServer, bytes: B) -where - B: Into>, -{ - server.ws_push_all_channels( - "/updates", - http::server::WsMessageType::Text, - LazyLoadBlob::new(Some("application/json"), bytes), - ); -}