A local-first private AI assistant for everyday use. Runs on-device models with encrypted P2P sync, and supports sharing chats publicly on ATProto.
10
fork

Configure Feed

Select the types of activity you want to include in your feed.

Merge pull request #87 from tilesprivacy/feat/identity

Basic Identity system for Tiles

authored by

Anandu Pavanan and committed by
GitHub
ef274d2e 138f1dfb

+1343 -42
+3 -2
.coderabbit.yml
··· 18 18 path_instructions: 19 19 - path: "**/*.{rs,toml}" 20 20 instructions: 21 - "Review the Rust code for conformity with best practices in Rust, 22 - Systems programming. Highlight any deviations." 21 + "Review the Rust code and Python code for conformity with best practices in Rust, 22 + Systems programming and Python. Highlight any deviations. Also highlight if there any 23 + any security issues in the code" 23 24
+876 -11
Cargo.lock
··· 118 118 checksum = "a23eb6b1614318a8071c9b2521f36b424b2c83db5eb3a0fead4a6c0809af6e61" 119 119 120 120 [[package]] 121 + name = "arbitrary" 122 + version = "1.4.2" 123 + source = "registry+https://github.com/rust-lang/crates.io-index" 124 + checksum = "c3d036a3c4ab069c7b410a2ce876bd74808d2d0888a82667669f8e783a898bf1" 125 + 126 + [[package]] 121 127 name = "arc-swap" 122 128 version = "1.8.0" 123 129 source = "registry+https://github.com/rust-lang/crates.io-index" ··· 353 359 ] 354 360 355 361 [[package]] 362 + name = "async-signature" 363 + version = "0.5.1" 364 + source = "registry+https://github.com/rust-lang/crates.io-index" 365 + checksum = "646dcc11163091f40c1618702bcde3d2e152c52b05fc4527fc67cfe077e47c22" 366 + dependencies = [ 367 + "signature", 368 + ] 369 + 370 + [[package]] 356 371 name = "async-stream" 357 372 version = "0.3.6" 358 373 source = "registry+https://github.com/rust-lang/crates.io-index" ··· 413 428 checksum = "c08606f8c3cbf4ce6ec8e28fb0014a2c086708fe954eaa885384a6165172e7e8" 414 429 415 430 [[package]] 431 + name = "base-x" 432 + version = "0.2.11" 433 + source = "registry+https://github.com/rust-lang/crates.io-index" 434 + checksum = "4cbbc9d0964165b47557570cce6c952866c2678457aca742aafc9fb771d30270" 435 + 436 + [[package]] 437 + name = "base16ct" 438 + version = "0.2.0" 439 + source = "registry+https://github.com/rust-lang/crates.io-index" 440 + checksum = "4c7f02d4ea65f2c1853089ffd8d2787bdbc63de2f0d29dedbcf8ccdfa0ccd4cf" 441 + 442 + [[package]] 443 + name = "base256emoji" 444 + version = "1.0.2" 445 + source = "registry+https://github.com/rust-lang/crates.io-index" 446 + checksum = "b5e9430d9a245a77c92176e649af6e275f20839a48389859d1661e9a128d077c" 447 + dependencies = [ 448 + "const-str", 449 + "match-lookup", 450 + ] 451 + 452 + [[package]] 453 + name = "base58" 454 + version = "0.2.0" 455 + source = "registry+https://github.com/rust-lang/crates.io-index" 456 + checksum = "6107fe1be6682a68940da878d9e9f5e90ca5745b3dec9fd1bb393c8777d4f581" 457 + 458 + [[package]] 416 459 name = "base64" 417 460 version = "0.22.1" 418 461 source = "registry+https://github.com/rust-lang/crates.io-index" 419 462 checksum = "72b3254f16251a8381aa12e40e3c4d2f0199f8c6508fbecb9d91f575e0fbb8c6" 420 463 421 464 [[package]] 465 + name = "base64ct" 466 + version = "1.8.3" 467 + source = "registry+https://github.com/rust-lang/crates.io-index" 468 + checksum = "2af50177e190e07a26ab74f8b1efbfe2ef87da2116221318cb1c2e82baf7de06" 469 + 470 + [[package]] 422 471 name = "bincode" 423 472 version = "1.3.3" 424 473 source = "registry+https://github.com/rust-lang/crates.io-index" ··· 434 483 checksum = "812e12b5285cc515a9c72a5c1d3b6d46a19dac5acfef5265968c166106e31dd3" 435 484 436 485 [[package]] 486 + name = "block-buffer" 487 + version = "0.10.4" 488 + source = "registry+https://github.com/rust-lang/crates.io-index" 489 + checksum = "3078c7629b62d3f0439517fa394996acacc5cbc91c5a20d8c658e77abd503a71" 490 + dependencies = [ 491 + "generic-array", 492 + ] 493 + 494 + [[package]] 437 495 name = "bon" 438 496 version = "3.8.2" 439 497 source = "registry+https://github.com/rust-lang/crates.io-index" ··· 498 556 checksum = "b35204fbdc0b3f4446b89fc1ac2cf84a8a68971995d0bf2e925ec7cd960f9cb3" 499 557 500 558 [[package]] 559 + name = "cbor4ii" 560 + version = "0.2.14" 561 + source = "registry+https://github.com/rust-lang/crates.io-index" 562 + checksum = "b544cf8c89359205f4f990d0e6f3828db42df85b5dac95d09157a250eb0749c4" 563 + dependencies = [ 564 + "serde", 565 + ] 566 + 567 + [[package]] 501 568 name = "cc" 502 569 version = "1.2.51" 503 570 source = "registry+https://github.com/rust-lang/crates.io-index" ··· 530 597 "iana-time-zone", 531 598 "num-traits", 532 599 "windows-link", 600 + ] 601 + 602 + [[package]] 603 + name = "cid" 604 + version = "0.11.1" 605 + source = "registry+https://github.com/rust-lang/crates.io-index" 606 + checksum = "3147d8272e8fa0ccd29ce51194dd98f79ddfb8191ba9e3409884e751798acf3a" 607 + dependencies = [ 608 + "arbitrary", 609 + "core2", 610 + "multibase", 611 + "multihash", 612 + "quickcheck", 613 + "rand 0.8.5", 614 + "serde", 615 + "serde_bytes", 616 + "unsigned-varint", 533 617 ] 534 618 535 619 [[package]] ··· 616 700 ] 617 701 618 702 [[package]] 703 + name = "const-oid" 704 + version = "0.9.6" 705 + source = "registry+https://github.com/rust-lang/crates.io-index" 706 + checksum = "c2459377285ad874054d797f3ccebf984978aa39129f6eafde5cdc8315b612f8" 707 + 708 + [[package]] 619 709 name = "const-random" 620 710 version = "0.1.18" 621 711 source = "registry+https://github.com/rust-lang/crates.io-index" ··· 636 726 ] 637 727 638 728 [[package]] 729 + name = "const-str" 730 + version = "0.4.3" 731 + source = "registry+https://github.com/rust-lang/crates.io-index" 732 + checksum = "2f421161cb492475f1661ddc9815a745a1c894592070661180fdec3d4872e9c3" 733 + 734 + [[package]] 639 735 name = "core-foundation" 640 736 version = "0.9.4" 641 737 source = "registry+https://github.com/rust-lang/crates.io-index" ··· 646 742 ] 647 743 648 744 [[package]] 745 + name = "core-foundation" 746 + version = "0.10.1" 747 + source = "registry+https://github.com/rust-lang/crates.io-index" 748 + checksum = "b2a6cd9ae233e7f62ba4e9353e81a88df7fc8a5987b8d445b4d90c879bd156f6" 749 + dependencies = [ 750 + "core-foundation-sys", 751 + "libc", 752 + ] 753 + 754 + [[package]] 649 755 name = "core-foundation-sys" 650 756 version = "0.8.7" 651 757 source = "registry+https://github.com/rust-lang/crates.io-index" 652 758 checksum = "773648b94d0e5d620f64f280777445740e61fe701025087ec8b57f45c791888b" 653 759 654 760 [[package]] 761 + name = "core2" 762 + version = "0.4.0" 763 + source = "registry+https://github.com/rust-lang/crates.io-index" 764 + checksum = "b49ba7ef1ad6107f8824dbe97de947cbaac53c44e7f9756a1fba0d37c1eec505" 765 + dependencies = [ 766 + "memchr", 767 + ] 768 + 769 + [[package]] 655 770 name = "core_affinity" 656 771 version = "0.8.3" 657 772 source = "registry+https://github.com/rust-lang/crates.io-index" ··· 660 775 "libc", 661 776 "num_cpus", 662 777 "winapi", 778 + ] 779 + 780 + [[package]] 781 + name = "cpufeatures" 782 + version = "0.2.17" 783 + source = "registry+https://github.com/rust-lang/crates.io-index" 784 + checksum = "59ed5838eebb26a2bb2e58f6d5b5316989ae9d08bab10e0e6d103e656d1b0280" 785 + dependencies = [ 786 + "libc", 663 787 ] 664 788 665 789 [[package]] ··· 703 827 checksum = "460fbee9c2c2f33933d720630a6a0bac33ba7053db5344fac858d4b8952d77d5" 704 828 705 829 [[package]] 830 + name = "crypto-bigint" 831 + version = "0.5.5" 832 + source = "registry+https://github.com/rust-lang/crates.io-index" 833 + checksum = "0dc92fb57ca44df6db8059111ab3af99a63d5d0f8375d9972e319a379c6bab76" 834 + dependencies = [ 835 + "generic-array", 836 + "rand_core 0.6.4", 837 + "subtle", 838 + "zeroize", 839 + ] 840 + 841 + [[package]] 842 + name = "crypto-common" 843 + version = "0.1.6" 844 + source = "registry+https://github.com/rust-lang/crates.io-index" 845 + checksum = "1bfb12502f3fc46cca1bb51ac28df9d618d813cdc3d2f25b9fe775a34af26bb3" 846 + dependencies = [ 847 + "generic-array", 848 + "typenum", 849 + ] 850 + 851 + [[package]] 706 852 name = "csv" 707 853 version = "1.4.0" 708 854 source = "registry+https://github.com/rust-lang/crates.io-index" ··· 724 870 ] 725 871 726 872 [[package]] 873 + name = "curve25519-dalek" 874 + version = "4.1.3" 875 + source = "registry+https://github.com/rust-lang/crates.io-index" 876 + checksum = "97fb8b7c4503de7d6ae7b42ab72a5a59857b4c937ec27a3d4539dba95b5ab2be" 877 + dependencies = [ 878 + "cfg-if", 879 + "cpufeatures", 880 + "curve25519-dalek-derive", 881 + "digest", 882 + "fiat-crypto", 883 + "rustc_version", 884 + "subtle", 885 + "zeroize", 886 + ] 887 + 888 + [[package]] 889 + name = "curve25519-dalek-derive" 890 + version = "0.1.1" 891 + source = "registry+https://github.com/rust-lang/crates.io-index" 892 + checksum = "f46882e17999c6cc590af592290432be3bce0428cb0d5f8b6715e4dc7b383eb3" 893 + dependencies = [ 894 + "proc-macro2", 895 + "quote", 896 + "syn 2.0.113", 897 + ] 898 + 899 + [[package]] 727 900 name = "darling" 728 901 version = "0.14.4" 729 902 source = "registry+https://github.com/rust-lang/crates.io-index" ··· 790 963 "darling_core 0.23.0", 791 964 "quote", 792 965 "syn 2.0.113", 966 + ] 967 + 968 + [[package]] 969 + name = "data-encoding" 970 + version = "2.10.0" 971 + source = "registry+https://github.com/rust-lang/crates.io-index" 972 + checksum = "d7a1e2f27636f116493b8b860f5546edb47c8d8f8ea73e1d2a20be88e28d1fea" 973 + 974 + [[package]] 975 + name = "data-encoding-macro" 976 + version = "0.1.19" 977 + source = "registry+https://github.com/rust-lang/crates.io-index" 978 + checksum = "8142a83c17aa9461d637e649271eae18bf2edd00e91f2e105df36c3c16355bdb" 979 + dependencies = [ 980 + "data-encoding", 981 + "data-encoding-macro-internal", 982 + ] 983 + 984 + [[package]] 985 + name = "data-encoding-macro-internal" 986 + version = "0.1.17" 987 + source = "registry+https://github.com/rust-lang/crates.io-index" 988 + checksum = "7ab67060fc6b8ef687992d439ca0fa36e7ed17e9a0b16b25b601e8757df720de" 989 + dependencies = [ 990 + "data-encoding", 991 + "syn 2.0.113", 992 + ] 993 + 994 + [[package]] 995 + name = "der" 996 + version = "0.7.10" 997 + source = "registry+https://github.com/rust-lang/crates.io-index" 998 + checksum = "e7c1832837b905bbfb5101e07cc24c8deddf52f93225eee6ead5f4d63d53ddcb" 999 + dependencies = [ 1000 + "const-oid", 1001 + "pem-rfc7468", 1002 + "zeroize", 1003 + ] 1004 + 1005 + [[package]] 1006 + name = "digest" 1007 + version = "0.10.7" 1008 + source = "registry+https://github.com/rust-lang/crates.io-index" 1009 + checksum = "9ed9a281f7bc9b7576e61468ba615a66a5c8cfdff42420a70aa82701a3b1e292" 1010 + dependencies = [ 1011 + "block-buffer", 1012 + "const-oid", 1013 + "crypto-common", 1014 + "subtle", 793 1015 ] 794 1016 795 1017 [[package]] ··· 885 1107 checksum = "d0881ea181b1df73ff77ffaaf9c7544ecc11e82fba9b5f27b262a3c73a332555" 886 1108 887 1109 [[package]] 1110 + name = "ecdsa" 1111 + version = "0.16.9" 1112 + source = "registry+https://github.com/rust-lang/crates.io-index" 1113 + checksum = "ee27f32b5c5292967d2d4a9d7f1e0b0aed2c15daded5a60300e4abb9d8020bca" 1114 + dependencies = [ 1115 + "der", 1116 + "digest", 1117 + "elliptic-curve", 1118 + "rfc6979", 1119 + "signature", 1120 + "spki", 1121 + ] 1122 + 1123 + [[package]] 1124 + name = "ed25519" 1125 + version = "2.2.3" 1126 + source = "registry+https://github.com/rust-lang/crates.io-index" 1127 + checksum = "115531babc129696a58c64a4fef0a8bf9e9698629fb97e9e40767d235cfbcd53" 1128 + dependencies = [ 1129 + "pkcs8", 1130 + "serde", 1131 + "signature", 1132 + ] 1133 + 1134 + [[package]] 1135 + name = "ed25519-dalek" 1136 + version = "2.2.0" 1137 + source = "registry+https://github.com/rust-lang/crates.io-index" 1138 + checksum = "70e796c081cee67dc755e1a36a0a172b897fab85fc3f6bc48307991f64e4eca9" 1139 + dependencies = [ 1140 + "curve25519-dalek", 1141 + "ed25519", 1142 + "rand_core 0.6.4", 1143 + "serde", 1144 + "sha2", 1145 + "subtle", 1146 + "zeroize", 1147 + ] 1148 + 1149 + [[package]] 888 1150 name = "either" 889 1151 version = "1.15.0" 890 1152 source = "registry+https://github.com/rust-lang/crates.io-index" 891 1153 checksum = "48c757948c5ede0e46177b7add2e67155f70e33c07fea8284df6576da70b3719" 892 1154 893 1155 [[package]] 1156 + name = "elliptic-curve" 1157 + version = "0.13.8" 1158 + source = "registry+https://github.com/rust-lang/crates.io-index" 1159 + checksum = "b5e6043086bf7973472e0c7dff2142ea0b680d30e18d9cc40f267efbf222bd47" 1160 + dependencies = [ 1161 + "base16ct", 1162 + "crypto-bigint", 1163 + "digest", 1164 + "ff", 1165 + "generic-array", 1166 + "group", 1167 + "pem-rfc7468", 1168 + "pkcs8", 1169 + "rand_core 0.6.4", 1170 + "sec1", 1171 + "subtle", 1172 + "zeroize", 1173 + ] 1174 + 1175 + [[package]] 894 1176 name = "encode_unicode" 895 1177 version = "1.0.0" 896 1178 source = "registry+https://github.com/rust-lang/crates.io-index" ··· 921 1203 "proc-macro2", 922 1204 "quote", 923 1205 "syn 2.0.113", 1206 + ] 1207 + 1208 + [[package]] 1209 + name = "env_filter" 1210 + version = "1.0.0" 1211 + source = "registry+https://github.com/rust-lang/crates.io-index" 1212 + checksum = "7a1c3cc8e57274ec99de65301228b537f1e4eedc1b8e0f9411c6caac8ae7308f" 1213 + dependencies = [ 1214 + "log", 1215 + "regex", 1216 + ] 1217 + 1218 + [[package]] 1219 + name = "env_logger" 1220 + version = "0.11.9" 1221 + source = "registry+https://github.com/rust-lang/crates.io-index" 1222 + checksum = "b2daee4ea451f429a58296525ddf28b45a3b64f1acf6587e2067437bb11e218d" 1223 + dependencies = [ 1224 + "env_filter", 1225 + "log", 924 1226 ] 925 1227 926 1228 [[package]] ··· 1003 1305 "rustix", 1004 1306 "windows-sys 0.59.0", 1005 1307 ] 1308 + 1309 + [[package]] 1310 + name = "ff" 1311 + version = "0.13.1" 1312 + source = "registry+https://github.com/rust-lang/crates.io-index" 1313 + checksum = "c0b50bfb653653f9ca9095b427bed08ab8d75a137839d9ad64eb11810d5b6393" 1314 + dependencies = [ 1315 + "rand_core 0.6.4", 1316 + "subtle", 1317 + ] 1318 + 1319 + [[package]] 1320 + name = "fiat-crypto" 1321 + version = "0.2.9" 1322 + source = "registry+https://github.com/rust-lang/crates.io-index" 1323 + checksum = "28dea519a9695b9977216879a3ebfddf92f1c08c05d984f8996aecd6ecdc811d" 1006 1324 1007 1325 [[package]] 1008 1326 name = "find-msvc-tools" ··· 1292 1610 ] 1293 1611 1294 1612 [[package]] 1613 + name = "generic-array" 1614 + version = "0.14.9" 1615 + source = "registry+https://github.com/rust-lang/crates.io-index" 1616 + checksum = "4bb6743198531e02858aeaea5398fcc883e71851fcbcb5a2f773e2fb6cb1edf2" 1617 + dependencies = [ 1618 + "typenum", 1619 + "version_check", 1620 + "zeroize", 1621 + ] 1622 + 1623 + [[package]] 1295 1624 name = "getrandom" 1296 1625 version = "0.2.16" 1297 1626 source = "registry+https://github.com/rust-lang/crates.io-index" ··· 1317 1646 ] 1318 1647 1319 1648 [[package]] 1649 + name = "getrandom" 1650 + version = "0.4.1" 1651 + source = "registry+https://github.com/rust-lang/crates.io-index" 1652 + checksum = "139ef39800118c7683f2fd3c98c1b23c09ae076556b435f8e9064ae108aaeeec" 1653 + dependencies = [ 1654 + "cfg-if", 1655 + "libc", 1656 + "r-efi", 1657 + "rand_core 0.10.0", 1658 + "wasip2", 1659 + "wasip3", 1660 + ] 1661 + 1662 + [[package]] 1320 1663 name = "glob" 1321 1664 version = "0.3.3" 1322 1665 source = "registry+https://github.com/rust-lang/crates.io-index" 1323 1666 checksum = "0cc23270f6e1808e30a928bdc84dea0b9b4136a8bc82338574f23baf47bbd280" 1667 + 1668 + [[package]] 1669 + name = "group" 1670 + version = "0.13.0" 1671 + source = "registry+https://github.com/rust-lang/crates.io-index" 1672 + checksum = "f0f9ef7462f7c099f518d754361858f86d8a07af53ba9af0fe635bbccb151a63" 1673 + dependencies = [ 1674 + "ff", 1675 + "rand_core 0.6.4", 1676 + "subtle", 1677 + ] 1324 1678 1325 1679 [[package]] 1326 1680 name = "h2" ··· 1407 1761 ] 1408 1762 1409 1763 [[package]] 1764 + name = "hmac" 1765 + version = "0.12.1" 1766 + source = "registry+https://github.com/rust-lang/crates.io-index" 1767 + checksum = "6c49c37c09c17a53d937dfbb742eb3a961d65a994e6bcdcf37e7399d0cc8ab5e" 1768 + dependencies = [ 1769 + "digest", 1770 + ] 1771 + 1772 + [[package]] 1410 1773 name = "home" 1411 1774 version = "0.5.12" 1412 1775 source = "registry+https://github.com/rust-lang/crates.io-index" ··· 1640 2003 ] 1641 2004 1642 2005 [[package]] 2006 + name = "id-arena" 2007 + version = "2.3.0" 2008 + source = "registry+https://github.com/rust-lang/crates.io-index" 2009 + checksum = "3d3067d79b975e8844ca9eb072e16b31c3c1c36928edf9c6789548c524d0d954" 2010 + 2011 + [[package]] 1643 2012 name = "ident_case" 1644 2013 version = "1.0.1" 1645 2014 source = "registry+https://github.com/rust-lang/crates.io-index" ··· 1674 2043 dependencies = [ 1675 2044 "equivalent", 1676 2045 "hashbrown 0.16.1", 2046 + "serde", 2047 + "serde_core", 1677 2048 ] 1678 2049 1679 2050 [[package]] ··· 1707 2078 ] 1708 2079 1709 2080 [[package]] 2081 + name = "ipld-core" 2082 + version = "0.4.3" 2083 + source = "registry+https://github.com/rust-lang/crates.io-index" 2084 + checksum = "090f624976d72f0b0bb71b86d58dc16c15e069193067cb3a3a09d655246cbbda" 2085 + dependencies = [ 2086 + "cid", 2087 + "quickcheck", 2088 + "serde", 2089 + "serde_bytes", 2090 + ] 2091 + 2092 + [[package]] 1710 2093 name = "ipnet" 1711 2094 version = "2.11.0" 1712 2095 source = "registry+https://github.com/rust-lang/crates.io-index" ··· 1764 2147 ] 1765 2148 1766 2149 [[package]] 2150 + name = "k256" 2151 + version = "0.13.4" 2152 + source = "registry+https://github.com/rust-lang/crates.io-index" 2153 + checksum = "f6e3919bbaa2945715f0bb6d3934a173d1e9a59ac23767fbaaef277265a7411b" 2154 + dependencies = [ 2155 + "cfg-if", 2156 + "ecdsa", 2157 + "elliptic-curve", 2158 + "once_cell", 2159 + "sha2", 2160 + "signature", 2161 + ] 2162 + 2163 + [[package]] 1767 2164 name = "kdam" 1768 2165 version = "0.6.4" 1769 2166 source = "registry+https://github.com/rust-lang/crates.io-index" ··· 1774 2171 ] 1775 2172 1776 2173 [[package]] 2174 + name = "keyring" 2175 + version = "3.6.3" 2176 + source = "registry+https://github.com/rust-lang/crates.io-index" 2177 + checksum = "eebcc3aff044e5944a8fbaf69eb277d11986064cba30c468730e8b9909fb551c" 2178 + dependencies = [ 2179 + "log", 2180 + "security-framework 2.11.1", 2181 + "security-framework 3.6.0", 2182 + "zeroize", 2183 + ] 2184 + 2185 + [[package]] 1777 2186 name = "lazy_static" 1778 2187 version = "1.5.0" 1779 2188 source = "registry+https://github.com/rust-lang/crates.io-index" 1780 2189 checksum = "bbd2bcb4c963f2ddae06a2efc7e9f3591312473c50c6685e1f298068316e66fe" 2190 + 2191 + [[package]] 2192 + name = "leb128" 2193 + version = "0.2.5" 2194 + source = "registry+https://github.com/rust-lang/crates.io-index" 2195 + checksum = "884e2677b40cc8c339eaefcb701c32ef1fd2493d71118dc0ca4b6a736c93bd67" 2196 + 2197 + [[package]] 2198 + name = "leb128fmt" 2199 + version = "0.1.0" 2200 + source = "registry+https://github.com/rust-lang/crates.io-index" 2201 + checksum = "09edd9e8b54e49e587e4f6295a7d29c3ea94d469cb40ab8ca70b288248a81db2" 1781 2202 1782 2203 [[package]] 1783 2204 name = "lexical-core" ··· 1949 2370 "spin", 1950 2371 "tokio", 1951 2372 "tokio-util", 1952 - "toml", 2373 + "toml 0.9.11+spec-1.1.0", 1953 2374 "tracing", 1954 2375 "tracing-subscriber", 1955 2376 ] ··· 1975 2396 "madsim", 1976 2397 "spin", 1977 2398 "tokio", 2399 + ] 2400 + 2401 + [[package]] 2402 + name = "match-lookup" 2403 + version = "0.1.2" 2404 + source = "registry+https://github.com/rust-lang/crates.io-index" 2405 + checksum = "757aee279b8bdbb9f9e676796fd459e4207a1f986e87886700abf589f5abf771" 2406 + dependencies = [ 2407 + "proc-macro2", 2408 + "quote", 2409 + "syn 2.0.113", 1978 2410 ] 1979 2411 1980 2412 [[package]] ··· 2046 2478 ] 2047 2479 2048 2480 [[package]] 2481 + name = "multibase" 2482 + version = "0.9.2" 2483 + source = "registry+https://github.com/rust-lang/crates.io-index" 2484 + checksum = "8694bb4835f452b0e3bb06dbebb1d6fc5385b6ca1caf2e55fd165c042390ec77" 2485 + dependencies = [ 2486 + "base-x", 2487 + "base256emoji", 2488 + "data-encoding", 2489 + "data-encoding-macro", 2490 + ] 2491 + 2492 + [[package]] 2493 + name = "multihash" 2494 + version = "0.19.3" 2495 + source = "registry+https://github.com/rust-lang/crates.io-index" 2496 + checksum = "6b430e7953c29dd6a09afc29ff0bb69c6e306329ee6794700aee27b76a1aea8d" 2497 + dependencies = [ 2498 + "arbitrary", 2499 + "core2", 2500 + "quickcheck", 2501 + "rand 0.8.5", 2502 + "serde", 2503 + "unsigned-varint", 2504 + ] 2505 + 2506 + [[package]] 2049 2507 name = "naive-timer" 2050 2508 version = "0.2.0" 2051 2509 source = "registry+https://github.com/rust-lang/crates.io-index" ··· 2072 2530 "openssl-probe", 2073 2531 "openssl-sys", 2074 2532 "schannel", 2075 - "security-framework", 2533 + "security-framework 2.11.1", 2076 2534 "security-framework-sys", 2077 2535 "tempfile", 2078 2536 ] ··· 2118 2576 ] 2119 2577 2120 2578 [[package]] 2579 + name = "nom-unicode" 2580 + version = "0.4.0" 2581 + source = "registry+https://github.com/rust-lang/crates.io-index" 2582 + checksum = "00dea06b6b61609274f105c468f1ea996d2f7226bfa528b4de79c05eabf5f759" 2583 + dependencies = [ 2584 + "nom 8.0.0", 2585 + ] 2586 + 2587 + [[package]] 2588 + name = "nonempty" 2589 + version = "0.10.0" 2590 + source = "registry+https://github.com/rust-lang/crates.io-index" 2591 + checksum = "303e8749c804ccd6ca3b428de7fe0d86cb86bc7606bc15291f100fd487960bb8" 2592 + dependencies = [ 2593 + "serde", 2594 + ] 2595 + 2596 + [[package]] 2121 2597 name = "nu-ansi-term" 2122 2598 version = "0.50.3" 2123 2599 source = "registry+https://github.com/rust-lang/crates.io-index" ··· 2303 2779 checksum = "9c6901729fa79e91a0913333229e9ca5dc725089d1c363b2f4b4760709dc4a52" 2304 2780 2305 2781 [[package]] 2782 + name = "p256" 2783 + version = "0.13.2" 2784 + source = "registry+https://github.com/rust-lang/crates.io-index" 2785 + checksum = "c9863ad85fa8f4460f9c48cb909d38a0d689dba1f6f6988a5e3e0d31071bcd4b" 2786 + dependencies = [ 2787 + "ecdsa", 2788 + "elliptic-curve", 2789 + "primeorder", 2790 + "sha2", 2791 + ] 2792 + 2793 + [[package]] 2306 2794 name = "panic-message" 2307 2795 version = "0.3.0" 2308 2796 source = "registry+https://github.com/rust-lang/crates.io-index" ··· 2377 2865 checksum = "57c0d7b74b563b49d38dae00a0c37d4d6de9b432382b2892f0574ddcae73fd0a" 2378 2866 2379 2867 [[package]] 2868 + name = "pem-rfc7468" 2869 + version = "0.7.0" 2870 + source = "registry+https://github.com/rust-lang/crates.io-index" 2871 + checksum = "88b39c9bfcfc231068454382784bb460aae594343fb030d46e9f50a645418412" 2872 + dependencies = [ 2873 + "base64ct", 2874 + ] 2875 + 2876 + [[package]] 2380 2877 name = "percent-encoding" 2381 2878 version = "2.3.2" 2382 2879 source = "registry+https://github.com/rust-lang/crates.io-index" ··· 2415 2912 checksum = "8b870d8c151b6f2fb93e84a13146138f05d02ed11c7e7c54f8826aaaf7c9f184" 2416 2913 2417 2914 [[package]] 2915 + name = "pkcs8" 2916 + version = "0.10.2" 2917 + source = "registry+https://github.com/rust-lang/crates.io-index" 2918 + checksum = "f950b2377845cebe5cf8b5165cb3cc1a5e0fa5cfa3e1f7f55707d8fd82e0a7b7" 2919 + dependencies = [ 2920 + "der", 2921 + "spki", 2922 + ] 2923 + 2924 + [[package]] 2418 2925 name = "pkg-config" 2419 2926 version = "0.3.32" 2420 2927 source = "registry+https://github.com/rust-lang/crates.io-index" ··· 2455 2962 ] 2456 2963 2457 2964 [[package]] 2965 + name = "primeorder" 2966 + version = "0.13.6" 2967 + source = "registry+https://github.com/rust-lang/crates.io-index" 2968 + checksum = "353e1ca18966c16d9deb1c69278edbc5f194139612772bd9537af60ac231e1e6" 2969 + dependencies = [ 2970 + "elliptic-curve", 2971 + ] 2972 + 2973 + [[package]] 2458 2974 name = "proc-macro-crate" 2459 2975 version = "3.4.0" 2460 2976 source = "registry+https://github.com/rust-lang/crates.io-index" ··· 2473 2989 ] 2474 2990 2475 2991 [[package]] 2992 + name = "quickcheck" 2993 + version = "1.1.0" 2994 + source = "registry+https://github.com/rust-lang/crates.io-index" 2995 + checksum = "95c589f335db0f6aaa168a7cd27b1fc6920f5e1470c804f814d9cd6e62a0f70b" 2996 + dependencies = [ 2997 + "env_logger", 2998 + "log", 2999 + "rand 0.10.0", 3000 + ] 3001 + 3002 + [[package]] 2476 3003 name = "quote" 2477 3004 version = "1.0.42" 2478 3005 source = "registry+https://github.com/rust-lang/crates.io-index" ··· 2519 3046 ] 2520 3047 2521 3048 [[package]] 3049 + name = "rand" 3050 + version = "0.10.0" 3051 + source = "registry+https://github.com/rust-lang/crates.io-index" 3052 + checksum = "bc266eb313df6c5c09c1c7b1fbe2510961e5bcd3add930c1e31f7ed9da0feff8" 3053 + dependencies = [ 3054 + "getrandom 0.4.1", 3055 + "rand_core 0.10.0", 3056 + ] 3057 + 3058 + [[package]] 2522 3059 name = "rand_chacha" 2523 3060 version = "0.3.1" 2524 3061 source = "registry+https://github.com/rust-lang/crates.io-index" ··· 2555 3092 dependencies = [ 2556 3093 "getrandom 0.3.4", 2557 3094 ] 3095 + 3096 + [[package]] 3097 + name = "rand_core" 3098 + version = "0.10.0" 3099 + source = "registry+https://github.com/rust-lang/crates.io-index" 3100 + checksum = "0c8d0fd677905edcbeedbf2edb6494d676f0e98d54d5cf9bda0b061cb8fb8aba" 2558 3101 2559 3102 [[package]] 2560 3103 name = "rand_xoshiro" ··· 2722 3265 ] 2723 3266 2724 3267 [[package]] 3268 + name = "rfc6979" 3269 + version = "0.4.0" 3270 + source = "registry+https://github.com/rust-lang/crates.io-index" 3271 + checksum = "f8dd2a808d456c4a54e300a23e9f5a67e122c3024119acbfd73e3bf664491cb2" 3272 + dependencies = [ 3273 + "hmac", 3274 + "subtle", 3275 + ] 3276 + 3277 + [[package]] 2725 3278 name = "rig-core" 2726 3279 version = "0.22.0" 2727 3280 source = "registry+https://github.com/rust-lang/crates.io-index" ··· 2924 3477 checksum = "94143f37725109f92c262ed2cf5e59bce7498c01bcc1502d7b9afe439a4e9f49" 2925 3478 2926 3479 [[package]] 3480 + name = "sec1" 3481 + version = "0.7.3" 3482 + source = "registry+https://github.com/rust-lang/crates.io-index" 3483 + checksum = "d3e97a565f76233a6003f9f5c54be1d9c5bdfa3eccfb189469f11ec4901c47dc" 3484 + dependencies = [ 3485 + "base16ct", 3486 + "der", 3487 + "generic-array", 3488 + "pkcs8", 3489 + "subtle", 3490 + "zeroize", 3491 + ] 3492 + 3493 + [[package]] 2927 3494 name = "security-framework" 2928 3495 version = "2.11.1" 2929 3496 source = "registry+https://github.com/rust-lang/crates.io-index" 2930 3497 checksum = "897b2245f0b511c87893af39b033e5ca9cce68824c4d7e7630b5a1d339658d02" 2931 3498 dependencies = [ 2932 3499 "bitflags", 2933 - "core-foundation", 3500 + "core-foundation 0.9.4", 3501 + "core-foundation-sys", 3502 + "libc", 3503 + "security-framework-sys", 3504 + ] 3505 + 3506 + [[package]] 3507 + name = "security-framework" 3508 + version = "3.6.0" 3509 + source = "registry+https://github.com/rust-lang/crates.io-index" 3510 + checksum = "d17b898a6d6948c3a8ee4372c17cb384f90d2e6e912ef00895b14fd7ab54ec38" 3511 + dependencies = [ 3512 + "bitflags", 3513 + "core-foundation 0.10.1", 2934 3514 "core-foundation-sys", 2935 3515 "libc", 2936 3516 "security-framework-sys", ··· 2938 3518 2939 3519 [[package]] 2940 3520 name = "security-framework-sys" 2941 - version = "2.15.0" 3521 + version = "2.16.0" 2942 3522 source = "registry+https://github.com/rust-lang/crates.io-index" 2943 - checksum = "cc1f0cbffaac4852523ce30d8bd3c5cdc873501d96ff467ca09b6767bb8cd5c0" 3523 + checksum = "321c8673b092a9a42605034a9879d73cb79101ed5fd117bc9a597b89b4e9e61a" 2944 3524 dependencies = [ 2945 3525 "core-foundation-sys", 2946 3526 "libc", ··· 2969 3549 ] 2970 3550 2971 3551 [[package]] 3552 + name = "serde-value" 3553 + version = "0.7.0" 3554 + source = "registry+https://github.com/rust-lang/crates.io-index" 3555 + checksum = "f3a1a3341211875ef120e117ea7fd5228530ae7e7036a779fdc9117be6b3282c" 3556 + dependencies = [ 3557 + "ordered-float 2.10.1", 3558 + "serde", 3559 + ] 3560 + 3561 + [[package]] 3562 + name = "serde_bytes" 3563 + version = "0.11.19" 3564 + source = "registry+https://github.com/rust-lang/crates.io-index" 3565 + checksum = "a5d440709e79d88e51ac01c4b72fc6cb7314017bb7da9eeff678aa94c10e3ea8" 3566 + dependencies = [ 3567 + "serde", 3568 + "serde_core", 3569 + ] 3570 + 3571 + [[package]] 2972 3572 name = "serde_core" 2973 3573 version = "1.0.228" 2974 3574 source = "registry+https://github.com/rust-lang/crates.io-index" ··· 3000 3600 ] 3001 3601 3002 3602 [[package]] 3603 + name = "serde_ipld_dagcbor" 3604 + version = "0.6.4" 3605 + source = "registry+https://github.com/rust-lang/crates.io-index" 3606 + checksum = "46182f4f08349a02b45c998ba3215d3f9de826246ba02bb9dddfe9a2a2100778" 3607 + dependencies = [ 3608 + "cbor4ii", 3609 + "ipld-core", 3610 + "scopeguard", 3611 + "serde", 3612 + ] 3613 + 3614 + [[package]] 3003 3615 name = "serde_json" 3004 3616 version = "1.0.148" 3005 3617 source = "registry+https://github.com/rust-lang/crates.io-index" ··· 3035 3647 ] 3036 3648 3037 3649 [[package]] 3650 + name = "sha2" 3651 + version = "0.10.9" 3652 + source = "registry+https://github.com/rust-lang/crates.io-index" 3653 + checksum = "a7507d819769d01a365ab707794a4084392c824f54a7a6a7862f8c3d0892b283" 3654 + dependencies = [ 3655 + "cfg-if", 3656 + "cpufeatures", 3657 + "digest", 3658 + ] 3659 + 3660 + [[package]] 3038 3661 name = "sharded-slab" 3039 3662 version = "0.1.7" 3040 3663 source = "registry+https://github.com/rust-lang/crates.io-index" ··· 3060 3683 ] 3061 3684 3062 3685 [[package]] 3686 + name = "signature" 3687 + version = "2.2.0" 3688 + source = "registry+https://github.com/rust-lang/crates.io-index" 3689 + checksum = "77549399552de45a898a580c1b41d445bf730df867cc44e6c0233bbc4b8329de" 3690 + dependencies = [ 3691 + "digest", 3692 + "rand_core 0.6.4", 3693 + ] 3694 + 3695 + [[package]] 3063 3696 name = "simd-adler32" 3064 3697 version = "0.3.8" 3065 3698 source = "registry+https://github.com/rust-lang/crates.io-index" ··· 3123 3756 checksum = "6980e8d7511241f8acf4aebddbb1ff938df5eebe98691418c4468d0b72a96a67" 3124 3757 dependencies = [ 3125 3758 "lock_api", 3759 + ] 3760 + 3761 + [[package]] 3762 + name = "spki" 3763 + version = "0.7.3" 3764 + source = "registry+https://github.com/rust-lang/crates.io-index" 3765 + checksum = "d91ed6c858b01f942cd56b37a94b3e0a1798290327d1236e4d9cf4eaca44d29d" 3766 + dependencies = [ 3767 + "base64ct", 3768 + "der", 3126 3769 ] 3127 3770 3128 3771 [[package]] ··· 3198 3841 checksum = "3c879d448e9d986b661742763247d3693ed13609438cf3d006f51f5368a5ba6b" 3199 3842 dependencies = [ 3200 3843 "bitflags", 3201 - "core-foundation", 3844 + "core-foundation 0.9.4", 3202 3845 "system-configuration-sys", 3203 3846 ] 3204 3847 ··· 3302 3945 "anyhow", 3303 3946 "bon", 3304 3947 "dspy-rs", 3948 + "ed25519-dalek", 3305 3949 "indexmap", 3950 + "keyring", 3306 3951 "nom 8.0.0", 3307 3952 "serde", 3308 3953 "serde_json", 3309 3954 "tokio", 3955 + "ucan", 3310 3956 ] 3311 3957 3312 3958 [[package]] ··· 3317 3963 "clap", 3318 3964 "futures-util", 3319 3965 "hf-hub", 3966 + "keyring", 3320 3967 "owo-colors", 3321 3968 "reqwest", 3322 3969 "rustyline", ··· 3325 3972 "tempfile", 3326 3973 "tilekit", 3327 3974 "tokio", 3975 + "toml 1.0.3+spec-1.1.0", 3328 3976 ] 3329 3977 3330 3978 [[package]] ··· 3416 4064 "indexmap", 3417 4065 "serde_core", 3418 4066 "serde_spanned", 3419 - "toml_datetime", 4067 + "toml_datetime 0.7.5+spec-1.1.0", 4068 + "toml_parser", 4069 + "toml_writer", 4070 + "winnow", 4071 + ] 4072 + 4073 + [[package]] 4074 + name = "toml" 4075 + version = "1.0.3+spec-1.1.0" 4076 + source = "registry+https://github.com/rust-lang/crates.io-index" 4077 + checksum = "c7614eaf19ad818347db24addfa201729cf2a9b6fdfd9eb0ab870fcacc606c0c" 4078 + dependencies = [ 4079 + "indexmap", 4080 + "serde_core", 4081 + "serde_spanned", 4082 + "toml_datetime 1.0.0+spec-1.1.0", 3420 4083 "toml_parser", 3421 4084 "toml_writer", 3422 4085 "winnow", ··· 3432 4095 ] 3433 4096 3434 4097 [[package]] 4098 + name = "toml_datetime" 4099 + version = "1.0.0+spec-1.1.0" 4100 + source = "registry+https://github.com/rust-lang/crates.io-index" 4101 + checksum = "32c2555c699578a4f59f0cc68e5116c8d7cabbd45e1409b989d4be085b53f13e" 4102 + dependencies = [ 4103 + "serde_core", 4104 + ] 4105 + 4106 + [[package]] 3435 4107 name = "toml_edit" 3436 4108 version = "0.23.10+spec-1.0.0" 3437 4109 source = "registry+https://github.com/rust-lang/crates.io-index" 3438 4110 checksum = "84c8b9f757e028cee9fa244aea147aab2a9ec09d5325a9b01e0a49730c2b5269" 3439 4111 dependencies = [ 3440 4112 "indexmap", 3441 - "toml_datetime", 4113 + "toml_datetime 0.7.5+spec-1.1.0", 3442 4114 "toml_parser", 3443 4115 "winnow", 3444 4116 ] 3445 4117 3446 4118 [[package]] 3447 4119 name = "toml_parser" 3448 - version = "1.0.6+spec-1.1.0" 4120 + version = "1.0.9+spec-1.1.0" 3449 4121 source = "registry+https://github.com/rust-lang/crates.io-index" 3450 - checksum = "a3198b4b0a8e11f09dd03e133c0280504d0801269e9afa46362ffde1cbeebf44" 4122 + checksum = "702d4415e08923e7e1ef96cd5727c0dfed80b4d2fa25db9647fe5eb6f7c5a4c4" 3451 4123 dependencies = [ 3452 4124 "winnow", 3453 4125 ] ··· 3588 4260 ] 3589 4261 3590 4262 [[package]] 4263 + name = "typenum" 4264 + version = "1.19.0" 4265 + source = "registry+https://github.com/rust-lang/crates.io-index" 4266 + checksum = "562d481066bde0658276a35467c4af00bdc6ee726305698a55b86e61d7ad82bb" 4267 + 4268 + [[package]] 4269 + name = "ucan" 4270 + version = "0.5.0" 4271 + source = "git+https://github.com/ucan-wg/rs-ucan.git?branch=main#c4d1cb7558582cbe0fe1f21b22026fe8303a0cab" 4272 + dependencies = [ 4273 + "base58", 4274 + "ed25519-dalek", 4275 + "futures", 4276 + "getrandom 0.2.16", 4277 + "ipld-core", 4278 + "leb128", 4279 + "nom 8.0.0", 4280 + "nom-unicode", 4281 + "nonempty", 4282 + "serde", 4283 + "serde-value", 4284 + "serde_bytes", 4285 + "serde_ipld_dagcbor", 4286 + "sha2", 4287 + "signature", 4288 + "thiserror 1.0.69", 4289 + "tracing", 4290 + "varsig", 4291 + ] 4292 + 4293 + [[package]] 3591 4294 name = "unicase" 3592 4295 version = "2.9.0" 3593 4296 source = "registry+https://github.com/rust-lang/crates.io-index" ··· 3610 4313 version = "0.2.2" 3611 4314 source = "registry+https://github.com/rust-lang/crates.io-index" 3612 4315 checksum = "b4ac048d71ede7ee76d585517add45da530660ef4390e49b098733c6e897f254" 4316 + 4317 + [[package]] 4318 + name = "unicode-xid" 4319 + version = "0.2.6" 4320 + source = "registry+https://github.com/rust-lang/crates.io-index" 4321 + checksum = "ebc1c04c71510c7f702b52b7c350734c9ff1295c464a03335b00bb84fc54f853" 4322 + 4323 + [[package]] 4324 + name = "unsigned-varint" 4325 + version = "0.8.0" 4326 + source = "registry+https://github.com/rust-lang/crates.io-index" 4327 + checksum = "eb066959b24b5196ae73cb057f45598450d2c5f71460e98c49b738086eff9c06" 3613 4328 3614 4329 [[package]] 3615 4330 name = "untrusted" ··· 3668 4383 checksum = "ba73ea9cf16a25df0c8caa16c51acb937d5712a8429db78a3ee29d5dcacd3a65" 3669 4384 3670 4385 [[package]] 4386 + name = "varsig" 4387 + version = "0.1.0" 4388 + source = "git+https://github.com/ucan-wg/rs-ucan.git?branch=main#c4d1cb7558582cbe0fe1f21b22026fe8303a0cab" 4389 + dependencies = [ 4390 + "async-signature", 4391 + "ed25519-dalek", 4392 + "ipld-core", 4393 + "k256", 4394 + "leb128", 4395 + "p256", 4396 + "serde", 4397 + "serde_bytes", 4398 + "serde_ipld_dagcbor", 4399 + "signature", 4400 + "thiserror 1.0.69", 4401 + "tracing", 4402 + ] 4403 + 4404 + [[package]] 3671 4405 name = "vcpkg" 3672 4406 version = "0.2.15" 3673 4407 source = "registry+https://github.com/rust-lang/crates.io-index" ··· 3700 4434 source = "registry+https://github.com/rust-lang/crates.io-index" 3701 4435 checksum = "0562428422c63773dad2c345a1882263bbf4d65cf3f42e90921f787ef5ad58e7" 3702 4436 dependencies = [ 3703 - "wit-bindgen", 4437 + "wit-bindgen 0.46.0", 4438 + ] 4439 + 4440 + [[package]] 4441 + name = "wasip3" 4442 + version = "0.4.0+wasi-0.3.0-rc-2026-01-06" 4443 + source = "registry+https://github.com/rust-lang/crates.io-index" 4444 + checksum = "5428f8bf88ea5ddc08faddef2ac4a67e390b88186c703ce6dbd955e1c145aca5" 4445 + dependencies = [ 4446 + "wit-bindgen 0.51.0", 3704 4447 ] 3705 4448 3706 4449 [[package]] ··· 3762 4505 ] 3763 4506 3764 4507 [[package]] 4508 + name = "wasm-encoder" 4509 + version = "0.244.0" 4510 + source = "registry+https://github.com/rust-lang/crates.io-index" 4511 + checksum = "990065f2fe63003fe337b932cfb5e3b80e0b4d0f5ff650e6985b1048f62c8319" 4512 + dependencies = [ 4513 + "leb128fmt", 4514 + "wasmparser", 4515 + ] 4516 + 4517 + [[package]] 4518 + name = "wasm-metadata" 4519 + version = "0.244.0" 4520 + source = "registry+https://github.com/rust-lang/crates.io-index" 4521 + checksum = "bb0e353e6a2fbdc176932bbaab493762eb1255a7900fe0fea1a2f96c296cc909" 4522 + dependencies = [ 4523 + "anyhow", 4524 + "indexmap", 4525 + "wasm-encoder", 4526 + "wasmparser", 4527 + ] 4528 + 4529 + [[package]] 3765 4530 name = "wasm-streams" 3766 4531 version = "0.4.2" 3767 4532 source = "registry+https://github.com/rust-lang/crates.io-index" ··· 3772 4537 "wasm-bindgen", 3773 4538 "wasm-bindgen-futures", 3774 4539 "web-sys", 4540 + ] 4541 + 4542 + [[package]] 4543 + name = "wasmparser" 4544 + version = "0.244.0" 4545 + source = "registry+https://github.com/rust-lang/crates.io-index" 4546 + checksum = "47b807c72e1bac69382b3a6fb3dbe8ea4c0ed87ff5629b8685ae6b9a611028fe" 4547 + dependencies = [ 4548 + "bitflags", 4549 + "hashbrown 0.15.5", 4550 + "indexmap", 4551 + "semver", 3775 4552 ] 3776 4553 3777 4554 [[package]] ··· 4083 4860 version = "0.46.0" 4084 4861 source = "registry+https://github.com/rust-lang/crates.io-index" 4085 4862 checksum = "f17a85883d4e6d00e8a97c586de764dabcc06133f7f1d55dce5cdc070ad7fe59" 4863 + 4864 + [[package]] 4865 + name = "wit-bindgen" 4866 + version = "0.51.0" 4867 + source = "registry+https://github.com/rust-lang/crates.io-index" 4868 + checksum = "d7249219f66ced02969388cf2bb044a09756a083d0fab1e566056b04d9fbcaa5" 4869 + dependencies = [ 4870 + "wit-bindgen-rust-macro", 4871 + ] 4872 + 4873 + [[package]] 4874 + name = "wit-bindgen-core" 4875 + version = "0.51.0" 4876 + source = "registry+https://github.com/rust-lang/crates.io-index" 4877 + checksum = "ea61de684c3ea68cb082b7a88508a8b27fcc8b797d738bfc99a82facf1d752dc" 4878 + dependencies = [ 4879 + "anyhow", 4880 + "heck", 4881 + "wit-parser", 4882 + ] 4883 + 4884 + [[package]] 4885 + name = "wit-bindgen-rust" 4886 + version = "0.51.0" 4887 + source = "registry+https://github.com/rust-lang/crates.io-index" 4888 + checksum = "b7c566e0f4b284dd6561c786d9cb0142da491f46a9fbed79ea69cdad5db17f21" 4889 + dependencies = [ 4890 + "anyhow", 4891 + "heck", 4892 + "indexmap", 4893 + "prettyplease", 4894 + "syn 2.0.113", 4895 + "wasm-metadata", 4896 + "wit-bindgen-core", 4897 + "wit-component", 4898 + ] 4899 + 4900 + [[package]] 4901 + name = "wit-bindgen-rust-macro" 4902 + version = "0.51.0" 4903 + source = "registry+https://github.com/rust-lang/crates.io-index" 4904 + checksum = "0c0f9bfd77e6a48eccf51359e3ae77140a7f50b1e2ebfe62422d8afdaffab17a" 4905 + dependencies = [ 4906 + "anyhow", 4907 + "prettyplease", 4908 + "proc-macro2", 4909 + "quote", 4910 + "syn 2.0.113", 4911 + "wit-bindgen-core", 4912 + "wit-bindgen-rust", 4913 + ] 4914 + 4915 + [[package]] 4916 + name = "wit-component" 4917 + version = "0.244.0" 4918 + source = "registry+https://github.com/rust-lang/crates.io-index" 4919 + checksum = "9d66ea20e9553b30172b5e831994e35fbde2d165325bec84fc43dbf6f4eb9cb2" 4920 + dependencies = [ 4921 + "anyhow", 4922 + "bitflags", 4923 + "indexmap", 4924 + "log", 4925 + "serde", 4926 + "serde_derive", 4927 + "serde_json", 4928 + "wasm-encoder", 4929 + "wasm-metadata", 4930 + "wasmparser", 4931 + "wit-parser", 4932 + ] 4933 + 4934 + [[package]] 4935 + name = "wit-parser" 4936 + version = "0.244.0" 4937 + source = "registry+https://github.com/rust-lang/crates.io-index" 4938 + checksum = "ecc8ac4bc1dc3381b7f59c34f00b67e18f910c2c0f50015669dde7def656a736" 4939 + dependencies = [ 4940 + "anyhow", 4941 + "id-arena", 4942 + "indexmap", 4943 + "log", 4944 + "semver", 4945 + "serde", 4946 + "serde_derive", 4947 + "serde_json", 4948 + "unicode-xid", 4949 + "wasmparser", 4950 + ] 4086 4951 4087 4952 [[package]] 4088 4953 name = "writeable"
+3
tilekit/Cargo.toml
··· 12 12 dspy-rs = "0.7.3" 13 13 bon = "3.7.0" 14 14 indexmap = "2.2.0" 15 + ucan = { git = "https://github.com/ucan-wg/rs-ucan.git", branch = "main", package = "ucan" } 16 + ed25519-dalek = { version = "2.2", features = ["rand_core"] } 17 + keyring = { version = "3", features = ["apple-native"] }
+40
tilekit/src/accounts.rs
··· 1 + //! Handles stuff related to accounts, identity etc.. 2 + 3 + use anyhow::Result; 4 + use ed25519_dalek::{SigningKey, ed25519::signature::rand_core::OsRng}; 5 + use keyring::Entry; 6 + use ucan::did::Ed25519Did; 7 + 8 + type Did = String; 9 + type Identity = Did; 10 + 11 + /// Creates an `Identity` for given application 12 + /// The keypair generated will be stored in OS secure storage 13 + /// 14 + /// # Arguments 15 + /// 16 + /// - `app`: The service for which Identity is made (for ex: tiles) 17 + pub fn create_identity(app: &str) -> Result<Identity> { 18 + let mut csprng = OsRng; 19 + let signing_key = SigningKey::generate(&mut csprng); 20 + let ed_did = Ed25519Did::from(signing_key.clone()); 21 + let did = ed_did.to_string(); 22 + let entry = Entry::new(app, &did)?; 23 + entry.set_secret(&signing_key.to_keypair_bytes())?; 24 + Ok(did) 25 + } 26 + 27 + #[cfg(test)] 28 + mod tests { 29 + use keyring::{mock, set_default_credential_builder}; 30 + 31 + use super::*; 32 + 33 + #[test] 34 + fn test_create_success() -> Result<()> { 35 + set_default_credential_builder(mock::default_credential_builder()); 36 + let did = create_identity("tiles")?; 37 + assert!(did.starts_with("did:key")); 38 + Ok(()) 39 + } 40 + }
+1
tilekit/src/lib.rs
··· 1 + pub mod accounts; 1 2 pub mod modelfile; 2 3 pub mod optimize;
-2
tilekit/src/modelfile.rs
··· 341 341 .parse(input) 342 342 } 343 343 fn create_modelfile(commands: Vec<(&str, Output)>) -> Result<Modelfile, String> { 344 - // TODO: There might be a better way 345 344 let mut modelfile: Modelfile = Modelfile::new(); 346 345 for command in commands { 347 346 let _ = match (command.0.to_lowercase().as_str(), command.1) { 348 - //TODO: Can add validations for path if its a gguf file later 349 347 ("from", Output::Single(from)) => modelfile.add_from(from.trim()), 350 348 ("parameter", Output::Pair((param, argument))) => { 351 349 modelfile.add_parameter(param, argument.trim())
+2 -1
tiles/Cargo.toml
··· 15 15 futures-util = "0.3" 16 16 hf-hub = {version = "0.4", features = ["tokio"]} 17 17 rustyline = "17.0" 18 - 18 + toml = "1.0.3" 19 19 [dev-dependencies] 20 20 tempfile = "3" 21 + keyring = { version = "3", features = ["apple-native"] }
+64 -1
tiles/src/commands/mod.rs
··· 1 1 // Module that handles CLI commands 2 2 3 + use anyhow::Result; 3 4 use owo_colors::OwoColorize; 4 5 use tiles::runtime::Runtime; 5 - use tiles::utils::config::set_memory_path; 6 + use tiles::utils::accounts::{ 7 + RootUser, create_root_account, get_root_user_details, save_root_account, set_nickname, 8 + }; 9 + use tiles::utils::config::{get_or_create_config, set_memory_path}; 6 10 use tiles::{core::health, runtime::RunArgs}; 7 11 8 12 pub use tilekit::optimize::optimize; 13 + 14 + use crate::{AccountArgs, AccountCommands}; 9 15 10 16 pub async fn run(runtime: &Runtime, run_args: RunArgs) { 11 17 let _ = runtime.run(run_args).await; ··· 33 39 pub async fn stop_server(runtime: &Runtime) { 34 40 let _ = runtime.stop_server_daemon().await; 35 41 } 42 + 43 + /// Runs the account command with the args being passed. 44 + pub fn run_account_commands(account_args: AccountArgs) -> Result<()> { 45 + let config = get_or_create_config()?; 46 + let root_user_details = get_root_user_details(&config)?; 47 + match account_args.command { 48 + Some(AccountCommands::Create { nickname }) => { 49 + if !root_user_details.id.is_empty() { 50 + println!("Root account exists with id: {}", root_user_details.id) 51 + } else { 52 + let root_user_config = RootUser::new(&create_root_account(&config, nickname)?)?; 53 + 54 + save_root_account(config, &root_user_config.to_table())?; 55 + println!( 56 + "{}", 57 + format_args!( 58 + "Root account has been created with id: {}", 59 + root_user_config.id 60 + ) 61 + ) 62 + } 63 + } 64 + Some(AccountCommands::SetNickname { nickname }) => { 65 + if root_user_details.id.is_empty() { 66 + println!("{}", get_account_not_created_msg()); 67 + } else { 68 + match set_nickname(&config, nickname) { 69 + Ok(root_user_config) => { 70 + let id = root_user_config.get("id").unwrap().as_str().unwrap(); 71 + let nickname = root_user_config.get("nickname").unwrap().as_str().unwrap(); 72 + save_root_account(config, &root_user_config)?; 73 + println!("Nickname {} has been set for ID: {}", nickname, id) 74 + } 75 + Err(err) => { 76 + println!("Failed to set nickname due to {}", err) 77 + } 78 + } 79 + } 80 + } 81 + _ => { 82 + if root_user_details.id.is_empty() { 83 + println!("{}", get_account_not_created_msg()); 84 + } else { 85 + println!("{}", root_user_details); 86 + } 87 + } 88 + } 89 + 90 + Ok(()) 91 + } 92 + 93 + fn get_account_not_created_msg() -> String { 94 + format!( 95 + "Root account not created yet, use {}", 96 + "tiles account create".yellow() 97 + ) 98 + }
+22
tiles/src/main.rs
··· 44 44 #[arg(long, default_value = "openai:gpt-4o-mini")] 45 45 model: String, 46 46 }, 47 + /// Manage user account 48 + Account(AccountArgs), 47 49 } 48 50 49 51 #[derive(Debug, Args)] ··· 90 92 SetPath { path: String }, 91 93 } 92 94 95 + #[derive(Debug, Args)] 96 + #[command(args_conflicts_with_subcommands = true)] 97 + #[command(flatten_help = true)] 98 + struct AccountArgs { 99 + #[command(subcommand)] 100 + command: Option<AccountCommands>, 101 + } 102 + 103 + #[derive(Debug, Subcommand)] 104 + enum AccountCommands { 105 + /// Creates a local root account 106 + Create { nickname: Option<String> }, 107 + 108 + /// Sets nickname to local root account 109 + SetNickname { nickname: String }, 110 + } 111 + 93 112 #[tokio::main(flavor = "current_thread")] 94 113 pub async fn main() -> Result<(), Box<dyn Error>> { 95 114 let cli = Cli::parse(); ··· 125 144 let modelfile = commands::optimize(modelfile_path.clone(), data, model).await?; 126 145 std::fs::write(&modelfile_path, modelfile.to_string())?; 127 146 println!("Successfully updated {}", modelfile_path); 147 + } 148 + Commands::Account(account_args) => { 149 + commands::run_account_commands(account_args)?; 128 150 } 129 151 } 130 152 Ok(())
-1
tiles/src/runtime/mlx.rs
··· 118 118 .spawn() 119 119 .expect("failed to start server"); 120 120 121 - fs::create_dir_all(&config_dir).context("Failed to create config directory")?; 122 121 std::fs::write(pid_file, child.id().to_string()).unwrap(); 123 122 println!("Server started with PID {}", child.id()); 124 123 Ok(())
+256
tiles/src/utils/accounts.rs
··· 1 + // Stuff related to account and identity system 2 + use anyhow::{Result, anyhow}; 3 + use std::fmt::Display; 4 + use tilekit::accounts::create_identity; 5 + use toml::Table; 6 + 7 + use crate::utils::config::save_config; 8 + const ROOT_USER_CONFIG_KEY: &str = "root-user"; 9 + 10 + #[allow(dead_code)] 11 + pub struct RootUser { 12 + pub id: String, 13 + pub nickname: String, 14 + } 15 + 16 + impl Display for RootUser { 17 + fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { 18 + write!(f, "id: {}\nnickname: {}\n", self.id, self.nickname) 19 + } 20 + } 21 + 22 + impl RootUser { 23 + pub fn new(config: &Table) -> Result<Self> { 24 + let id = config 25 + .get("id") 26 + .ok_or_else(|| anyhow!("Missing ID"))? 27 + .as_str() 28 + .ok_or_else(|| anyhow!("ID not a string"))?; 29 + let nickname = config 30 + .get("nickname") 31 + .ok_or_else(|| anyhow!("Missing Nickname"))? 32 + .as_str() 33 + .ok_or_else(|| anyhow!("Nickname not a string"))?; 34 + Ok(RootUser { 35 + id: id.to_owned(), 36 + nickname: nickname.to_owned(), 37 + }) 38 + } 39 + 40 + pub fn to_table(&self) -> Table { 41 + let mut root_user_table = Table::new(); 42 + root_user_table.insert(String::from("id"), toml::Value::String(self.id.clone())); 43 + root_user_table.insert( 44 + String::from("nickname"), 45 + toml::Value::String(self.nickname.clone()), 46 + ); 47 + root_user_table 48 + } 49 + } 50 + 51 + /// Returns a `RootUser`, which represents a root user 52 + /// 53 + /// # Params 54 + /// 55 + /// - config: A `Table` type of entire config.toml file 56 + pub fn get_root_user_details(config: &Table) -> Result<RootUser> { 57 + let root_user = config 58 + .get(ROOT_USER_CONFIG_KEY) 59 + .ok_or_else(|| anyhow!("root-user key not found"))?; 60 + let root_user_table = root_user 61 + .as_table() 62 + .ok_or_else(|| anyhow!("root user not a table"))?; 63 + RootUser::new(root_user_table) 64 + } 65 + 66 + /// Create a root account 67 + /// Stores the private credentials in OS secure password manager 68 + /// 69 + /// # Params 70 + /// 71 + /// - config: A `Table` type of entire config.toml file 72 + /// - nickname: Nickname for the identity (Optional) 73 + /// 74 + /// Returns the root_user_config as a `Table` type 75 + pub fn create_root_account(config: &Table, nickname: Option<String>) -> Result<Table> { 76 + let root_user = config 77 + .get(ROOT_USER_CONFIG_KEY) 78 + .ok_or_else(|| anyhow!("{} doesn't exist", ROOT_USER_CONFIG_KEY))?; 79 + let root_user_table = root_user 80 + .as_table() 81 + .ok_or_else(|| anyhow!("Failed to parse root user info"))?; 82 + let root_user_data = RootUser::new(root_user_table)?; 83 + let did = root_user_data.id; 84 + if did.is_empty() { 85 + Ok(create_root_user(root_user_table, nickname)?) 86 + } else { 87 + Ok(root_user_table.clone()) 88 + } 89 + } 90 + 91 + /// Save the root config in `Table` type to config.toml 92 + /// 93 + /// # Params 94 + /// 95 + /// - config: A `Table` type of entire config.toml file 96 + /// - root_user_config: A `Table` type of root user 97 + pub fn save_root_account(mut config: Table, root_user_config: &Table) -> Result<()> { 98 + config.insert( 99 + String::from(ROOT_USER_CONFIG_KEY), 100 + toml::Value::Table(root_user_config.clone()), 101 + ); 102 + save_config(&config) 103 + } 104 + 105 + /// Sets nickname for the root account 106 + /// 107 + /// # Params 108 + /// 109 + /// - config: A `Table` type of entire config.toml file 110 + /// - nickname: Nickname for the identity 111 + /// 112 + /// Returns the root_user_config as a `Table` type 113 + pub fn set_nickname(config: &Table, nickname: String) -> Result<Table> { 114 + let root_user = config.get(ROOT_USER_CONFIG_KEY).unwrap(); 115 + let mut root_user_table = root_user.as_table().unwrap().clone(); 116 + let did = root_user_table.get("id").unwrap().as_str().unwrap(); 117 + if did.is_empty() { 118 + Err(anyhow::anyhow!("No Root user available")) 119 + } else { 120 + root_user_table.insert("id".to_owned(), toml::Value::String(did.to_owned())); 121 + root_user_table.insert("nickname".to_owned(), toml::Value::String(nickname)); 122 + Ok(root_user_table) 123 + } 124 + } 125 + 126 + fn create_root_user(root_user_config: &Table, nickname: Option<String>) -> Result<Table> { 127 + let mut root_user_table = root_user_config.clone(); 128 + match create_identity("tiles") { 129 + Ok(did) => { 130 + root_user_table.insert("id".to_owned(), toml::Value::String(did)); 131 + if let Some(nickname) = nickname { 132 + root_user_table.insert("nickname".to_owned(), toml::Value::String(nickname)); 133 + } 134 + Ok(root_user_table) 135 + } 136 + Err(err) => Err(err), 137 + } 138 + } 139 + 140 + #[cfg(test)] 141 + mod tests { 142 + use anyhow::Result; 143 + use keyring::{mock, set_default_credential_builder}; 144 + use toml::Table; 145 + 146 + use crate::utils::accounts::{create_root_account, get_root_user_details}; 147 + 148 + #[test] 149 + fn test_get_root_user_details_empty_id() -> Result<()> { 150 + let config: Table = toml::from_str( 151 + r#" 152 + [root-user] 153 + id = '' 154 + nickname = '' 155 + "#, 156 + ) 157 + .unwrap(); 158 + let acc_details = get_root_user_details(&config)?; 159 + assert!(acc_details.id.is_empty()); 160 + Ok(()) 161 + } 162 + 163 + #[test] 164 + fn test_get_root_user_details_valid_id() -> Result<()> { 165 + let config: Table = toml::from_str( 166 + r#" 167 + [root-user] 168 + id = 'did:key:xyz' 169 + nickname = '' 170 + "#, 171 + ) 172 + .unwrap(); 173 + let acc_details = get_root_user_details(&config)?; 174 + assert!(acc_details.id.contains("did:key")); 175 + Ok(()) 176 + } 177 + 178 + #[test] 179 + fn test_create_root_account_but_exists() { 180 + let config: Table = toml::from_str( 181 + r#" 182 + [root-user] 183 + id = 'did:key:xyz' 184 + nickname = '' 185 + "#, 186 + ) 187 + .unwrap(); 188 + let root_user = create_root_account(&config, None).unwrap(); 189 + 190 + assert_eq!( 191 + root_user.get("id").unwrap().as_str().unwrap(), 192 + "did:key:xyz" 193 + ); 194 + } 195 + 196 + #[test] 197 + fn test_create_root_account_new() { 198 + set_default_credential_builder(mock::default_credential_builder()); 199 + let config: Table = toml::from_str( 200 + r#" 201 + [root-user] 202 + id = '' 203 + nickname = '' 204 + "#, 205 + ) 206 + .unwrap(); 207 + let root_user = create_root_account(&config, None).unwrap(); 208 + 209 + assert_ne!( 210 + root_user.get("id").unwrap().as_str().unwrap(), 211 + "did:key:xyz" 212 + ); 213 + 214 + assert!( 215 + root_user 216 + .get("id") 217 + .unwrap() 218 + .as_str() 219 + .unwrap() 220 + .starts_with("did:key") 221 + ); 222 + } 223 + 224 + #[test] 225 + fn test_create_root_account_new_w_nickname() { 226 + set_default_credential_builder(mock::default_credential_builder()); 227 + let config: Table = toml::from_str( 228 + r#" 229 + [root-user] 230 + id = '' 231 + nickname = '' 232 + "#, 233 + ) 234 + .unwrap(); 235 + let root_user = create_root_account(&config, Some(String::from("madclaws"))).unwrap(); 236 + 237 + assert_ne!( 238 + root_user.get("id").unwrap().as_str().unwrap(), 239 + "did:key:xyz" 240 + ); 241 + 242 + assert!( 243 + root_user 244 + .get("id") 245 + .unwrap() 246 + .as_str() 247 + .unwrap() 248 + .starts_with("did:key") 249 + ); 250 + 251 + assert_eq!( 252 + root_user.get("nickname").unwrap().as_str().unwrap(), 253 + "madclaws" 254 + ); 255 + } 256 + }
+75 -24
tiles/src/utils/config.rs
··· 1 1 // Configuration related stuff 2 2 3 - use anyhow::{Context, Result}; 3 + use anyhow::{Context, Result, anyhow}; 4 4 use std::path::PathBuf; 5 5 use std::str::FromStr; 6 6 use std::{env, fs}; 7 + use toml::Table; 7 8 8 9 pub trait ConfigProvider { 9 10 fn get_config_dir(&self) -> Result<PathBuf>; ··· 59 60 } 60 61 61 62 pub fn get_memory_path() -> Result<String> { 62 - let tiles_config_dir = DefaultProvider.get_config_dir()?; 63 - let mut is_memory_path_found: bool = false; 64 - let mut memory_path: String = String::from(""); 65 - if tiles_config_dir.is_dir() 66 - && let Ok(content) = fs::read_to_string(tiles_config_dir.join(".memory_path")) 67 - { 68 - memory_path = content; 69 - is_memory_path_found = true; 70 - } 63 + let root_config = get_or_create_config()?; 64 + let memory_config = root_config 65 + .get("memory") 66 + .ok_or_else(|| anyhow!("memory section doesnt exist"))? 67 + .as_table() 68 + .expect("Failed to parse to table (memory)"); 71 69 72 - if is_memory_path_found { 73 - Ok(memory_path) 74 - } else { 70 + let path = memory_config 71 + .get("path") 72 + .ok_or_else(|| anyhow!("path doesnt exist (memory)"))? 73 + .as_str() 74 + .expect("parse failed (memory)"); 75 + if path.is_empty() { 75 76 Err(anyhow::anyhow!(format!("NOT SET"))) 77 + } else { 78 + Ok(path.to_owned()) 76 79 } 77 80 } 78 81 ··· 95 98 false 96 99 } 97 100 98 - fn set_memory_path_with_provider<P: ConfigProvider>(provider: &P, path: &str) -> Result<String> { 101 + fn set_memory_path_with_provider<P: ConfigProvider>(_provider: &P, path: &str) -> Result<String> { 99 102 let path_buf = PathBuf::from_str(path)?; 100 103 if path_buf.try_exists()? { 101 - let tiles_config_dir = provider.get_config_dir()?; 102 - let tiles_config_memory_path = tiles_config_dir.join(".memory_path"); 103 - if tiles_config_memory_path.try_exists()? { 104 - fs::write(tiles_config_memory_path, path)?; 105 - } else { 106 - fs::create_dir_all(&tiles_config_dir) 107 - .context("Failed to create tiles config directory")?; 108 - fs::write(tiles_config_memory_path, path) 109 - .context("Failed to write the memory path to .memory_path")?; 110 - } 104 + let mut root_config = get_or_create_config()?; 105 + let mut memory_config = root_config 106 + .get("memory") 107 + .ok_or_else(|| anyhow!("memory section doesnt exist"))? 108 + .as_table() 109 + .expect("Failed to parse to table (memory)") 110 + .clone(); 111 + memory_config.insert(String::from("path"), toml::Value::String(path.to_owned())); 112 + root_config.insert(String::from("memory"), toml::Value::Table(memory_config)); 113 + save_config(&root_config)?; 111 114 } else { 112 115 return Err(anyhow::anyhow!(format!( 113 116 "Not a valid path {}", ··· 119 122 path_buf.to_str().unwrap() 120 123 )) 121 124 } 125 + 126 + pub fn get_or_create_config() -> Result<Table> { 127 + let tiles_config_dir = DefaultProvider.get_config_dir()?; 128 + let config_toml_path = tiles_config_dir.join("config.toml"); 129 + 130 + fs::create_dir_all(&tiles_config_dir).context("Failed to create config directory")?; 131 + if config_toml_path.try_exists()? { 132 + let config_str = fs::read_to_string(config_toml_path)?; 133 + Ok(config_str.parse::<Table>()?) 134 + } else { 135 + let init_table: Table = toml::from_str( 136 + r#" 137 + [root-user] 138 + id = '' 139 + nickname = '' 140 + 141 + [memory] 142 + path = '' 143 + "#, 144 + )?; 145 + fs::write(config_toml_path, init_table.to_string())?; 146 + Ok(init_table) 147 + } 148 + } 149 + 150 + /// Saves the root config toml `Table` type 151 + pub fn save_config(config: &Table) -> Result<()> { 152 + let tiles_config_dir = DefaultProvider.get_config_dir()?; 153 + let config_path = tiles_config_dir.join("config.toml"); 154 + let tmp_path = tiles_config_dir.join("config.tmp.toml"); 155 + fs::write(&tmp_path, config.to_string())?; 156 + fs::copy(&tmp_path, &config_path)?; 157 + fs::remove_file(tmp_path)?; 158 + Ok(()) 159 + } 160 + 161 + //TODO: Add more tests for config.toml 162 + #[cfg(test)] 163 + mod tests { 164 + 165 + use super::*; 166 + 167 + #[test] 168 + fn test_create_config_file() -> Result<()> { 169 + let _config_table = get_or_create_config()?; 170 + Ok(()) 171 + } 172 + }
+1
tiles/src/utils/mod.rs
··· 1 + pub mod accounts; 1 2 pub mod config; 2 3 pub mod hf_model_downloader;