From d2c65d05fc14ebb566a160e8ac227f3987df58d5 Mon Sep 17 00:00:00 2001 From: Nico <1622112+nicarq@users.noreply.github.com> Date: Wed, 13 Sep 2023 16:57:02 +0800 Subject: [PATCH] the return of pyo3 (#70) * checkpointing * fixes * checkpointing * fix tests? * fix workflow * checkpointing * checkpointing * more pyo3 * shinkai builder pyo3 * checkpointing * it works! --- .actrc | 1 + .gitignore | 1 + .../shinkai-message-primitives/Cargo.toml | 12 - shinkai-libs/shinkai-message-pyo3/Cargo.lock | 2984 +++++++++++++++++ shinkai-libs/shinkai-message-pyo3/Cargo.toml | 29 + shinkai-libs/shinkai-message-pyo3/README.md | 15 + .../shinkai-message-pyo3/run_tests.sh | 20 + shinkai-libs/shinkai-message-pyo3/src/lib.rs | 1 + shinkai-libs/shinkai-message-pyo3/src/main.rs | 7 + .../encryption_method_pyo3.rs | 47 + .../shinkai_pyo3_wrapper/encryption_pyo3.rs | 0 .../external_metadata_pyo3.rs | 114 + .../internal_metadata_pyo3.rs | 118 + .../message_schema_type_pyo3.rs | 34 + .../src/shinkai_pyo3_wrapper/mod.rs | 8 + .../shinkai_builder_pyo3.rs | 995 ++++++ .../shinkai_message_pyo3.rs | 285 ++ .../shinkai_pyo3_wrapper/shinkai_name_pyo3.rs | 55 + .../shinkai_schema_pyo3.rs | 53 + .../shinkai-message-pyo3/tests/__init__.py | 0 .../tests/test_shinkai_message_pyo3.py | 39 + .../tests/shinkai_message_tests.rs | 129 - 22 files changed, 4806 insertions(+), 141 deletions(-) create mode 100644 .actrc create mode 100644 shinkai-libs/shinkai-message-pyo3/Cargo.lock create mode 100644 shinkai-libs/shinkai-message-pyo3/Cargo.toml create mode 100644 shinkai-libs/shinkai-message-pyo3/README.md create mode 100755 shinkai-libs/shinkai-message-pyo3/run_tests.sh create mode 100644 shinkai-libs/shinkai-message-pyo3/src/lib.rs create mode 100644 shinkai-libs/shinkai-message-pyo3/src/main.rs create mode 100644 shinkai-libs/shinkai-message-pyo3/src/shinkai_pyo3_wrapper/encryption_method_pyo3.rs create mode 100644 shinkai-libs/shinkai-message-pyo3/src/shinkai_pyo3_wrapper/encryption_pyo3.rs create mode 100644 shinkai-libs/shinkai-message-pyo3/src/shinkai_pyo3_wrapper/external_metadata_pyo3.rs create mode 100644 shinkai-libs/shinkai-message-pyo3/src/shinkai_pyo3_wrapper/internal_metadata_pyo3.rs create mode 100644 shinkai-libs/shinkai-message-pyo3/src/shinkai_pyo3_wrapper/message_schema_type_pyo3.rs create mode 100644 shinkai-libs/shinkai-message-pyo3/src/shinkai_pyo3_wrapper/mod.rs create mode 100644 shinkai-libs/shinkai-message-pyo3/src/shinkai_pyo3_wrapper/shinkai_builder_pyo3.rs create mode 100644 shinkai-libs/shinkai-message-pyo3/src/shinkai_pyo3_wrapper/shinkai_message_pyo3.rs create mode 100644 shinkai-libs/shinkai-message-pyo3/src/shinkai_pyo3_wrapper/shinkai_name_pyo3.rs create mode 100644 shinkai-libs/shinkai-message-pyo3/src/shinkai_pyo3_wrapper/shinkai_schema_pyo3.rs create mode 100644 shinkai-libs/shinkai-message-pyo3/tests/__init__.py create mode 100644 shinkai-libs/shinkai-message-pyo3/tests/test_shinkai_message_pyo3.py diff --git a/.actrc b/.actrc new file mode 100644 index 000000000..85619c8b0 --- /dev/null +++ b/.actrc @@ -0,0 +1 @@ +-P ubuntu-latest=nektos/act-environments-ubuntu:18.04 \ No newline at end of file diff --git a/.gitignore b/.gitignore index a6c834f22..c6b8529ae 100644 --- a/.gitignore +++ b/.gitignore @@ -24,3 +24,4 @@ tmp_*.js qr_code_profile_*.png qr_code_device_*.png .venv/ +shinkai-libs/shinkai-message-pyo3/tests/__pycache__ diff --git a/shinkai-libs/shinkai-message-primitives/Cargo.toml b/shinkai-libs/shinkai-message-primitives/Cargo.toml index 3a876dd0f..b639b8e2b 100644 --- a/shinkai-libs/shinkai-message-primitives/Cargo.toml +++ b/shinkai-libs/shinkai-message-primitives/Cargo.toml @@ -35,18 +35,6 @@ crate-type = ["cdylib", "rlib"] name = "shinkai_message_tests" path = "tests/shinkai_message_tests.rs" -# [[test]] -# name = "shinkai_message_builder_tests" -# path = "tests/shinkai_message_builder_tests.rs" - [[test]] name = "shinkai_name_tests" path = "tests/shinkai_name_tests.rs" - -# [[test]] -# name = "serialized_agent_tests" -# path = "tests/serialized_agent_conversion_tests.rs" - -# [[test]] -# name = "shinkai_jobs_tests" -# path = "tests/shinkai_jobs_tests.rs" diff --git a/shinkai-libs/shinkai-message-pyo3/Cargo.lock b/shinkai-libs/shinkai-message-pyo3/Cargo.lock new file mode 100644 index 000000000..43c34b532 --- /dev/null +++ b/shinkai-libs/shinkai-message-pyo3/Cargo.lock @@ -0,0 +1,2984 @@ +# This file is automatically @generated by Cargo. +# It is not intended for manual editing. +version = 3 + +[[package]] +name = "adler" +version = "1.0.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f26201604c87b1e01bd3d98f8d5d9a8fcbb815e8cedb41ffccbeb4bf593a35fe" + +[[package]] +name = "aead" +version = "0.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7fc95d1bdb8e6666b2b217308eeeb09f2d6728d104be3e31916cc74d15420331" +dependencies = [ + "generic-array", +] + +[[package]] +name = "ahash" +version = "0.7.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fcb51a0695d8f838b1ee009b3fbf66bda078cd64590202a864a8f3e8c4315c47" +dependencies = [ + "getrandom 0.2.10", + "once_cell", + "version_check", +] + +[[package]] +name = "aho-corasick" +version = "1.0.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0c378d78423fdad8089616f827526ee33c19f2fddbd5de1629152c9593ba4783" +dependencies = [ + "memchr", +] + +[[package]] +name = "android-tzdata" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e999941b234f3131b00bc13c22d06e8c5ff726d1b6318ac7eb276997bbb4fef0" + +[[package]] +name = "android_system_properties" +version = "0.1.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "819e7219dbd41043ac279b19830f2efc897156490d7fd6ea916720117ee66311" +dependencies = [ + "libc", +] + +[[package]] +name = "anstream" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b1f58811cfac344940f1a400b6e6231ce35171f614f26439e80f8c1465c5cc0c" +dependencies = [ + "anstyle", + "anstyle-parse", + "anstyle-query", + "anstyle-wincon", + "colorchoice", + "utf8parse", +] + +[[package]] +name = "anstyle" +version = "1.0.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "15c4c2c83f81532e5845a733998b6971faca23490340a418e9b72a3ec9de12ea" + +[[package]] +name = "anstyle-parse" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "938874ff5980b03a87c5524b3ae5b59cf99b1d6bc836848df7bc5ada9643c333" +dependencies = [ + "utf8parse", +] + +[[package]] +name = "anstyle-query" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5ca11d4be1bab0c8bc8734a9aa7bf4ee8316d462a08c6ac5052f888fef5b494b" +dependencies = [ + "windows-sys 0.48.0", +] + +[[package]] +name = "anstyle-wincon" +version = "2.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "58f54d10c6dfa51283a066ceab3ec1ab78d13fae00aa49243a45e4571fb79dfd" +dependencies = [ + "anstyle", + "windows-sys 0.48.0", +] + +[[package]] +name = "anyhow" +version = "1.0.75" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a4668cab20f66d8d020e1fbc0ebe47217433c1b6c8f2040faf858554e394ace6" + +[[package]] +name = "autocfg" +version = "1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d468802bab17cbc0cc575e9b053f41e72aa36bfa6b7f55e3529ffa43161b97fa" + +[[package]] +name = "base64" +version = "0.13.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9e1b586273c5702936fe7b7d6896644d8be71e6314cfe09d3167c95f712589e8" + +[[package]] +name = "base64" +version = "0.21.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9ba43ea6f343b788c8764558649e08df62f86c6ef251fdaeb1ffd010a9ae50a2" + +[[package]] +name = "bincode" +version = "1.3.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b1f45e9417d87227c7a56d22e471c6206462cba514c7590c09aff4cf6d1ddcad" +dependencies = [ + "serde", +] + +[[package]] +name = "bitflags" +version = "1.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a" + +[[package]] +name = "bitflags" +version = "2.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b4682ae6287fcf752ecaabbfcc7b6f9b72aa33933dc23a554d853aea8eea8635" + +[[package]] +name = "block-buffer" +version = "0.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4152116fd6e9dadb291ae18fc1ec3575ed6d84c29642d97890f4b4a3417297e4" +dependencies = [ + "generic-array", +] + +[[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 = "bstr" +version = "1.6.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4c2f7349907b712260e64b0afe2f84692af14a454be26187d9df565c7f69266a" +dependencies = [ + "memchr", + "serde", +] + +[[package]] +name = "bumpalo" +version = "3.13.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a3e2c3daef883ecc1b5d58c15adae93470a91d425f3532ba1695849656af3fc1" + +[[package]] +name = "byteorder" +version = "1.4.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "14c189c53d098945499cdfa7ecc63567cf3886b3332b312a5b4585d8d3a6a610" + +[[package]] +name = "bytes" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a2bd12c1caf447e69cd4528f47f94d203fd2582878ecb9e9465484c4148a8223" + +[[package]] +name = "bytesize" +version = "1.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a3e368af43e418a04d52505cf3dbc23dda4e3407ae2fa99fd0e4f308ce546acc" + +[[package]] +name = "bzip2" +version = "0.4.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bdb116a6ef3f6c3698828873ad02c3014b3c85cadb88496095628e3ef1e347f8" +dependencies = [ + "bzip2-sys", + "libc", +] + +[[package]] +name = "bzip2-sys" +version = "0.1.11+1.0.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "736a955f3fa7875102d57c82b8cac37ec45224a07fd32d58f9f7a186b6cd4cdc" +dependencies = [ + "cc", + "libc", + "pkg-config", +] + +[[package]] +name = "cab" +version = "0.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ae6b4de23c7d39c0631fd3cc952d87951c86c75a13812d7247cb7a896e7b3551" +dependencies = [ + "byteorder", + "flate2", + "lzxd", + "time", +] + +[[package]] +name = "camino" +version = "1.1.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c59e92b5a388f549b863a7bea62612c09f24c8393560709a54558a9abdfb3b9c" +dependencies = [ + "serde", +] + +[[package]] +name = "cargo-config2" +version = "0.1.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9447c7fc85724e3e8b2b4a55077c6925973b25cd8f14a2fb6a597d29c5b40400" +dependencies = [ + "home", + "once_cell", + "serde", + "shell-escape", + "toml 0.7.8", +] + +[[package]] +name = "cargo-options" +version = "0.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9b8e8daa6b2b84aa7cccd57317d9a9b36d969d75bb95923471f4eabbd36f2955" +dependencies = [ + "clap", +] + +[[package]] +name = "cargo-platform" +version = "0.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2cfa25e60aea747ec7e1124f238816749faa93759c6ff5b31f1ccdda137f4479" +dependencies = [ + "serde", +] + +[[package]] +name = "cargo-xwin" +version = "0.14.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8a3496410423935e28df3dec1ada46ad1220de36100a2f56da688062de267c38" +dependencies = [ + "anyhow", + "cargo-config2", + "cargo-options", + "clap", + "dirs", + "fs-err", + "indicatif", + "paste", + "path-slash", + "tracing-subscriber", + "which", + "xwin", +] + +[[package]] +name = "cargo-zigbuild" +version = "0.17.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0caf84ddebd0994ca5b340ce4fd59070fa05e370b1061fbe95f9c1df384c6205" +dependencies = [ + "anyhow", + "cargo-options", + "cargo_metadata", + "clap", + "dirs", + "fs-err", + "path-slash", + "rustc_version", + "semver", + "serde", + "serde_json", + "shlex", + "target-lexicon", + "which", +] + +[[package]] +name = "cargo_metadata" +version = "0.17.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e7daec1a2a2129eeba1644b220b4647ec537b0b5d4bfd6876fcc5a540056b592" +dependencies = [ + "camino", + "cargo-platform", + "semver", + "serde", + "serde_json", + "thiserror", +] + +[[package]] +name = "cbindgen" +version = "0.24.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4b922faaf31122819ec80c4047cc684c6979a087366c069611e33649bf98e18d" +dependencies = [ + "heck", + "indexmap 1.9.3", + "log", + "proc-macro2", + "quote", + "serde", + "serde_json", + "syn 1.0.109", + "tempfile", + "toml 0.5.11", +] + +[[package]] +name = "cc" +version = "1.0.83" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f1174fb0b6ec23863f8b971027804a42614e347eafb0a95bf0b12cdae21fc4d0" +dependencies = [ + "libc", +] + +[[package]] +name = "cfb" +version = "0.7.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d38f2da7a0a2c4ccf0065be06397cc26a81f4e528be095826eee9d4adbb8c60f" +dependencies = [ + "byteorder", + "fnv", + "uuid", +] + +[[package]] +name = "cfg-if" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" + +[[package]] +name = "chacha20" +version = "0.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ed8738f14471a99f0e316c327e68fc82a3611cc2895fcb604b89eedaf8f39d95" +dependencies = [ + "cipher", + "zeroize", +] + +[[package]] +name = "chacha20poly1305" +version = "0.7.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "af1fc18e6d90c40164bf6c317476f2a98f04661e310e79830366b7e914c58a8e" +dependencies = [ + "aead", + "chacha20", + "cipher", + "poly1305", + "zeroize", +] + +[[package]] +name = "charset" +version = "0.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "18e9079d1a12a2cc2bffb5db039c43661836ead4082120d5844f02555aca2d46" +dependencies = [ + "base64 0.13.1", + "encoding_rs", +] + +[[package]] +name = "chrono" +version = "0.4.30" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "defd4e7873dbddba6c7c91e199c7fcb946abc4a6a4ac3195400bcfb01b5de877" +dependencies = [ + "android-tzdata", + "iana-time-zone", + "js-sys", + "num-traits", + "wasm-bindgen", + "windows-targets 0.48.5", +] + +[[package]] +name = "chrono-tz" +version = "0.5.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2554a3155fec064362507487171dcc4edc3df60cb10f3a1fb10ed8094822b120" +dependencies = [ + "chrono", + "parse-zoneinfo", +] + +[[package]] +name = "chumsky" +version = "0.9.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "23170228b96236b5a7299057ac284a321457700bc8c41a4476052f0f4ba5349d" +dependencies = [ + "hashbrown 0.12.3", + "stacker", +] + +[[package]] +name = "cipher" +version = "0.2.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "12f8e7987cbd042a63249497f41aed09f8e65add917ea6566effbc56578d6801" +dependencies = [ + "generic-array", +] + +[[package]] +name = "clap" +version = "4.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6a13b88d2c62ff462f88e4a121f17a82c1af05693a2f192b5c38d14de73c19f6" +dependencies = [ + "clap_builder", + "clap_derive", +] + +[[package]] +name = "clap_builder" +version = "4.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2bb9faaa7c2ef94b2743a21f5a29e6f0010dff4caa69ac8e9d6cf8b6fa74da08" +dependencies = [ + "anstream", + "anstyle", + "clap_lex", + "strsim", + "terminal_size", +] + +[[package]] +name = "clap_complete" +version = "4.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4110a1e6af615a9e6d0a36f805d5c99099f8bab9b8042f5bc1fa220a4a89e36f" +dependencies = [ + "clap", +] + +[[package]] +name = "clap_complete_command" +version = "0.5.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "183495371ea78d4c9ff638bfc6497d46fed2396e4f9c50aebc1278a4a9919a3d" +dependencies = [ + "clap", + "clap_complete", + "clap_complete_fig", + "clap_complete_nushell", +] + +[[package]] +name = "clap_complete_fig" +version = "4.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9e9bae21b3f6eb417ad3054c8b1094aa0542116eba4979b1b271baefbfa6b965" +dependencies = [ + "clap", + "clap_complete", +] + +[[package]] +name = "clap_complete_nushell" +version = "0.1.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5d02bc8b1a18ee47c4d2eec3fb5ac034dc68ebea6125b1509e9ccdffcddce66e" +dependencies = [ + "clap", + "clap_complete", +] + +[[package]] +name = "clap_derive" +version = "4.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0862016ff20d69b84ef8247369fabf5c008a7417002411897d40ee1f4532b873" +dependencies = [ + "heck", + "proc-macro2", + "quote", + "syn 2.0.31", +] + +[[package]] +name = "clap_lex" +version = "0.5.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cd7cc57abe963c6d3b9d8be5b06ba7c8957a930305ca90304f24ef040aa6f961" + +[[package]] +name = "cli-table" +version = "0.4.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "adfbb116d9e2c4be7011360d0c0bee565712c11e969c9609b25b619366dc379d" +dependencies = [ + "termcolor", + "unicode-width", +] + +[[package]] +name = "colorchoice" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "acbf1af155f9b9ef647e42cdc158db4b64a1b61f743629225fde6f3e0be2a7c7" + +[[package]] +name = "configparser" +version = "3.0.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5458d9d1a587efaf5091602c59d299696a3877a439c8f6d461a2d3cce11df87a" + +[[package]] +name = "console" +version = "0.15.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c926e00cc70edefdc64d3a5ff31cc65bb97a3460097762bd23afb4d8145fccf8" +dependencies = [ + "encode_unicode", + "lazy_static", + "libc", + "unicode-width", + "windows-sys 0.45.0", +] + +[[package]] +name = "console_log" +version = "0.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e89f72f65e8501878b8a004d5a1afb780987e2ce2b4532c562e367a72c57499f" +dependencies = [ + "log", + "web-sys", +] + +[[package]] +name = "core-foundation-sys" +version = "0.8.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e496a50fda8aacccc86d7529e2c1e0892dbd0f898a6b5645b5561b89c3210efa" + +[[package]] +name = "cpufeatures" +version = "0.2.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a17b76ff3a4162b0b27f354a0c87015ddad39d35f9c0c36607a3bdd175dde1f1" +dependencies = [ + "libc", +] + +[[package]] +name = "cpuid-bool" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dcb25d077389e53838a8158c8e99174c5a9d902dee4904320db714f3c653ffba" + +[[package]] +name = "crc32fast" +version = "1.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b540bd8bc810d3885c6ea91e2018302f68baba2129ab3e88f32389ee9370880d" +dependencies = [ + "cfg-if", +] + +[[package]] +name = "crossbeam-channel" +version = "0.5.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a33c2bf77f2df06183c3aa30d1e96c0695a313d4f9c453cc3762a6db39f99200" +dependencies = [ + "cfg-if", + "crossbeam-utils", +] + +[[package]] +name = "crossbeam-deque" +version = "0.8.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ce6fd6f855243022dcecf8702fef0c297d4338e226845fe067f6341ad9fa0cef" +dependencies = [ + "cfg-if", + "crossbeam-epoch", + "crossbeam-utils", +] + +[[package]] +name = "crossbeam-epoch" +version = "0.9.15" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ae211234986c545741a7dc064309f67ee1e5ad243d0e48335adc0484d960bcc7" +dependencies = [ + "autocfg", + "cfg-if", + "crossbeam-utils", + "memoffset", + "scopeguard", +] + +[[package]] +name = "crossbeam-utils" +version = "0.8.16" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5a22b2d63d4d1dc0b7f1b6b2747dd0088008a9be28b6ddf0b1e7d335e3037294" +dependencies = [ + "cfg-if", +] + +[[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 = "curve25519-dalek" +version = "3.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "90f9d052967f590a76e62eb387bd0bbb1b000182c3cefe5364db6b7211651bc0" +dependencies = [ + "byteorder", + "digest 0.9.0", + "rand_core 0.5.1", + "subtle", + "zeroize", +] + +[[package]] +name = "data-encoding" +version = "2.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c2e66c9d817f1720209181c316d28635c050fa304f9c79e47a520882661b7308" + +[[package]] +name = "deranged" +version = "0.3.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f2696e8a945f658fd14dc3b87242e6b80cd0f36ff04ea560fa39082368847946" + +[[package]] +name = "dialoguer" +version = "0.10.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "59c6f2989294b9a498d3ad5491a79c6deb604617378e1cdc4bfc1c1361fe2f87" +dependencies = [ + "console", + "shell-words", + "zeroize", +] + +[[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 0.10.4", + "crypto-common", +] + +[[package]] +name = "dirs" +version = "5.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "44c45a9d03d6676652bcb5e724c7e988de1acad23a711b5217ab9cbecbec2225" +dependencies = [ + "dirs-sys", +] + +[[package]] +name = "dirs-sys" +version = "0.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "520f05a5cbd335fae5a99ff7a6ab8627577660ee5cfd6a94a6a929b52ff0321c" +dependencies = [ + "libc", + "option-ext", + "redox_users", + "windows-sys 0.48.0", +] + +[[package]] +name = "dunce" +version = "1.0.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "56ce8c6da7551ec6c462cbaf3bfbc75131ebbfa1c944aeaa9dab51ca1c5f0c3b" + +[[package]] +name = "ed25519" +version = "1.5.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "91cff35c70bba8a626e3185d8cd48cc11b5437e1a5bcd15b9b5fa3c64b6dfee7" +dependencies = [ + "signature", +] + +[[package]] +name = "ed25519-dalek" +version = "1.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c762bae6dcaf24c4c84667b8579785430908723d5c889f469d76a41d59cc7a9d" +dependencies = [ + "curve25519-dalek", + "ed25519", + "rand 0.7.3", + "serde", + "sha2 0.9.9", + "zeroize", +] + +[[package]] +name = "either" +version = "1.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a26ae43d7bcc3b814de94796a5e736d4029efb0ee900c12e2d54c993ad1a1e07" + +[[package]] +name = "encode_unicode" +version = "0.3.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a357d28ed41a50f9c765dbfe56cbc04a64e53e5fc58ba79fbc34c10ef3df831f" + +[[package]] +name = "encoding_rs" +version = "0.8.33" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7268b386296a025e474d5140678f75d6de9493ae55a5d709eeb9dd08149945e1" +dependencies = [ + "cfg-if", +] + +[[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.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "136526188508e25c6fef639d7927dfb3e0e3084488bf202267829cf7fc23dbdd" +dependencies = [ + "errno-dragonfly", + "libc", + "windows-sys 0.48.0", +] + +[[package]] +name = "errno-dragonfly" +version = "0.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "aa68f1b12764fab894d2755d2518754e71b4fd80ecfb822714a1206c2aab39bf" +dependencies = [ + "cc", + "libc", +] + +[[package]] +name = "fastrand" +version = "2.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6999dc1837253364c2ebb0704ba97994bd874e8f195d665c50b7548f6ea92764" + +[[package]] +name = "fat-macho" +version = "0.4.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "63fa117c7dcabeb8c83d5c229764cfa46518545d2dba5a9a08912014711f997b" +dependencies = [ + "goblin", +] + +[[package]] +name = "filetime" +version = "0.2.22" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d4029edd3e734da6fe05b6cd7bd2960760a616bd2ddd0d59a0124746d6272af0" +dependencies = [ + "cfg-if", + "libc", + "redox_syscall 0.3.5", + "windows-sys 0.48.0", +] + +[[package]] +name = "flate2" +version = "1.0.27" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c6c98ee8095e9d1dcbf2fcc6d95acccb90d1c81db1e44725c6a984b1dbdfb010" +dependencies = [ + "crc32fast", + "miniz_oxide", +] + +[[package]] +name = "fnv" +version = "1.0.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3f9eec918d3f24069decb9af1554cad7c880e2da24a9afd88aca000531ab82c1" + +[[package]] +name = "form_urlencoded" +version = "1.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a62bc1cf6f830c2ec14a513a9fb124d0a213a629668a4186f329db21fe045652" +dependencies = [ + "percent-encoding", +] + +[[package]] +name = "fs-err" +version = "2.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0845fa252299212f0389d64ba26f34fa32cfe41588355f21ed507c59a0f64541" + +[[package]] +name = "generic-array" +version = "0.14.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "85649ca51fd72272d7821adaf274ad91c288277713d9c18820d8499a7ff69e9a" +dependencies = [ + "typenum", + "version_check", +] + +[[package]] +name = "getrandom" +version = "0.1.16" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8fc3cb4d91f53b50155bdcfd23f6a4c39ae1969c2ae85982b135750cccaf5fce" +dependencies = [ + "cfg-if", + "libc", + "wasi 0.9.0+wasi-snapshot-preview1", +] + +[[package]] +name = "getrandom" +version = "0.2.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "be4136b2a15dd319360be1c07d9933517ccf0be8f16bf62a3bee4f0d618df427" +dependencies = [ + "cfg-if", + "libc", + "wasi 0.11.0+wasi-snapshot-preview1", +] + +[[package]] +name = "glob" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d2fabcfbdc87f4758337ca535fb41a6d701b65693ce38287d856d1674551ec9b" + +[[package]] +name = "globset" +version = "0.4.13" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "759c97c1e17c55525b57192c06a267cda0ac5210b222d6b82189a2338fa1c13d" +dependencies = [ + "aho-corasick", + "bstr", + "fnv", + "log", + "regex", +] + +[[package]] +name = "goblin" +version = "0.7.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f27c1b4369c2cd341b5de549380158b105a04c331be5db9110eef7b6d2742134" +dependencies = [ + "log", + "plain", + "scroll", +] + +[[package]] +name = "hashbrown" +version = "0.12.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8a9ee70c43aaf417c914396645a0fa852624801b24ebb7ae78fe8272889ac888" +dependencies = [ + "ahash", +] + +[[package]] +name = "hashbrown" +version = "0.14.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2c6201b9ff9fd90a5a3bac2e56a830d0caa509576f0e503818ee82c181b3437a" + +[[package]] +name = "heck" +version = "0.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "95505c38b4572b2d910cecb0281560f54b440a19336cbbcb27bf6ce6adc6f5a8" + +[[package]] +name = "hermit-abi" +version = "0.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "443144c8cdadd93ebf52ddb4056d257f5b52c04d3c804e657d19eb73fc33668b" + +[[package]] +name = "hex" +version = "0.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "644f9158b2f133fd50f5fb3242878846d9eb792e445c893805ff0e3824006e35" + +[[package]] +name = "home" +version = "0.5.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5444c27eef6923071f7ebcc33e3444508466a76f7a2b93da00ed6e19f30c1ddb" +dependencies = [ + "windows-sys 0.48.0", +] + +[[package]] +name = "iana-time-zone" +version = "0.1.57" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2fad5b825842d2b38bd206f3e81d6957625fd7f0a361e345c30e01a0ae2dd613" +dependencies = [ + "android_system_properties", + "core-foundation-sys", + "iana-time-zone-haiku", + "js-sys", + "wasm-bindgen", + "windows", +] + +[[package]] +name = "iana-time-zone-haiku" +version = "0.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f31827a206f56af32e590ba56d5d2d085f558508192593743f16b2306495269f" +dependencies = [ + "cc", +] + +[[package]] +name = "idna" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7d20d6b07bfbc108882d88ed8e37d39636dcc260e15e30c45e6ba089610b917c" +dependencies = [ + "unicode-bidi", + "unicode-normalization", +] + +[[package]] +name = "ignore" +version = "0.4.20" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dbe7873dab538a9a44ad79ede1faf5f30d49f9a5c883ddbab48bce81b64b7492" +dependencies = [ + "globset", + "lazy_static", + "log", + "memchr", + "regex", + "same-file", + "thread_local", + "walkdir", + "winapi-util", +] + +[[package]] +name = "indexmap" +version = "1.9.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bd070e393353796e801d209ad339e89596eb4c8d430d18ede6a1cced8fafbd99" +dependencies = [ + "autocfg", + "hashbrown 0.12.3", + "serde", +] + +[[package]] +name = "indexmap" +version = "2.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d5477fe2230a79769d8dc68e0eabf5437907c0457a5614a9e8dddb67f65eb65d" +dependencies = [ + "equivalent", + "hashbrown 0.14.0", +] + +[[package]] +name = "indicatif" +version = "0.17.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0b297dc40733f23a0e52728a58fa9489a5b7638a324932de16b41adc3ef80730" +dependencies = [ + "console", + "instant", + "number_prefix", + "portable-atomic", + "unicode-width", +] + +[[package]] +name = "indoc" +version = "1.0.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bfa799dd5ed20a7e349f3b4639aa80d74549c81716d9ec4f994c9b5815598306" + +[[package]] +name = "instant" +version = "0.1.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7a5bbe824c507c5da5956355e86a746d82e0e1464f65d862cc5e71da70e94b2c" +dependencies = [ + "cfg-if", +] + +[[package]] +name = "io-lifetimes" +version = "1.0.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "eae7b9aee968036d54dce06cebaefd919e4472e753296daccd6d344e3e2df0c2" +dependencies = [ + "hermit-abi", + "libc", + "windows-sys 0.48.0", +] + +[[package]] +name = "itertools" +version = "0.11.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b1c173a5686ce8bfa551b3563d0c2170bf24ca44da99c7ca4bfdab5418c3fe57" +dependencies = [ + "either", +] + +[[package]] +name = "itoa" +version = "1.0.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "af150ab688ff2122fcef229be89cb50dd66af9e01a4ff320cc137eecc9bacc38" + +[[package]] +name = "js-sys" +version = "0.3.64" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c5f195fe497f702db0f318b07fdd68edb16955aed830df8363d837542f8f935a" +dependencies = [ + "wasm-bindgen", +] + +[[package]] +name = "lazy_static" +version = "1.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e2abad23fbc42b3700f2f279844dc832adb2b2eb069b2df918f455c4e18cc646" + +[[package]] +name = "lddtree" +version = "0.3.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2f5bfec46830ad3a95199ae6804dfe9f51fdad43d7a95fbb6c185efa9824c295" +dependencies = [ + "fs-err", + "glob", + "goblin", +] + +[[package]] +name = "libc" +version = "0.2.147" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b4668fb0ea861c1df094127ac5f1da3409a82116a4ba74fca2e58ef927159bb3" + +[[package]] +name = "linux-raw-sys" +version = "0.3.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ef53942eb7bf7ff43a617b3e2c1c4a5ecf5944a7c1bc12d7ee39bbb15e5c1519" + +[[package]] +name = "linux-raw-sys" +version = "0.4.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1a9bad9f94746442c783ca431b22403b519cd7fbeed0533fdd6328b2f2212128" + +[[package]] +name = "lock_api" +version = "0.4.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c1cc9717a20b1bb222f333e6a92fd32f7d8a18ddc5a3191a11af45dcbf4dcd16" +dependencies = [ + "autocfg", + "scopeguard", +] + +[[package]] +name = "log" +version = "0.4.20" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b5e6163cb8c49088c2c36f57875e58ccd8c87c7427f7fbd50ea6710b2f3f2e8f" + +[[package]] +name = "lzxd" +version = "0.1.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "784462f20dddd9dfdb45de963fa4ad4a288cb10a7889ac5d2c34fb6481c6b213" + +[[package]] +name = "mailparse" +version = "0.14.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6b56570f5f8c0047260d1c8b5b331f62eb9c660b9dd4071a8c46f8c7d3f280aa" +dependencies = [ + "charset", + "data-encoding", + "quoted_printable", +] + +[[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 = "maturin" +version = "1.2.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "305d5fef5e34c2f897547920e0c39c8d74fec863fbfc4156e41faf2f9ab0c718" +dependencies = [ + "anyhow", + "base64 0.21.4", + "bytesize", + "cargo-config2", + "cargo-options", + "cargo-xwin", + "cargo-zigbuild", + "cargo_metadata", + "cbindgen", + "cc", + "clap", + "clap_complete_command", + "configparser", + "console", + "dialoguer", + "dirs", + "dunce", + "fat-macho", + "flate2", + "fs-err", + "glob", + "goblin", + "ignore", + "indexmap 1.9.3", + "itertools", + "lddtree", + "minijinja", + "multipart", + "normpath", + "once_cell", + "pep440_rs", + "pep508_rs", + "platform-info", + "pyproject-toml", + "python-pkginfo", + "regex", + "rustc_version", + "rustls", + "rustls-pemfile", + "same-file", + "semver", + "serde", + "serde_json", + "sha2 0.10.7", + "tar", + "target-lexicon", + "tempfile", + "textwrap", + "thiserror", + "time", + "toml 0.7.8", + "toml_edit", + "tracing", + "tracing-subscriber", + "ureq", + "url", + "wild", + "zip", +] + +[[package]] +name = "memchr" +version = "2.6.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8f232d6ef707e1956a43342693d2a31e72989554d58299d7a88738cc95b0d35c" + +[[package]] +name = "memoffset" +version = "0.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5a634b1c61a95585bd15607c6ab0c4e5b226e695ff2800ba0cdccddf208c406c" +dependencies = [ + "autocfg", +] + +[[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.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4192263c238a5f0d0c6bfd21f336a313a4ce1c450542449ca191bb657b4642ef" +dependencies = [ + "mime", + "unicase", +] + +[[package]] +name = "minijinja" +version = "1.0.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "50c43c912b380856deeb78d826e3b77df13a90e69aef6223e3ad28c02d2ca857" +dependencies = [ + "serde", +] + +[[package]] +name = "minimal-lexical" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "68354c5c6bd36d73ff3feceb05efa59b6acb7626617f4962be322a825e61f79a" + +[[package]] +name = "miniz_oxide" +version = "0.7.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e7810e0be55b428ada41041c41f32c9f1a42817901b4ccf45fa3d4b6561e74c7" +dependencies = [ + "adler", +] + +[[package]] +name = "msi" +version = "0.5.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "eaa7bfcd0ffc3b4dc4a555e5ada4d302b4b6b5ce8d6bc07a6ea703ea63aff149" +dependencies = [ + "byteorder", + "cfb", + "encoding_rs", + "uuid", +] + +[[package]] +name = "multipart" +version = "0.18.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "00dec633863867f29cb39df64a397cdf4a6354708ddd7759f70c7fb51c5f9182" +dependencies = [ + "log", + "mime", + "mime_guess", + "rand 0.8.5", + "tempfile", +] + +[[package]] +name = "nom" +version = "7.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d273983c5a657a70a3e8f2a01329822f3b8c8172b73826411a55751e404a0a4a" +dependencies = [ + "memchr", + "minimal-lexical", +] + +[[package]] +name = "normpath" +version = "1.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ec60c60a693226186f5d6edf073232bfb6464ed97eb22cf3b01c1e8198fd97f5" +dependencies = [ + "windows-sys 0.48.0", +] + +[[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-traits" +version = "0.2.16" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f30b0abd723be7e2ffca1272140fac1a2f084c77ec3e123c192b66af1ee9e6c2" +dependencies = [ + "autocfg", +] + +[[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 = "number_prefix" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "830b246a0e5f20af87141b25c173cd1b609bd7779a4617d6ec582abaf90870f3" + +[[package]] +name = "once_cell" +version = "1.18.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dd8b5dd2ae5ed71462c540258bedcb51965123ad7e7ccf4b9a8cafaa4a63576d" + +[[package]] +name = "opaque-debug" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "624a8340c38c1b80fd549087862da4ba43e08858af025b236e509b6649fc13d5" + +[[package]] +name = "option-ext" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "04744f49eae99ab78e0d5c0b603ab218f515ea8cfe5a456d7629ad883a3b6e7d" + +[[package]] +name = "overload" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b15813163c1d831bf4a13c3610c05c0d03b39feb07f7e09fa234dac9b15aaf39" + +[[package]] +name = "parking_lot" +version = "0.12.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3742b2c103b9f06bc9fff0a37ff4912935851bee6d36f3c02bcc755bcfec228f" +dependencies = [ + "lock_api", + "parking_lot_core", +] + +[[package]] +name = "parking_lot_core" +version = "0.9.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "93f00c865fe7cabf650081affecd3871070f26767e7b2070a3ffae14c654b447" +dependencies = [ + "cfg-if", + "libc", + "redox_syscall 0.3.5", + "smallvec", + "windows-targets 0.48.5", +] + +[[package]] +name = "parse-zoneinfo" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c705f256449c60da65e11ff6626e0c16a0a0b96aaa348de61376b249bc340f41" +dependencies = [ + "regex", +] + +[[package]] +name = "paste" +version = "1.0.14" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "de3145af08024dea9fa9914f381a17b8fc6034dfb00f3a84013f7ff43f29ed4c" + +[[package]] +name = "path-slash" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1e91099d4268b0e11973f036e885d652fb0b21fedcf69738c627f94db6a44f42" + +[[package]] +name = "pep440_rs" +version = "0.3.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b05bf2c44c4cd12f03b2c3ca095f3aa21f44e43c16021c332e511884719705be" +dependencies = [ + "lazy_static", + "regex", + "serde", + "unicode-width", +] + +[[package]] +name = "pep508_rs" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c0713d7bb861ca2b7d4c50a38e1f31a4b63a2e2df35ef1e5855cc29e108453e2" +dependencies = [ + "once_cell", + "pep440_rs", + "regex", + "serde", + "thiserror", + "tracing", + "unicode-width", + "url", +] + +[[package]] +name = "percent-encoding" +version = "2.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9b2a4787296e9989611394c33f193f676704af1686e70b8f8033ab5ba9a35a94" + +[[package]] +name = "pin-project-lite" +version = "0.2.13" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8afb450f006bf6385ca15ef45d71d2288452bc3683ce2e2cacc0d18e4be60b58" + +[[package]] +name = "pkg-config" +version = "0.3.27" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "26072860ba924cbfa98ea39c8c19b4dd6a4a25423dbdf219c1eca91aa0cf6964" + +[[package]] +name = "plain" +version = "0.2.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b4596b6d070b27117e987119b4dac604f3c58cfb0b191112e24771b2faeac1a6" + +[[package]] +name = "platform-info" +version = "2.0.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d6259c4860e53bf665016f1b2f46a8859cadfa717581dc9d597ae4069de6300f" +dependencies = [ + "libc", + "winapi", +] + +[[package]] +name = "poly1305" +version = "0.6.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4b7456bc1ad2d4cf82b3a016be4c2ac48daf11bf990c1603ebd447fe6f30fca8" +dependencies = [ + "cpuid-bool", + "universal-hash", +] + +[[package]] +name = "portable-atomic" +version = "1.4.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "31114a898e107c51bb1609ffaf55a0e011cf6a4d7f1170d0015a165082c0338b" + +[[package]] +name = "ppv-lite86" +version = "0.2.17" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5b40af805b3121feab8a3c29f04d8ad262fa8e0561883e7653e024ae4479e6de" + +[[package]] +name = "proc-macro2" +version = "1.0.66" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "18fb31db3f9bddb2ea821cde30a9f70117e3f119938b5ee630b7403aa6e2ead9" +dependencies = [ + "unicode-ident", +] + +[[package]] +name = "psm" +version = "0.1.21" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5787f7cda34e3033a72192c018bc5883100330f362ef279a8cbccfce8bb4e874" +dependencies = [ + "cc", +] + +[[package]] +name = "pyo3" +version = "0.19.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e681a6cfdc4adcc93b4d3cf993749a4552018ee0a9b65fc0ccfad74352c72a38" +dependencies = [ + "cfg-if", + "indoc", + "libc", + "memoffset", + "parking_lot", + "pyo3-build-config", + "pyo3-ffi", + "pyo3-macros", + "unindent", +] + +[[package]] +name = "pyo3-build-config" +version = "0.19.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "076c73d0bc438f7a4ef6fdd0c3bb4732149136abd952b110ac93e4edb13a6ba5" +dependencies = [ + "once_cell", + "target-lexicon", +] + +[[package]] +name = "pyo3-ffi" +version = "0.19.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e53cee42e77ebe256066ba8aa77eff722b3bb91f3419177cf4cd0f304d3284d9" +dependencies = [ + "libc", + "pyo3-build-config", +] + +[[package]] +name = "pyo3-macros" +version = "0.19.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dfeb4c99597e136528c6dd7d5e3de5434d1ceaf487436a3f03b2d56b6fc9efd1" +dependencies = [ + "proc-macro2", + "pyo3-macros-backend", + "quote", + "syn 1.0.109", +] + +[[package]] +name = "pyo3-macros-backend" +version = "0.19.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "947dc12175c254889edc0c02e399476c2f652b4b9ebd123aa655c224de259536" +dependencies = [ + "proc-macro2", + "quote", + "syn 1.0.109", +] + +[[package]] +name = "pyproject-toml" +version = "0.6.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ee79feaa9d31e1c417e34219e610b67db4e786ce9b49d77dda549640abb9dc5f" +dependencies = [ + "indexmap 1.9.3", + "pep440_rs", + "pep508_rs", + "serde", + "toml 0.7.8", +] + +[[package]] +name = "python-pkginfo" +version = "0.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "037469c164f08c891bf6d69ca02f1d56210011451e229618669777df82124cfa" +dependencies = [ + "flate2", + "fs-err", + "mailparse", + "rfc2047-decoder", + "tar", + "thiserror", + "zip", +] + +[[package]] +name = "quote" +version = "1.0.33" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5267fca4496028628a95160fc423a33e8b2e6af8a5302579e322e4b520293cae" +dependencies = [ + "proc-macro2", +] + +[[package]] +name = "quoted_printable" +version = "0.4.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5a3866219251662ec3b26fc217e3e05bf9c4f84325234dfb96bf0bf840889e49" + +[[package]] +name = "rand" +version = "0.7.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6a6b1679d49b24bbfe0c803429aa1874472f50d9b363131f0e89fc356b544d03" +dependencies = [ + "getrandom 0.1.16", + "libc", + "rand_chacha 0.2.2", + "rand_core 0.5.1", + "rand_hc", +] + +[[package]] +name = "rand" +version = "0.8.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "34af8d1a0e25924bc5b7c43c079c942339d8f0a8b57c39049bef581b46327404" +dependencies = [ + "libc", + "rand_chacha 0.3.1", + "rand_core 0.6.4", +] + +[[package]] +name = "rand_chacha" +version = "0.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f4c8ed856279c9737206bf725bf36935d8666ead7aa69b52be55af369d193402" +dependencies = [ + "ppv-lite86", + "rand_core 0.5.1", +] + +[[package]] +name = "rand_chacha" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e6c10a63a0fa32252be49d21e7709d4d4baf8d231c2dbce1eaa8141b9b127d88" +dependencies = [ + "ppv-lite86", + "rand_core 0.6.4", +] + +[[package]] +name = "rand_core" +version = "0.5.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "90bde5296fc891b0cef12a6d03ddccc162ce7b2aff54160af9338f8d40df6d19" +dependencies = [ + "getrandom 0.1.16", +] + +[[package]] +name = "rand_core" +version = "0.6.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ec0be4795e2f6a28069bec0b5ff3e2ac9bafc99e6a9a7dc3547996c5c816922c" +dependencies = [ + "getrandom 0.2.10", +] + +[[package]] +name = "rand_hc" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ca3129af7b92a17112d59ad498c6f81eaf463253766b90396d39ea7a39d6613c" +dependencies = [ + "rand_core 0.5.1", +] + +[[package]] +name = "rand_os" +version = "0.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a788ae3edb696cfcba1c19bfd388cc4b8c21f8a408432b199c072825084da58a" +dependencies = [ + "getrandom 0.1.16", + "rand_core 0.5.1", +] + +[[package]] +name = "rayon" +version = "1.7.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1d2df5196e37bcc87abebc0053e20787d73847bb33134a69841207dd0a47f03b" +dependencies = [ + "either", + "rayon-core", +] + +[[package]] +name = "rayon-core" +version = "1.11.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4b8f95bd6966f5c87776639160a66bd8ab9895d9d4ab01ddba9fc60661aebe8d" +dependencies = [ + "crossbeam-channel", + "crossbeam-deque", + "crossbeam-utils", + "num_cpus", +] + +[[package]] +name = "redox_syscall" +version = "0.2.16" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fb5a58c1855b4b6819d59012155603f0b22ad30cad752600aadfcb695265519a" +dependencies = [ + "bitflags 1.3.2", +] + +[[package]] +name = "redox_syscall" +version = "0.3.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "567664f262709473930a4bf9e51bf2ebf3348f2e748ccc50dea20646858f8f29" +dependencies = [ + "bitflags 1.3.2", +] + +[[package]] +name = "redox_users" +version = "0.4.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b033d837a7cf162d7993aded9304e30a83213c648b6e389db233191f891e5c2b" +dependencies = [ + "getrandom 0.2.10", + "redox_syscall 0.2.16", + "thiserror", +] + +[[package]] +name = "regex" +version = "1.9.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "697061221ea1b4a94a624f67d0ae2bfe4e22b8a17b6a192afb11046542cc8c47" +dependencies = [ + "aho-corasick", + "memchr", + "regex-automata 0.3.8", + "regex-syntax 0.7.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.3.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c2f401f4955220693b56f8ec66ee9c78abffd8d1c4f23dc41a23839eb88f0795" +dependencies = [ + "aho-corasick", + "memchr", + "regex-syntax 0.7.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.7.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dbb5fb1acd8a1a18b3dd5be62d25485eb770e05afb408a9627d14d451bae12da" + +[[package]] +name = "rfc2047-decoder" +version = "0.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "61fc4b4e52897c3e30b12b7e9b04461215b647fbe66f6def60dd8edbce14ec2e" +dependencies = [ + "base64 0.21.4", + "charset", + "chumsky", + "memchr", + "quoted_printable", + "thiserror", +] + +[[package]] +name = "ring" +version = "0.16.20" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3053cf52e236a3ed746dfc745aa9cacf1b791d846bdaf412f60a8d7d6e17c8fc" +dependencies = [ + "cc", + "libc", + "once_cell", + "spin", + "untrusted", + "web-sys", + "winapi", +] + +[[package]] +name = "rustc_version" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bfa0f585226d2e68097d4f95d113b15b83a82e819ab25717ec0590d9584ef366" +dependencies = [ + "semver", +] + +[[package]] +name = "rustix" +version = "0.37.23" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4d69718bf81c6127a49dc64e44a742e8bb9213c0ff8869a22c308f84c1d4ab06" +dependencies = [ + "bitflags 1.3.2", + "errno", + "io-lifetimes", + "libc", + "linux-raw-sys 0.3.8", + "windows-sys 0.48.0", +] + +[[package]] +name = "rustix" +version = "0.38.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bdf14a7a466ce88b5eac3da815b53aefc208ce7e74d1c263aabb04d88c4abeb1" +dependencies = [ + "bitflags 2.4.0", + "errno", + "libc", + "linux-raw-sys 0.4.7", + "windows-sys 0.48.0", +] + +[[package]] +name = "rustls" +version = "0.21.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cd8d6c9f025a446bc4d18ad9632e69aec8f287aa84499ee335599fabd20c3fd8" +dependencies = [ + "log", + "ring", + "rustls-webpki 0.101.4", + "sct", +] + +[[package]] +name = "rustls-pemfile" +version = "1.0.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2d3987094b1d07b653b7dfdc3f70ce9a1da9c51ac18c1b06b662e4f9a0e9f4b2" +dependencies = [ + "base64 0.21.4", +] + +[[package]] +name = "rustls-webpki" +version = "0.100.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e98ff011474fa39949b7e5c0428f9b4937eda7da7848bbb947786b7be0b27dab" +dependencies = [ + "ring", + "untrusted", +] + +[[package]] +name = "rustls-webpki" +version = "0.101.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7d93931baf2d282fff8d3a532bbfd7653f734643161b87e3e01e59a04439bf0d" +dependencies = [ + "ring", + "untrusted", +] + +[[package]] +name = "ryu" +version = "1.0.15" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1ad4cc8da4ef723ed60bced201181d83791ad433213d8c24efffda1eec85d741" + +[[package]] +name = "same-file" +version = "1.0.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "93fc1dc3aaa9bfed95e02e6eadabb4baf7e3078b0bd1b4d7b6b0b68378900502" +dependencies = [ + "winapi-util", +] + +[[package]] +name = "scopeguard" +version = "1.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "94143f37725109f92c262ed2cf5e59bce7498c01bcc1502d7b9afe439a4e9f49" + +[[package]] +name = "scroll" +version = "0.11.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "04c565b551bafbef4157586fa379538366e4385d42082f255bfd96e4fe8519da" +dependencies = [ + "scroll_derive", +] + +[[package]] +name = "scroll_derive" +version = "0.11.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1db149f81d46d2deba7cd3c50772474707729550221e69588478ebf9ada425ae" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.31", +] + +[[package]] +name = "sct" +version = "0.7.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d53dcdb7c9f8158937a7981b48accfd39a43af418591a5d008c7b22b5e1b7ca4" +dependencies = [ + "ring", + "untrusted", +] + +[[package]] +name = "semver" +version = "1.0.18" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b0293b4b29daaf487284529cc2f5675b8e57c61f70167ba415a463651fd6a918" +dependencies = [ + "serde", +] + +[[package]] +name = "serde" +version = "1.0.188" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cf9e0fcba69a370eed61bcf2b728575f726b50b55cba78064753d708ddc7549e" +dependencies = [ + "serde_derive", +] + +[[package]] +name = "serde_derive" +version = "1.0.188" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4eca7ac642d82aa35b60049a6eccb4be6be75e599bd2e9adb5f875a737654af2" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.31", +] + +[[package]] +name = "serde_json" +version = "1.0.106" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2cc66a619ed80bf7a0f6b17dd063a84b88f6dea1813737cf469aef1d081142c2" +dependencies = [ + "itoa", + "ryu", + "serde", +] + +[[package]] +name = "serde_spanned" +version = "0.6.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "96426c9936fd7a0124915f9185ea1d20aa9445cc9821142f0a73bc9207a2e186" +dependencies = [ + "serde", +] + +[[package]] +name = "sha2" +version = "0.9.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4d58a1e1bf39749807d89cf2d98ac2dfa0ff1cb3faa38fbb64dd88ac8013d800" +dependencies = [ + "block-buffer 0.9.0", + "cfg-if", + "cpufeatures", + "digest 0.9.0", + "opaque-debug", +] + +[[package]] +name = "sha2" +version = "0.10.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "479fb9d862239e610720565ca91403019f2f00410f1864c5aa7479b950a76ed8" +dependencies = [ + "cfg-if", + "cpufeatures", + "digest 0.10.7", +] + +[[package]] +name = "sharded-slab" +version = "0.1.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "900fba806f70c630b0a382d0d825e17a0f19fcd059a2ade1ff237bcddf446b31" +dependencies = [ + "lazy_static", +] + +[[package]] +name = "shell-escape" +version = "0.1.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "45bb67a18fa91266cc7807181f62f9178a6873bfad7dc788c42e6430db40184f" + +[[package]] +name = "shell-words" +version = "1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "24188a676b6ae68c3b2cb3a01be17fbf7240ce009799bb56d5b1409051e78fde" + +[[package]] +name = "shinkai_message_primitives" +version = "0.1.0" +dependencies = [ + "anyhow", + "bincode", + "chacha20poly1305", + "chrono", + "chrono-tz", + "console_log", + "ed25519-dalek", + "hex", + "log", + "rand 0.8.5", + "rand_os", + "regex", + "serde", + "serde_json", + "sha2 0.9.9", + "thiserror", + "x25519-dalek", +] + +[[package]] +name = "shinkai_message_pyo3" +version = "0.1.0" +dependencies = [ + "ed25519-dalek", + "hex", + "maturin", + "pyo3", + "rand 0.8.5", + "rand_os", + "serde", + "serde_json", + "shinkai_message_primitives", + "x25519-dalek", +] + +[[package]] +name = "shlex" +version = "1.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a7cee0529a6d40f580e7a5e6c495c8fbfe21b7b52795ed4bb5e62cdf92bc6380" + +[[package]] +name = "signature" +version = "1.6.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "74233d3b3b2f6d4b006dc19dee745e73e2a6bfb6f93607cd3b02bd5b00797d7c" + +[[package]] +name = "smallvec" +version = "1.11.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "62bb4feee49fdd9f707ef802e22365a35de4b7b299de4763d44bfea899442ff9" + +[[package]] +name = "smawk" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f67ad224767faa3c7d8b6d91985b78e70a1324408abcb1cfcc2be4c06bc06043" + +[[package]] +name = "socks" +version = "0.3.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f0c3dbbd9ae980613c6dd8e28a9407b50509d3803b57624d5dfe8315218cd58b" +dependencies = [ + "byteorder", + "libc", + "winapi", +] + +[[package]] +name = "spin" +version = "0.5.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6e63cff320ae2c57904679ba7cb63280a3dc4613885beafb148ee7bf9aa9042d" + +[[package]] +name = "stacker" +version = "0.1.15" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c886bd4480155fd3ef527d45e9ac8dd7118a898a46530b7b94c3e21866259fce" +dependencies = [ + "cc", + "cfg-if", + "libc", + "psm", + "winapi", +] + +[[package]] +name = "static_assertions" +version = "1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a2eb9349b6444b326872e140eb1cf5e7c522154d69e7a0ffb0fb81c06b37543f" + +[[package]] +name = "strsim" +version = "0.10.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "73473c0e59e6d5812c5dfe2a064a6444949f089e20eec9a2e5506596494e4623" + +[[package]] +name = "subtle" +version = "2.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6bdef32e8150c2a081110b42772ffe7d7c9032b606bc226c8260fd97e0976601" + +[[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.31" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "718fa2415bcb8d8bd775917a1bf12a7931b6dfa890753378538118181e0cb398" +dependencies = [ + "proc-macro2", + "quote", + "unicode-ident", +] + +[[package]] +name = "tar" +version = "0.4.40" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b16afcea1f22891c49a00c751c7b63b2233284064f11a200fc624137c51e2ddb" +dependencies = [ + "filetime", + "libc", + "xattr", +] + +[[package]] +name = "target-lexicon" +version = "0.12.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9d0e916b1148c8e263850e1ebcbd046f333e0683c724876bb0da63ea4373dc8a" + +[[package]] +name = "tempfile" +version = "3.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cb94d2f3cc536af71caac6b6fcebf65860b347e7ce0cc9ebe8f70d3e521054ef" +dependencies = [ + "cfg-if", + "fastrand", + "redox_syscall 0.3.5", + "rustix 0.38.12", + "windows-sys 0.48.0", +] + +[[package]] +name = "termcolor" +version = "1.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "be55cf8942feac5c765c2c993422806843c9a9a45d4d5c407ad6dd2ea95eb9b6" +dependencies = [ + "winapi-util", +] + +[[package]] +name = "terminal_size" +version = "0.2.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8e6bf6f19e9f8ed8d4048dc22981458ebcf406d67e94cd422e5ecd73d63b3237" +dependencies = [ + "rustix 0.37.23", + "windows-sys 0.48.0", +] + +[[package]] +name = "textwrap" +version = "0.16.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "222a222a5bfe1bba4a77b45ec488a741b3cb8872e5e499451fd7d0129c9c7c3d" +dependencies = [ + "smawk", + "unicode-linebreak", + "unicode-width", +] + +[[package]] +name = "thiserror" +version = "1.0.48" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9d6d7a740b8a666a7e828dd00da9c0dc290dff53154ea77ac109281de90589b7" +dependencies = [ + "thiserror-impl", +] + +[[package]] +name = "thiserror-impl" +version = "1.0.48" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "49922ecae66cc8a249b77e68d1d0623c1b2c514f0060c27cdc68bd62a1219d35" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.31", +] + +[[package]] +name = "thread_local" +version = "1.1.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3fdd6f064ccff2d6567adcb3873ca630700f00b5ad3f060c25b5dcfd9a4ce152" +dependencies = [ + "cfg-if", + "once_cell", +] + +[[package]] +name = "time" +version = "0.3.28" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "17f6bb557fd245c28e6411aa56b6403c689ad95061f50e4be16c274e70a17e48" +dependencies = [ + "deranged", + "serde", + "time-core", +] + +[[package]] +name = "time-core" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7300fbefb4dadc1af235a9cef3737cea692a9d97e1b9cbcd4ebdae6f8868e6fb" + +[[package]] +name = "tinyvec" +version = "1.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "87cc5ceb3875bb20c2890005a4e226a4651264a5c75edb2421b52861a0a0cb50" +dependencies = [ + "tinyvec_macros", +] + +[[package]] +name = "tinyvec_macros" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1f3ccbac311fea05f86f61904b462b55fb3df8837a366dfc601a0161d0532f20" + +[[package]] +name = "toml" +version = "0.5.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f4f7f0dd8d50a853a531c426359045b1998f04219d88799810762cd4ad314234" +dependencies = [ + "serde", +] + +[[package]] +name = "toml" +version = "0.7.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dd79e69d3b627db300ff956027cc6c3798cef26d22526befdfcd12feeb6d2257" +dependencies = [ + "serde", + "serde_spanned", + "toml_datetime", + "toml_edit", +] + +[[package]] +name = "toml_datetime" +version = "0.6.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7cda73e2f1397b1262d6dfdcef8aafae14d1de7748d66822d3bfeeb6d03e5e4b" +dependencies = [ + "serde", +] + +[[package]] +name = "toml_edit" +version = "0.19.15" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1b5bb770da30e5cbfde35a2d7b9b8a2c4b8ef89548a7a6aeab5c9a576e3e7421" +dependencies = [ + "indexmap 2.0.0", + "serde", + "serde_spanned", + "toml_datetime", + "winnow", +] + +[[package]] +name = "tracing" +version = "0.1.37" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8ce8c33a8d48bd45d624a6e523445fd21ec13d3653cd51f681abf67418f54eb8" +dependencies = [ + "cfg-if", + "log", + "pin-project-lite", + "tracing-attributes", + "tracing-core", +] + +[[package]] +name = "tracing-attributes" +version = "0.1.26" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5f4f31f56159e98206da9efd823404b79b6ef3143b4a7ab76e67b1751b25a4ab" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.31", +] + +[[package]] +name = "tracing-core" +version = "0.1.31" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0955b8137a1df6f1a2e9a37d8a6656291ff0297c1a97c24e0d8425fe2312f79a" +dependencies = [ + "once_cell", + "valuable", +] + +[[package]] +name = "tracing-log" +version = "0.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "78ddad33d2d10b1ed7eb9d1f518a5674713876e97e5bb9b7345a7984fbb4f922" +dependencies = [ + "lazy_static", + "log", + "tracing-core", +] + +[[package]] +name = "tracing-serde" +version = "0.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bc6b213177105856957181934e4920de57730fc69bf42c37ee5bb664d406d9e1" +dependencies = [ + "serde", + "tracing-core", +] + +[[package]] +name = "tracing-subscriber" +version = "0.3.17" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "30a651bc37f915e81f087d86e62a18eec5f79550c7faff886f7090b4ea757c77" +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 = "twox-hash" +version = "1.6.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "97fee6b57c6a41524a810daee9286c02d7752c4253064d0b05472833a438f675" +dependencies = [ + "cfg-if", + "rand 0.8.5", + "static_assertions", +] + +[[package]] +name = "typenum" +version = "1.16.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "497961ef93d974e23eb6f433eb5fe1b7930b659f06d12dec6fc44a8f554c0bba" + +[[package]] +name = "unicase" +version = "2.7.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f7d2d4dafb69621809a81864c9c1b864479e1235c0dd4e199924b9742439ed89" +dependencies = [ + "version_check", +] + +[[package]] +name = "unicode-bidi" +version = "0.3.13" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "92888ba5573ff080736b3648696b70cafad7d250551175acbaa4e0385b3e1460" + +[[package]] +name = "unicode-ident" +version = "1.0.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "301abaae475aa91687eb82514b328ab47a211a533026cb25fc3e519b86adfc3c" + +[[package]] +name = "unicode-linebreak" +version = "0.1.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3b09c83c3c29d37506a3e260c08c03743a6bb66a9cd432c6934ab501a190571f" + +[[package]] +name = "unicode-normalization" +version = "0.1.22" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5c5713f0fc4b5db668a2ac63cdb7bb4469d8c9fed047b1d0292cc7b0ce2ba921" +dependencies = [ + "tinyvec", +] + +[[package]] +name = "unicode-width" +version = "0.1.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c0edd1e5b14653f783770bce4a4dabb4a5108a5370a5f5d8cfe8710c361f6c8b" + +[[package]] +name = "unindent" +version = "0.1.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e1766d682d402817b5ac4490b3c3002d91dfa0d22812f341609f97b08757359c" + +[[package]] +name = "universal-hash" +version = "0.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9f214e8f697e925001e66ec2c6e37a4ef93f0f78c2eed7814394e10c62025b05" +dependencies = [ + "generic-array", + "subtle", +] + +[[package]] +name = "untrusted" +version = "0.7.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a156c684c91ea7d62626509bce3cb4e1d9ed5c4d978f7b4352658f96a4c26b4a" + +[[package]] +name = "ureq" +version = "2.7.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0b11c96ac7ee530603dcdf68ed1557050f374ce55a5a07193ebf8cbc9f8927e9" +dependencies = [ + "base64 0.21.4", + "flate2", + "log", + "once_cell", + "rustls", + "rustls-webpki 0.100.2", + "serde", + "serde_json", + "socks", + "url", + "webpki-roots", +] + +[[package]] +name = "url" +version = "2.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "143b538f18257fac9cad154828a57c6bf5157e1aa604d4816b5995bf6de87ae5" +dependencies = [ + "form_urlencoded", + "idna", + "percent-encoding", + "serde", +] + +[[package]] +name = "utf8parse" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "711b9620af191e0cdc7468a8d14e709c3dcdb115b36f838e601583af800a370a" + +[[package]] +name = "uuid" +version = "1.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "79daa5ed5740825c40b389c5e50312b9c86df53fccd33f281df655642b43869d" + +[[package]] +name = "valuable" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "830b7e5d4d90034032940e4ace0d9a9a057e7a45cd94e6c007832e39edb82f6d" + +[[package]] +name = "version_check" +version = "0.9.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "49874b5167b65d7193b8aba1567f5c7d93d001cafc34600cee003eda787e483f" + +[[package]] +name = "versions" +version = "5.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c73a36bc44e3039f51fbee93e39f41225f6b17b380eb70cc2aab942df06b34dd" +dependencies = [ + "itertools", + "nom", +] + +[[package]] +name = "walkdir" +version = "2.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d71d857dc86794ca4c280d616f7da00d2dbfd8cd788846559a6813e6aa4b54ee" +dependencies = [ + "same-file", + "winapi-util", +] + +[[package]] +name = "wasi" +version = "0.9.0+wasi-snapshot-preview1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cccddf32554fecc6acb585f82a32a72e28b48f8c4c1883ddfeeeaa96f7d8e519" + +[[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.87" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7706a72ab36d8cb1f80ffbf0e071533974a60d0a308d01a5d0375bf60499a342" +dependencies = [ + "cfg-if", + "wasm-bindgen-macro", +] + +[[package]] +name = "wasm-bindgen-backend" +version = "0.2.87" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5ef2b6d3c510e9625e5fe6f509ab07d66a760f0885d858736483c32ed7809abd" +dependencies = [ + "bumpalo", + "log", + "once_cell", + "proc-macro2", + "quote", + "syn 2.0.31", + "wasm-bindgen-shared", +] + +[[package]] +name = "wasm-bindgen-macro" +version = "0.2.87" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dee495e55982a3bd48105a7b947fd2a9b4a8ae3010041b9e0faab3f9cd028f1d" +dependencies = [ + "quote", + "wasm-bindgen-macro-support", +] + +[[package]] +name = "wasm-bindgen-macro-support" +version = "0.2.87" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "54681b18a46765f095758388f2d0cf16eb8d4169b639ab575a8f5693af210c7b" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.31", + "wasm-bindgen-backend", + "wasm-bindgen-shared", +] + +[[package]] +name = "wasm-bindgen-shared" +version = "0.2.87" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ca6ad05a4870b2bf5fe995117d3728437bd27d7cd5f06f13c17443ef369775a1" + +[[package]] +name = "web-sys" +version = "0.3.64" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9b85cbef8c220a6abc02aefd892dfc0fc23afb1c6a426316ec33253a3877249b" +dependencies = [ + "js-sys", + "wasm-bindgen", +] + +[[package]] +name = "webpki-roots" +version = "0.23.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b03058f88386e5ff5310d9111d53f48b17d732b401aeb83a8d5190f2ac459338" +dependencies = [ + "rustls-webpki 0.100.2", +] + +[[package]] +name = "which" +version = "4.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "87ba24419a2078cd2b0f2ede2691b6c66d8e47836da3b6db8265ebad47afbfc7" +dependencies = [ + "either", + "home", + "once_cell", + "rustix 0.38.12", +] + +[[package]] +name = "wild" +version = "2.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "05b116685a6be0c52f5a103334cbff26db643826c7b3735fc0a3ba9871310a74" +dependencies = [ + "glob", +] + +[[package]] +name = "winapi" +version = "0.3.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5c839a674fcd7a98952e593242ea400abe93992746761e38641405d28b00f419" +dependencies = [ + "winapi-i686-pc-windows-gnu", + "winapi-x86_64-pc-windows-gnu", +] + +[[package]] +name = "winapi-i686-pc-windows-gnu" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ac3b87c63620426dd9b991e5ce0329eff545bccbbb34f3be09ff6fb6ab51b7b6" + +[[package]] +name = "winapi-util" +version = "0.1.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "70ec6ce85bb158151cae5e5c87f95a8e97d2c0c4b001223f33a334e3ce5de178" +dependencies = [ + "winapi", +] + +[[package]] +name = "winapi-x86_64-pc-windows-gnu" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f" + +[[package]] +name = "windows" +version = "0.48.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e686886bc078bc1b0b600cac0147aadb815089b6e4da64016cbd754b6342700f" +dependencies = [ + "windows-targets 0.48.5", +] + +[[package]] +name = "windows-sys" +version = "0.45.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "75283be5efb2831d37ea142365f009c02ec203cd29a3ebecbc093d52315b66d0" +dependencies = [ + "windows-targets 0.42.2", +] + +[[package]] +name = "windows-sys" +version = "0.48.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "677d2418bec65e3338edb076e806bc1ec15693c5d0104683f2efe857f61056a9" +dependencies = [ + "windows-targets 0.48.5", +] + +[[package]] +name = "windows-targets" +version = "0.42.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8e5180c00cd44c9b1c88adb3693291f1cd93605ded80c250a75d472756b4d071" +dependencies = [ + "windows_aarch64_gnullvm 0.42.2", + "windows_aarch64_msvc 0.42.2", + "windows_i686_gnu 0.42.2", + "windows_i686_msvc 0.42.2", + "windows_x86_64_gnu 0.42.2", + "windows_x86_64_gnullvm 0.42.2", + "windows_x86_64_msvc 0.42.2", +] + +[[package]] +name = "windows-targets" +version = "0.48.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9a2fa6e2155d7247be68c096456083145c183cbbbc2764150dda45a87197940c" +dependencies = [ + "windows_aarch64_gnullvm 0.48.5", + "windows_aarch64_msvc 0.48.5", + "windows_i686_gnu 0.48.5", + "windows_i686_msvc 0.48.5", + "windows_x86_64_gnu 0.48.5", + "windows_x86_64_gnullvm 0.48.5", + "windows_x86_64_msvc 0.48.5", +] + +[[package]] +name = "windows_aarch64_gnullvm" +version = "0.42.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "597a5118570b68bc08d8d59125332c54f1ba9d9adeedeef5b99b02ba2b0698f8" + +[[package]] +name = "windows_aarch64_gnullvm" +version = "0.48.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2b38e32f0abccf9987a4e3079dfb67dcd799fb61361e53e2882c3cbaf0d905d8" + +[[package]] +name = "windows_aarch64_msvc" +version = "0.42.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e08e8864a60f06ef0d0ff4ba04124db8b0fb3be5776a5cd47641e942e58c4d43" + +[[package]] +name = "windows_aarch64_msvc" +version = "0.48.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dc35310971f3b2dbbf3f0690a219f40e2d9afcf64f9ab7cc1be722937c26b4bc" + +[[package]] +name = "windows_i686_gnu" +version = "0.42.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c61d927d8da41da96a81f029489353e68739737d3beca43145c8afec9a31a84f" + +[[package]] +name = "windows_i686_gnu" +version = "0.48.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a75915e7def60c94dcef72200b9a8e58e5091744960da64ec734a6c6e9b3743e" + +[[package]] +name = "windows_i686_msvc" +version = "0.42.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "44d840b6ec649f480a41c8d80f9c65108b92d89345dd94027bfe06ac444d1060" + +[[package]] +name = "windows_i686_msvc" +version = "0.48.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8f55c233f70c4b27f66c523580f78f1004e8b5a8b659e05a4eb49d4166cca406" + +[[package]] +name = "windows_x86_64_gnu" +version = "0.42.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8de912b8b8feb55c064867cf047dda097f92d51efad5b491dfb98f6bbb70cb36" + +[[package]] +name = "windows_x86_64_gnu" +version = "0.48.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "53d40abd2583d23e4718fddf1ebec84dbff8381c07cae67ff7768bbf19c6718e" + +[[package]] +name = "windows_x86_64_gnullvm" +version = "0.42.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "26d41b46a36d453748aedef1486d5c7a85db22e56aff34643984ea85514e94a3" + +[[package]] +name = "windows_x86_64_gnullvm" +version = "0.48.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0b7b52767868a23d5bab768e390dc5f5c55825b6d30b86c844ff2dc7414044cc" + +[[package]] +name = "windows_x86_64_msvc" +version = "0.42.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9aec5da331524158c6d1a4ac0ab1541149c0b9505fde06423b02f5ef0106b9f0" + +[[package]] +name = "windows_x86_64_msvc" +version = "0.48.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ed94fce61571a4006852b7389a063ab983c02eb1bb37b47f8272ce92d06d9538" + +[[package]] +name = "winnow" +version = "0.5.15" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7c2e3184b9c4e92ad5167ca73039d0c42476302ab603e2fec4487511f38ccefc" +dependencies = [ + "memchr", +] + +[[package]] +name = "x25519-dalek" +version = "1.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2392b6b94a576b4e2bf3c5b2757d63f10ada8020a2e4d08ac849ebcf6ea8e077" +dependencies = [ + "curve25519-dalek", + "rand_core 0.5.1", + "zeroize", +] + +[[package]] +name = "xattr" +version = "1.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f4686009f71ff3e5c4dbcf1a282d0a44db3f021ba69350cd42086b3e5f1c6985" +dependencies = [ + "libc", +] + +[[package]] +name = "xwin" +version = "0.2.14" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9c16d94a0ca213c840bc7482ca9388957b0ee2eafceab13846d4189504155e62" +dependencies = [ + "anyhow", + "bytes", + "cab", + "camino", + "clap", + "cli-table", + "flate2", + "indicatif", + "msi", + "parking_lot", + "rayon", + "regex", + "serde", + "serde_json", + "sha2 0.10.7", + "tempfile", + "tracing", + "tracing-subscriber", + "twox-hash", + "ureq", + "versions", + "zip", +] + +[[package]] +name = "zeroize" +version = "1.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4756f7db3f7b5574938c3eb1c117038b8e07f95ee6718c0efad4ac21508f1efd" +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.31", +] + +[[package]] +name = "zip" +version = "0.6.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "760394e246e4c28189f19d488c058bf16f564016aefac5d32bb1f3b51d5e9261" +dependencies = [ + "byteorder", + "bzip2", + "crc32fast", + "crossbeam-utils", + "flate2", + "time", +] diff --git a/shinkai-libs/shinkai-message-pyo3/Cargo.toml b/shinkai-libs/shinkai-message-pyo3/Cargo.toml new file mode 100644 index 000000000..89f472a42 --- /dev/null +++ b/shinkai-libs/shinkai-message-pyo3/Cargo.toml @@ -0,0 +1,29 @@ +[package] +name = "shinkai_message_pyo3" +version = "0.1.0" +edition = "2018" +authors = ["Nico Arqueros "] + +# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html +[lib] +crate-type = ["cdylib"] + +[dependencies.serde] +version = "1.0.188" +features = ["derive"] + +[dependencies] +shinkai_message_primitives = { path = "../shinkai-message-primitives" } +serde_json = "1.0.105" +x25519-dalek = "1.2.0" +ed25519-dalek = "1.0.1" +rand_os = "0.2.2" +rand = "0.8" +hex = "=0.4.2" + +[dependencies.pyo3] +version = "0.19.2" +features = ["auto-initialize", "extension-module"] + +[build-dependencies] +maturin = "1.2.3" diff --git a/shinkai-libs/shinkai-message-pyo3/README.md b/shinkai-libs/shinkai-message-pyo3/README.md new file mode 100644 index 000000000..3316328b4 --- /dev/null +++ b/shinkai-libs/shinkai-message-pyo3/README.md @@ -0,0 +1,15 @@ +## Compile + +You can build your Python library with the following command: + +`maturin develop` + +If you want to build a wheel (.whl) file that you can distribute and install with pip, you can use the following command: + +`maturin build` + +Before running these commands, make sure you have activated the Python virtual environment where you want to install the library, if you're using one. + +## Run Tests + +WIP: `python -m unittest` \ No newline at end of file diff --git a/shinkai-libs/shinkai-message-pyo3/run_tests.sh b/shinkai-libs/shinkai-message-pyo3/run_tests.sh new file mode 100755 index 000000000..facf94bdf --- /dev/null +++ b/shinkai-libs/shinkai-message-pyo3/run_tests.sh @@ -0,0 +1,20 @@ +#!/bin/bash + +# Activate your virtual environment +source ./venv/bin/activate + +# Run maturin develop and capture its output +output=$(maturin develop) + +# If maturin develop is successful, extract the path of the built wheel file +if [ $? -eq 0 ]; then + wheel_file=$(echo "$output" | grep -o '/.*\.whl') + + # Update the installed package using the built wheel file + pip install --upgrade "$wheel_file" + + # Run the tests + python3 -m unittest tests.test_shinkai_message_pyo3 +else + echo "maturin develop failed" +fi \ No newline at end of file diff --git a/shinkai-libs/shinkai-message-pyo3/src/lib.rs b/shinkai-libs/shinkai-message-pyo3/src/lib.rs new file mode 100644 index 000000000..864161323 --- /dev/null +++ b/shinkai-libs/shinkai-message-pyo3/src/lib.rs @@ -0,0 +1 @@ +pub mod shinkai_pyo3_wrapper; \ No newline at end of file diff --git a/shinkai-libs/shinkai-message-pyo3/src/main.rs b/shinkai-libs/shinkai-message-pyo3/src/main.rs new file mode 100644 index 000000000..2595a1a72 --- /dev/null +++ b/shinkai-libs/shinkai-message-pyo3/src/main.rs @@ -0,0 +1,7 @@ +pub mod shinkai_pyo3_wrapper; + +use std::error::Error; + +fn main() -> Result<(), Box> { + Ok(()) +} diff --git a/shinkai-libs/shinkai-message-pyo3/src/shinkai_pyo3_wrapper/encryption_method_pyo3.rs b/shinkai-libs/shinkai-message-pyo3/src/shinkai_pyo3_wrapper/encryption_method_pyo3.rs new file mode 100644 index 000000000..22f33edcd --- /dev/null +++ b/shinkai-libs/shinkai-message-pyo3/src/shinkai_pyo3_wrapper/encryption_method_pyo3.rs @@ -0,0 +1,47 @@ +use std::str::FromStr; +use pyo3::exceptions::PyValueError; +use pyo3::{ToPyObject, PyObject, Python, PyErr, pyclass}; +use shinkai_message_primitives::shinkai_utils::encryption::EncryptionMethod; +use pyo3::prelude::*; + +#[pyclass] +#[derive(Clone)] +pub struct PyEncryptionMethod { + pub inner: EncryptionMethod, +} + +#[pymethods] +impl PyEncryptionMethod { + #[new] + #[args(value = "\"None\"")] + pub fn new(value: &str) -> Self { + let inner = match value { + "None" => EncryptionMethod::None, + // Add other cases here for other possible values of EncryptionMethod + _ => panic!("Invalid value for EncryptionMethod"), + }; + PyEncryptionMethod { inner } + } +} + +impl FromStr for PyEncryptionMethod { + type Err = pyo3::PyErr; + + fn from_str(s: &str) -> Result { + let encryption = match s { + "DiffieHellmanChaChaPoly1305" | "default" => EncryptionMethod::DiffieHellmanChaChaPoly1305, + "None" => EncryptionMethod::None, + _ => return Err(PyValueError::new_err("Invalid EncryptionMethod")), + }; + Ok(PyEncryptionMethod { inner: encryption }) + } +} + +impl ToPyObject for PyEncryptionMethod { + fn to_object(&self, py: Python) -> PyObject { + match self.inner { + EncryptionMethod::DiffieHellmanChaChaPoly1305 => "default".to_object(py), + EncryptionMethod::None => "None".to_object(py), + } + } +} \ No newline at end of file diff --git a/shinkai-libs/shinkai-message-pyo3/src/shinkai_pyo3_wrapper/encryption_pyo3.rs b/shinkai-libs/shinkai-message-pyo3/src/shinkai_pyo3_wrapper/encryption_pyo3.rs new file mode 100644 index 000000000..e69de29bb diff --git a/shinkai-libs/shinkai-message-pyo3/src/shinkai_pyo3_wrapper/external_metadata_pyo3.rs b/shinkai-libs/shinkai-message-pyo3/src/shinkai_pyo3_wrapper/external_metadata_pyo3.rs new file mode 100644 index 000000000..9e2962c9d --- /dev/null +++ b/shinkai-libs/shinkai-message-pyo3/src/shinkai_pyo3_wrapper/external_metadata_pyo3.rs @@ -0,0 +1,114 @@ +use pyo3::{exceptions::PyValueError, prelude::*, types::PyDict}; +use shinkai_message_primitives::{ + shinkai_message::shinkai_message::{ + EncryptedShinkaiBody, ExternalMetadata, MessageBody, ShinkaiBody, ShinkaiMessage, ShinkaiVersion, + }, + shinkai_utils::encryption::EncryptionMethod, +}; + +use super::shinkai_message_pyo3::PyExternalMetadata; + +#[pymethods] +impl PyExternalMetadata { + #[new] + fn new(sender: String, recipient: String, scheduled_time: String, signature: String, other: String) -> PyResult { + let inner = ExternalMetadata { + sender, + recipient, + scheduled_time, + signature, + other, + }; + + Ok(Self { inner }) + } + + #[getter] + fn get_sender(&self) -> PyResult { + Ok(self.inner.sender.clone()) + } + + #[setter] + fn set_sender(&mut self, sender: String) { + self.inner.sender = sender; + } + + #[getter] + fn get_recipient(&self) -> PyResult { + Ok(self.inner.recipient.clone()) + } + + #[setter] + fn set_recipient(&mut self, recipient: String) { + self.inner.recipient = recipient; + } + + #[getter] + fn get_scheduled_time(&self) -> PyResult { + Ok(self.inner.scheduled_time.clone()) + } + + #[setter] + fn set_scheduled_time(&mut self, scheduled_time: String) { + self.inner.scheduled_time = scheduled_time; + } + + #[getter] + fn get_signature(&self) -> PyResult { + Ok(self.inner.signature.clone()) + } + + #[setter] + fn set_signature(&mut self, signature: String) { + self.inner.signature = signature; + } + + #[getter] + fn get_other(&self) -> PyResult { + Ok(self.inner.other.clone()) + } + + #[setter] + fn set_other(&mut self, other: String) { + self.inner.other = other; + } +} + +impl<'source> FromPyObject<'source> for PyExternalMetadata { + fn extract(ob: &'source PyAny) -> PyResult { + let s: &str = ob.extract()?; + let parts: Vec<&str> = s.split(',').collect(); + if parts.len() != 5 { + return Err(PyErr::new::( + "Invalid ExternalMetadata format", + )); + } + let sender = parts[0].to_string(); + let recipient = parts[1].to_string(); + let scheduled_time = parts[2].to_string(); + let signature = parts[3].to_string(); + let other = parts[4].to_string(); + Ok(PyExternalMetadata { + inner: ExternalMetadata { + sender, + recipient, + scheduled_time, + signature, + other, + }, + }) + } +} + +impl ToPyObject for PyExternalMetadata { + fn to_object(&self, py: Python) -> PyObject { + let dict = PyDict::new(py); + dict.set_item("sender", self.inner.sender.clone()).unwrap(); + dict.set_item("recipient", self.inner.recipient.clone()).unwrap(); + dict.set_item("scheduled_time", self.inner.scheduled_time.clone()) + .unwrap(); + dict.set_item("signature", self.inner.signature.clone()).unwrap(); + dict.set_item("other", self.inner.other.clone()).unwrap(); + dict.into() + } +} diff --git a/shinkai-libs/shinkai-message-pyo3/src/shinkai_pyo3_wrapper/internal_metadata_pyo3.rs b/shinkai-libs/shinkai-message-pyo3/src/shinkai_pyo3_wrapper/internal_metadata_pyo3.rs new file mode 100644 index 000000000..c69c651aa --- /dev/null +++ b/shinkai-libs/shinkai-message-pyo3/src/shinkai_pyo3_wrapper/internal_metadata_pyo3.rs @@ -0,0 +1,118 @@ +use pyo3::{exceptions::PyValueError, prelude::*, types::PyDict}; +use shinkai_message_primitives::{shinkai_message::shinkai_message::{InternalMetadata}, shinkai_utils::encryption::EncryptionMethod}; +use pyo3::ToPyObject; +use crate::shinkai_pyo3_wrapper::shinkai_message_pyo3::PyInternalMetadata; +use super::encryption_method_pyo3::PyEncryptionMethod; + +#[pymethods] +impl PyInternalMetadata { + #[new] + fn new(sender_subidentity: String, recipient_subidentity: String, inbox: String, signature: String, encryption: Py) -> PyResult { + Python::with_gil(|py| { + let encryption_ref = encryption.as_ref(py).borrow(); + let inner = InternalMetadata { + sender_subidentity, + recipient_subidentity, + inbox, + signature, + encryption: encryption_ref.inner.clone(), + }; + Ok(Self { inner }) + }) + } + + #[getter] + fn get_sender_subidentity(&self) -> PyResult { + Ok(self.inner.sender_subidentity.clone()) + } + + #[setter] + fn set_sender_subidentity(&mut self, sender_subidentity: String) { + self.inner.sender_subidentity = sender_subidentity; + } + + #[getter] + fn get_recipient_subidentity(&self) -> PyResult { + Ok(self.inner.recipient_subidentity.clone()) + } + + #[setter] + fn set_recipient_subidentity(&mut self, recipient_subidentity: String) { + self.inner.recipient_subidentity = recipient_subidentity; + } + + #[getter] + fn get_inbox(&self) -> PyResult { + Ok(self.inner.inbox.clone()) + } + + #[setter] + fn set_inbox(&mut self, inbox: String) { + self.inner.inbox = inbox; + } + + #[getter] + fn get_signature(&self) -> PyResult { + Ok(self.inner.signature.clone()) + } + + #[setter] + fn set_signature(&mut self, signature: String) { + self.inner.signature = signature; + } + + #[getter] + fn get_encryption(&self) -> PyResult> { + Python::with_gil(|py| { + Ok(Py::new(py, PyEncryptionMethod { inner: self.inner.encryption.clone() })?) + }) + } + + #[setter] + fn set_encryption(&mut self, encryption: Py) { + Python::with_gil(|py| { + let encryption_ref = encryption.as_ref(py).borrow(); + self.inner.encryption = encryption_ref.inner.clone(); + }); + } +} + +impl<'source> FromPyObject<'source> for PyInternalMetadata { + fn extract(ob: &'source PyAny) -> PyResult { + let s: &str = ob.extract()?; + let parts: Vec<&str> = s.split(',').collect(); + if parts.len() != 5 { + return Err(PyErr::new::( + "Invalid InternalMetadata format", + )); + } + let sender_subidentity = parts[0].to_string(); + let recipient_subidentity = parts[1].to_string(); + let inbox = parts[2].to_string(); + let signature = parts[3].to_string(); + let encryption_str = parts[4].to_string(); + let encryption = EncryptionMethod::from_str(&encryption_str); + + Ok(PyInternalMetadata { + inner: InternalMetadata { + sender_subidentity, + recipient_subidentity, + inbox, + signature, + encryption, + }, + }) + } +} + +impl ToPyObject for PyInternalMetadata { + fn to_object(&self, py: Python) -> PyObject { + let dict = PyDict::new(py); + dict.set_item("sender_subidentity", self.inner.sender_subidentity.clone()).unwrap(); + dict.set_item("recipient_subidentity", self.inner.recipient_subidentity.clone()).unwrap(); + dict.set_item("inbox", self.inner.inbox.clone()).unwrap(); + dict.set_item("signature", self.inner.signature.clone()).unwrap(); + dict.set_item("encryption", self.inner.encryption.as_str()).unwrap(); + dict.into() + } +} \ No newline at end of file diff --git a/shinkai-libs/shinkai-message-pyo3/src/shinkai_pyo3_wrapper/message_schema_type_pyo3.rs b/shinkai-libs/shinkai-message-pyo3/src/shinkai_pyo3_wrapper/message_schema_type_pyo3.rs new file mode 100644 index 000000000..96b5a331a --- /dev/null +++ b/shinkai-libs/shinkai-message-pyo3/src/shinkai_pyo3_wrapper/message_schema_type_pyo3.rs @@ -0,0 +1,34 @@ +use pyo3::prelude::*; +use pyo3::wrap_pyfunction; +use pyo3::types::PyString; +use shinkai_message_primitives::shinkai_message::shinkai_message_schemas::MessageSchemaType; + +#[pyclass] +#[derive(Debug, Clone)] +pub struct PyMessageSchemaType { + pub inner: MessageSchemaType, +} + +#[pymethods] +impl PyMessageSchemaType { + #[new] + pub fn new(schema_type: String) -> PyResult { + let inner = MessageSchemaType::from_str(&schema_type) + .ok_or_else(|| PyErr::new::("Invalid schema type"))?; + Ok(Self { inner }) + } + + pub fn to_str(&self) -> PyResult<&'static str> { + Ok(self.inner.to_str()) + } + + pub fn is_empty(&self) -> bool { + self.inner.is_empty() + } +} + +#[pymodule] +fn shinkai_message_schemas(_py: Python, m: &PyModule) -> PyResult<()> { + m.add_class::()?; + Ok(()) +} \ No newline at end of file diff --git a/shinkai-libs/shinkai-message-pyo3/src/shinkai_pyo3_wrapper/mod.rs b/shinkai-libs/shinkai-message-pyo3/src/shinkai_pyo3_wrapper/mod.rs new file mode 100644 index 000000000..b103c33bc --- /dev/null +++ b/shinkai-libs/shinkai-message-pyo3/src/shinkai_pyo3_wrapper/mod.rs @@ -0,0 +1,8 @@ +pub mod shinkai_message_pyo3; +pub mod external_metadata_pyo3; +pub mod internal_metadata_pyo3; +pub mod encryption_method_pyo3; +pub mod shinkai_builder_pyo3; +pub mod message_schema_type_pyo3; +pub mod shinkai_schema_pyo3; +pub mod shinkai_name_pyo3; \ No newline at end of file diff --git a/shinkai-libs/shinkai-message-pyo3/src/shinkai_pyo3_wrapper/shinkai_builder_pyo3.rs b/shinkai-libs/shinkai-message-pyo3/src/shinkai_pyo3_wrapper/shinkai_builder_pyo3.rs new file mode 100644 index 000000000..5d4935623 --- /dev/null +++ b/shinkai-libs/shinkai-message-pyo3/src/shinkai_pyo3_wrapper/shinkai_builder_pyo3.rs @@ -0,0 +1,995 @@ +use super::{ + encryption_method_pyo3::PyEncryptionMethod, message_schema_type_pyo3::PyMessageSchemaType, + shinkai_message_pyo3::PyShinkaiMessage, shinkai_schema_pyo3::PyJobScope, +}; +use ed25519_dalek::{PublicKey as SignaturePublicKey, SecretKey as SignatureStaticKey}; +use pyo3::{prelude::*, pyclass, types::PyDict, PyResult}; +use shinkai_message_primitives::{ + schemas::{agents::serialized_agent::SerializedAgent, inbox_name::InboxName, registration_code::RegistrationCode}, + shinkai_message::shinkai_message_schemas::{ + APIAddAgentRequest, APIGetMessagesFromInboxRequest, APIReadUpToTimeRequest, IdentityPermissions, JobCreation, + JobScope, MessageSchemaType, RegistrationCodeRequest, RegistrationCodeType, JobMessage, + }, + shinkai_utils::{ + encryption::{ + encryption_public_key_to_string, string_to_encryption_public_key, string_to_encryption_static_key, + EncryptionMethod, + }, + shinkai_message_builder::ShinkaiMessageBuilder, + signatures::{signature_public_key_to_string, string_to_signature_secret_key}, + }, +}; +use x25519_dalek::{PublicKey as EncryptionPublicKey, StaticSecret as EncryptionStaticKey}; + +#[pyclass] +pub struct PyShinkaiMessageBuilder { + // pub inner: ShinkaiMessageBuilder, + pub inner: Option, +} + +#[pymethods] +impl PyShinkaiMessageBuilder { + #[new] + #[args(my_encryption_secret_key, my_signature_secret_key, receiver_public_key)] + fn new( + my_encryption_secret_key: String, + my_signature_secret_key: String, + receiver_public_key: String, + ) -> PyResult { + let my_encryption_secret_key = string_to_encryption_static_key(&my_encryption_secret_key) + .map_err(|e| PyErr::new::(e))?; + let my_signature_secret_key = string_to_signature_secret_key(&my_signature_secret_key) + .map_err(|e| PyErr::new::(e))?; + let receiver_public_key = string_to_encryption_public_key(&receiver_public_key) + .map_err(|e| PyErr::new::(e))?; + + let inner = ShinkaiMessageBuilder::new(my_encryption_secret_key, my_signature_secret_key, receiver_public_key); + + Ok(Self { inner: Some(inner) }) + } + + fn body_encryption(&mut self, encryption: Py) -> PyResult<()> { + Python::with_gil(|py| { + let encryption_ref = encryption.as_ref(py).borrow(); + if let Some(mut inner) = self.inner.take() { + let new_inner = inner.body_encryption(encryption_ref.inner.clone()); + self.inner = Some(new_inner); + Ok(()) + } else { + Err(PyErr::new::("inner is None")) + } + }) + } + + fn no_body_encryption(&mut self) -> PyResult<()> { + if let Some(inner) = self.inner.take() { + let new_inner = inner.no_body_encryption(); + self.inner = Some(new_inner); + Ok(()) + } else { + Err(PyErr::new::("inner is None")) + } + } + + fn message_raw_content(&mut self, message_raw_content: String) -> PyResult<()> { + if let Some(inner) = self.inner.take() { + let new_inner = inner.message_raw_content(message_raw_content); + self.inner = Some(new_inner); + Ok(()) + } else { + Err(PyErr::new::("inner is None")) + } + } + + fn message_schema_type(&mut self, content: Py) -> PyResult<()> { + Python::with_gil(|py| { + let content_ref = content.as_ref(py).borrow(); + let rust_content = content_ref.inner.clone(); + if let Some(inner) = self.inner.take() { + let mut inner_clone = inner.clone(); + inner_clone.message_schema_type(rust_content); + self.inner = Some(inner); + Ok(()) + } else { + Err(PyErr::new::("inner is None")) + } + }) + } + + fn internal_metadata( + &mut self, + sender_subidentity: String, + recipient_subidentity: String, + encryption: Py, + ) -> PyResult<()> { + Python::with_gil(|py| { + let encryption_ref = encryption.as_ref(py).borrow(); + if let Some(inner) = self.inner.take() { + let new_inner = + inner.internal_metadata(sender_subidentity, recipient_subidentity, encryption_ref.inner.clone()); + self.inner = Some(new_inner); + Ok(()) + } else { + Err(PyErr::new::("inner is None")) + } + }) + } + + fn internal_metadata_with_inbox( + &mut self, + sender_subidentity: String, + recipient_subidentity: String, + inbox: String, + encryption: Py, + ) -> PyResult<()> { + Python::with_gil(|py| { + let encryption_ref = encryption.as_ref(py).borrow(); + if let Some(inner) = self.inner.take() { + let new_inner = inner.internal_metadata_with_inbox( + sender_subidentity, + recipient_subidentity, + inbox, + encryption_ref.inner.clone(), + ); + self.inner = Some(new_inner); + Ok(()) + } else { + Err(PyErr::new::("inner is None")) + } + }) + } + + fn internal_metadata_with_schema( + &mut self, + sender_subidentity: String, + recipient_subidentity: String, + inbox: String, + message_schema: Py, + encryption: Py, + ) -> PyResult<()> { + Python::with_gil(|py| { + let encryption_ref = encryption.as_ref(py).borrow(); + let message_schema_ref = message_schema.as_ref(py).borrow(); + if let Some(inner) = self.inner.take() { + let new_inner = inner.internal_metadata_with_schema( + sender_subidentity, + recipient_subidentity, + inbox, + message_schema_ref.inner.clone(), + encryption_ref.inner.clone(), + ); + self.inner = Some(new_inner); + Ok(()) + } else { + Err(PyErr::new::("inner is None")) + } + }) + } + + fn empty_encrypted_internal_metadata(&mut self) -> PyResult<()> { + if let Some(inner) = self.inner.take() { + let new_inner = inner.empty_encrypted_internal_metadata(); + self.inner = Some(new_inner); + Ok(()) + } else { + Err(PyErr::new::("inner is None")) + } + } + + fn empty_non_encrypted_internal_metadata(&mut self) -> PyResult<()> { + if let Some(inner) = self.inner.take() { + let new_inner = inner.empty_non_encrypted_internal_metadata(); + self.inner = Some(new_inner); + Ok(()) + } else { + Err(PyErr::new::("inner is None")) + } + } + + fn external_metadata(&mut self, recipient: String, sender: String) -> PyResult<()> { + if let Some(inner) = self.inner.take() { + let new_inner = inner.external_metadata(recipient, sender); + self.inner = Some(new_inner); + Ok(()) + } else { + Err(PyErr::new::("inner is None")) + } + } + + fn external_metadata_with_other(&mut self, recipient: String, sender: String, other: String) -> PyResult<()> { + if let Some(inner) = self.inner.take() { + let new_inner = inner.external_metadata_with_other(recipient, sender, other); + self.inner = Some(new_inner); + Ok(()) + } else { + Err(PyErr::new::("inner is None")) + } + } + + fn external_metadata_with_schedule( + &mut self, + recipient: String, + sender: String, + scheduled_time: String, + ) -> PyResult<()> { + if let Some(inner) = self.inner.take() { + let new_inner = inner.external_metadata_with_schedule(recipient, sender, scheduled_time); + self.inner = Some(new_inner); + Ok(()) + } else { + Err(PyErr::new::("inner is None")) + } + } + + fn build(&mut self) -> PyResult { + if let Some(inner) = self.inner.take() { + match inner.build() { + Ok(shinkai_message) => { + self.inner = Some(inner); + Ok(PyShinkaiMessage { inner: shinkai_message }) + } + Err(e) => Err(PyErr::new::(e.to_string())), + } + } else { + Err(PyErr::new::("inner is None")) + } + } + + fn build_to_string(&mut self) -> PyResult { + if let Some(inner) = self.inner.take() { + match inner.build() { + Ok(shinkai_message) => { + self.inner = Some(inner); + serde_json::to_string(&shinkai_message) + .map_err(|e| PyErr::new::(e.to_string())) + } + Err(e) => Err(PyErr::new::(e.to_string())), + } + } else { + Err(PyErr::new::("inner is None")) + } + } + + #[staticmethod] + fn ack_message( + my_encryption_secret_key: String, + my_signature_secret_key: String, + receiver_public_key: String, + sender: String, + receiver: String, + ) -> PyResult { + let mut builder = + PyShinkaiMessageBuilder::new(my_encryption_secret_key, my_signature_secret_key, receiver_public_key)?; + + builder.message_raw_content("ACK".to_string())?; + builder.empty_non_encrypted_internal_metadata()?; + builder.no_body_encryption()?; + builder.external_metadata(receiver, sender)?; + builder.build_to_string() + } + + #[staticmethod] + fn create_custom_shinkai_message_to_node( + my_subidentity_encryption_sk: String, + my_subidentity_signature_sk: String, + receiver_public_key: String, + data: String, + sender: String, + sender_subidentity: String, + recipient: String, + recipient_subidentity: String, + other: String, + schema: Py, + ) -> PyResult { + Python::with_gil(|py| { + let builder_result = PyShinkaiMessageBuilder::new( + my_subidentity_encryption_sk, + my_subidentity_signature_sk, + receiver_public_key, + ); + + match builder_result { + Ok(mut builder) => { + let body_encryption = Py::new( + py, + PyEncryptionMethod { + inner: EncryptionMethod::DiffieHellmanChaChaPoly1305, + }, + )?; + let internal_encryption = Py::new( + py, + PyEncryptionMethod { + inner: EncryptionMethod::None, + }, + )?; + + match builder.message_raw_content(data) { + Ok(_) => (), + Err(e) => return Err(e), + } + + match builder.body_encryption(body_encryption) { + Ok(_) => (), + Err(e) => return Err(e), + } + + match builder.external_metadata_with_other(recipient, sender, other) { + Ok(_) => (), + Err(e) => return Err(e), + } + + match builder.internal_metadata_with_schema( + sender_subidentity, + recipient_subidentity, + "".to_string(), + schema, + internal_encryption, + ) { + Ok(_) => (), + Err(e) => return Err(e), + } + + builder.build_to_string() + } + Err(e) => Err(e), + } + }) + } + + #[staticmethod] + fn request_code_registration( + my_subidentity_encryption_sk: String, + my_subidentity_signature_sk: String, + receiver_public_key: String, + permissions: String, + code_type: String, + sender_subidentity: String, + sender: String, + receiver: String, + ) -> PyResult { + let permissions = IdentityPermissions::from_str(&permissions) + .ok_or_else(|| PyErr::new::("Invalid permissions"))?; + let code_type: RegistrationCodeType = serde_json::from_str(&code_type) + .map_err(|_| PyErr::new::("Invalid code type"))?; + let registration_code_request = RegistrationCodeRequest { permissions, code_type }; + let data = serde_json::to_string(®istration_code_request) + .map_err(|e| PyErr::new::(e.to_string().clone()))?; + + Python::with_gil(|py| { + let schema = Py::new( + py, + PyMessageSchemaType { + inner: MessageSchemaType::CreateRegistrationCode, + }, + )?; + Self::create_custom_shinkai_message_to_node( + my_subidentity_encryption_sk, + my_subidentity_signature_sk, + receiver_public_key, + data, + sender, + sender_subidentity, + receiver.clone(), + receiver, + "".to_string(), + schema, + ) + }) + } + + #[staticmethod] + fn use_code_registration_for_profile( + profile_encryption_sk: String, + profile_signature_sk: String, + receiver_public_key: String, + code: String, + identity_type: String, + permission_type: String, + registration_name: String, + sender: String, + sender_subidentity: String, + recipient: String, + recipient_subidentity: String, + ) -> PyResult { + let profile_encryption_sk_type = match string_to_encryption_static_key(&profile_encryption_sk) { + Ok(key) => key, + Err(_) => { + return Err(PyErr::new::( + "Invalid encryption key", + )) + } + }; + let profile_signature_sk_type = match string_to_signature_secret_key(&profile_signature_sk) { + Ok(key) => key, + Err(_) => return Err(PyErr::new::("Invalid signature key")), + }; + + let profile_signature_pk = ed25519_dalek::PublicKey::from(&profile_signature_sk_type); + let profile_encryption_pk = x25519_dalek::PublicKey::from(&profile_encryption_sk_type); + + let registration_code = RegistrationCode { + code, + registration_name: registration_name.clone(), + device_identity_pk: "".to_string(), + device_encryption_pk: "".to_string(), + profile_identity_pk: signature_public_key_to_string(profile_signature_pk), + profile_encryption_pk: encryption_public_key_to_string(profile_encryption_pk), + identity_type, + permission_type, + }; + + let body = serde_json::to_string(®istration_code) + .map_err(|e| PyErr::new::(e.to_string().clone()))?; + let other = encryption_public_key_to_string(profile_encryption_pk); + + Python::with_gil(|py| { + let schema = Py::new( + py, + PyMessageSchemaType { + inner: MessageSchemaType::TextContent, + }, + )?; + Self::create_custom_shinkai_message_to_node( + profile_encryption_sk, + profile_signature_sk, + receiver_public_key, + body, + sender, + sender_subidentity, + recipient.clone(), + recipient, + other, + schema, + ) + }) + } + + #[staticmethod] + fn use_code_registration_for_device( + my_device_encryption_sk: String, + my_device_signature_sk: String, + profile_encryption_sk: String, + profile_signature_sk: String, + receiver_public_key: String, + code: String, + identity_type: String, + permission_type: String, + registration_name: String, + sender: String, + sender_subidentity: String, + recipient: String, + recipient_subidentity: String, + ) -> PyResult { + let my_subidentity_encryption_sk_type = match string_to_encryption_static_key(&my_device_encryption_sk) { + Ok(key) => key, + Err(_) => { + return Err(PyErr::new::( + "Invalid device encryption key", + )) + } + }; + let my_subidentity_signature_sk_type = match string_to_signature_secret_key(&my_device_signature_sk) { + Ok(key) => key, + Err(_) => { + return Err(PyErr::new::( + "Invalid device signature key", + )) + } + }; + let profile_encryption_sk_type = match string_to_encryption_static_key(&profile_encryption_sk) { + Ok(key) => key, + Err(_) => { + return Err(PyErr::new::( + "Invalid profile encryption key", + )) + } + }; + let profile_signature_sk_type = match string_to_signature_secret_key(&profile_signature_sk) { + Ok(key) => key, + Err(_) => { + return Err(PyErr::new::( + "Invalid profile signature key", + )) + } + }; + + let my_subidentity_signature_pk = ed25519_dalek::PublicKey::from(&my_subidentity_signature_sk_type); + let my_subidentity_encryption_pk = x25519_dalek::PublicKey::from(&my_subidentity_encryption_sk_type); + let profile_signature_pk = ed25519_dalek::PublicKey::from(&profile_signature_sk_type); + let profile_encryption_pk = x25519_dalek::PublicKey::from(&profile_encryption_sk_type); + + let other = encryption_public_key_to_string(my_subidentity_encryption_pk); + let registration_code = RegistrationCode { + code, + registration_name: registration_name.clone(), + device_identity_pk: signature_public_key_to_string(my_subidentity_signature_pk), + device_encryption_pk: other.clone(), + profile_identity_pk: signature_public_key_to_string(profile_signature_pk), + profile_encryption_pk: encryption_public_key_to_string(profile_encryption_pk), + identity_type, + permission_type, + }; + + let body = match serde_json::to_string(®istration_code) { + Ok(body) => body, + Err(e) => return Err(PyErr::new::(e.to_string().clone())), + }; + let other = encryption_public_key_to_string(my_subidentity_encryption_pk); + + Python::with_gil(|py| { + let schema = match Py::new( + py, + PyMessageSchemaType { + inner: MessageSchemaType::TextContent, + }, + ) { + Ok(schema) => schema, + Err(_) => { + return Err(PyErr::new::( + "Failed to create schema", + )) + } + }; + Self::create_custom_shinkai_message_to_node( + my_device_encryption_sk, + my_device_signature_sk, + receiver_public_key, + body, + sender, + sender_subidentity, + recipient.clone(), + recipient, + other, + schema, + ) + }) + } + + #[staticmethod] + fn get_last_messages_from_inbox( + my_subidentity_encryption_sk: String, + my_subidentity_signature_sk: String, + receiver_public_key: String, + inbox: String, + count: usize, + sender: String, + sender_subidentity: String, + recipient: String, + recipient_subidentity: String, + offset: Option, + ) -> PyResult { + let inbox_name = match InboxName::new(inbox.clone()) { + Ok(name) => name, + Err(_) => return Err(PyErr::new::("Invalid inbox name")), + }; + let get_last_messages_from_inbox = APIGetMessagesFromInboxRequest { + inbox: inbox_name.to_string(), + count, + offset, + }; + + let body = match serde_json::to_string(&get_last_messages_from_inbox) { + Ok(body) => body, + Err(e) => return Err(PyErr::new::(e.to_string().clone())), + }; + + Python::with_gil(|py| { + let schema = match Py::new( + py, + PyMessageSchemaType { + inner: MessageSchemaType::APIGetMessagesFromInboxRequest, + }, + ) { + Ok(schema) => schema, + Err(_) => { + return Err(PyErr::new::( + "Failed to create schema", + )) + } + }; + Self::create_custom_shinkai_message_to_node( + my_subidentity_encryption_sk, + my_subidentity_signature_sk, + receiver_public_key, + body, + sender, + sender_subidentity, + recipient.clone(), + recipient, + "".to_string(), + schema, + ) + }) + } + + #[staticmethod] + fn get_last_unread_messages_from_inbox( + my_subidentity_encryption_sk: String, + my_subidentity_signature_sk: String, + receiver_public_key: String, + inbox: String, + count: usize, + offset: Option, + sender: String, + sender_subidentity: String, + recipient: String, + recipient_subidentity: String, + ) -> PyResult { + let inbox_name = match InboxName::new(inbox.clone()) { + Ok(name) => name, + Err(_) => return Err(PyErr::new::("Invalid inbox name")), + }; + let get_last_unread_messages_from_inbox = APIGetMessagesFromInboxRequest { + inbox: inbox_name.to_string(), + count, + offset, + }; + + let body = match serde_json::to_string(&get_last_unread_messages_from_inbox) { + Ok(body) => body, + Err(e) => return Err(PyErr::new::(e.to_string().clone())), + }; + + Python::with_gil(|py| { + let schema = match Py::new( + py, + PyMessageSchemaType { + inner: MessageSchemaType::APIGetMessagesFromInboxRequest, + }, + ) { + Ok(schema) => schema, + Err(_) => { + return Err(PyErr::new::( + "Failed to create schema", + )) + } + }; + Self::create_custom_shinkai_message_to_node( + my_subidentity_encryption_sk, + my_subidentity_signature_sk, + receiver_public_key, + body, + sender, + sender_subidentity, + recipient.clone(), + recipient, + "".to_string(), + schema, + ) + }) + } + + #[staticmethod] + fn request_add_agent( + my_subidentity_encryption_sk: String, + my_subidentity_signature_sk: String, + receiver_public_key: String, + agent_json: &str, + sender: String, + sender_subidentity: String, + recipient: String, + recipient_subidentity: String, + ) -> PyResult { + let agent: SerializedAgent = match serde_json::from_str(agent_json) { + Ok(agent) => agent, + Err(_) => { + return Err(PyErr::new::( + "Failed to deserialize agent from JSON", + )) + } + }; + + let add_agent_request = APIAddAgentRequest { agent }; + let body = match serde_json::to_string(&add_agent_request) { + Ok(body) => body, + Err(e) => return Err(PyErr::new::(e.to_string().clone())), + }; + + Python::with_gil(|py| { + let schema = match Py::new( + py, + PyMessageSchemaType { + inner: MessageSchemaType::APIAddAgentRequest, + }, + ) { + Ok(schema) => schema, + Err(_) => { + return Err(PyErr::new::( + "Failed to create schema", + )) + } + }; + Self::create_custom_shinkai_message_to_node( + my_subidentity_encryption_sk, + my_subidentity_signature_sk, + receiver_public_key, + body, + sender, + sender_subidentity, + recipient.clone(), + recipient, + "".to_string(), + schema, + ) + }) + } + + #[staticmethod] + fn read_up_to_time( + my_subidentity_encryption_sk: String, + my_subidentity_signature_sk: String, + receiver_public_key: String, + inbox: String, + up_to_time: String, + sender: String, + sender_subidentity: String, + recipient: String, + recipient_subidentity: String, + ) -> PyResult { + let inbox_name = match InboxName::new(inbox.clone()) { + Ok(name) => name, + Err(_) => return Err(PyErr::new::("Invalid inbox name")), + }; + let read_up_to_time = APIReadUpToTimeRequest { inbox_name, up_to_time }; + + let body = match serde_json::to_string(&read_up_to_time) { + Ok(body) => body, + Err(e) => return Err(PyErr::new::(e.to_string().clone())), + }; + + Python::with_gil(|py| { + let schema = match Py::new( + py, + PyMessageSchemaType { + inner: MessageSchemaType::APIReadUpToTimeRequest, + }, + ) { + Ok(schema) => schema, + Err(_) => { + return Err(PyErr::new::( + "Failed to create schema", + )) + } + }; + Self::create_custom_shinkai_message_to_node( + my_subidentity_encryption_sk, + my_subidentity_signature_sk, + receiver_public_key, + body, + sender, + sender_subidentity, + recipient.clone(), + recipient, + "".to_string(), + schema, + ) + }) + } + + #[staticmethod] + fn ping_pong_message( + message: String, + my_encryption_secret_key: String, + my_signature_secret_key: String, + receiver_public_key: String, + sender: String, + receiver: String, + ) -> PyResult { + if message != "Ping" && message != "Pong" { + return Err(PyErr::new::( + "Invalid message: must be 'Ping' or 'Pong'", + )); + } + + let mut builder = match PyShinkaiMessageBuilder::new( + my_encryption_secret_key, + my_signature_secret_key, + receiver_public_key, + ) { + Ok(builder) => builder, + Err(e) => return Err(e), + }; + + let _ = builder.message_raw_content(message); + let _ = builder.empty_non_encrypted_internal_metadata(); + let _ = builder.no_body_encryption(); + let _ = builder.external_metadata(receiver, sender); + + builder.build_to_string() + } + + #[staticmethod] + fn job_creation( + my_encryption_secret_key: String, + my_signature_secret_key: String, + receiver_public_key: String, + scope: Py, + sender: String, + receiver: String, + receiver_subidentity: String, + ) -> PyResult { + Python::with_gil(|py| { + let scope: PyJobScope = match scope.extract(py) { + Ok(scope) => scope, + Err(_) => { + return Err(PyErr::new::( + "Failed to deserialize scope from JSON", + )) + } + }; + + let job_creation = JobCreation { scope: scope.inner }; + let body = match serde_json::to_string(&job_creation) { + Ok(body) => body, + Err(e) => return Err(PyErr::new::(e.to_string().clone())), + }; + + let mut builder = match PyShinkaiMessageBuilder::new( + my_encryption_secret_key, + my_signature_secret_key, + receiver_public_key, + ) { + Ok(builder) => builder, + Err(e) => return Err(e), + }; + + let message_schema = match Py::new(py, PyMessageSchemaType::new("JobCreationSchema".to_string())?) { + Ok(schema) => schema, + Err(_) => { + return Err(PyErr::new::( + "Failed to create message schema", + )) + } + }; + + let encryption = match Py::new(py, PyEncryptionMethod::new("None")) { + Ok(encryption) => encryption, + Err(_) => { + return Err(PyErr::new::( + "Failed to create encryption method", + )) + } + }; + + let _ = builder.message_raw_content(body); + let _ = builder.internal_metadata_with_schema( + "".to_string(), + receiver_subidentity.clone(), + "".to_string(), + message_schema, + encryption, + ); + let _ = builder.no_body_encryption(); + let _ = builder.external_metadata(receiver, sender); + + builder.build_to_string() + }) + } + + #[staticmethod] + pub fn job_message( + job_id: String, + content: String, + my_encryption_secret_key: String, + my_signature_secret_key: String, + receiver_public_key: String, + sender: String, + receiver: String, + receiver_subidentity: String, + ) -> PyResult { + Python::with_gil(|py| { + let job_id_clone = job_id.clone(); + let job_message = JobMessage { job_id, content }; + + let body = match serde_json::to_string(&job_message) { + Ok(body) => body, + Err(e) => return Err(PyErr::new::(e.to_string().clone())), + }; + + let mut builder = match PyShinkaiMessageBuilder::new( + my_encryption_secret_key, + my_signature_secret_key, + receiver_public_key, + ) { + Ok(builder) => builder, + Err(e) => return Err(e), + }; + + let inbox = match InboxName::get_job_inbox_name_from_params(job_id_clone) { + Ok(inbox) => inbox.to_string(), + Err(e) => return Err(PyErr::new::(e.to_string().clone())), + }; + + let message_schema = match Py::new( + py, + PyMessageSchemaType { + inner: MessageSchemaType::JobMessageSchema, + }, + ) { + Ok(schema) => schema, + Err(_) => { + return Err(PyErr::new::( + "Failed to create message schema", + )) + } + }; + + let encryption = match Py::new(py, PyEncryptionMethod::new("None")) { + Ok(encryption) => encryption, + Err(_) => { + return Err(PyErr::new::( + "Failed to create encryption method", + )) + } + }; + + let _ = builder.message_raw_content(body); + let _ = builder.internal_metadata_with_schema( + "".to_string(), + receiver_subidentity.clone(), + inbox, + message_schema, + encryption, + ); + let _ = builder.no_body_encryption(); + let _ = builder.external_metadata(receiver, sender); + + builder.build_to_string() + }) + } + + #[staticmethod] +pub fn terminate_message( + my_encryption_secret_key: String, + my_signature_secret_key: String, + receiver_public_key: String, + sender: String, + receiver: String, +) -> PyResult { + Python::with_gil(|py| { + let mut builder = match PyShinkaiMessageBuilder::new( + my_encryption_secret_key, + my_signature_secret_key, + receiver_public_key, + ) { + Ok(builder) => builder, + Err(e) => return Err(e), + }; + + let _ = builder.message_raw_content("terminate".to_string()); + let _ = builder.empty_non_encrypted_internal_metadata(); + let _ = builder.no_body_encryption(); + let _ = builder.external_metadata(receiver, sender); + + builder.build_to_string() + }) +} + +#[staticmethod] +pub fn error_message( + my_encryption_secret_key: String, + my_signature_secret_key: String, + receiver_public_key: String, + sender: String, + receiver: String, + error_msg: String, +) -> PyResult { + Python::with_gil(|py| { + let mut builder = match PyShinkaiMessageBuilder::new( + my_encryption_secret_key, + my_signature_secret_key, + receiver_public_key, + ) { + Ok(builder) => builder, + Err(e) => return Err(e), + }; + + let _ = builder.message_raw_content(format!("{{error: \"{}\"}}", error_msg)); + let _ = builder.empty_encrypted_internal_metadata(); + let _ = builder.no_body_encryption(); + let _ = builder.external_metadata(receiver, sender); + + builder.build_to_string() + }) +} +} diff --git a/shinkai-libs/shinkai-message-pyo3/src/shinkai_pyo3_wrapper/shinkai_message_pyo3.rs b/shinkai-libs/shinkai-message-pyo3/src/shinkai_pyo3_wrapper/shinkai_message_pyo3.rs new file mode 100644 index 000000000..260b79db5 --- /dev/null +++ b/shinkai-libs/shinkai-message-pyo3/src/shinkai_pyo3_wrapper/shinkai_message_pyo3.rs @@ -0,0 +1,285 @@ +use pyo3::{exceptions::PyValueError, prelude::*, types::PyDict}; +use shinkai_message_primitives::{ + shinkai_message::shinkai_message::{ + EncryptedShinkaiBody, ExternalMetadata, MessageBody, ShinkaiBody, ShinkaiMessage, ShinkaiVersion, InternalMetadata, + }, + shinkai_utils::encryption::EncryptionMethod, +}; + +use super::shinkai_builder_pyo3::PyShinkaiMessageBuilder; + +#[pymodule] +fn shinkai_message_pyo3(_py: Python, m: &PyModule) -> PyResult<()> { + m.add_class::()?; + m.add_class::()?; + m.add_class::()?; + m.add_class::()?; + // Add any other classes or functions you want to expose to Python here + Ok(()) +} + +#[pyclass] +pub struct PyShinkaiMessage { + pub inner: ShinkaiMessage, +} + +#[pyclass] +pub struct PyExternalMetadata { + pub inner: ExternalMetadata, +} + +#[pyclass] +pub struct PyInternalMetadata { + pub inner: InternalMetadata, +} + +// #[pymethods] +// impl PyShinkaiMessage { +// #[new] +// #[args(kwargs = "**")] +// fn new(kwargs: Option<&PyDict>) -> PyResult { +// // Initialize your PyShinkaiMessage here using kwargs if necessary +// // For now, let's just use the default +// Ok(Self { +// inner: Default::default(), +// }) +// } + +// #[getter] +// fn get_external_metadata(&self) -> PyResult { +// Ok(PyExternalMetadata { +// inner: self.inner.external_metadata.clone(), +// }) +// } + +// #[setter] +// fn set_external_metadata(&mut self, py_external_metadata: PyExternalMetadata) { +// self.inner.external_metadata = py_external_metadata.inner; +// } + +// // ... rest of your methods here, replacing [self](file:///Users/nijaar/shinkai/develop/shinkai-node/src/network/node_error.rs#11%2C13-11%2C13) with `self.inner` +// } + +// // Previous Approach 2 + +// #[pymethods] +// impl ShinkaiMessage { +// #[getter] +// fn get_body(&self) -> PyResult { +// Ok(self.body.clone()) +// } + +// #[setter] +// fn set_body(&mut self, body: MessageBody) { +// self.body = body; +// } + +// #[getter] +// fn get_external_metadata(&self) -> PyResult { +// Ok(self.external_metadata.clone()) +// } + +// #[setter] +// fn set_external_metadata(&mut self, external_metadata: ExternalMetadata) { +// self.external_metadata = external_metadata; +// } + +// #[getter] +// fn get_encryption(&self) -> PyResult { +// Ok(self.encryption.clone()) +// } + +// #[setter] +// fn set_encryption(&mut self, encryption: EncryptionMethod) { +// self.encryption = encryption; +// } + +// #[getter] +// fn get_version(&self) -> PyResult { +// Ok(self.version.clone()) +// } + +// #[setter] +// fn set_version(&mut self, version: ShinkaiVersion) { +// self.version = version; +// } +// } + +// Previous Approach +// +// #[pyclass] +// #[derive(Clone)] +// struct PyEncryptionMethod { +// value: EncryptionMethod, +// } + +// #[pymethods] +// impl PyEncryptionMethod { +// #[new] +// fn new(value: String) -> Self { +// let method = match value.as_str() { +// "DiffieHellmanChaChaPoly1305" | "default" => EncryptionMethod::DiffieHellmanChaChaPoly1305, +// _ => EncryptionMethod::None, +// }; + +// PyEncryptionMethod { value: method } +// } + +// #[getter] +// fn value(&self) -> String { +// match self.value { +// EncryptionMethod::DiffieHellmanChaChaPoly1305 => String::from("DiffieHellmanChaChaPoly1305"), +// EncryptionMethod::None => String::from("None"), +// } +// } +// } + +// #[pyclass] +// #[derive(Clone)] +// struct PyShinkaiVersion { +// value: ShinkaiVersion, +// } + +// #[pyclass] +// #[derive(Clone)] +// pub struct PyMessageBody { +// value: MessageBody, +// } + +// #[pyclass] +// #[derive(Clone)] +// struct PyInternalMetadata { +// #[pyo3(get, set)] +// sender_subidentity: String, +// #[pyo3(get, set)] +// recipient_subidentity: String, +// #[pyo3(get, set)] +// inbox: String, +// #[pyo3(get, set)] +// signature: String, +// #[pyo3(get, set)] +// encryption: PyEncryptionMethod, // Assuming you have this class defined +// } + +// #[pyclass] +// #[derive(Clone)] +// struct PyExternalMetadata { +// #[pyo3(get, set)] +// sender: String, +// #[pyo3(get, set)] +// recipient: String, +// #[pyo3(get, set)] +// scheduled_time: String, +// #[pyo3(get, set)] +// signature: String, +// #[pyo3(get, set)] +// other: String, +// } + +// #[pyclass] +// #[derive(Clone)] +// struct PyShinkaiMessage { +// #[pyo3(get, set)] +// body: PyMessageBody, +// #[pyo3(get, set)] +// external_metadata: PyExternalMetadata, +// #[pyo3(get, set)] +// encryption: PyEncryptionMethod, +// #[pyo3(get, set)] +// version: PyShinkaiVersion, +// } + +// #[pymodule] +// fn shinkai_message_pyo3(_py: Python, m: &PyModule) -> PyResult<()> { +// #[pymethods] +// impl PyInternalMetadata { +// #[new] +// fn new( +// sender_subidentity: String, +// recipient_subidentity: String, +// inbox: String, +// signature: String, +// encryption: PyEncryptionMethod, +// ) -> Self { +// PyInternalMetadata { +// sender_subidentity, +// recipient_subidentity, +// inbox, +// signature, +// encryption, +// } +// } +// } + +// #[pymethods] +// impl PyExternalMetadata { +// #[new] +// fn new(sender: String, recipient: String, scheduled_time: String, signature: String, other: String) -> Self { +// PyExternalMetadata { +// sender, +// recipient, +// scheduled_time, +// signature, +// other, +// } +// } +// } + +// #[pymethods] +// impl PyShinkaiVersion { +// #[new] +// #[args(value = "String::from(\"V1_0\")")] +// fn new(value: String) -> Self { +// let version = match value.as_str() { +// "V1_0" => ShinkaiVersion::V1_0, +// _ => ShinkaiVersion::Unsupported, +// }; + +// PyShinkaiVersion { value: version } +// } + +// #[getter] +// fn value(&self) -> String { +// match self.value { +// ShinkaiVersion::V1_0 => String::from("V1_0"), +// ShinkaiVersion::Unsupported => String::from("Unsupported"), +// } +// } +// } + +// Ok(()) +// } + +// #[pymethods] +// impl PyMessageBody { +// #[new] +// fn new(value: String, body: PyObject) -> PyResult { +// let py = body.py(); +// let value = match value.as_str() { +// "encrypted" => MessageBody::Encrypted(body.extract::(py)?), +// "unencrypted" => MessageBody::Unencrypted(body.extract::(py)?), +// _ => return Err(PyValueError::new_err("Invalid value")), +// }; + +// Ok(PyMessageBody { value }) +// } + +// #[getter] +// fn value(&self) -> PyResult { +// match &self.value { +// MessageBody::Encrypted(_) => Ok(String::from("encrypted")), +// MessageBody::Unencrypted(_) => Ok(String::from("unencrypted")), +// } +// } + +// #[getter] +// fn body(&self) -> PyResult { +// let gil_guard = Python::acquire_gil(); +// let py = gil_guard.python(); + +// match &self.value { +// MessageBody::Encrypted(body) => Ok(body.into_py(py)), +// MessageBody::Unencrypted(body) => Ok(body.into_py(py)), +// } +// } +// } diff --git a/shinkai-libs/shinkai-message-pyo3/src/shinkai_pyo3_wrapper/shinkai_name_pyo3.rs b/shinkai-libs/shinkai-message-pyo3/src/shinkai_pyo3_wrapper/shinkai_name_pyo3.rs new file mode 100644 index 000000000..a5eeccca4 --- /dev/null +++ b/shinkai-libs/shinkai-message-pyo3/src/shinkai_pyo3_wrapper/shinkai_name_pyo3.rs @@ -0,0 +1,55 @@ +use pyo3::{PyResult, FromPyObject, types::PyString, PyAny}; +use shinkai_message_primitives::schemas::inbox_name::{InboxName, InboxNameError}; +use pyo3::prelude::*; + +#[pyclass] +pub struct PyInboxName { + pub inner: InboxName, +} + +#[pymethods] +impl PyInboxName { + #[new] + fn new(name: &str) -> PyResult { + match InboxName::new(name.to_string()) { + Ok(inbox_name) => Ok(PyInboxName { + inner: inbox_name, + }), + Err(err) => Err(PyErr::new::(err.to_string())), + } + } + + #[getter] + fn get_inner(&self) -> PyResult { + Ok(self.inner.to_string()) + } + + #[setter] + fn set_inner(&mut self, value: String) -> PyResult<()> { + match InboxName::new(value) { + Ok(inbox_name) => { + self.inner = inbox_name; + Ok(()) + }, + Err(err) => Err(PyErr::new::(err.to_string())), + } + } +} + +#[pyclass] +pub struct PyInboxNameError { + pub inner: InboxNameError, +} + +impl From for PyErr { + fn from(err: PyInboxNameError) -> Self { + PyErr::new::(err.inner.to_string()) + } +} + +impl<'source> FromPyObject<'source> for PyInboxName { + fn extract(ob: &'source PyAny) -> PyResult { + let s = ob.downcast::()?.to_str()?.to_owned(); + PyInboxName::new(&s) + } +} diff --git a/shinkai-libs/shinkai-message-pyo3/src/shinkai_pyo3_wrapper/shinkai_schema_pyo3.rs b/shinkai-libs/shinkai-message-pyo3/src/shinkai_pyo3_wrapper/shinkai_schema_pyo3.rs new file mode 100644 index 000000000..93291e5b4 --- /dev/null +++ b/shinkai-libs/shinkai-message-pyo3/src/shinkai_pyo3_wrapper/shinkai_schema_pyo3.rs @@ -0,0 +1,53 @@ +use pyo3::prelude::*; +use pyo3::types::IntoPyDict; +use serde_json::Result; +use shinkai_message_primitives::{shinkai_message::shinkai_message_schemas::{JobScope, JobCreation}, schemas::inbox_name::InboxName}; + +use super::shinkai_name_pyo3::PyInboxName; + +#[pyclass] +#[derive(Clone)] +pub struct PyJobScope { + pub inner: JobScope, +} + +#[pymethods] +impl PyJobScope { + #[new] + #[args(buckets = "None", documents = "None")] + fn new(buckets: Option>, documents: Option>) -> Self { + PyJobScope { + inner: JobScope { + buckets: buckets.unwrap_or_else(Vec::::new).into_iter().map(|py_inbox_name| py_inbox_name.inner).collect(), + documents: documents.unwrap_or_else(Vec::new), + }, + } + } + + fn to_bytes(&self) -> PyResult> { + let j = serde_json::to_string(&self.inner).map_err(|e| PyErr::new::(e.to_string()))?; + Ok(j.into_bytes()) + } + + #[staticmethod] + fn from_bytes(bytes: &[u8]) -> PyResult { + let job_scope = serde_json::from_slice(bytes).map_err(|e| PyErr::new::(e.to_string()))?; + Ok(PyJobScope { inner: job_scope }) + } + + #[staticmethod] + fn from_json_str(s: &str) -> PyResult { + let job_scope = serde_json::from_str(s).map_err(|e| PyErr::new::(e.to_string()))?; + Ok(PyJobScope { inner: job_scope }) + } + + fn to_json_str(&self) -> PyResult { + let json_str = serde_json::to_string(&self.inner).map_err(|e| PyErr::new::(e.to_string()))?; + Ok(json_str) + } +} + +#[pyclass] +pub struct PyJobCreation { + pub inner: JobCreation, +} diff --git a/shinkai-libs/shinkai-message-pyo3/tests/__init__.py b/shinkai-libs/shinkai-message-pyo3/tests/__init__.py new file mode 100644 index 000000000..e69de29bb diff --git a/shinkai-libs/shinkai-message-pyo3/tests/test_shinkai_message_pyo3.py b/shinkai-libs/shinkai-message-pyo3/tests/test_shinkai_message_pyo3.py new file mode 100644 index 000000000..99bdaddbf --- /dev/null +++ b/shinkai-libs/shinkai-message-pyo3/tests/test_shinkai_message_pyo3.py @@ -0,0 +1,39 @@ +import unittest +import shinkai_message_pyo3 +import json + +class TestShinkaiMessagePyO3(unittest.TestCase): + def test_ack_message(self): + my_encryption_secret_key = "d83f619804a92fdb4057192dc43dd748ea778adc52bc498ce80524c014b81159" + my_signature_secret_key = "df3f619804a92fdb4057192dc43dd748ea778adc52bc498ce80524c014b81119" + receiver_public_key = "798cbd64d78c4a0fba338b2a6349634940dc4e5b601db1029e02c41e0fe05679" + sender = "@@sender.shinkai" + receiver = "@@receiver.shinkai" + + result = shinkai_message_pyo3.PyShinkaiMessageBuilder.ack_message( + my_encryption_secret_key, + my_signature_secret_key, + receiver_public_key, + sender, + receiver + ) + + # print("Result of ack_message:", result) + + # Parse the result as a JSON object + result_json = json.loads(result) + + # Add assertions to check the fields of the result + self.assertEqual(result_json["body"]["unencrypted"]["message_data"]["unencrypted"]["message_raw_content"], "ACK") + self.assertEqual(result_json["body"]["unencrypted"]["message_data"]["unencrypted"]["message_content_schema"], "Empty") + self.assertEqual(result_json["body"]["unencrypted"]["internal_metadata"]["sender_subidentity"], "") + self.assertEqual(result_json["body"]["unencrypted"]["internal_metadata"]["recipient_subidentity"], "") + self.assertEqual(result_json["body"]["unencrypted"]["internal_metadata"]["inbox"], "inbox::@@receiver.shinkai::@@sender.shinkai::false") + self.assertEqual(result_json["body"]["unencrypted"]["internal_metadata"]["encryption"], "None") + self.assertEqual(result_json["external_metadata"]["sender"], "@@sender.shinkai") + self.assertEqual(result_json["external_metadata"]["recipient"], "@@receiver.shinkai") + self.assertEqual(result_json["encryption"], "None") + self.assertEqual(result_json["version"], "V1_0") + +if __name__ == '__main__': + unittest.main() \ No newline at end of file diff --git a/shinkai-libs/shinkai-message-wasm/tests/shinkai_message_tests.rs b/shinkai-libs/shinkai-message-wasm/tests/shinkai_message_tests.rs index 04a10c4f5..c49fb3038 100644 --- a/shinkai-libs/shinkai-message-wasm/tests/shinkai_message_tests.rs +++ b/shinkai-libs/shinkai-message-wasm/tests/shinkai_message_tests.rs @@ -28,135 +28,6 @@ mod tests { use shinkai_message_wasm::ShinkaiMessageWrapper; use wasm_bindgen_test::*; - #[test] - fn test_encode_decode_message() { - // Initialize the message - let (my_encryption_secret_key, my_encryption_public_key) = unsafe_deterministic_encryption_keypair(0); - let (my_signature_secret_key, my_signature_public_key) = unsafe_deterministic_signature_keypair(0); - let receiver_public_key = my_encryption_public_key.clone(); - - let message = ShinkaiMessageBuilder::new( - my_encryption_secret_key.clone(), - clone_signature_secret_key(&my_signature_secret_key), - receiver_public_key, - ) - .message_raw_content("Hello World".to_string()) - .body_encryption(EncryptionMethod::None) - .message_schema_type(MessageSchemaType::TextContent) - .internal_metadata_with_inbox( - "".to_string(), - "main_profile_node1".to_string(), - "inbox::@@node1.shinkai::@@node1.shinkai/main_profile_node1::false".to_string(), - EncryptionMethod::None, - ) - .external_metadata_with_schedule( - "@@node1.shinkai".to_string(), - "@@node1.shinkai".to_string(), - "2023-07-02T20:53:34Z".to_string(), - ) - .build() - .unwrap(); - - // Encode the message - let encoded_message = message.encode_message().unwrap(); - - // Decode the message - let decoded_message = ShinkaiMessage::decode_message_result(encoded_message).unwrap(); - - // Check if the original and decoded messages are the same - assert_eq!( - message.calculate_message_hash(), - decoded_message.calculate_message_hash() - ); - } - - #[test] - fn test_serde_encode_decode_message() { - // Initialize the message - let (my_encryption_secret_key, my_encryption_public_key) = unsafe_deterministic_encryption_keypair(0); - let (my_signature_secret_key, my_signature_public_key) = unsafe_deterministic_signature_keypair(0); - let receiver_public_key = my_encryption_public_key.clone(); - - let message = ShinkaiMessageBuilder::new( - my_encryption_secret_key.clone(), - clone_signature_secret_key(&my_signature_secret_key), - receiver_public_key, - ) - .message_raw_content("Hello World".to_string()) - .body_encryption(EncryptionMethod::DiffieHellmanChaChaPoly1305) - .message_schema_type(MessageSchemaType::TextContent) - .internal_metadata_with_inbox( - "".to_string(), - "main_profile_node1".to_string(), - "inbox::@@node1.shinkai::@@node1.shinkai/main_profile_node1::false".to_string(), - EncryptionMethod::None, - ) - .external_metadata_with_schedule( - "@@node1.shinkai".to_string(), - "@@node1.shinkai".to_string(), - "2023-07-02T20:53:34Z".to_string(), - ) - .build() - .unwrap(); - - // Serialize the message to a JSON string - let serialized_message = serde_json::to_string(&message).unwrap(); - - // Deserialize the JSON string back to a ShinkaiMessage - let deserialized_message: ShinkaiMessage = serde_json::from_str(&serialized_message).unwrap(); - - // Check if the original and deserialized messages are the same - assert_eq!( - message.calculate_message_hash(), - deserialized_message.calculate_message_hash() - ); - } - - #[test] - fn test_serde_encode_decode_message_with_decode_message_result() { - // Initialize the message - let (my_encryption_secret_key, my_encryption_public_key) = unsafe_deterministic_encryption_keypair(0); - let (my_signature_secret_key, my_signature_public_key) = unsafe_deterministic_signature_keypair(0); - let receiver_public_key = my_encryption_public_key.clone(); - - let message = ShinkaiMessageBuilder::new( - my_encryption_secret_key.clone(), - clone_signature_secret_key(&my_signature_secret_key), - receiver_public_key, - ) - .message_raw_content("Hello World".to_string()) - .body_encryption(EncryptionMethod::None) - .message_schema_type(MessageSchemaType::TextContent) - .internal_metadata_with_inbox( - "".to_string(), - "main_profile_node1".to_string(), - "inbox::@@node1.shinkai::@@node1.shinkai/main_profile_node1::false".to_string(), - EncryptionMethod::DiffieHellmanChaChaPoly1305, - ) - .external_metadata_with_schedule( - "@@node1.shinkai".to_string(), - "@@node1.shinkai".to_string(), - "2023-07-02T20:53:34Z".to_string(), - ) - .build() - .unwrap(); - - // Serialize the message to a JSON string - let serialized_message = serde_json::to_string(&message).unwrap(); - - // Convert the JSON string to bytes - let serialized_message_bytes = serialized_message.into_bytes(); - - // Deserialize the JSON string back to a ShinkaiMessage using decode_message_result - let deserialized_message = ShinkaiMessage::decode_message_result(serialized_message_bytes).unwrap(); - - // Check if the original and deserialized messages are the same - assert_eq!( - message.calculate_message_hash(), - deserialized_message.calculate_message_hash() - ); - } - #[cfg(target_arch = "wasm32")] #[wasm_bindgen_test] fn test_wasm_serde_encode_decode_message_with_decode_message_result() {