The world's most clever kitty cat

Load and Dump chain commands

bwc9876.dev 032de680 c158cdd6

verified
+930 -9
+726 -4
Cargo.lock
··· 131 131 "colog", 132 132 "fastrand", 133 133 "log", 134 + "reqwest", 134 135 "rmp-serde", 135 136 "rustls", 136 137 "serde", ··· 170 171 ] 171 172 172 173 [[package]] 174 + name = "bumpalo" 175 + version = "3.20.2" 176 + source = "registry+https://github.com/rust-lang/crates.io-index" 177 + checksum = "5d20789868f4b01b2f2caec9f5c4e0213b41e3e5702a50157d699ae31ced2fcb" 178 + 179 + [[package]] 173 180 name = "bytes" 174 181 version = "1.11.1" 175 182 source = "registry+https://github.com/rust-lang/crates.io-index" ··· 200 207 checksum = "9330f8b2ff13f34540b44e946ef35111825727b38d33286ef986142615121801" 201 208 202 209 [[package]] 210 + name = "cfg_aliases" 211 + version = "0.2.1" 212 + source = "registry+https://github.com/rust-lang/crates.io-index" 213 + checksum = "613afe47fcd5fac7ccf1db93babcb082c5994d996f20b8b159f2ad1658eb5724" 214 + 215 + [[package]] 203 216 name = "cmake" 204 217 version = "0.1.57" 205 218 source = "registry+https://github.com/rust-lang/crates.io-index" ··· 242 255 dependencies = [ 243 256 "bytes", 244 257 "memchr", 258 + ] 259 + 260 + [[package]] 261 + name = "core-foundation" 262 + version = "0.9.4" 263 + source = "registry+https://github.com/rust-lang/crates.io-index" 264 + checksum = "91e195e091a93c46f7102ec7818a2aa394e1e1771c3ab4825963fa03e45afb8f" 265 + dependencies = [ 266 + "core-foundation-sys", 267 + "libc", 245 268 ] 246 269 247 270 [[package]] ··· 270 293 ] 271 294 272 295 [[package]] 296 + name = "displaydoc" 297 + version = "0.2.5" 298 + source = "registry+https://github.com/rust-lang/crates.io-index" 299 + checksum = "97369cbbc041bc366949bc74d34658d6cda5621039731c6310521892a3a20ae0" 300 + dependencies = [ 301 + "proc-macro2", 302 + "quote", 303 + "syn", 304 + ] 305 + 306 + [[package]] 273 307 name = "dunce" 274 308 version = "1.0.5" 275 309 source = "registry+https://github.com/rust-lang/crates.io-index" 276 310 checksum = "92773504d58c093f6de2459af4af33faa518c13451eb8f2b5698ed3d36e7c813" 311 + 312 + [[package]] 313 + name = "encoding_rs" 314 + version = "0.8.35" 315 + source = "registry+https://github.com/rust-lang/crates.io-index" 316 + checksum = "75030f3c4f45dafd7586dd6780965a8c7e8e285a5ecb86713e63a79c5b2766f3" 317 + dependencies = [ 318 + "cfg-if", 319 + ] 277 320 278 321 [[package]] 279 322 name = "env_filter" ··· 333 376 checksum = "3f9eec918d3f24069decb9af1554cad7c880e2da24a9afd88aca000531ab82c1" 334 377 335 378 [[package]] 379 + name = "form_urlencoded" 380 + version = "1.2.2" 381 + source = "registry+https://github.com/rust-lang/crates.io-index" 382 + checksum = "cb4cb245038516f5f85277875cdaa4f7d2c9a0fa0468de06ed190163b1581fcf" 383 + dependencies = [ 384 + "percent-encoding", 385 + ] 386 + 387 + [[package]] 336 388 name = "fs_extra" 337 389 version = "1.3.0" 338 390 source = "registry+https://github.com/rust-lang/crates.io-index" ··· 374 426 "futures-core", 375 427 "futures-task", 376 428 "pin-project-lite", 429 + "slab", 377 430 ] 378 431 379 432 [[package]] ··· 383 436 checksum = "ff2abc00be7fca6ebc474524697ae276ad847ad0a6b3faa4bcb027e9a4614ad0" 384 437 dependencies = [ 385 438 "cfg-if", 439 + "js-sys", 386 440 "libc", 387 441 "wasi", 442 + "wasm-bindgen", 388 443 ] 389 444 390 445 [[package]] ··· 394 449 checksum = "899def5c37c4fd7b2664648c28120ecec138e4d395b459e5ca34f9cce2dd77fd" 395 450 dependencies = [ 396 451 "cfg-if", 452 + "js-sys", 397 453 "libc", 398 454 "r-efi", 399 455 "wasip2", 456 + "wasm-bindgen", 400 457 ] 401 458 402 459 [[package]] ··· 508 565 source = "registry+https://github.com/rust-lang/crates.io-index" 509 566 checksum = "96547c2556ec9d12fb1578c4eaf448b04993e7fb79cbaad930a656880a6bdfa0" 510 567 dependencies = [ 568 + "base64", 511 569 "bytes", 512 570 "futures-channel", 513 571 "futures-util", 514 572 "http", 515 573 "http-body", 516 574 "hyper", 575 + "ipnet", 517 576 "libc", 577 + "percent-encoding", 518 578 "pin-project-lite", 519 579 "socket2", 580 + "system-configuration", 520 581 "tokio", 521 582 "tower-service", 522 583 "tracing", 584 + "windows-registry", 585 + ] 586 + 587 + [[package]] 588 + name = "icu_collections" 589 + version = "2.1.1" 590 + source = "registry+https://github.com/rust-lang/crates.io-index" 591 + checksum = "4c6b649701667bbe825c3b7e6388cb521c23d88644678e83c0c4d0a621a34b43" 592 + dependencies = [ 593 + "displaydoc", 594 + "potential_utf", 595 + "yoke", 596 + "zerofrom", 597 + "zerovec", 598 + ] 599 + 600 + [[package]] 601 + name = "icu_locale_core" 602 + version = "2.1.1" 603 + source = "registry+https://github.com/rust-lang/crates.io-index" 604 + checksum = "edba7861004dd3714265b4db54a3c390e880ab658fec5f7db895fae2046b5bb6" 605 + dependencies = [ 606 + "displaydoc", 607 + "litemap", 608 + "tinystr", 609 + "writeable", 610 + "zerovec", 611 + ] 612 + 613 + [[package]] 614 + name = "icu_normalizer" 615 + version = "2.1.1" 616 + source = "registry+https://github.com/rust-lang/crates.io-index" 617 + checksum = "5f6c8828b67bf8908d82127b2054ea1b4427ff0230ee9141c54251934ab1b599" 618 + dependencies = [ 619 + "icu_collections", 620 + "icu_normalizer_data", 621 + "icu_properties", 622 + "icu_provider", 623 + "smallvec", 624 + "zerovec", 625 + ] 626 + 627 + [[package]] 628 + name = "icu_normalizer_data" 629 + version = "2.1.1" 630 + source = "registry+https://github.com/rust-lang/crates.io-index" 631 + checksum = "7aedcccd01fc5fe81e6b489c15b247b8b0690feb23304303a9e560f37efc560a" 632 + 633 + [[package]] 634 + name = "icu_properties" 635 + version = "2.1.2" 636 + source = "registry+https://github.com/rust-lang/crates.io-index" 637 + checksum = "020bfc02fe870ec3a66d93e677ccca0562506e5872c650f893269e08615d74ec" 638 + dependencies = [ 639 + "icu_collections", 640 + "icu_locale_core", 641 + "icu_properties_data", 642 + "icu_provider", 643 + "zerotrie", 644 + "zerovec", 645 + ] 646 + 647 + [[package]] 648 + name = "icu_properties_data" 649 + version = "2.1.2" 650 + source = "registry+https://github.com/rust-lang/crates.io-index" 651 + checksum = "616c294cf8d725c6afcd8f55abc17c56464ef6211f9ed59cccffe534129c77af" 652 + 653 + [[package]] 654 + name = "icu_provider" 655 + version = "2.1.1" 656 + source = "registry+https://github.com/rust-lang/crates.io-index" 657 + checksum = "85962cf0ce02e1e0a629cc34e7ca3e373ce20dda4c4d7294bbd0bf1fdb59e614" 658 + dependencies = [ 659 + "displaydoc", 660 + "icu_locale_core", 661 + "writeable", 662 + "yoke", 663 + "zerofrom", 664 + "zerotrie", 665 + "zerovec", 666 + ] 667 + 668 + [[package]] 669 + name = "idna" 670 + version = "1.1.0" 671 + source = "registry+https://github.com/rust-lang/crates.io-index" 672 + checksum = "3b0875f23caa03898994f6ddc501886a45c7d3d62d04d2d90788d47be1b1e4de" 673 + dependencies = [ 674 + "idna_adapter", 675 + "smallvec", 676 + "utf8_iter", 677 + ] 678 + 679 + [[package]] 680 + name = "idna_adapter" 681 + version = "1.2.1" 682 + source = "registry+https://github.com/rust-lang/crates.io-index" 683 + checksum = "3acae9609540aa318d1bc588455225fb2085b9ed0c4f6bd0d9d5bcd86f1a0344" 684 + dependencies = [ 685 + "icu_normalizer", 686 + "icu_properties", 523 687 ] 524 688 525 689 [[package]] ··· 530 694 dependencies = [ 531 695 "equivalent", 532 696 "hashbrown", 697 + ] 698 + 699 + [[package]] 700 + name = "ipnet" 701 + version = "2.12.0" 702 + source = "registry+https://github.com/rust-lang/crates.io-index" 703 + checksum = "d98f6fed1fde3f8c21bc40a1abb88dd75e67924f9cffc3ef95607bad8017f8e2" 704 + 705 + [[package]] 706 + name = "iri-string" 707 + version = "0.7.10" 708 + source = "registry+https://github.com/rust-lang/crates.io-index" 709 + checksum = "c91338f0783edbd6195decb37bae672fd3b165faffb89bf7b9e6942f8b1a731a" 710 + dependencies = [ 711 + "memchr", 712 + "serde", 533 713 ] 534 714 535 715 [[package]] ··· 579 759 "combine", 580 760 "jni-sys", 581 761 "log", 582 - "thiserror", 762 + "thiserror 1.0.69", 583 763 "walkdir", 584 764 "windows-sys 0.45.0", 585 765 ] ··· 601 781 ] 602 782 603 783 [[package]] 784 + name = "js-sys" 785 + version = "0.3.91" 786 + source = "registry+https://github.com/rust-lang/crates.io-index" 787 + checksum = "b49715b7073f385ba4bc528e5747d02e66cb39c6146efb66b781f131f0fb399c" 788 + dependencies = [ 789 + "once_cell", 790 + "wasm-bindgen", 791 + ] 792 + 793 + [[package]] 604 794 name = "libc" 605 795 version = "0.2.183" 606 796 source = "registry+https://github.com/rust-lang/crates.io-index" 607 797 checksum = "b5b646652bf6661599e1da8901b3b9522896f01e736bad5f723fe7a3a27f899d" 608 798 609 799 [[package]] 800 + name = "litemap" 801 + version = "0.8.1" 802 + source = "registry+https://github.com/rust-lang/crates.io-index" 803 + checksum = "6373607a59f0be73a39b6fe456b8192fcc3585f602af20751600e974dd455e77" 804 + 805 + [[package]] 610 806 name = "log" 611 807 version = "0.4.29" 612 808 source = "registry+https://github.com/rust-lang/crates.io-index" 613 809 checksum = "5e5032e24019045c762d3c0f28f5b6b8bbf38563a65908389bf7978758920897" 810 + 811 + [[package]] 812 + name = "lru-slab" 813 + version = "0.1.2" 814 + source = "registry+https://github.com/rust-lang/crates.io-index" 815 + checksum = "112b39cec0b298b6c1999fee3e31427f74f676e4cb9879ed1a121b43661a4154" 614 816 615 817 [[package]] 616 818 name = "memchr" 617 819 version = "2.8.0" 618 820 source = "registry+https://github.com/rust-lang/crates.io-index" 619 821 checksum = "f8ca58f447f06ed17d5fc4043ce1b10dd205e060fb3ce5b979b8ed8e59ff3f79" 822 + 823 + [[package]] 824 + name = "mime" 825 + version = "0.3.17" 826 + source = "registry+https://github.com/rust-lang/crates.io-index" 827 + checksum = "6877bb514081ee2a7ff5ef9de3281f14a4dd4bceac4c09388074a6b5df8a139a" 620 828 621 829 [[package]] 622 830 name = "mio" ··· 711 919 ] 712 920 713 921 [[package]] 922 + name = "potential_utf" 923 + version = "0.1.4" 924 + source = "registry+https://github.com/rust-lang/crates.io-index" 925 + checksum = "b73949432f5e2a09657003c25bca5e19a0e9c84f8058ca374f49e0ebe605af77" 926 + dependencies = [ 927 + "zerovec", 928 + ] 929 + 930 + [[package]] 714 931 name = "powerfmt" 715 932 version = "0.2.0" 716 933 source = "registry+https://github.com/rust-lang/crates.io-index" 717 934 checksum = "439ee305def115ba05938db6eb1644ff94165c5ab5e9420d1c1bcedbba909391" 718 935 719 936 [[package]] 937 + name = "ppv-lite86" 938 + version = "0.2.21" 939 + source = "registry+https://github.com/rust-lang/crates.io-index" 940 + checksum = "85eae3c4ed2f50dcfe72643da4befc30deadb458a9b590d720cde2f2b1e97da9" 941 + dependencies = [ 942 + "zerocopy", 943 + ] 944 + 945 + [[package]] 720 946 name = "proc-macro2" 721 947 version = "1.0.106" 722 948 source = "registry+https://github.com/rust-lang/crates.io-index" ··· 726 952 ] 727 953 728 954 [[package]] 955 + name = "quinn" 956 + version = "0.11.9" 957 + source = "registry+https://github.com/rust-lang/crates.io-index" 958 + checksum = "b9e20a958963c291dc322d98411f541009df2ced7b5a4f2bd52337638cfccf20" 959 + dependencies = [ 960 + "bytes", 961 + "cfg_aliases", 962 + "pin-project-lite", 963 + "quinn-proto", 964 + "quinn-udp", 965 + "rustc-hash", 966 + "rustls", 967 + "socket2", 968 + "thiserror 2.0.18", 969 + "tokio", 970 + "tracing", 971 + "web-time", 972 + ] 973 + 974 + [[package]] 975 + name = "quinn-proto" 976 + version = "0.11.14" 977 + source = "registry+https://github.com/rust-lang/crates.io-index" 978 + checksum = "434b42fec591c96ef50e21e886936e66d3cc3f737104fdb9b737c40ffb94c098" 979 + dependencies = [ 980 + "aws-lc-rs", 981 + "bytes", 982 + "getrandom 0.3.4", 983 + "lru-slab", 984 + "rand", 985 + "ring", 986 + "rustc-hash", 987 + "rustls", 988 + "rustls-pki-types", 989 + "slab", 990 + "thiserror 2.0.18", 991 + "tinyvec", 992 + "tracing", 993 + "web-time", 994 + ] 995 + 996 + [[package]] 997 + name = "quinn-udp" 998 + version = "0.5.14" 999 + source = "registry+https://github.com/rust-lang/crates.io-index" 1000 + checksum = "addec6a0dcad8a8d96a771f815f0eaf55f9d1805756410b39f5fa81332574cbd" 1001 + dependencies = [ 1002 + "cfg_aliases", 1003 + "libc", 1004 + "once_cell", 1005 + "socket2", 1006 + "tracing", 1007 + "windows-sys 0.52.0", 1008 + ] 1009 + 1010 + [[package]] 729 1011 name = "quote" 730 1012 version = "1.0.45" 731 1013 source = "registry+https://github.com/rust-lang/crates.io-index" ··· 741 1023 checksum = "69cdb34c158ceb288df11e18b4bd39de994f6657d83847bdffdbd7f346754b0f" 742 1024 743 1025 [[package]] 1026 + name = "rand" 1027 + version = "0.9.2" 1028 + source = "registry+https://github.com/rust-lang/crates.io-index" 1029 + checksum = "6db2770f06117d490610c7488547d543617b21bfa07796d7a12f6f1bd53850d1" 1030 + dependencies = [ 1031 + "rand_chacha", 1032 + "rand_core", 1033 + ] 1034 + 1035 + [[package]] 1036 + name = "rand_chacha" 1037 + version = "0.9.0" 1038 + source = "registry+https://github.com/rust-lang/crates.io-index" 1039 + checksum = "d3022b5f1df60f26e1ffddd6c66e8aa15de382ae63b3a0c1bfc0e4d3e3f325cb" 1040 + dependencies = [ 1041 + "ppv-lite86", 1042 + "rand_core", 1043 + ] 1044 + 1045 + [[package]] 1046 + name = "rand_core" 1047 + version = "0.9.5" 1048 + source = "registry+https://github.com/rust-lang/crates.io-index" 1049 + checksum = "76afc826de14238e6e8c374ddcc1fa19e374fd8dd986b0d2af0d02377261d83c" 1050 + dependencies = [ 1051 + "getrandom 0.3.4", 1052 + ] 1053 + 1054 + [[package]] 744 1055 name = "regex" 745 1056 version = "1.12.3" 746 1057 source = "registry+https://github.com/rust-lang/crates.io-index" ··· 770 1081 checksum = "dc897dd8d9e8bd1ed8cdad82b5966c3e0ecae09fb1907d58efaa013543185d0a" 771 1082 772 1083 [[package]] 1084 + name = "reqwest" 1085 + version = "0.13.2" 1086 + source = "registry+https://github.com/rust-lang/crates.io-index" 1087 + checksum = "ab3f43e3283ab1488b624b44b0e988d0acea0b3214e694730a055cb6b2efa801" 1088 + dependencies = [ 1089 + "base64", 1090 + "bytes", 1091 + "encoding_rs", 1092 + "futures-core", 1093 + "h2", 1094 + "http", 1095 + "http-body", 1096 + "http-body-util", 1097 + "hyper", 1098 + "hyper-rustls", 1099 + "hyper-util", 1100 + "js-sys", 1101 + "log", 1102 + "mime", 1103 + "percent-encoding", 1104 + "pin-project-lite", 1105 + "quinn", 1106 + "rustls", 1107 + "rustls-pki-types", 1108 + "rustls-platform-verifier", 1109 + "sync_wrapper", 1110 + "tokio", 1111 + "tokio-rustls", 1112 + "tower", 1113 + "tower-http", 1114 + "tower-service", 1115 + "url", 1116 + "wasm-bindgen", 1117 + "wasm-bindgen-futures", 1118 + "web-sys", 1119 + ] 1120 + 1121 + [[package]] 773 1122 name = "ring" 774 1123 version = "0.17.14" 775 1124 source = "registry+https://github.com/rust-lang/crates.io-index" ··· 803 1152 ] 804 1153 805 1154 [[package]] 1155 + name = "rustc-hash" 1156 + version = "2.1.1" 1157 + source = "registry+https://github.com/rust-lang/crates.io-index" 1158 + checksum = "357703d41365b4b27c590e3ed91eabb1b663f07c4c084095e60cbed4362dff0d" 1159 + 1160 + [[package]] 806 1161 name = "rustls" 807 1162 version = "0.23.37" 808 1163 source = "registry+https://github.com/rust-lang/crates.io-index" ··· 835 1190 source = "registry+https://github.com/rust-lang/crates.io-index" 836 1191 checksum = "be040f8b0a225e40375822a563fa9524378b9d63112f53e19ffff34df5d33fdd" 837 1192 dependencies = [ 1193 + "web-time", 838 1194 "zeroize", 839 1195 ] 840 1196 ··· 844 1200 source = "registry+https://github.com/rust-lang/crates.io-index" 845 1201 checksum = "1d99feebc72bae7ab76ba994bb5e121b8d83d910ca40b36e0921f53becc41784" 846 1202 dependencies = [ 847 - "core-foundation", 1203 + "core-foundation 0.10.1", 848 1204 "core-foundation-sys", 849 1205 "jni", 850 1206 "log", ··· 878 1234 ] 879 1235 880 1236 [[package]] 1237 + name = "rustversion" 1238 + version = "1.0.22" 1239 + source = "registry+https://github.com/rust-lang/crates.io-index" 1240 + checksum = "b39cdef0fa800fc44525c84ccb54a029961a8215f9619753635a9c0d2538d46d" 1241 + 1242 + [[package]] 881 1243 name = "same-file" 882 1244 version = "1.0.6" 883 1245 source = "registry+https://github.com/rust-lang/crates.io-index" ··· 902 1264 checksum = "b7f4bc775c73d9a02cde8bf7b2ec4c9d12743edf609006c7facc23998404cd1d" 903 1265 dependencies = [ 904 1266 "bitflags", 905 - "core-foundation", 1267 + "core-foundation 0.10.1", 906 1268 "core-foundation-sys", 907 1269 "libc", 908 1270 "security-framework-sys", ··· 1033 1395 ] 1034 1396 1035 1397 [[package]] 1398 + name = "stable_deref_trait" 1399 + version = "1.2.1" 1400 + source = "registry+https://github.com/rust-lang/crates.io-index" 1401 + checksum = "6ce2be8dc25455e1f91df71bfa12ad37d7af1092ae736f3a6cd0e37bc7810596" 1402 + 1403 + [[package]] 1036 1404 name = "subtle" 1037 1405 version = "2.6.1" 1038 1406 source = "registry+https://github.com/rust-lang/crates.io-index" ··· 1050 1418 ] 1051 1419 1052 1420 [[package]] 1421 + name = "sync_wrapper" 1422 + version = "1.0.2" 1423 + source = "registry+https://github.com/rust-lang/crates.io-index" 1424 + checksum = "0bf256ce5efdfa370213c1dabab5935a12e49f2c58d15e9eac2870d3b4f27263" 1425 + dependencies = [ 1426 + "futures-core", 1427 + ] 1428 + 1429 + [[package]] 1430 + name = "synstructure" 1431 + version = "0.13.2" 1432 + source = "registry+https://github.com/rust-lang/crates.io-index" 1433 + checksum = "728a70f3dbaf5bab7f0c4b1ac8d7ae5ea60a4b5549c8a5914361c99147a709d2" 1434 + dependencies = [ 1435 + "proc-macro2", 1436 + "quote", 1437 + "syn", 1438 + ] 1439 + 1440 + [[package]] 1441 + name = "system-configuration" 1442 + version = "0.7.0" 1443 + source = "registry+https://github.com/rust-lang/crates.io-index" 1444 + checksum = "a13f3d0daba03132c0aa9767f98351b3488edc2c100cda2d2ec2b04f3d8d3c8b" 1445 + dependencies = [ 1446 + "bitflags", 1447 + "core-foundation 0.9.4", 1448 + "system-configuration-sys", 1449 + ] 1450 + 1451 + [[package]] 1452 + name = "system-configuration-sys" 1453 + version = "0.6.0" 1454 + source = "registry+https://github.com/rust-lang/crates.io-index" 1455 + checksum = "8e1d1b10ced5ca923a1fcb8d03e96b8d3268065d724548c0211415ff6ac6bac4" 1456 + dependencies = [ 1457 + "core-foundation-sys", 1458 + "libc", 1459 + ] 1460 + 1461 + [[package]] 1053 1462 name = "thiserror" 1054 1463 version = "1.0.69" 1055 1464 source = "registry+https://github.com/rust-lang/crates.io-index" 1056 1465 checksum = "b6aaf5339b578ea85b50e080feb250a3e8ae8cfcdff9a461c9ec2904bc923f52" 1057 1466 dependencies = [ 1058 - "thiserror-impl", 1467 + "thiserror-impl 1.0.69", 1468 + ] 1469 + 1470 + [[package]] 1471 + name = "thiserror" 1472 + version = "2.0.18" 1473 + source = "registry+https://github.com/rust-lang/crates.io-index" 1474 + checksum = "4288b5bcbc7920c07a1149a35cf9590a2aa808e0bc1eafaade0b80947865fbc4" 1475 + dependencies = [ 1476 + "thiserror-impl 2.0.18", 1059 1477 ] 1060 1478 1061 1479 [[package]] ··· 1070 1488 ] 1071 1489 1072 1490 [[package]] 1491 + name = "thiserror-impl" 1492 + version = "2.0.18" 1493 + source = "registry+https://github.com/rust-lang/crates.io-index" 1494 + checksum = "ebc4ee7f67670e9b64d05fa4253e753e016c6c95ff35b89b7941d6b856dec1d5" 1495 + dependencies = [ 1496 + "proc-macro2", 1497 + "quote", 1498 + "syn", 1499 + ] 1500 + 1501 + [[package]] 1073 1502 name = "time" 1074 1503 version = "0.3.47" 1075 1504 source = "registry+https://github.com/rust-lang/crates.io-index" ··· 1100 1529 ] 1101 1530 1102 1531 [[package]] 1532 + name = "tinystr" 1533 + version = "0.8.2" 1534 + source = "registry+https://github.com/rust-lang/crates.io-index" 1535 + checksum = "42d3e9c45c09de15d06dd8acf5f4e0e399e85927b7f00711024eb7ae10fa4869" 1536 + dependencies = [ 1537 + "displaydoc", 1538 + "zerovec", 1539 + ] 1540 + 1541 + [[package]] 1542 + name = "tinyvec" 1543 + version = "1.10.0" 1544 + source = "registry+https://github.com/rust-lang/crates.io-index" 1545 + checksum = "bfa5fdc3bce6191a1dbc8c02d5c8bffcf557bafa17c124c5264a458f1b0613fa" 1546 + dependencies = [ 1547 + "tinyvec_macros", 1548 + ] 1549 + 1550 + [[package]] 1551 + name = "tinyvec_macros" 1552 + version = "0.1.1" 1553 + source = "registry+https://github.com/rust-lang/crates.io-index" 1554 + checksum = "1f3ccbac311fea05f86f61904b462b55fb3df8837a366dfc601a0161d0532f20" 1555 + 1556 + [[package]] 1103 1557 name = "tokio" 1104 1558 version = "1.50.0" 1105 1559 source = "registry+https://github.com/rust-lang/crates.io-index" ··· 1171 1625 "tokio-rustls", 1172 1626 "tokio-util", 1173 1627 ] 1628 + 1629 + [[package]] 1630 + name = "tower" 1631 + version = "0.5.3" 1632 + source = "registry+https://github.com/rust-lang/crates.io-index" 1633 + checksum = "ebe5ef63511595f1344e2d5cfa636d973292adc0eec1f0ad45fae9f0851ab1d4" 1634 + dependencies = [ 1635 + "futures-core", 1636 + "futures-util", 1637 + "pin-project-lite", 1638 + "sync_wrapper", 1639 + "tokio", 1640 + "tower-layer", 1641 + "tower-service", 1642 + ] 1643 + 1644 + [[package]] 1645 + name = "tower-http" 1646 + version = "0.6.8" 1647 + source = "registry+https://github.com/rust-lang/crates.io-index" 1648 + checksum = "d4e6559d53cc268e5031cd8429d05415bc4cb4aefc4aa5d6cc35fbf5b924a1f8" 1649 + dependencies = [ 1650 + "bitflags", 1651 + "bytes", 1652 + "futures-util", 1653 + "http", 1654 + "http-body", 1655 + "iri-string", 1656 + "pin-project-lite", 1657 + "tower", 1658 + "tower-layer", 1659 + "tower-service", 1660 + ] 1661 + 1662 + [[package]] 1663 + name = "tower-layer" 1664 + version = "0.3.3" 1665 + source = "registry+https://github.com/rust-lang/crates.io-index" 1666 + checksum = "121c2a6cda46980bb0fcd1647ffaf6cd3fc79a013de288782836f6df9c48780e" 1174 1667 1175 1668 [[package]] 1176 1669 name = "tower-service" ··· 1348 1841 checksum = "8ecb6da28b8a351d773b68d5825ac39017e680750f980f3a1a85cd8dd28a47c1" 1349 1842 1350 1843 [[package]] 1844 + name = "url" 1845 + version = "2.5.8" 1846 + source = "registry+https://github.com/rust-lang/crates.io-index" 1847 + checksum = "ff67a8a4397373c3ef660812acab3268222035010ab8680ec4215f38ba3d0eed" 1848 + dependencies = [ 1849 + "form_urlencoded", 1850 + "idna", 1851 + "percent-encoding", 1852 + "serde", 1853 + ] 1854 + 1855 + [[package]] 1856 + name = "utf8_iter" 1857 + version = "1.0.4" 1858 + source = "registry+https://github.com/rust-lang/crates.io-index" 1859 + checksum = "b6c140620e7ffbb22c2dee59cafe6084a59b5ffc27a8859a5f0d494b5d52b6be" 1860 + 1861 + [[package]] 1351 1862 name = "utf8parse" 1352 1863 version = "0.2.2" 1353 1864 source = "registry+https://github.com/rust-lang/crates.io-index" ··· 1388 1899 ] 1389 1900 1390 1901 [[package]] 1902 + name = "wasm-bindgen" 1903 + version = "0.2.114" 1904 + source = "registry+https://github.com/rust-lang/crates.io-index" 1905 + checksum = "6532f9a5c1ece3798cb1c2cfdba640b9b3ba884f5db45973a6f442510a87d38e" 1906 + dependencies = [ 1907 + "cfg-if", 1908 + "once_cell", 1909 + "rustversion", 1910 + "wasm-bindgen-macro", 1911 + "wasm-bindgen-shared", 1912 + ] 1913 + 1914 + [[package]] 1915 + name = "wasm-bindgen-futures" 1916 + version = "0.4.64" 1917 + source = "registry+https://github.com/rust-lang/crates.io-index" 1918 + checksum = "e9c5522b3a28661442748e09d40924dfb9ca614b21c00d3fd135720e48b67db8" 1919 + dependencies = [ 1920 + "cfg-if", 1921 + "futures-util", 1922 + "js-sys", 1923 + "once_cell", 1924 + "wasm-bindgen", 1925 + "web-sys", 1926 + ] 1927 + 1928 + [[package]] 1929 + name = "wasm-bindgen-macro" 1930 + version = "0.2.114" 1931 + source = "registry+https://github.com/rust-lang/crates.io-index" 1932 + checksum = "18a2d50fcf105fb33bb15f00e7a77b772945a2ee45dcf454961fd843e74c18e6" 1933 + dependencies = [ 1934 + "quote", 1935 + "wasm-bindgen-macro-support", 1936 + ] 1937 + 1938 + [[package]] 1939 + name = "wasm-bindgen-macro-support" 1940 + version = "0.2.114" 1941 + source = "registry+https://github.com/rust-lang/crates.io-index" 1942 + checksum = "03ce4caeaac547cdf713d280eda22a730824dd11e6b8c3ca9e42247b25c631e3" 1943 + dependencies = [ 1944 + "bumpalo", 1945 + "proc-macro2", 1946 + "quote", 1947 + "syn", 1948 + "wasm-bindgen-shared", 1949 + ] 1950 + 1951 + [[package]] 1952 + name = "wasm-bindgen-shared" 1953 + version = "0.2.114" 1954 + source = "registry+https://github.com/rust-lang/crates.io-index" 1955 + checksum = "75a326b8c223ee17883a4251907455a2431acc2791c98c26279376490c378c16" 1956 + dependencies = [ 1957 + "unicode-ident", 1958 + ] 1959 + 1960 + [[package]] 1961 + name = "web-sys" 1962 + version = "0.3.91" 1963 + source = "registry+https://github.com/rust-lang/crates.io-index" 1964 + checksum = "854ba17bb104abfb26ba36da9729addc7ce7f06f5c0f90f3c391f8461cca21f9" 1965 + dependencies = [ 1966 + "js-sys", 1967 + "wasm-bindgen", 1968 + ] 1969 + 1970 + [[package]] 1971 + name = "web-time" 1972 + version = "1.1.0" 1973 + source = "registry+https://github.com/rust-lang/crates.io-index" 1974 + checksum = "5a6580f308b1fad9207618087a65c04e7a10bc77e02c8e84e9b00dd4b12fa0bb" 1975 + dependencies = [ 1976 + "js-sys", 1977 + "wasm-bindgen", 1978 + ] 1979 + 1980 + [[package]] 1391 1981 name = "webpki-root-certs" 1392 1982 version = "1.0.6" 1393 1983 source = "registry+https://github.com/rust-lang/crates.io-index" ··· 1410 2000 version = "0.2.1" 1411 2001 source = "registry+https://github.com/rust-lang/crates.io-index" 1412 2002 checksum = "f0805222e57f7521d6a62e36fa9163bc891acd422f971defe97d64e70d0a4fe5" 2003 + 2004 + [[package]] 2005 + name = "windows-registry" 2006 + version = "0.6.1" 2007 + source = "registry+https://github.com/rust-lang/crates.io-index" 2008 + checksum = "02752bf7fbdcce7f2a27a742f798510f3e5ad88dbe84871e5168e2120c3d5720" 2009 + dependencies = [ 2010 + "windows-link", 2011 + "windows-result", 2012 + "windows-strings", 2013 + ] 2014 + 2015 + [[package]] 2016 + name = "windows-result" 2017 + version = "0.4.1" 2018 + source = "registry+https://github.com/rust-lang/crates.io-index" 2019 + checksum = "7781fa89eaf60850ac3d2da7af8e5242a5ea78d1a11c49bf2910bb5a73853eb5" 2020 + dependencies = [ 2021 + "windows-link", 2022 + ] 2023 + 2024 + [[package]] 2025 + name = "windows-strings" 2026 + version = "0.5.1" 2027 + source = "registry+https://github.com/rust-lang/crates.io-index" 2028 + checksum = "7837d08f69c77cf6b07689544538e017c1bfcf57e34b4c0ff58e6c2cd3b37091" 2029 + dependencies = [ 2030 + "windows-link", 2031 + ] 1413 2032 1414 2033 [[package]] 1415 2034 name = "windows-sys" ··· 1566 2185 checksum = "d7249219f66ced02969388cf2bb044a09756a083d0fab1e566056b04d9fbcaa5" 1567 2186 1568 2187 [[package]] 2188 + name = "writeable" 2189 + version = "0.6.2" 2190 + source = "registry+https://github.com/rust-lang/crates.io-index" 2191 + checksum = "9edde0db4769d2dc68579893f2306b26c6ecfbe0ef499b013d731b7b9247e0b9" 2192 + 2193 + [[package]] 2194 + name = "yoke" 2195 + version = "0.8.1" 2196 + source = "registry+https://github.com/rust-lang/crates.io-index" 2197 + checksum = "72d6e5c6afb84d73944e5cedb052c4680d5657337201555f9f2a16b7406d4954" 2198 + dependencies = [ 2199 + "stable_deref_trait", 2200 + "yoke-derive", 2201 + "zerofrom", 2202 + ] 2203 + 2204 + [[package]] 2205 + name = "yoke-derive" 2206 + version = "0.8.1" 2207 + source = "registry+https://github.com/rust-lang/crates.io-index" 2208 + checksum = "b659052874eb698efe5b9e8cf382204678a0086ebf46982b79d6ca3182927e5d" 2209 + dependencies = [ 2210 + "proc-macro2", 2211 + "quote", 2212 + "syn", 2213 + "synstructure", 2214 + ] 2215 + 2216 + [[package]] 2217 + name = "zerocopy" 2218 + version = "0.8.42" 2219 + source = "registry+https://github.com/rust-lang/crates.io-index" 2220 + checksum = "f2578b716f8a7a858b7f02d5bd870c14bf4ddbbcf3a4c05414ba6503640505e3" 2221 + dependencies = [ 2222 + "zerocopy-derive", 2223 + ] 2224 + 2225 + [[package]] 2226 + name = "zerocopy-derive" 2227 + version = "0.8.42" 2228 + source = "registry+https://github.com/rust-lang/crates.io-index" 2229 + checksum = "7e6cc098ea4d3bd6246687de65af3f920c430e236bee1e3bf2e441463f08a02f" 2230 + dependencies = [ 2231 + "proc-macro2", 2232 + "quote", 2233 + "syn", 2234 + ] 2235 + 2236 + [[package]] 2237 + name = "zerofrom" 2238 + version = "0.1.6" 2239 + source = "registry+https://github.com/rust-lang/crates.io-index" 2240 + checksum = "50cc42e0333e05660c3587f3bf9d0478688e15d870fab3346451ce7f8c9fbea5" 2241 + dependencies = [ 2242 + "zerofrom-derive", 2243 + ] 2244 + 2245 + [[package]] 2246 + name = "zerofrom-derive" 2247 + version = "0.1.6" 2248 + source = "registry+https://github.com/rust-lang/crates.io-index" 2249 + checksum = "d71e5d6e06ab090c67b5e44993ec16b72dcbaabc526db883a360057678b48502" 2250 + dependencies = [ 2251 + "proc-macro2", 2252 + "quote", 2253 + "syn", 2254 + "synstructure", 2255 + ] 2256 + 2257 + [[package]] 1569 2258 name = "zeroize" 1570 2259 version = "1.8.2" 1571 2260 source = "registry+https://github.com/rust-lang/crates.io-index" 1572 2261 checksum = "b97154e67e32c85465826e8bcc1c59429aaaf107c1e4a9e53c8d8ccd5eff88d0" 2262 + 2263 + [[package]] 2264 + name = "zerotrie" 2265 + version = "0.2.3" 2266 + source = "registry+https://github.com/rust-lang/crates.io-index" 2267 + checksum = "2a59c17a5562d507e4b54960e8569ebee33bee890c70aa3fe7b97e85a9fd7851" 2268 + dependencies = [ 2269 + "displaydoc", 2270 + "yoke", 2271 + "zerofrom", 2272 + ] 2273 + 2274 + [[package]] 2275 + name = "zerovec" 2276 + version = "0.11.5" 2277 + source = "registry+https://github.com/rust-lang/crates.io-index" 2278 + checksum = "6c28719294829477f525be0186d13efa9a3c602f7ec202ca9e353d310fb9a002" 2279 + dependencies = [ 2280 + "yoke", 2281 + "zerofrom", 2282 + "zerovec-derive", 2283 + ] 2284 + 2285 + [[package]] 2286 + name = "zerovec-derive" 2287 + version = "0.11.2" 2288 + source = "registry+https://github.com/rust-lang/crates.io-index" 2289 + checksum = "eadce39539ca5cb3985590102671f2567e659fca9666581ad3411d59207951f3" 2290 + dependencies = [ 2291 + "proc-macro2", 2292 + "quote", 2293 + "syn", 2294 + ] 1573 2295 1574 2296 [[package]] 1575 2297 name = "zmij"
+1
Cargo.toml
··· 9 9 colog = "1.4.0" 10 10 fastrand = "2.3.0" 11 11 log = "0.4.29" 12 + reqwest = "0.13.2" 12 13 rmp-serde = "1.3.1" 13 14 rustls = "0.23.37" 14 15 serde = { version = "1.0.228", features = ["derive"] }
+43
src/brain.rs
··· 212 212 pub fn get_weights(&self, tok: &str) -> Option<&Edges> { 213 213 self.0.get(&Self::normalize_token(tok)) 214 214 } 215 + 216 + fn legacy_token_format(tok: &Token) -> String { 217 + tok.as_ref() 218 + .map(|s| format!("W-{s}")) 219 + .unwrap_or_else(|| String::from("E--")) 220 + } 221 + 222 + pub fn as_legacy_hashmap(&self) -> HashMap<String, HashMap<String, Weight>> { 223 + self.0 224 + .iter() 225 + .map(|(k, v)| { 226 + let map = 227 + v.0.iter() 228 + .map(|(t, w)| (Self::legacy_token_format(t), *w)) 229 + .collect(); 230 + (Self::legacy_token_format(k), map) 231 + }) 232 + .collect() 233 + } 234 + 235 + fn read_legacy_token(s: String) -> Token { 236 + match s.as_str() { 237 + "E--" => None, 238 + word => Some(word.strip_prefix("W-").unwrap_or(word).to_string()), 239 + } 240 + } 241 + 242 + pub fn from_legacy_hashmap(map: HashMap<String, HashMap<String, Weight>>) -> Self { 243 + Self( 244 + map.into_iter() 245 + .map(|(k, v)| { 246 + let sum = v.values().map(|w| *w as u64).sum::<u64>() as u64; 247 + let edges = Edges( 248 + v.into_iter() 249 + .map(|(t, w)| (Self::read_legacy_token(t), w)) 250 + .collect(), 251 + sum, 252 + ); 253 + (Self::read_legacy_token(k), edges) 254 + }) 255 + .collect(), 256 + ) 257 + } 215 258 } 216 259 217 260 #[cfg(test)]
+58
src/cmd/dump_chain.rs
··· 1 + use std::sync::Arc; 2 + 3 + use brotli::enc::BrotliEncoderParams; 4 + use twilight_interactions::command::{CommandModel, CreateCommand}; 5 + use twilight_model::{ 6 + application::interaction::{Interaction, application_command::CommandData}, 7 + http::attachment::Attachment, 8 + }; 9 + 10 + use crate::{BotContext, cmd::DEFER_INTER_RESP_EPHEMERAL, prelude::*}; 11 + 12 + #[derive(CommandModel, CreateCommand)] 13 + #[command(name = "dump_chain", desc = "Dump chain")] 14 + pub struct DumpChainCommand { 15 + /// Generate as Nushell (Legacy) compatible msgpack 16 + compat: Option<bool>, 17 + } 18 + 19 + impl DumpChainCommand { 20 + pub async fn handle(inter: Interaction, data: CommandData, ctx: Arc<BotContext>) -> Result { 21 + let Self { compat } = 22 + Self::from_interaction(data.into()).context("Failed to parse command data")?; 23 + 24 + let client = ctx.http.interaction(ctx.app_id); 25 + 26 + client 27 + .create_response(inter.id, &inter.token, &DEFER_INTER_RESP_EPHEMERAL) 28 + .await 29 + .context("Failed to defer")?; 30 + 31 + let mut buf = Vec::<u8>::with_capacity(4096); 32 + let params = BrotliEncoderParams::default(); 33 + let mut brotli_writer = brotli::CompressorWriter::with_params(&mut buf, 4096, &params); 34 + 35 + if compat.unwrap_or_default() { 36 + let brain = ctx.brain_handle.lock().await; 37 + let map = brain.as_legacy_hashmap(); 38 + drop(brain); 39 + rmp_serde::encode::write(&mut brotli_writer, &map) 40 + .context("Failed to legacy encode brain")?; 41 + } else { 42 + let brain = ctx.brain_handle.lock().await; 43 + rmp_serde::encode::write(&mut brotli_writer, &*brain) 44 + .context("Failed to write serialized brain")?; 45 + } 46 + drop(brotli_writer); 47 + 48 + let attachment = Attachment::from_bytes(String::from("brain.msgpackz"), buf, 1); 49 + 50 + client 51 + .update_response(&inter.token) 52 + .attachments(&[attachment]) 53 + .await 54 + .context("Failed to send brain")?; 55 + 56 + Ok(()) 57 + } 58 + }
+67
src/cmd/load_chain.rs
··· 1 + use std::sync::{Arc, atomic::Ordering}; 2 + 3 + use twilight_interactions::command::{CommandModel, CreateCommand}; 4 + use twilight_model::{ 5 + application::interaction::{Interaction, application_command::CommandData}, 6 + channel::Attachment, 7 + }; 8 + 9 + use crate::{ 10 + BotContext, brain::Brain, cmd::DEFER_INTER_RESP_EPHEMERAL, prelude::*, status::update_status, 11 + }; 12 + 13 + #[derive(CommandModel, CreateCommand)] 14 + #[command(name = "load_chain", desc = "Load a chain from a .msgpackz file")] 15 + pub struct LoadChainCommand { 16 + /// Brain file to load 17 + file: Attachment, 18 + /// Use a Nushell (Legacy) compatible msgpack 19 + compat: Option<bool>, 20 + } 21 + 22 + impl LoadChainCommand { 23 + pub async fn handle(inter: Interaction, data: CommandData, ctx: Arc<BotContext>) -> Result { 24 + let Self { file, compat } = 25 + Self::from_interaction(data.into()).context("Failed to parse command data")?; 26 + 27 + let client = ctx.http.interaction(ctx.app_id); 28 + 29 + client 30 + .create_response(inter.id, &inter.token, &DEFER_INTER_RESP_EPHEMERAL) 31 + .await 32 + .context("Failed to defer")?; 33 + 34 + let mut data = std::io::Cursor::new( 35 + reqwest::get(file.url) 36 + .await 37 + .context("Failed to request attachment")? 38 + .bytes() 39 + .await 40 + .context("Failed to decode as bytes")?, 41 + ); 42 + let mut brotli_stream = brotli::Decompressor::new(&mut data, 4096); 43 + 44 + let new_brain: Brain = if compat.unwrap_or_default() { 45 + Brain::from_legacy_hashmap( 46 + rmp_serde::from_read(&mut brotli_stream).context("Failed to decode brain file")?, 47 + ) 48 + } else { 49 + rmp_serde::from_read(&mut brotli_stream).context("Failed to decode brain file")? 50 + }; 51 + 52 + { 53 + let mut brain = ctx.brain_handle.lock().await; 54 + brain.merge_from(new_brain); 55 + ctx.pending_save.store(true, Ordering::Relaxed); 56 + update_status(&*brain, &ctx.shard_sender).context("Failed to update status")?; 57 + } 58 + 59 + client 60 + .update_response(&inter.token) 61 + .content(Some("Bingus Learned!")) 62 + .await 63 + .context("Failed to send brain")?; 64 + 65 + Ok(()) 66 + } 67 + }
+32 -2
src/cmd/mod.rs
··· 1 + mod dump_chain; 2 + mod load_chain; 1 3 mod weights; 2 4 3 5 use std::sync::Arc; ··· 5 7 use log::warn; 6 8 use twilight_interactions::command::CreateCommand; 7 9 use twilight_model::application::interaction::{Interaction, application_command::CommandData}; 8 - use twilight_model::http::interaction::{InteractionResponse, InteractionResponseType}; 10 + use twilight_model::channel::message::MessageFlags; 11 + use twilight_model::http::interaction::{ 12 + InteractionResponse, InteractionResponseData, InteractionResponseType, 13 + }; 9 14 15 + use crate::cmd::dump_chain::DumpChainCommand; 16 + use crate::cmd::load_chain::LoadChainCommand; 10 17 use crate::{BotContext, prelude::*}; 11 18 12 19 use weights::WeightsCommand; ··· 16 23 data: None, 17 24 }; 18 25 26 + const DEFER_INTER_RESP_EPHEMERAL: InteractionResponse = InteractionResponse { 27 + kind: InteractionResponseType::DeferredChannelMessageWithSource, 28 + data: Some(InteractionResponseData { 29 + allowed_mentions: None, 30 + attachments: None, 31 + choices: None, 32 + components: None, 33 + content: None, 34 + custom_id: None, 35 + embeds: None, 36 + flags: Some(MessageFlags::EPHEMERAL), 37 + title: None, 38 + tts: None, 39 + poll: None, 40 + }), 41 + }; 42 + 19 43 pub async fn register_all_commands(ctx: Arc<BotContext>) -> Result { 20 - let commands = [WeightsCommand::create_command().into()]; 44 + let commands = [ 45 + WeightsCommand::create_command().into(), 46 + DumpChainCommand::create_command().into(), 47 + LoadChainCommand::create_command().into(), 48 + ]; 21 49 22 50 let client = ctx.http.interaction(ctx.app_id); 23 51 ··· 36 64 ) -> Result { 37 65 match &*data.name { 38 66 "weights" => WeightsCommand::handle(inter, data, ctx).await, 67 + "dump_chain" => DumpChainCommand::handle(inter, data, ctx).await, 68 + "load_chain" => LoadChainCommand::handle(inter, data, ctx).await, 39 69 other => { 40 70 warn!("Unknown command send: {other}"); 41 71 Ok(())
+2 -2
src/cmd/weights.rs
··· 35 35 36 36 impl WeightsCommand { 37 37 pub async fn handle(inter: Interaction, data: CommandData, ctx: Arc<BotContext>) -> Result { 38 - let WeightsCommand { token } = WeightsCommand::from_interaction(data.into()) 39 - .context("Failed to parse command data")?; 38 + let Self { token } = 39 + Self::from_interaction(data.into()).context("Failed to parse command data")?; 40 40 41 41 let client = ctx.http.interaction(ctx.app_id); 42 42
+1 -1
src/main.rs
··· 207 207 if let Err(why) = save_brain(ctx.clone()).await { 208 208 error!("Failed to save brain file:\n{why:?}"); 209 209 } 210 - ctx.pending_save.store(true, Ordering::Relaxed); 210 + ctx.pending_save.store(false, Ordering::Relaxed); 211 211 }); 212 212 } 213 213 },