Skip to content

armgit / ente

Public Imported from GitHub
0

πŸ’š End-to-end encrypted cloud for everything.

Remove redundant llmchat and core_uniffi Rust packages

Prateek Sunal141143ea19b1
diff --git a/mobile/native/android/packages/rust/tool/build_android.sh b/mobile/native/android/packages/rust/tool/build_android.sh
index 01df3f034d..21fab39461 100755
--- a/mobile/native/android/packages/rust/tool/build_android.sh
+++ b/mobile/native/android/packages/rust/tool/build_android.sh
@@ -122,11 +122,8 @@ ensure_uniffi_bindgen
# Remove stale generated bindings to avoid duplicate symbol conflicts.
rm -f "$CORE_KOTLIN_OUT_DIR/io/ente/ensu/crypto/core.kt"
rm -f "$RUST_KOTLIN_OUT_DIR/io/ente/labs/inference_rs/inference.kt"
-rm -f "$RUST_KOTLIN_OUT_DIR/io/ente/labs/inference_rs/inference_rs_uniffi.kt"
rm -f "$RUST_KOTLIN_OUT_DIR/io/ente/labs/ensu_db/db.kt"
-rm -f "$RUST_KOTLIN_OUT_DIR/io/ente/labs/llmchat_db/llmchat_db_uniffi.kt"
rm -f "$RUST_KOTLIN_OUT_DIR/io/ente/labs/ensu_sync/sync.kt"
-rm -f "$RUST_KOTLIN_OUT_DIR/io/ente/labs/llmchat_sync/llmchat_sync_uniffi.kt"
generate_kotlin_bindings "$CORE_UNIFFI_RUST_DIR" "core" "$CORE_KOTLIN_OUT_DIR"
generate_kotlin_bindings "$INFERENCE_UNIFFI_RUST_DIR" "inference" "$RUST_KOTLIN_OUT_DIR"
diff --git a/mobile/native/darwin/Apps/ensu/README.md b/mobile/native/darwin/Apps/ensu/README.md
index df450c9e16..e810d60bfc 100644
--- a/mobile/native/darwin/Apps/ensu/README.md
+++ b/mobile/native/darwin/Apps/ensu/README.md
@@ -28,7 +28,7 @@ Run `./build.sh --help` or `./run.sh --help` for full options.
- SwiftMath is fetched via SwiftPM (`https://github.com/mgriebling/SwiftMath.git`).
- UniFFI Swift bindings are generated locally and gitignored:
- `ensu/Generated/core*`, `ensu/Generated/db*`, `ensu/Generated/sync*`
- - `../Packages/Rust/Sources/InferenceRS/inference_rs_uniffi*`
+ - `../Packages/Rust/Sources/InferenceRS/`
- `../Packages/Rust/InferenceRSFFI.xcframework`
The Xcode build script (`scripts/build-rust.sh`) builds Rust static libs, but it does
@@ -124,4 +124,3 @@ ENTE_API_ENDPOINT="https://your-endpoint.example" \
-derivedDataPath build
```
-
diff --git a/rust/ensu/db/Cargo.lock b/rust/ensu/db/Cargo.lock
index c7fef105ae..50bdbaaafc 100644
--- a/rust/ensu/db/Cargo.lock
+++ b/rust/ensu/db/Cargo.lock
@@ -54,6 +54,26 @@ version = "1.8.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "2af50177e190e07a26ab74f8b1efbfe2ef87da2116221318cb1c2e82baf7de06"
+[[package]]
+name = "bip39"
+version = "2.2.2"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "90dbd31c98227229239363921e60fcf5e558e43ec69094d46fc4996f08d1d5bc"
+dependencies = [
+ "bitcoin_hashes",
+ "serde",
+ "unicode-normalization",
+]
+
+[[package]]
+name = "bitcoin_hashes"
+version = "0.14.1"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "26ec84b80c482df901772e931a9a681e26a1b9ee2302edeff23cb30328745c8b"
+dependencies = [
+ "hex-conservative",
+]
+
[[package]]
name = "bitflags"
version = "2.10.0"
@@ -297,6 +317,7 @@ version = "0.0.1"
dependencies = [
"argon2",
"base64",
+ "bip39",
"blake2b_simd",
"crypto_secretstream",
"getrandom 0.2.17",
@@ -501,6 +522,15 @@ version = "0.4.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "7f24254aa9a54b5c858eaee2f5bccdb46aaf0e486a595ed5fd8f86ba55232a70"
+[[package]]
+name = "hex-conservative"
+version = "0.2.2"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "fda06d18ac606267c40c04e41b9947729bf8b9efe74bd4e82b61a5f26a510b9f"
+dependencies = [
+ "arrayvec",
+]
+
[[package]]
name = "http"
version = "1.4.0"
@@ -1582,6 +1612,15 @@ version = "1.0.22"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "9312f7c4f6ff9069b165498234ce8be658059c6728633667c526e27dc2cf1df5"
+[[package]]
+name = "unicode-normalization"
+version = "0.1.25"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "5fd4f6878c9cb28d874b009da9e8d183b5abc80117c40bbd187a1fde336be6e8"
+dependencies = [
+ "tinyvec",
+]
+
[[package]]
name = "universal-hash"
version = "0.5.1"
diff --git a/rust/llmchat/README.md b/rust/llmchat/README.md
deleted file mode 100644
index 1782286f0d..0000000000
--- a/rust/llmchat/README.md
+++ /dev/null
@@ -1,17 +0,0 @@
-# LLM Chat (Rust)
-
-This directory contains the Rust crates for the Ensu LLM chat stack.
-
-## Crates
-
-- `db/` (`llmchat-db`) β€” local chat database.
-- `sync/` (`llmchat-sync`) β€” sync engine (uses `llmchat-db`).
-- `inference/` (`inference_rs`) β€” inference runtime.
-
-## UniFFI bindings
-
-UniFFI wrapper crates live under `uniffi/`:
-
-- `uniffi/llmchat_db_uniffi`
-- `uniffi/llmchat_sync_uniffi`
-- `uniffi/inference_rs_uniffi`
diff --git a/rust/llmchat/db/Cargo.lock b/rust/llmchat/db/Cargo.lock
deleted file mode 100644
index f924e68f14..0000000000
--- a/rust/llmchat/db/Cargo.lock
+++ /dev/null
@@ -1,2104 +0,0 @@
-# This file is automatically @generated by Cargo.
-# It is not intended for manual editing.
-version = 4
-
-[[package]]
-name = "aead"
-version = "0.5.2"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "d122413f284cf2d62fb1b7db97e02edb8cda96d769b16e443a4f6195e35662b0"
-dependencies = [
- "crypto-common",
- "generic-array",
-]
-
-[[package]]
-name = "argon2"
-version = "0.5.3"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "3c3610892ee6e0cbce8ae2700349fcf8f98adb0dbfbee85aec3c9179d29cc072"
-dependencies = [
- "base64ct",
- "blake2",
- "cpufeatures",
- "password-hash",
-]
-
-[[package]]
-name = "arrayref"
-version = "0.3.9"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "76a2e8124351fda1ef8aaaa3bbd7ebbcb486bbcd4225aca0aa0d84bb2db8fecb"
-
-[[package]]
-name = "arrayvec"
-version = "0.7.6"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "7c02d123df017efcdfbd739ef81735b36c5ba83ec3c59c80a9d7ecc718f92e50"
-
-[[package]]
-name = "atomic-waker"
-version = "1.1.2"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "1505bd5d3d116872e7271a6d4e16d81d0c8570876c8de68093a09ac269d8aac0"
-
-[[package]]
-name = "base64"
-version = "0.22.1"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "72b3254f16251a8381aa12e40e3c4d2f0199f8c6508fbecb9d91f575e0fbb8c6"
-
-[[package]]
-name = "base64ct"
-version = "1.8.3"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "2af50177e190e07a26ab74f8b1efbfe2ef87da2116221318cb1c2e82baf7de06"
-
-[[package]]
-name = "bitflags"
-version = "2.10.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "812e12b5285cc515a9c72a5c1d3b6d46a19dac5acfef5265968c166106e31dd3"
-
-[[package]]
-name = "blake2"
-version = "0.10.6"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "46502ad458c9a52b69d4d4d32775c788b7a1b85e8bc9d482d92250fc0e3f8efe"
-dependencies = [
- "digest",
-]
-
-[[package]]
-name = "blake2b_simd"
-version = "1.0.4"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "b79834656f71332577234b50bfc009996f7449e0c056884e6a02492ded0ca2f3"
-dependencies = [
- "arrayref",
- "arrayvec",
- "constant_time_eq",
-]
-
-[[package]]
-name = "block-buffer"
-version = "0.10.4"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "3078c7629b62d3f0439517fa394996acacc5cbc91c5a20d8c658e77abd503a71"
-dependencies = [
- "generic-array",
-]
-
-[[package]]
-name = "block-padding"
-version = "0.3.3"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "a8894febbff9f758034a5b8e12d87918f56dfc64a8e1fe757d65e29041538d93"
-dependencies = [
- "generic-array",
-]
-
-[[package]]
-name = "bumpalo"
-version = "3.19.1"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "5dd9dc738b7a8311c7ade152424974d8115f2cdad61e8dab8dac9f2362298510"
-
-[[package]]
-name = "bytes"
-version = "1.11.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "b35204fbdc0b3f4446b89fc1ac2cf84a8a68971995d0bf2e925ec7cd960f9cb3"
-
-[[package]]
-name = "cc"
-version = "1.2.53"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "755d2fce177175ffca841e9a06afdb2c4ab0f593d53b4dee48147dfaade85932"
-dependencies = [
- "find-msvc-tools",
- "shlex",
-]
-
-[[package]]
-name = "cfg-if"
-version = "1.0.4"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "9330f8b2ff13f34540b44e946ef35111825727b38d33286ef986142615121801"
-
-[[package]]
-name = "cfg_aliases"
-version = "0.2.1"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "613afe47fcd5fac7ccf1db93babcb082c5994d996f20b8b159f2ad1658eb5724"
-
-[[package]]
-name = "chacha20"
-version = "0.9.1"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "c3613f74bd2eac03dad61bd53dbe620703d4371614fe0bc3b9f04dd36fe4e818"
-dependencies = [
- "cfg-if",
- "cipher",
- "cpufeatures",
-]
-
-[[package]]
-name = "cipher"
-version = "0.4.4"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "773f3b9af64447d2ce9850330c473515014aa235e6a783b02db81ff39e4a3dad"
-dependencies = [
- "crypto-common",
- "inout",
- "zeroize",
-]
-
-[[package]]
-name = "constant_time_eq"
-version = "0.4.2"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "3d52eff69cd5e647efe296129160853a42795992097e8af39800e1060caeea9b"
-
-[[package]]
-name = "core-foundation"
-version = "0.9.4"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "91e195e091a93c46f7102ec7818a2aa394e1e1771c3ab4825963fa03e45afb8f"
-dependencies = [
- "core-foundation-sys",
- "libc",
-]
-
-[[package]]
-name = "core-foundation"
-version = "0.10.1"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "b2a6cd9ae233e7f62ba4e9353e81a88df7fc8a5987b8d445b4d90c879bd156f6"
-dependencies = [
- "core-foundation-sys",
- "libc",
-]
-
-[[package]]
-name = "core-foundation-sys"
-version = "0.8.7"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "773648b94d0e5d620f64f280777445740e61fe701025087ec8b57f45c791888b"
-
-[[package]]
-name = "cpufeatures"
-version = "0.2.17"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "59ed5838eebb26a2bb2e58f6d5b5316989ae9d08bab10e0e6d103e656d1b0280"
-dependencies = [
- "libc",
-]
-
-[[package]]
-name = "crypto-common"
-version = "0.1.7"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "78c8292055d1c1df0cce5d180393dc8cce0abec0a7102adb6c7b1eef6016d60a"
-dependencies = [
- "generic-array",
- "rand_core 0.6.4",
- "typenum",
-]
-
-[[package]]
-name = "crypto_secretstream"
-version = "0.2.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "9a6419214057ad50a13efccb3ad7714b86b848e3a5aa7b6cf5a3ff07edf387eb"
-dependencies = [
- "aead",
- "chacha20",
- "getrandom 0.2.17",
- "poly1305",
- "rand_core 0.6.4",
- "subtle",
-]
-
-[[package]]
-name = "curve25519-dalek"
-version = "4.1.3"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "97fb8b7c4503de7d6ae7b42ab72a5a59857b4c937ec27a3d4539dba95b5ab2be"
-dependencies = [
- "cfg-if",
- "cpufeatures",
- "curve25519-dalek-derive",
- "fiat-crypto",
- "rustc_version",
- "subtle",
- "zeroize",
-]
-
-[[package]]
-name = "curve25519-dalek-derive"
-version = "0.1.1"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "f46882e17999c6cc590af592290432be3bce0428cb0d5f8b6715e4dc7b383eb3"
-dependencies = [
- "proc-macro2",
- "quote",
- "syn",
-]
-
-[[package]]
-name = "digest"
-version = "0.10.7"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "9ed9a281f7bc9b7576e61468ba615a66a5c8cfdff42420a70aa82701a3b1e292"
-dependencies = [
- "block-buffer",
- "crypto-common",
- "subtle",
-]
-
-[[package]]
-name = "displaydoc"
-version = "0.2.5"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "97369cbbc041bc366949bc74d34658d6cda5621039731c6310521892a3a20ae0"
-dependencies = [
- "proc-macro2",
- "quote",
- "syn",
-]
-
-[[package]]
-name = "encoding_rs"
-version = "0.8.35"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "75030f3c4f45dafd7586dd6780965a8c7e8e285a5ecb86713e63a79c5b2766f3"
-dependencies = [
- "cfg-if",
-]
-
-[[package]]
-name = "ente-core"
-version = "0.0.1"
-dependencies = [
- "argon2",
- "base64",
- "blake2b_simd",
- "crypto_secretstream",
- "getrandom 0.2.17",
- "hex",
- "md-5",
- "rand_core 0.6.4",
- "reqwest",
- "salsa20",
- "serde",
- "serde_json",
- "subtle",
- "thiserror",
- "x25519-dalek",
- "xsalsa20poly1305",
- "zeroize",
-]
-
-[[package]]
-name = "equivalent"
-version = "1.0.2"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "877a4ace8713b0bcf2a4e7eec82529c029f1d0619886d18145fea96c3ffe5c0f"
-
-[[package]]
-name = "errno"
-version = "0.3.14"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "39cab71617ae0d63f51a36d69f866391735b51691dbda63cf6f96d042b63efeb"
-dependencies = [
- "libc",
- "windows-sys 0.61.2",
-]
-
-[[package]]
-name = "fallible-iterator"
-version = "0.3.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "2acce4a10f12dc2fb14a218589d4f1f62ef011b2d0cc4b3cb1bba8e94da14649"
-
-[[package]]
-name = "fallible-streaming-iterator"
-version = "0.1.9"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "7360491ce676a36bf9bb3c56c1aa791658183a54d2744120f27285738d90465a"
-
-[[package]]
-name = "fastrand"
-version = "2.3.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "37909eebbb50d72f9059c3b6d82c0463f2ff062c9e95845c43a6c9c0355411be"
-
-[[package]]
-name = "fiat-crypto"
-version = "0.2.9"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "28dea519a9695b9977216879a3ebfddf92f1c08c05d984f8996aecd6ecdc811d"
-
-[[package]]
-name = "find-msvc-tools"
-version = "0.1.8"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "8591b0bcc8a98a64310a2fae1bb3e9b8564dd10e381e6e28010fde8e8e8568db"
-
-[[package]]
-name = "fnv"
-version = "1.0.7"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "3f9eec918d3f24069decb9af1554cad7c880e2da24a9afd88aca000531ab82c1"
-
-[[package]]
-name = "foldhash"
-version = "0.2.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "77ce24cb58228fbb8aa041425bb1050850ac19177686ea6e0f41a70416f56fdb"
-
-[[package]]
-name = "form_urlencoded"
-version = "1.2.2"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "cb4cb245038516f5f85277875cdaa4f7d2c9a0fa0468de06ed190163b1581fcf"
-dependencies = [
- "percent-encoding",
-]
-
-[[package]]
-name = "futures-channel"
-version = "0.3.31"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "2dff15bf788c671c1934e366d07e30c1814a8ef514e1af724a602e8a2fbe1b10"
-dependencies = [
- "futures-core",
-]
-
-[[package]]
-name = "futures-core"
-version = "0.3.31"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "05f29059c0c2090612e8d742178b0580d2dc940c837851ad723096f87af6663e"
-
-[[package]]
-name = "futures-sink"
-version = "0.3.31"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "e575fab7d1e0dcb8d0c7bcf9a63ee213816ab51902e6d244a95819acacf1d4f7"
-
-[[package]]
-name = "futures-task"
-version = "0.3.31"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "f90f7dce0722e95104fcb095585910c0977252f286e354b5e3bd38902cd99988"
-
-[[package]]
-name = "futures-util"
-version = "0.3.31"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "9fa08315bb612088cc391249efdc3bc77536f16c91f6cf495e6fbe85b20a4a81"
-dependencies = [
- "futures-core",
- "futures-task",
- "pin-project-lite",
- "pin-utils",
- "slab",
-]
-
-[[package]]
-name = "generic-array"
-version = "0.14.7"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "85649ca51fd72272d7821adaf274ad91c288277713d9c18820d8499a7ff69e9a"
-dependencies = [
- "typenum",
- "version_check",
-]
-
-[[package]]
-name = "getrandom"
-version = "0.2.17"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "ff2abc00be7fca6ebc474524697ae276ad847ad0a6b3faa4bcb027e9a4614ad0"
-dependencies = [
- "cfg-if",
- "js-sys",
- "libc",
- "wasi",
- "wasm-bindgen",
-]
-
-[[package]]
-name = "getrandom"
-version = "0.3.4"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "899def5c37c4fd7b2664648c28120ecec138e4d395b459e5ca34f9cce2dd77fd"
-dependencies = [
- "cfg-if",
- "js-sys",
- "libc",
- "r-efi",
- "wasip2",
- "wasm-bindgen",
-]
-
-[[package]]
-name = "h2"
-version = "0.4.13"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "2f44da3a8150a6703ed5d34e164b875fd14c2cdab9af1252a9a1020bde2bdc54"
-dependencies = [
- "atomic-waker",
- "bytes",
- "fnv",
- "futures-core",
- "futures-sink",
- "http",
- "indexmap",
- "slab",
- "tokio",
- "tokio-util",
- "tracing",
-]
-
-[[package]]
-name = "hashbrown"
-version = "0.16.1"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "841d1cc9bed7f9236f321df977030373f4a4163ae1a7dbfe1a51a2c1a51d9100"
-dependencies = [
- "foldhash",
-]
-
-[[package]]
-name = "hashlink"
-version = "0.11.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "ea0b22561a9c04a7cb1a302c013e0259cd3b4bb619f145b32f72b8b4bcbed230"
-dependencies = [
- "hashbrown",
-]
-
-[[package]]
-name = "hex"
-version = "0.4.3"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "7f24254aa9a54b5c858eaee2f5bccdb46aaf0e486a595ed5fd8f86ba55232a70"
-
-[[package]]
-name = "http"
-version = "1.4.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "e3ba2a386d7f85a81f119ad7498ebe444d2e22c2af0b86b069416ace48b3311a"
-dependencies = [
- "bytes",
- "itoa",
-]
-
-[[package]]
-name = "http-body"
-version = "1.0.1"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "1efedce1fb8e6913f23e0c92de8e62cd5b772a67e7b3946df930a62566c93184"
-dependencies = [
- "bytes",
- "http",
-]
-
-[[package]]
-name = "http-body-util"
-version = "0.1.3"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "b021d93e26becf5dc7e1b75b1bed1fd93124b374ceb73f43d4d4eafec896a64a"
-dependencies = [
- "bytes",
- "futures-core",
- "http",
- "http-body",
- "pin-project-lite",
-]
-
-[[package]]
-name = "httparse"
-version = "1.10.1"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "6dbf3de79e51f3d586ab4cb9d5c3e2c14aa28ed23d180cf89b4df0454a69cc87"
-
-[[package]]
-name = "hyper"
-version = "1.8.1"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "2ab2d4f250c3d7b1c9fcdff1cece94ea4e2dfbec68614f7b87cb205f24ca9d11"
-dependencies = [
- "atomic-waker",
- "bytes",
- "futures-channel",
- "futures-core",
- "h2",
- "http",
- "http-body",
- "httparse",
- "itoa",
- "pin-project-lite",
- "pin-utils",
- "smallvec",
- "tokio",
- "want",
-]
-
-[[package]]
-name = "hyper-rustls"
-version = "0.27.7"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "e3c93eb611681b207e1fe55d5a71ecf91572ec8a6705cdb6857f7d8d5242cf58"
-dependencies = [
- "http",
- "hyper",
- "hyper-util",
- "rustls",
- "rustls-native-certs",
- "rustls-pki-types",
- "tokio",
- "tokio-rustls",
- "tower-service",
-]
-
-[[package]]
-name = "hyper-util"
-version = "0.1.19"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "727805d60e7938b76b826a6ef209eb70eaa1812794f9424d4a4e2d740662df5f"
-dependencies = [
- "base64",
- "bytes",
- "futures-channel",
- "futures-core",
- "futures-util",
- "http",
- "http-body",
- "hyper",
- "ipnet",
- "libc",
- "percent-encoding",
- "pin-project-lite",
- "socket2",
- "system-configuration",
- "tokio",
- "tower-service",
- "tracing",
- "windows-registry",
-]
-
-[[package]]
-name = "icu_collections"
-version = "2.1.1"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "4c6b649701667bbe825c3b7e6388cb521c23d88644678e83c0c4d0a621a34b43"
-dependencies = [
- "displaydoc",
- "potential_utf",
- "yoke",
- "zerofrom",
- "zerovec",
-]
-
-[[package]]
-name = "icu_locale_core"
-version = "2.1.1"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "edba7861004dd3714265b4db54a3c390e880ab658fec5f7db895fae2046b5bb6"
-dependencies = [
- "displaydoc",
- "litemap",
- "tinystr",
- "writeable",
- "zerovec",
-]
-
-[[package]]
-name = "icu_normalizer"
-version = "2.1.1"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "5f6c8828b67bf8908d82127b2054ea1b4427ff0230ee9141c54251934ab1b599"
-dependencies = [
- "icu_collections",
- "icu_normalizer_data",
- "icu_properties",
- "icu_provider",
- "smallvec",
- "zerovec",
-]
-
-[[package]]
-name = "icu_normalizer_data"
-version = "2.1.1"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "7aedcccd01fc5fe81e6b489c15b247b8b0690feb23304303a9e560f37efc560a"
-
-[[package]]
-name = "icu_properties"
-version = "2.1.2"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "020bfc02fe870ec3a66d93e677ccca0562506e5872c650f893269e08615d74ec"
-dependencies = [
- "icu_collections",
- "icu_locale_core",
- "icu_properties_data",
- "icu_provider",
- "zerotrie",
- "zerovec",
-]
-
-[[package]]
-name = "icu_properties_data"
-version = "2.1.2"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "616c294cf8d725c6afcd8f55abc17c56464ef6211f9ed59cccffe534129c77af"
-
-[[package]]
-name = "icu_provider"
-version = "2.1.1"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "85962cf0ce02e1e0a629cc34e7ca3e373ce20dda4c4d7294bbd0bf1fdb59e614"
-dependencies = [
- "displaydoc",
- "icu_locale_core",
- "writeable",
- "yoke",
- "zerofrom",
- "zerotrie",
- "zerovec",
-]
-
-[[package]]
-name = "idna"
-version = "1.1.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "3b0875f23caa03898994f6ddc501886a45c7d3d62d04d2d90788d47be1b1e4de"
-dependencies = [
- "idna_adapter",
- "smallvec",
- "utf8_iter",
-]
-
-[[package]]
-name = "idna_adapter"
-version = "1.2.1"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "3acae9609540aa318d1bc588455225fb2085b9ed0c4f6bd0d9d5bcd86f1a0344"
-dependencies = [
- "icu_normalizer",
- "icu_properties",
-]
-
-[[package]]
-name = "indexmap"
-version = "2.13.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "7714e70437a7dc3ac8eb7e6f8df75fd8eb422675fc7678aff7364301092b1017"
-dependencies = [
- "equivalent",
- "hashbrown",
-]
-
-[[package]]
-name = "inout"
-version = "0.1.4"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "879f10e63c20629ecabbb64a8010319738c66a5cd0c29b02d63d272b03751d01"
-dependencies = [
- "block-padding",
- "generic-array",
-]
-
-[[package]]
-name = "ipnet"
-version = "2.11.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "469fb0b9cefa57e3ef31275ee7cacb78f2fdca44e4765491884a2b119d4eb130"
-
-[[package]]
-name = "iri-string"
-version = "0.7.10"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "c91338f0783edbd6195decb37bae672fd3b165faffb89bf7b9e6942f8b1a731a"
-dependencies = [
- "memchr",
- "serde",
-]
-
-[[package]]
-name = "itoa"
-version = "1.0.17"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "92ecc6618181def0457392ccd0ee51198e065e016d1d527a7ac1b6dc7c1f09d2"
-
-[[package]]
-name = "js-sys"
-version = "0.3.85"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "8c942ebf8e95485ca0d52d97da7c5a2c387d0e7f0ba4c35e93bfcaee045955b3"
-dependencies = [
- "once_cell",
- "wasm-bindgen",
-]
-
-[[package]]
-name = "libc"
-version = "0.2.180"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "bcc35a38544a891a5f7c865aca548a982ccb3b8650a5b06d0fd33a10283c56fc"
-
-[[package]]
-name = "libsqlite3-sys"
-version = "0.36.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "95b4103cffefa72eb8428cb6b47d6627161e51c2739fc5e3b734584157bc642a"
-dependencies = [
- "cc",
- "pkg-config",
- "vcpkg",
-]
-
-[[package]]
-name = "linux-raw-sys"
-version = "0.11.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "df1d3c3b53da64cf5760482273a98e575c651a67eec7f77df96b5b642de8f039"
-
-[[package]]
-name = "litemap"
-version = "0.8.1"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "6373607a59f0be73a39b6fe456b8192fcc3585f602af20751600e974dd455e77"
-
-[[package]]
-name = "llmchat-db"
-version = "0.1.0"
-dependencies = [
- "ente-core",
- "rusqlite",
- "serde",
- "serde_json",
- "tempfile",
- "thiserror",
- "uuid",
- "zeroize",
-]
-
-[[package]]
-name = "log"
-version = "0.4.29"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "5e5032e24019045c762d3c0f28f5b6b8bbf38563a65908389bf7978758920897"
-
-[[package]]
-name = "lru-slab"
-version = "0.1.2"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "112b39cec0b298b6c1999fee3e31427f74f676e4cb9879ed1a121b43661a4154"
-
-[[package]]
-name = "md-5"
-version = "0.10.6"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "d89e7ee0cfbedfc4da3340218492196241d89eefb6dab27de5df917a6d2e78cf"
-dependencies = [
- "cfg-if",
- "digest",
-]
-
-[[package]]
-name = "memchr"
-version = "2.7.6"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "f52b00d39961fc5b2736ea853c9cc86238e165017a493d1d5c8eac6bdc4cc273"
-
-[[package]]
-name = "mime"
-version = "0.3.17"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "6877bb514081ee2a7ff5ef9de3281f14a4dd4bceac4c09388074a6b5df8a139a"
-
-[[package]]
-name = "mio"
-version = "1.1.1"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "a69bcab0ad47271a0234d9422b131806bf3968021e5dc9328caf2d4cd58557fc"
-dependencies = [
- "libc",
- "wasi",
- "windows-sys 0.61.2",
-]
-
-[[package]]
-name = "once_cell"
-version = "1.21.3"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "42f5e15c9953c5e4ccceeb2e7382a716482c34515315f7b03532b8b4e8393d2d"
-
-[[package]]
-name = "opaque-debug"
-version = "0.3.1"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "c08d65885ee38876c4f86fa503fb49d7b507c2b62552df7c70b2fce627e06381"
-
-[[package]]
-name = "openssl-probe"
-version = "0.2.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "9f50d9b3dabb09ecd771ad0aa242ca6894994c130308ca3d7684634df8037391"
-
-[[package]]
-name = "password-hash"
-version = "0.5.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "346f04948ba92c43e8469c1ee6736c7563d71012b17d40745260fe106aac2166"
-dependencies = [
- "base64ct",
- "rand_core 0.6.4",
- "subtle",
-]
-
-[[package]]
-name = "percent-encoding"
-version = "2.3.2"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "9b4f627cb1b25917193a259e49bdad08f671f8d9708acfd5fe0a8c1455d87220"
-
-[[package]]
-name = "pin-project-lite"
-version = "0.2.16"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "3b3cff922bd51709b605d9ead9aa71031d81447142d828eb4a6eba76fe619f9b"
-
-[[package]]
-name = "pin-utils"
-version = "0.1.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "8b870d8c151b6f2fb93e84a13146138f05d02ed11c7e7c54f8826aaaf7c9f184"
-
-[[package]]
-name = "pkg-config"
-version = "0.3.32"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "7edddbd0b52d732b21ad9a5fab5c704c14cd949e5e9a1ec5929a24fded1b904c"
-
-[[package]]
-name = "poly1305"
-version = "0.8.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "8159bd90725d2df49889a078b54f4f79e87f1f8a8444194cdca81d38f5393abf"
-dependencies = [
- "cpufeatures",
- "opaque-debug",
- "universal-hash",
-]
-
-[[package]]
-name = "potential_utf"
-version = "0.1.4"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "b73949432f5e2a09657003c25bca5e19a0e9c84f8058ca374f49e0ebe605af77"
-dependencies = [
- "zerovec",
-]
-
-[[package]]
-name = "ppv-lite86"
-version = "0.2.21"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "85eae3c4ed2f50dcfe72643da4befc30deadb458a9b590d720cde2f2b1e97da9"
-dependencies = [
- "zerocopy",
-]
-
-[[package]]
-name = "proc-macro2"
-version = "1.0.105"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "535d180e0ecab6268a3e718bb9fd44db66bbbc256257165fc699dadf70d16fe7"
-dependencies = [
- "unicode-ident",
-]
-
-[[package]]
-name = "quinn"
-version = "0.11.9"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "b9e20a958963c291dc322d98411f541009df2ced7b5a4f2bd52337638cfccf20"
-dependencies = [
- "bytes",
- "cfg_aliases",
- "pin-project-lite",
- "quinn-proto",
- "quinn-udp",
- "rustc-hash",
- "rustls",
- "socket2",
- "thiserror",
- "tokio",
- "tracing",
- "web-time",
-]
-
-[[package]]
-name = "quinn-proto"
-version = "0.11.13"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "f1906b49b0c3bc04b5fe5d86a77925ae6524a19b816ae38ce1e426255f1d8a31"
-dependencies = [
- "bytes",
- "getrandom 0.3.4",
- "lru-slab",
- "rand",
- "ring",
- "rustc-hash",
- "rustls",
- "rustls-pki-types",
- "slab",
- "thiserror",
- "tinyvec",
- "tracing",
- "web-time",
-]
-
-[[package]]
-name = "quinn-udp"
-version = "0.5.14"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "addec6a0dcad8a8d96a771f815f0eaf55f9d1805756410b39f5fa81332574cbd"
-dependencies = [
- "cfg_aliases",
- "libc",
- "once_cell",
- "socket2",
- "tracing",
- "windows-sys 0.60.2",
-]
-
-[[package]]
-name = "quote"
-version = "1.0.43"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "dc74d9a594b72ae6656596548f56f667211f8a97b3d4c3d467150794690dc40a"
-dependencies = [
- "proc-macro2",
-]
-
-[[package]]
-name = "r-efi"
-version = "5.3.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "69cdb34c158ceb288df11e18b4bd39de994f6657d83847bdffdbd7f346754b0f"
-
-[[package]]
-name = "rand"
-version = "0.9.2"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "6db2770f06117d490610c7488547d543617b21bfa07796d7a12f6f1bd53850d1"
-dependencies = [
- "rand_chacha",
- "rand_core 0.9.5",
-]
-
-[[package]]
-name = "rand_chacha"
-version = "0.9.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "d3022b5f1df60f26e1ffddd6c66e8aa15de382ae63b3a0c1bfc0e4d3e3f325cb"
-dependencies = [
- "ppv-lite86",
- "rand_core 0.9.5",
-]
-
-[[package]]
-name = "rand_core"
-version = "0.6.4"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "ec0be4795e2f6a28069bec0b5ff3e2ac9bafc99e6a9a7dc3547996c5c816922c"
-dependencies = [
- "getrandom 0.2.17",
-]
-
-[[package]]
-name = "rand_core"
-version = "0.9.5"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "76afc826de14238e6e8c374ddcc1fa19e374fd8dd986b0d2af0d02377261d83c"
-dependencies = [
- "getrandom 0.3.4",
-]
-
-[[package]]
-name = "reqwest"
-version = "0.12.28"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "eddd3ca559203180a307f12d114c268abf583f59b03cb906fd0b3ff8646c1147"
-dependencies = [
- "base64",
- "bytes",
- "encoding_rs",
- "futures-core",
- "h2",
- "http",
- "http-body",
- "http-body-util",
- "hyper",
- "hyper-rustls",
- "hyper-util",
- "js-sys",
- "log",
- "mime",
- "percent-encoding",
- "pin-project-lite",
- "quinn",
- "rustls",
- "rustls-native-certs",
- "rustls-pki-types",
- "serde",
- "serde_json",
- "serde_urlencoded",
- "sync_wrapper",
- "tokio",
- "tokio-rustls",
- "tower",
- "tower-http",
- "tower-service",
- "url",
- "wasm-bindgen",
- "wasm-bindgen-futures",
- "web-sys",
-]
-
-[[package]]
-name = "ring"
-version = "0.17.14"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "a4689e6c2294d81e88dc6261c768b63bc4fcdb852be6d1352498b114f61383b7"
-dependencies = [
- "cc",
- "cfg-if",
- "getrandom 0.2.17",
- "libc",
- "untrusted",
- "windows-sys 0.52.0",
-]
-
-[[package]]
-name = "rsqlite-vfs"
-version = "0.1.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "a8a1f2315036ef6b1fbacd1972e8ee7688030b0a2121edfc2a6550febd41574d"
-dependencies = [
- "hashbrown",
- "thiserror",
-]
-
-[[package]]
-name = "rusqlite"
-version = "0.38.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "f1c93dd1c9683b438c392c492109cb702b8090b2bfc8fed6f6e4eb4523f17af3"
-dependencies = [
- "bitflags",
- "fallible-iterator",
- "fallible-streaming-iterator",
- "hashlink",
- "libsqlite3-sys",
- "smallvec",
- "sqlite-wasm-rs",
-]
-
-[[package]]
-name = "rustc-hash"
-version = "2.1.1"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "357703d41365b4b27c590e3ed91eabb1b663f07c4c084095e60cbed4362dff0d"
-
-[[package]]
-name = "rustc_version"
-version = "0.4.1"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "cfcb3a22ef46e85b45de6ee7e79d063319ebb6594faafcf1c225ea92ab6e9b92"
-dependencies = [
- "semver",
-]
-
-[[package]]
-name = "rustix"
-version = "1.1.3"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "146c9e247ccc180c1f61615433868c99f3de3ae256a30a43b49f67c2d9171f34"
-dependencies = [
- "bitflags",
- "errno",
- "libc",
- "linux-raw-sys",
- "windows-sys 0.61.2",
-]
-
-[[package]]
-name = "rustls"
-version = "0.23.36"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "c665f33d38cea657d9614f766881e4d510e0eda4239891eea56b4cadcf01801b"
-dependencies = [
- "once_cell",
- "ring",
- "rustls-pki-types",
- "rustls-webpki",
- "subtle",
- "zeroize",
-]
-
-[[package]]
-name = "rustls-native-certs"
-version = "0.8.3"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "612460d5f7bea540c490b2b6395d8e34a953e52b491accd6c86c8164c5932a63"
-dependencies = [
- "openssl-probe",
- "rustls-pki-types",
- "schannel",
- "security-framework",
-]
-
-[[package]]
-name = "rustls-pki-types"
-version = "1.14.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "be040f8b0a225e40375822a563fa9524378b9d63112f53e19ffff34df5d33fdd"
-dependencies = [
- "web-time",
- "zeroize",
-]
-
-[[package]]
-name = "rustls-webpki"
-version = "0.103.9"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "d7df23109aa6c1567d1c575b9952556388da57401e4ace1d15f79eedad0d8f53"
-dependencies = [
- "ring",
- "rustls-pki-types",
- "untrusted",
-]
-
-[[package]]
-name = "rustversion"
-version = "1.0.22"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "b39cdef0fa800fc44525c84ccb54a029961a8215f9619753635a9c0d2538d46d"
-
-[[package]]
-name = "ryu"
-version = "1.0.22"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "a50f4cf475b65d88e057964e0e9bb1f0aa9bbb2036dc65c64596b42932536984"
-
-[[package]]
-name = "salsa20"
-version = "0.10.2"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "97a22f5af31f73a954c10289c93e8a50cc23d971e80ee446f1f6f7137a088213"
-dependencies = [
- "cipher",
-]
-
-[[package]]
-name = "schannel"
-version = "0.1.28"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "891d81b926048e76efe18581bf793546b4c0eaf8448d72be8de2bbee5fd166e1"
-dependencies = [
- "windows-sys 0.61.2",
-]
-
-[[package]]
-name = "security-framework"
-version = "3.5.1"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "b3297343eaf830f66ede390ea39da1d462b6b0c1b000f420d0a83f898bbbe6ef"
-dependencies = [
- "bitflags",
- "core-foundation 0.10.1",
- "core-foundation-sys",
- "libc",
- "security-framework-sys",
-]
-
-[[package]]
-name = "security-framework-sys"
-version = "2.15.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "cc1f0cbffaac4852523ce30d8bd3c5cdc873501d96ff467ca09b6767bb8cd5c0"
-dependencies = [
- "core-foundation-sys",
- "libc",
-]
-
-[[package]]
-name = "semver"
-version = "1.0.27"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "d767eb0aabc880b29956c35734170f26ed551a859dbd361d140cdbeca61ab1e2"
-
-[[package]]
-name = "serde"
-version = "1.0.228"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "9a8e94ea7f378bd32cbbd37198a4a91436180c5bb472411e48b5ec2e2124ae9e"
-dependencies = [
- "serde_core",
- "serde_derive",
-]
-
-[[package]]
-name = "serde_core"
-version = "1.0.228"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "41d385c7d4ca58e59fc732af25c3983b67ac852c1a25000afe1175de458b67ad"
-dependencies = [
- "serde_derive",
-]
-
-[[package]]
-name = "serde_derive"
-version = "1.0.228"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "d540f220d3187173da220f885ab66608367b6574e925011a9353e4badda91d79"
-dependencies = [
- "proc-macro2",
- "quote",
- "syn",
-]
-
-[[package]]
-name = "serde_json"
-version = "1.0.149"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "83fc039473c5595ace860d8c4fafa220ff474b3fc6bfdb4293327f1a37e94d86"
-dependencies = [
- "itoa",
- "memchr",
- "serde",
- "serde_core",
- "zmij",
-]
-
-[[package]]
-name = "serde_urlencoded"
-version = "0.7.1"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "d3491c14715ca2294c4d6a88f15e84739788c1d030eed8c110436aafdaa2f3fd"
-dependencies = [
- "form_urlencoded",
- "itoa",
- "ryu",
- "serde",
-]
-
-[[package]]
-name = "shlex"
-version = "1.3.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "0fda2ff0d084019ba4d7c6f371c95d8fd75ce3524c3cb8fb653a3023f6323e64"
-
-[[package]]
-name = "slab"
-version = "0.4.11"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "7a2ae44ef20feb57a68b23d846850f861394c2e02dc425a50098ae8c90267589"
-
-[[package]]
-name = "smallvec"
-version = "1.15.1"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "67b1b7a3b5fe4f1376887184045fcf45c69e92af734b7aaddc05fb777b6fbd03"
-
-[[package]]
-name = "socket2"
-version = "0.6.1"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "17129e116933cf371d018bb80ae557e889637989d8638274fb25622827b03881"
-dependencies = [
- "libc",
- "windows-sys 0.60.2",
-]
-
-[[package]]
-name = "sqlite-wasm-rs"
-version = "0.5.2"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "2f4206ed3a67690b9c29b77d728f6acc3ce78f16bf846d83c94f76400320181b"
-dependencies = [
- "cc",
- "js-sys",
- "rsqlite-vfs",
- "wasm-bindgen",
-]
-
-[[package]]
-name = "stable_deref_trait"
-version = "1.2.1"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "6ce2be8dc25455e1f91df71bfa12ad37d7af1092ae736f3a6cd0e37bc7810596"
-
-[[package]]
-name = "subtle"
-version = "2.6.1"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "13c2bddecc57b384dee18652358fb23172facb8a2c51ccc10d74c157bdea3292"
-
-[[package]]
-name = "syn"
-version = "2.0.114"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "d4d107df263a3013ef9b1879b0df87d706ff80f65a86ea879bd9c31f9b307c2a"
-dependencies = [
- "proc-macro2",
- "quote",
- "unicode-ident",
-]
-
-[[package]]
-name = "sync_wrapper"
-version = "1.0.2"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "0bf256ce5efdfa370213c1dabab5935a12e49f2c58d15e9eac2870d3b4f27263"
-dependencies = [
- "futures-core",
-]
-
-[[package]]
-name = "synstructure"
-version = "0.13.2"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "728a70f3dbaf5bab7f0c4b1ac8d7ae5ea60a4b5549c8a5914361c99147a709d2"
-dependencies = [
- "proc-macro2",
- "quote",
- "syn",
-]
-
-[[package]]
-name = "system-configuration"
-version = "0.6.1"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "3c879d448e9d986b661742763247d3693ed13609438cf3d006f51f5368a5ba6b"
-dependencies = [
- "bitflags",
- "core-foundation 0.9.4",
- "system-configuration-sys",
-]
-
-[[package]]
-name = "system-configuration-sys"
-version = "0.6.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "8e1d1b10ced5ca923a1fcb8d03e96b8d3268065d724548c0211415ff6ac6bac4"
-dependencies = [
- "core-foundation-sys",
- "libc",
-]
-
-[[package]]
-name = "tempfile"
-version = "3.24.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "655da9c7eb6305c55742045d5a8d2037996d61d8de95806335c7c86ce0f82e9c"
-dependencies = [
- "fastrand",
- "getrandom 0.3.4",
- "once_cell",
- "rustix",
- "windows-sys 0.61.2",
-]
-
-[[package]]
-name = "thiserror"
-version = "2.0.18"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "4288b5bcbc7920c07a1149a35cf9590a2aa808e0bc1eafaade0b80947865fbc4"
-dependencies = [
- "thiserror-impl",
-]
-
-[[package]]
-name = "thiserror-impl"
-version = "2.0.18"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "ebc4ee7f67670e9b64d05fa4253e753e016c6c95ff35b89b7941d6b856dec1d5"
-dependencies = [
- "proc-macro2",
- "quote",
- "syn",
-]
-
-[[package]]
-name = "tinystr"
-version = "0.8.2"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "42d3e9c45c09de15d06dd8acf5f4e0e399e85927b7f00711024eb7ae10fa4869"
-dependencies = [
- "displaydoc",
- "zerovec",
-]
-
-[[package]]
-name = "tinyvec"
-version = "1.10.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "bfa5fdc3bce6191a1dbc8c02d5c8bffcf557bafa17c124c5264a458f1b0613fa"
-dependencies = [
- "tinyvec_macros",
-]
-
-[[package]]
-name = "tinyvec_macros"
-version = "0.1.1"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "1f3ccbac311fea05f86f61904b462b55fb3df8837a366dfc601a0161d0532f20"
-
-[[package]]
-name = "tokio"
-version = "1.49.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "72a2903cd7736441aac9df9d7688bd0ce48edccaadf181c3b90be801e81d3d86"
-dependencies = [
- "bytes",
- "libc",
- "mio",
- "pin-project-lite",
- "socket2",
- "windows-sys 0.61.2",
-]
-
-[[package]]
-name = "tokio-rustls"
-version = "0.26.4"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "1729aa945f29d91ba541258c8df89027d5792d85a8841fb65e8bf0f4ede4ef61"
-dependencies = [
- "rustls",
- "tokio",
-]
-
-[[package]]
-name = "tokio-util"
-version = "0.7.18"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "9ae9cec805b01e8fc3fd2fe289f89149a9b66dd16786abd8b19cfa7b48cb0098"
-dependencies = [
- "bytes",
- "futures-core",
- "futures-sink",
- "pin-project-lite",
- "tokio",
-]
-
-[[package]]
-name = "tower"
-version = "0.5.3"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "ebe5ef63511595f1344e2d5cfa636d973292adc0eec1f0ad45fae9f0851ab1d4"
-dependencies = [
- "futures-core",
- "futures-util",
- "pin-project-lite",
- "sync_wrapper",
- "tokio",
- "tower-layer",
- "tower-service",
-]
-
-[[package]]
-name = "tower-http"
-version = "0.6.8"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "d4e6559d53cc268e5031cd8429d05415bc4cb4aefc4aa5d6cc35fbf5b924a1f8"
-dependencies = [
- "bitflags",
- "bytes",
- "futures-util",
- "http",
- "http-body",
- "iri-string",
- "pin-project-lite",
- "tower",
- "tower-layer",
- "tower-service",
-]
-
-[[package]]
-name = "tower-layer"
-version = "0.3.3"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "121c2a6cda46980bb0fcd1647ffaf6cd3fc79a013de288782836f6df9c48780e"
-
-[[package]]
-name = "tower-service"
-version = "0.3.3"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "8df9b6e13f2d32c91b9bd719c00d1958837bc7dec474d94952798cc8e69eeec3"
-
-[[package]]
-name = "tracing"
-version = "0.1.44"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "63e71662fa4b2a2c3a26f570f037eb95bb1f85397f3cd8076caed2f026a6d100"
-dependencies = [
- "pin-project-lite",
- "tracing-core",
-]
-
-[[package]]
-name = "tracing-core"
-version = "0.1.36"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "db97caf9d906fbde555dd62fa95ddba9eecfd14cb388e4f491a66d74cd5fb79a"
-dependencies = [
- "once_cell",
-]
-
-[[package]]
-name = "try-lock"
-version = "0.2.5"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "e421abadd41a4225275504ea4d6566923418b7f05506fbc9c0fe86ba7396114b"
-
-[[package]]
-name = "typenum"
-version = "1.19.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "562d481066bde0658276a35467c4af00bdc6ee726305698a55b86e61d7ad82bb"
-
-[[package]]
-name = "unicode-ident"
-version = "1.0.22"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "9312f7c4f6ff9069b165498234ce8be658059c6728633667c526e27dc2cf1df5"
-
-[[package]]
-name = "universal-hash"
-version = "0.5.1"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "fc1de2c688dc15305988b563c3854064043356019f97a4b46276fe734c4f07ea"
-dependencies = [
- "crypto-common",
- "subtle",
-]
-
-[[package]]
-name = "untrusted"
-version = "0.9.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "8ecb6da28b8a351d773b68d5825ac39017e680750f980f3a1a85cd8dd28a47c1"
-
-[[package]]
-name = "url"
-version = "2.5.8"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "ff67a8a4397373c3ef660812acab3268222035010ab8680ec4215f38ba3d0eed"
-dependencies = [
- "form_urlencoded",
- "idna",
- "percent-encoding",
- "serde",
-]
-
-[[package]]
-name = "utf8_iter"
-version = "1.0.4"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "b6c140620e7ffbb22c2dee59cafe6084a59b5ffc27a8859a5f0d494b5d52b6be"
-
-[[package]]
-name = "uuid"
-version = "1.19.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "e2e054861b4bd027cd373e18e8d8d8e6548085000e41290d95ce0c373a654b4a"
-dependencies = [
- "getrandom 0.3.4",
- "js-sys",
- "uuid-rng-internal",
- "wasm-bindgen",
-]
-
-[[package]]
-name = "uuid-rng-internal"
-version = "1.19.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "8d0021aebf9af0cbec73af2f884a2cd0a41d984c00e42f27baa11856ab480e2c"
-dependencies = [
- "getrandom 0.3.4",
-]
-
-[[package]]
-name = "vcpkg"
-version = "0.2.15"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "accd4ea62f7bb7a82fe23066fb0957d48ef677f6eeb8215f372f52e48bb32426"
-
-[[package]]
-name = "version_check"
-version = "0.9.5"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "0b928f33d975fc6ad9f86c8f283853ad26bdd5b10b7f1542aa2fa15e2289105a"
-
-[[package]]
-name = "want"
-version = "0.3.1"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "bfa7760aed19e106de2c7c0b581b509f2f25d3dacaf737cb82ac61bc6d760b0e"
-dependencies = [
- "try-lock",
-]
-
-[[package]]
-name = "wasi"
-version = "0.11.1+wasi-snapshot-preview1"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "ccf3ec651a847eb01de73ccad15eb7d99f80485de043efb2f370cd654f4ea44b"
-
-[[package]]
-name = "wasip2"
-version = "1.0.2+wasi-0.2.9"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "9517f9239f02c069db75e65f174b3da828fe5f5b945c4dd26bd25d89c03ebcf5"
-dependencies = [
- "wit-bindgen",
-]
-
-[[package]]
-name = "wasm-bindgen"
-version = "0.2.108"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "64024a30ec1e37399cf85a7ffefebdb72205ca1c972291c51512360d90bd8566"
-dependencies = [
- "cfg-if",
- "once_cell",
- "rustversion",
- "wasm-bindgen-macro",
- "wasm-bindgen-shared",
-]
-
-[[package]]
-name = "wasm-bindgen-futures"
-version = "0.4.58"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "70a6e77fd0ae8029c9ea0063f87c46fde723e7d887703d74ad2616d792e51e6f"
-dependencies = [
- "cfg-if",
- "futures-util",
- "js-sys",
- "once_cell",
- "wasm-bindgen",
- "web-sys",
-]
-
-[[package]]
-name = "wasm-bindgen-macro"
-version = "0.2.108"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "008b239d9c740232e71bd39e8ef6429d27097518b6b30bdf9086833bd5b6d608"
-dependencies = [
- "quote",
- "wasm-bindgen-macro-support",
-]
-
-[[package]]
-name = "wasm-bindgen-macro-support"
-version = "0.2.108"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "5256bae2d58f54820e6490f9839c49780dff84c65aeab9e772f15d5f0e913a55"
-dependencies = [
- "bumpalo",
- "proc-macro2",
- "quote",
- "syn",
- "wasm-bindgen-shared",
-]
-
-[[package]]
-name = "wasm-bindgen-shared"
-version = "0.2.108"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "1f01b580c9ac74c8d8f0c0e4afb04eeef2acf145458e52c03845ee9cd23e3d12"
-dependencies = [
- "unicode-ident",
-]
-
-[[package]]
-name = "web-sys"
-version = "0.3.85"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "312e32e551d92129218ea9a2452120f4aabc03529ef03e4d0d82fb2780608598"
-dependencies = [
- "js-sys",
- "wasm-bindgen",
-]
-
-[[package]]
-name = "web-time"
-version = "1.1.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "5a6580f308b1fad9207618087a65c04e7a10bc77e02c8e84e9b00dd4b12fa0bb"
-dependencies = [
- "js-sys",
- "wasm-bindgen",
-]
-
-[[package]]
-name = "windows-link"
-version = "0.2.1"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "f0805222e57f7521d6a62e36fa9163bc891acd422f971defe97d64e70d0a4fe5"
-
-[[package]]
-name = "windows-registry"
-version = "0.6.1"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "02752bf7fbdcce7f2a27a742f798510f3e5ad88dbe84871e5168e2120c3d5720"
-dependencies = [
- "windows-link",
- "windows-result",
- "windows-strings",
-]
-
-[[package]]
-name = "windows-result"
-version = "0.4.1"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "7781fa89eaf60850ac3d2da7af8e5242a5ea78d1a11c49bf2910bb5a73853eb5"
-dependencies = [
- "windows-link",
-]
-
-[[package]]
-name = "windows-strings"
-version = "0.5.1"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "7837d08f69c77cf6b07689544538e017c1bfcf57e34b4c0ff58e6c2cd3b37091"
-dependencies = [
- "windows-link",
-]
-
-[[package]]
-name = "windows-sys"
-version = "0.52.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "282be5f36a8ce781fad8c8ae18fa3f9beff57ec1b52cb3de0789201425d9a33d"
-dependencies = [
- "windows-targets 0.52.6",
-]
-
-[[package]]
-name = "windows-sys"
-version = "0.60.2"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "f2f500e4d28234f72040990ec9d39e3a6b950f9f22d3dba18416c35882612bcb"
-dependencies = [
- "windows-targets 0.53.5",
-]
-
-[[package]]
-name = "windows-sys"
-version = "0.61.2"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "ae137229bcbd6cdf0f7b80a31df61766145077ddf49416a728b02cb3921ff3fc"
-dependencies = [
- "windows-link",
-]
-
-[[package]]
-name = "windows-targets"
-version = "0.52.6"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "9b724f72796e036ab90c1021d4780d4d3d648aca59e491e6b98e725b84e99973"
-dependencies = [
- "windows_aarch64_gnullvm 0.52.6",
- "windows_aarch64_msvc 0.52.6",
- "windows_i686_gnu 0.52.6",
- "windows_i686_gnullvm 0.52.6",
- "windows_i686_msvc 0.52.6",
- "windows_x86_64_gnu 0.52.6",
- "windows_x86_64_gnullvm 0.52.6",
- "windows_x86_64_msvc 0.52.6",
-]
-
-[[package]]
-name = "windows-targets"
-version = "0.53.5"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "4945f9f551b88e0d65f3db0bc25c33b8acea4d9e41163edf90dcd0b19f9069f3"
-dependencies = [
- "windows-link",
- "windows_aarch64_gnullvm 0.53.1",
- "windows_aarch64_msvc 0.53.1",
- "windows_i686_gnu 0.53.1",
- "windows_i686_gnullvm 0.53.1",
- "windows_i686_msvc 0.53.1",
- "windows_x86_64_gnu 0.53.1",
- "windows_x86_64_gnullvm 0.53.1",
- "windows_x86_64_msvc 0.53.1",
-]
-
-[[package]]
-name = "windows_aarch64_gnullvm"
-version = "0.52.6"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "32a4622180e7a0ec044bb555404c800bc9fd9ec262ec147edd5989ccd0c02cd3"
-
-[[package]]
-name = "windows_aarch64_gnullvm"
-version = "0.53.1"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "a9d8416fa8b42f5c947f8482c43e7d89e73a173cead56d044f6a56104a6d1b53"
-
-[[package]]
-name = "windows_aarch64_msvc"
-version = "0.52.6"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "09ec2a7bb152e2252b53fa7803150007879548bc709c039df7627cabbd05d469"
-
-[[package]]
-name = "windows_aarch64_msvc"
-version = "0.53.1"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "b9d782e804c2f632e395708e99a94275910eb9100b2114651e04744e9b125006"
-
-[[package]]
-name = "windows_i686_gnu"
-version = "0.52.6"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "8e9b5ad5ab802e97eb8e295ac6720e509ee4c243f69d781394014ebfe8bbfa0b"
-
-[[package]]
-name = "windows_i686_gnu"
-version = "0.53.1"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "960e6da069d81e09becb0ca57a65220ddff016ff2d6af6a223cf372a506593a3"
-
-[[package]]
-name = "windows_i686_gnullvm"
-version = "0.52.6"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "0eee52d38c090b3caa76c563b86c3a4bd71ef1a819287c19d586d7334ae8ed66"
-
-[[package]]
-name = "windows_i686_gnullvm"
-version = "0.53.1"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "fa7359d10048f68ab8b09fa71c3daccfb0e9b559aed648a8f95469c27057180c"
-
-[[package]]
-name = "windows_i686_msvc"
-version = "0.52.6"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "240948bc05c5e7c6dabba28bf89d89ffce3e303022809e73deaefe4f6ec56c66"
-
-[[package]]
-name = "windows_i686_msvc"
-version = "0.53.1"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "1e7ac75179f18232fe9c285163565a57ef8d3c89254a30685b57d83a38d326c2"
-
-[[package]]
-name = "windows_x86_64_gnu"
-version = "0.52.6"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "147a5c80aabfbf0c7d901cb5895d1de30ef2907eb21fbbab29ca94c5b08b1a78"
-
-[[package]]
-name = "windows_x86_64_gnu"
-version = "0.53.1"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "9c3842cdd74a865a8066ab39c8a7a473c0778a3f29370b5fd6b4b9aa7df4a499"
-
-[[package]]
-name = "windows_x86_64_gnullvm"
-version = "0.52.6"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "24d5b23dc417412679681396f2b49f3de8c1473deb516bd34410872eff51ed0d"
-
-[[package]]
-name = "windows_x86_64_gnullvm"
-version = "0.53.1"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "0ffa179e2d07eee8ad8f57493436566c7cc30ac536a3379fdf008f47f6bb7ae1"
-
-[[package]]
-name = "windows_x86_64_msvc"
-version = "0.52.6"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "589f6da84c646204747d1270a2a5661ea66ed1cced2631d546fdfb155959f9ec"
-
-[[package]]
-name = "windows_x86_64_msvc"
-version = "0.53.1"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "d6bbff5f0aada427a1e5a6da5f1f98158182f26556f345ac9e04d36d0ebed650"
-
-[[package]]
-name = "wit-bindgen"
-version = "0.51.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "d7249219f66ced02969388cf2bb044a09756a083d0fab1e566056b04d9fbcaa5"
-
-[[package]]
-name = "writeable"
-version = "0.6.2"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "9edde0db4769d2dc68579893f2306b26c6ecfbe0ef499b013d731b7b9247e0b9"
-
-[[package]]
-name = "x25519-dalek"
-version = "2.0.1"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "c7e468321c81fb07fa7f4c636c3972b9100f0346e5b6a9f2bd0603a52f7ed277"
-dependencies = [
- "curve25519-dalek",
- "rand_core 0.6.4",
- "serde",
- "zeroize",
-]
-
-[[package]]
-name = "xsalsa20poly1305"
-version = "0.9.1"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "02a6dad357567f81cd78ee75f7c61f1b30bb2fe4390be8fb7c69e2ac8dffb6c7"
-dependencies = [
- "aead",
- "poly1305",
- "salsa20",
- "subtle",
- "zeroize",
-]
-
-[[package]]
-name = "yoke"
-version = "0.8.1"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "72d6e5c6afb84d73944e5cedb052c4680d5657337201555f9f2a16b7406d4954"
-dependencies = [
- "stable_deref_trait",
- "yoke-derive",
- "zerofrom",
-]
-
-[[package]]
-name = "yoke-derive"
-version = "0.8.1"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "b659052874eb698efe5b9e8cf382204678a0086ebf46982b79d6ca3182927e5d"
-dependencies = [
- "proc-macro2",
- "quote",
- "syn",
- "synstructure",
-]
-
-[[package]]
-name = "zerocopy"
-version = "0.8.33"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "668f5168d10b9ee831de31933dc111a459c97ec93225beb307aed970d1372dfd"
-dependencies = [
- "zerocopy-derive",
-]
-
-[[package]]
-name = "zerocopy-derive"
-version = "0.8.33"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "2c7962b26b0a8685668b671ee4b54d007a67d4eaf05fda79ac0ecf41e32270f1"
-dependencies = [
- "proc-macro2",
- "quote",
- "syn",
-]
-
-[[package]]
-name = "zerofrom"
-version = "0.1.6"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "50cc42e0333e05660c3587f3bf9d0478688e15d870fab3346451ce7f8c9fbea5"
-dependencies = [
- "zerofrom-derive",
-]
-
-[[package]]
-name = "zerofrom-derive"
-version = "0.1.6"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "d71e5d6e06ab090c67b5e44993ec16b72dcbaabc526db883a360057678b48502"
-dependencies = [
- "proc-macro2",
- "quote",
- "syn",
- "synstructure",
-]
-
-[[package]]
-name = "zeroize"
-version = "1.8.2"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "b97154e67e32c85465826e8bcc1c59429aaaf107c1e4a9e53c8d8ccd5eff88d0"
-dependencies = [
- "zeroize_derive",
-]
-
-[[package]]
-name = "zeroize_derive"
-version = "1.4.3"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "85a5b4158499876c763cb03bc4e49185d3cccbabb15b33c627f7884f43db852e"
-dependencies = [
- "proc-macro2",
- "quote",
- "syn",
-]
-
-[[package]]
-name = "zerotrie"
-version = "0.2.3"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "2a59c17a5562d507e4b54960e8569ebee33bee890c70aa3fe7b97e85a9fd7851"
-dependencies = [
- "displaydoc",
- "yoke",
- "zerofrom",
-]
-
-[[package]]
-name = "zerovec"
-version = "0.11.5"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "6c28719294829477f525be0186d13efa9a3c602f7ec202ca9e353d310fb9a002"
-dependencies = [
- "yoke",
- "zerofrom",
- "zerovec-derive",
-]
-
-[[package]]
-name = "zerovec-derive"
-version = "0.11.2"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "eadce39539ca5cb3985590102671f2567e659fca9666581ad3411d59207951f3"
-dependencies = [
- "proc-macro2",
- "quote",
- "syn",
-]
-
-[[package]]
-name = "zmij"
-version = "1.0.16"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "dfcd145825aace48cff44a8844de64bf75feec3080e0aa5cdbde72961ae51a65"
diff --git a/rust/llmchat/db/Cargo.toml b/rust/llmchat/db/Cargo.toml
deleted file mode 100644
index 6f52b2b850..0000000000
--- a/rust/llmchat/db/Cargo.toml
+++ /dev/null
@@ -1,20 +0,0 @@
-[package]
-name = "llmchat-db"
-version = "0.1.0"
-edition = "2024"
-
-[dependencies]
-ente-core = { path = "../../core" }
-rusqlite = { version = "0.38", features = ["bundled"], optional = true }
-serde = { version = "1", features = ["derive"] }
-serde_json = "1"
-thiserror = "2"
-uuid = { version = "1", features = ["v4", "rng-getrandom"] }
-zeroize = { version = "1.8", features = ["derive"] }
-
-[dev-dependencies]
-tempfile = "3"
-
-[features]
-default = ["sqlite"]
-sqlite = ["dep:rusqlite"]
diff --git a/rust/llmchat/db/src/attachments_db.rs b/rust/llmchat/db/src/attachments_db.rs
deleted file mode 100644
index 02ca71afc1..0000000000
--- a/rust/llmchat/db/src/attachments_db.rs
+++ /dev/null
@@ -1,365 +0,0 @@
-use std::sync::Arc;
-
-use uuid::Uuid;
-
-use crate::Result;
-use crate::backend::{Backend, RowExt, Value};
-use crate::traits::{Clock, SystemClock};
-
-#[derive(Debug, Clone, Copy, PartialEq, Eq)]
-pub enum UploadState {
- Pending,
- Uploading,
- Uploaded,
- Failed,
-}
-
-impl UploadState {
- pub fn as_str(&self) -> &'static str {
- match self {
- UploadState::Pending => "pending",
- UploadState::Uploading => "uploading",
- UploadState::Uploaded => "uploaded",
- UploadState::Failed => "failed",
- }
- }
-}
-
-impl std::str::FromStr for UploadState {
- type Err = crate::Error;
-
- fn from_str(value: &str) -> std::result::Result<Self, Self::Err> {
- match value {
- "pending" => Ok(UploadState::Pending),
- "uploading" => Ok(UploadState::Uploading),
- "uploaded" => Ok(UploadState::Uploaded),
- "failed" => Ok(UploadState::Failed),
- _ => Err(crate::Error::Row(format!(
- "invalid upload_state value {value}"
- ))),
- }
- }
-}
-
-#[derive(Debug, Clone, PartialEq, Eq)]
-pub struct AttachmentUploadRow {
- pub attachment_id: String,
- pub session_uuid: Uuid,
- pub message_uuid: Uuid,
- pub size: i64,
- pub remote_id: Option<String>,
- pub upload_state: UploadState,
- pub uploaded_at: Option<i64>,
- pub updated_at: i64,
-}
-
-pub struct AttachmentsDb<B: Backend> {
- backend: B,
- clock: Arc<dyn Clock>,
-}
-
-impl<B: Backend> AttachmentsDb<B> {
- pub fn new(backend: B, clock: Arc<dyn Clock>) -> Result<Self> {
- crate::attachments_migrations::migrate(&backend)?;
- Ok(Self { backend, clock })
- }
-
- pub fn new_with_defaults(backend: B) -> Result<Self> {
- Self::new(backend, Arc::new(SystemClock))
- }
-
- pub fn upsert_pending_attachment(
- &self,
- attachment_id: &str,
- session_uuid: Uuid,
- message_uuid: Uuid,
- size: i64,
- ) -> Result<()> {
- let now = self.clock.now_us();
- // If row exists, do not overwrite an existing terminal state.
- // Only ensure it's present and updated.
- self.backend.execute(
- "INSERT INTO attachments (attachment_id, session_uuid, message_uuid, size, remote_id, upload_state, uploaded_at, updated_at) \
- VALUES (?, ?, ?, ?, NULL, 'pending', NULL, ?) \
- ON CONFLICT(attachment_id) DO UPDATE SET \
- session_uuid = excluded.session_uuid, \
- message_uuid = excluded.message_uuid, \
- size = excluded.size, \
- remote_id = attachments.remote_id, \
- updated_at = excluded.updated_at",
- &[
- Value::Text(attachment_id.to_string()),
- Value::Text(session_uuid.to_string()),
- Value::Text(message_uuid.to_string()),
- Value::Integer(size),
- Value::Integer(now),
- ],
- )?;
- Ok(())
- }
-
- pub fn set_attachment_upload_state(
- &self,
- attachment_id: &str,
- state: UploadState,
- ) -> Result<()> {
- let now = self.clock.now_us();
- self.backend.execute(
- "UPDATE attachments SET upload_state = ?, updated_at = ? WHERE attachment_id = ?",
- &[
- Value::Text(state.as_str().to_string()),
- Value::Integer(now),
- Value::Text(attachment_id.to_string()),
- ],
- )?;
- Ok(())
- }
-
- pub fn set_attachment_remote_id(
- &self,
- attachment_id: &str,
- remote_id: Option<&str>,
- ) -> Result<()> {
- let now = self.clock.now_us();
- let value = remote_id
- .map(|id| Value::Text(id.to_string()))
- .unwrap_or(Value::Null);
- self.backend.execute(
- "UPDATE attachments SET remote_id = ?, updated_at = ? WHERE attachment_id = ?",
- &[
- value,
- Value::Integer(now),
- Value::Text(attachment_id.to_string()),
- ],
- )?;
- Ok(())
- }
-
- pub fn get_attachment_remote_id(&self, attachment_id: &str) -> Result<Option<String>> {
- let row = self.backend.query_row(
- "SELECT remote_id FROM attachments WHERE attachment_id = ?",
- &[Value::Text(attachment_id.to_string())],
- )?;
- match row {
- Some(row) => Ok(row.get_optional_string(0)?),
- None => Ok(None),
- }
- }
-
- pub fn mark_attachment_uploaded(&self, attachment_id: &str) -> Result<()> {
- let now = self.clock.now_us();
- self.backend.execute(
- "UPDATE attachments SET upload_state = 'uploaded', uploaded_at = ?, updated_at = ? WHERE attachment_id = ?",
- &[
- Value::Integer(now),
- Value::Integer(now),
- Value::Text(attachment_id.to_string()),
- ],
- )?;
- Ok(())
- }
-
- pub fn reset_all_upload_state(&self) -> Result<()> {
- let now = self.clock.now_us();
- self.backend.execute(
- "UPDATE attachments SET upload_state = 'pending', remote_id = NULL, uploaded_at = NULL, updated_at = ?",
- &[Value::Integer(now)],
- )?;
- Ok(())
- }
-
- pub fn get_upload_state(&self, attachment_id: &str) -> Result<Option<UploadState>> {
- let row = self.backend.query_row(
- "SELECT upload_state FROM attachments WHERE attachment_id = ?",
- &[Value::Text(attachment_id.to_string())],
- )?;
- match row {
- Some(row) => {
- let state: UploadState = row.get_string(0)?.parse()?;
- Ok(Some(state))
- }
- None => Ok(None),
- }
- }
-
- pub fn upsert_attachment_with_state(
- &self,
- attachment_id: &str,
- session_uuid: Uuid,
- message_uuid: Uuid,
- size: i64,
- remote_id: Option<&str>,
- state: UploadState,
- ) -> Result<()> {
- let now = self.clock.now_us();
- let uploaded_at = if state == UploadState::Uploaded {
- Value::Integer(now)
- } else {
- Value::Null
- };
- let remote_value = remote_id
- .map(|value| Value::Text(value.to_string()))
- .unwrap_or(Value::Null);
- self.backend.execute(
- "INSERT INTO attachments (attachment_id, session_uuid, message_uuid, size, remote_id, upload_state, uploaded_at, updated_at) \
- VALUES (?, ?, ?, ?, ?, ?, ?, ?) \
- ON CONFLICT(attachment_id) DO UPDATE SET \
- session_uuid = excluded.session_uuid, \
- message_uuid = excluded.message_uuid, \
- size = excluded.size, \
- remote_id = COALESCE(excluded.remote_id, attachments.remote_id), \
- upload_state = excluded.upload_state, \
- uploaded_at = excluded.uploaded_at, \
- updated_at = excluded.updated_at",
- &[
- Value::Text(attachment_id.to_string()),
- Value::Text(session_uuid.to_string()),
- Value::Text(message_uuid.to_string()),
- Value::Integer(size),
- remote_value,
- Value::Text(state.as_str().to_string()),
- uploaded_at,
- Value::Integer(now),
- ],
- )?;
- Ok(())
- }
-
- pub fn get_pending_uploads_for_session(
- &self,
- session_uuid: Uuid,
- ) -> Result<Vec<AttachmentUploadRow>> {
- let rows = self.backend.query(
- "SELECT attachment_id, session_uuid, message_uuid, size, remote_id, upload_state, uploaded_at, updated_at \
- FROM attachments \
- WHERE session_uuid = ? AND upload_state IN ('pending','uploading','failed') \
- ORDER BY updated_at ASC",
- &[Value::Text(session_uuid.to_string())],
- )?;
-
- rows.iter().map(Self::row_from_row).collect()
- }
-
- pub fn get_pending_uploads_for_message(
- &self,
- message_uuid: Uuid,
- ) -> Result<Vec<AttachmentUploadRow>> {
- let rows = self.backend.query(
- "SELECT attachment_id, session_uuid, message_uuid, size, remote_id, upload_state, uploaded_at, updated_at \
- FROM attachments \
- WHERE message_uuid = ? AND upload_state IN ('pending','uploading','failed') \
- ORDER BY updated_at ASC",
- &[Value::Text(message_uuid.to_string())],
- )?;
-
- rows.iter().map(Self::row_from_row).collect()
- }
-
- pub fn delete_attachment_tracking_for_message(&self, message_uuid: Uuid) -> Result<()> {
- self.backend.execute(
- "DELETE FROM attachments WHERE message_uuid = ?",
- &[Value::Text(message_uuid.to_string())],
- )?;
- Ok(())
- }
-
- pub fn delete_attachment_tracking_for_session(&self, session_uuid: Uuid) -> Result<()> {
- self.backend.execute(
- "DELETE FROM attachments WHERE session_uuid = ?",
- &[Value::Text(session_uuid.to_string())],
- )?;
- Ok(())
- }
-
- fn row_from_row(row: &crate::backend::Row) -> Result<AttachmentUploadRow> {
- let attachment_id = row.get_string(0)?;
- let session_uuid = Uuid::parse_str(&row.get_string(1)?)?;
- let message_uuid = Uuid::parse_str(&row.get_string(2)?)?;
- let size = row.get_i64(3)?;
- let remote_id = row.get_optional_string(4)?;
- let upload_state: UploadState = row.get_string(5)?.parse()?;
- let uploaded_at = row.get_optional_i64(6)?;
- let updated_at = row.get_i64(7)?;
- Ok(AttachmentUploadRow {
- attachment_id,
- session_uuid,
- message_uuid,
- size,
- remote_id,
- upload_state,
- uploaded_at,
- updated_at,
- })
- }
-}
-
-#[cfg(feature = "sqlite")]
-impl AttachmentsDb<crate::backend::sqlite::SqliteBackend> {
- pub fn open_sqlite(path: impl AsRef<std::path::Path>, clock: Arc<dyn Clock>) -> Result<Self> {
- let backend = crate::backend::sqlite::SqliteBackend::open(path)?;
- Self::new(backend, clock)
- }
-
- pub fn open_sqlite_with_defaults(path: impl AsRef<std::path::Path>) -> Result<Self> {
- let backend = crate::backend::sqlite::SqliteBackend::open(path)?;
- Self::new_with_defaults(backend)
- }
-
- pub fn open_in_memory(clock: Arc<dyn Clock>) -> Result<Self> {
- let backend = crate::backend::sqlite::SqliteBackend::open_in_memory()?;
- Self::new(backend, clock)
- }
-}
-
-#[cfg(all(test, feature = "sqlite"))]
-mod tests {
- use std::sync::atomic::{AtomicI64, Ordering};
-
- use super::*;
- use crate::backend::sqlite::SqliteBackend;
-
- #[derive(Debug)]
- struct StepClock {
- current: AtomicI64,
- }
-
- impl StepClock {
- fn new(start: i64) -> Self {
- Self {
- current: AtomicI64::new(start),
- }
- }
- }
-
- impl Clock for StepClock {
- fn now_us(&self) -> i64 {
- self.current.fetch_add(1, Ordering::SeqCst)
- }
- }
-
- #[test]
- fn pending_and_mark_uploaded() {
- let clock = Arc::new(StepClock::new(100));
- let backend = SqliteBackend::open_in_memory().unwrap();
- let db = AttachmentsDb::new(backend, clock.clone()).unwrap();
-
- let session = Uuid::from_u128(1);
- let message = Uuid::from_u128(2);
-
- db.upsert_pending_attachment("att-1", session, message, 123)
- .unwrap();
-
- let pending = db.get_pending_uploads_for_session(session).unwrap();
- assert_eq!(pending.len(), 1);
- assert_eq!(pending[0].upload_state, UploadState::Pending);
-
- db.set_attachment_upload_state("att-1", UploadState::Uploading)
- .unwrap();
- let pending = db.get_pending_uploads_for_message(message).unwrap();
- assert_eq!(pending[0].upload_state, UploadState::Uploading);
-
- db.mark_attachment_uploaded("att-1").unwrap();
- let pending_after = db.get_pending_uploads_for_session(session).unwrap();
- assert!(pending_after.is_empty());
- }
-}
diff --git a/rust/llmchat/db/src/attachments_migrations.rs b/rust/llmchat/db/src/attachments_migrations.rs
deleted file mode 100644
index 764f49f560..0000000000
--- a/rust/llmchat/db/src/attachments_migrations.rs
+++ /dev/null
@@ -1,71 +0,0 @@
-use crate::attachments_schema;
-use crate::backend::RowExt;
-use crate::{Backend, Error, Result};
-
-pub const LATEST_VERSION: i64 = 2;
-
-pub fn migrate<B: Backend>(backend: &B) -> Result<()> {
- let version = user_version(backend)?;
- match version {
- 0 => {
- backend.execute_batch(attachments_schema::CREATE_ALL)?;
- backend.execute("PRAGMA user_version = 2;", &[])?;
- Ok(())
- }
- 1 => {
- backend.execute("ALTER TABLE attachments ADD COLUMN remote_id TEXT;", &[])?;
- backend.execute("PRAGMA user_version = 2;", &[])?;
- Ok(())
- }
- LATEST_VERSION => Ok(()),
- other => Err(Error::Migration(format!(
- "unsupported attachments schema version {other}"
- ))),
- }
-}
-
-fn user_version<B: Backend>(backend: &B) -> Result<i64> {
- let row = backend
- .query_row("PRAGMA user_version;", &[])?
- .ok_or_else(|| Error::Migration("missing user_version pragma".to_string()))?;
- row.get_i64(0)
-}
-
-#[cfg(all(test, feature = "sqlite"))]
-mod tests {
- use super::*;
- use crate::backend::sqlite::SqliteBackend;
- use crate::backend::{BackendTx, RowExt, Value};
-
- #[test]
- fn creates_schema_and_indexes() {
- let backend = SqliteBackend::open_in_memory().unwrap();
- migrate(&backend).unwrap();
-
- let row = backend
- .query_row(
- "SELECT name FROM sqlite_master WHERE type = 'table' AND name = ?",
- &[Value::Text("attachments".to_string())],
- )
- .unwrap();
- assert!(row.is_some(), "missing attachments table");
-
- for index in [
- "idx_attachments_session",
- "idx_attachments_message",
- "idx_attachments_state",
- ] {
- let row = backend
- .query_row(
- "SELECT name FROM sqlite_master WHERE type = 'index' AND name = ?",
- &[Value::Text(index.to_string())],
- )
- .unwrap();
- assert!(row.is_some(), "missing index {index}");
- }
-
- let row = backend.query_row("PRAGMA user_version;", &[]).unwrap();
- let version = row.unwrap().get_i64(0).unwrap();
- assert_eq!(version, LATEST_VERSION);
- }
-}
diff --git a/rust/llmchat/db/src/attachments_schema.rs b/rust/llmchat/db/src/attachments_schema.rs
deleted file mode 100644
index aedfa2a6b8..0000000000
--- a/rust/llmchat/db/src/attachments_schema.rs
+++ /dev/null
@@ -1,35 +0,0 @@
-pub const CREATE_ATTACHMENTS: &str = "
-CREATE TABLE IF NOT EXISTS attachments (
- attachment_id TEXT PRIMARY KEY NOT NULL,
- session_uuid TEXT NOT NULL,
- message_uuid TEXT NOT NULL,
- size INTEGER NOT NULL,
- remote_id TEXT,
- upload_state TEXT NOT NULL CHECK(upload_state IN ('pending','uploading','uploaded','failed')),
- uploaded_at INTEGER,
- updated_at INTEGER NOT NULL
-);
-";
-
-pub const CREATE_INDEXES: &str = "
-CREATE INDEX IF NOT EXISTS idx_attachments_session ON attachments(session_uuid);
-CREATE INDEX IF NOT EXISTS idx_attachments_message ON attachments(message_uuid);
-CREATE INDEX IF NOT EXISTS idx_attachments_state ON attachments(upload_state);
-";
-
-pub const CREATE_ALL: &str = "
-CREATE TABLE IF NOT EXISTS attachments (
- attachment_id TEXT PRIMARY KEY NOT NULL,
- session_uuid TEXT NOT NULL,
- message_uuid TEXT NOT NULL,
- size INTEGER NOT NULL,
- remote_id TEXT,
- upload_state TEXT NOT NULL CHECK(upload_state IN ('pending','uploading','uploaded','failed')),
- uploaded_at INTEGER,
- updated_at INTEGER NOT NULL
-);
-
-CREATE INDEX IF NOT EXISTS idx_attachments_session ON attachments(session_uuid);
-CREATE INDEX IF NOT EXISTS idx_attachments_message ON attachments(message_uuid);
-CREATE INDEX IF NOT EXISTS idx_attachments_state ON attachments(upload_state);
-";
diff --git a/rust/llmchat/db/src/backend/mod.rs b/rust/llmchat/db/src/backend/mod.rs
deleted file mode 100644
index 64570d3cdc..0000000000
--- a/rust/llmchat/db/src/backend/mod.rs
+++ /dev/null
@@ -1,93 +0,0 @@
-use crate::{Error, Result};
-
-#[cfg(feature = "sqlite")]
-pub mod sqlite;
-
-#[derive(Debug, Clone, PartialEq)]
-pub enum Value {
- Null,
- Integer(i64),
- Text(String),
- Blob(Vec<u8>),
-}
-
-pub type Row = Vec<Value>;
-
-pub trait BackendTx {
- fn execute(&self, sql: &str, params: &[Value]) -> Result<usize>;
- fn query(&self, sql: &str, params: &[Value]) -> Result<Vec<Row>>;
- fn query_row(&self, sql: &str, params: &[Value]) -> Result<Option<Row>>;
- fn execute_batch(&self, sql: &str) -> Result<()>;
-}
-
-pub trait Backend: BackendTx {
- type Tx<'a>: BackendTx
- where
- Self: 'a;
-
- fn transaction<T, F>(&self, f: F) -> Result<T>
- where
- F: for<'a> FnOnce(&Self::Tx<'a>) -> Result<T>;
-}
-
-pub trait RowExt {
- fn get_i64(&self, idx: usize) -> Result<i64>;
- fn get_string(&self, idx: usize) -> Result<String>;
- fn get_blob(&self, idx: usize) -> Result<Vec<u8>>;
- fn get_optional_string(&self, idx: usize) -> Result<Option<String>>;
- fn get_optional_i64(&self, idx: usize) -> Result<Option<i64>>;
-}
-
-impl RowExt for Vec<Value> {
- fn get_i64(&self, idx: usize) -> Result<i64> {
- match self.get(idx) {
- Some(Value::Integer(value)) => Ok(*value),
- Some(other) => Err(Error::Row(format!(
- "expected integer at column {idx}, got {other:?}"
- ))),
- None => Err(Error::Row(format!("missing column {idx}"))),
- }
- }
-
- fn get_string(&self, idx: usize) -> Result<String> {
- match self.get(idx) {
- Some(Value::Text(value)) => Ok(value.clone()),
- Some(other) => Err(Error::Row(format!(
- "expected text at column {idx}, got {other:?}"
- ))),
- None => Err(Error::Row(format!("missing column {idx}"))),
- }
- }
-
- fn get_blob(&self, idx: usize) -> Result<Vec<u8>> {
- match self.get(idx) {
- Some(Value::Blob(value)) => Ok(value.clone()),
- Some(other) => Err(Error::Row(format!(
- "expected blob at column {idx}, got {other:?}"
- ))),
- None => Err(Error::Row(format!("missing column {idx}"))),
- }
- }
-
- fn get_optional_string(&self, idx: usize) -> Result<Option<String>> {
- match self.get(idx) {
- Some(Value::Null) => Ok(None),
- Some(Value::Text(value)) => Ok(Some(value.clone())),
- Some(other) => Err(Error::Row(format!(
- "expected optional text at column {idx}, got {other:?}"
- ))),
- None => Err(Error::Row(format!("missing column {idx}"))),
- }
- }
-
- fn get_optional_i64(&self, idx: usize) -> Result<Option<i64>> {
- match self.get(idx) {
- Some(Value::Null) => Ok(None),
- Some(Value::Integer(value)) => Ok(Some(*value)),
- Some(other) => Err(Error::Row(format!(
- "expected optional integer at column {idx}, got {other:?}"
- ))),
- None => Err(Error::Row(format!("missing column {idx}"))),
- }
- }
-}
diff --git a/rust/llmchat/db/src/backend/sqlite.rs b/rust/llmchat/db/src/backend/sqlite.rs
deleted file mode 100644
index 7cafca7abe..0000000000
--- a/rust/llmchat/db/src/backend/sqlite.rs
+++ /dev/null
@@ -1,209 +0,0 @@
-use std::path::Path;
-use std::sync::{Mutex, MutexGuard};
-
-use rusqlite::types::Value as SqlValue;
-use rusqlite::{Connection, params_from_iter};
-
-use crate::{Backend, BackendTx, Error, Result, Row, Value};
-
-pub struct SqliteBackend {
- conn: Mutex<Connection>,
-}
-
-impl SqliteBackend {
- pub fn open(path: impl AsRef<Path>) -> Result<Self> {
- let conn = Connection::open(path)?;
- conn.execute_batch("PRAGMA foreign_keys = ON;")?;
- Ok(Self {
- conn: Mutex::new(conn),
- })
- }
-
- pub fn open_in_memory() -> Result<Self> {
- let conn = Connection::open_in_memory()?;
- conn.execute_batch("PRAGMA foreign_keys = ON;")?;
- Ok(Self {
- conn: Mutex::new(conn),
- })
- }
-
- fn lock_conn(&self) -> Result<MutexGuard<'_, Connection>> {
- self.conn
- .lock()
- .map_err(|_| Error::UnsupportedOperation("sqlite connection lock poisoned".to_string()))
- }
-}
-
-pub struct SqliteTransaction<'a> {
- guard: MutexGuard<'a, Connection>,
-}
-
-impl<'a> SqliteTransaction<'a> {
- fn begin(guard: MutexGuard<'a, Connection>) -> Result<Self> {
- guard.execute_batch("BEGIN IMMEDIATE")?;
- Ok(Self { guard })
- }
-
- fn commit(self) -> Result<()> {
- self.guard.execute_batch("COMMIT")?;
- Ok(())
- }
-
- fn rollback(self) -> Result<()> {
- self.guard.execute_batch("ROLLBACK")?;
- Ok(())
- }
-}
-
-trait SqliteConn {
- fn execute_sql(&self, sql: &str, params: &[SqlValue]) -> rusqlite::Result<usize>;
- fn prepare_sql<'a>(&'a self, sql: &str) -> rusqlite::Result<rusqlite::Statement<'a>>;
- fn execute_batch_sql(&self, sql: &str) -> rusqlite::Result<()>;
-}
-
-impl SqliteConn for Connection {
- fn execute_sql(&self, sql: &str, params: &[SqlValue]) -> rusqlite::Result<usize> {
- self.execute(sql, params_from_iter(params.iter().cloned()))
- }
-
- fn prepare_sql<'a>(&'a self, sql: &str) -> rusqlite::Result<rusqlite::Statement<'a>> {
- self.prepare(sql)
- }
-
- fn execute_batch_sql(&self, sql: &str) -> rusqlite::Result<()> {
- self.execute_batch(sql)
- }
-}
-
-impl<'a> SqliteConn for SqliteTransaction<'a> {
- fn execute_sql(&self, sql: &str, params: &[SqlValue]) -> rusqlite::Result<usize> {
- self.guard
- .execute(sql, params_from_iter(params.iter().cloned()))
- }
-
- fn prepare_sql<'b>(&'b self, sql: &str) -> rusqlite::Result<rusqlite::Statement<'b>> {
- self.guard.prepare(sql)
- }
-
- fn execute_batch_sql(&self, sql: &str) -> rusqlite::Result<()> {
- self.guard.execute_batch(sql)
- }
-}
-
-impl BackendTx for SqliteBackend {
- fn execute(&self, sql: &str, params: &[Value]) -> Result<usize> {
- let conn = self.lock_conn()?;
- execute_impl(&*conn, sql, params)
- }
-
- fn query(&self, sql: &str, params: &[Value]) -> Result<Vec<Row>> {
- let conn = self.lock_conn()?;
- query_impl(&*conn, sql, params)
- }
-
- fn query_row(&self, sql: &str, params: &[Value]) -> Result<Option<Row>> {
- let conn = self.lock_conn()?;
- query_row_impl(&*conn, sql, params)
- }
-
- fn execute_batch(&self, sql: &str) -> Result<()> {
- let conn = self.lock_conn()?;
- execute_batch_impl(&*conn, sql)
- }
-}
-
-impl Backend for SqliteBackend {
- type Tx<'a> = SqliteTransaction<'a>;
-
- fn transaction<T, F>(&self, f: F) -> Result<T>
- where
- F: for<'a> FnOnce(&Self::Tx<'a>) -> Result<T>,
- {
- let guard = self.lock_conn()?;
- let wrapper = SqliteTransaction::begin(guard)?;
- let result = f(&wrapper);
- match result {
- Ok(value) => {
- wrapper.commit()?;
- Ok(value)
- }
- Err(err) => {
- wrapper.rollback()?;
- Err(err)
- }
- }
- }
-}
-
-impl<'a> BackendTx for SqliteTransaction<'a> {
- fn execute(&self, sql: &str, params: &[Value]) -> Result<usize> {
- execute_impl(self, sql, params)
- }
-
- fn query(&self, sql: &str, params: &[Value]) -> Result<Vec<Row>> {
- query_impl(self, sql, params)
- }
-
- fn query_row(&self, sql: &str, params: &[Value]) -> Result<Option<Row>> {
- query_row_impl(self, sql, params)
- }
-
- fn execute_batch(&self, sql: &str) -> Result<()> {
- execute_batch_impl(self, sql)
- }
-}
-
-fn execute_impl<C: SqliteConn>(conn: &C, sql: &str, params: &[Value]) -> Result<usize> {
- let params = to_sql_params(params);
- Ok(conn.execute_sql(sql, &params)?)
-}
-
-fn execute_batch_impl<C: SqliteConn>(conn: &C, sql: &str) -> Result<()> {
- conn.execute_batch_sql(sql)?;
- Ok(())
-}
-
-fn query_impl<C: SqliteConn>(conn: &C, sql: &str, params: &[Value]) -> Result<Vec<Row>> {
- let params = to_sql_params(params);
- let mut stmt = conn.prepare_sql(sql)?;
- let mut rows = stmt.query(params_from_iter(params))?;
- let mut results = Vec::new();
- while let Some(row) = rows.next()? {
- let column_count = row.as_ref().column_count();
- let mut values = Vec::with_capacity(column_count);
- for idx in 0..column_count {
- let value: SqlValue = row.get(idx)?;
- values.push(from_sql_value(value)?);
- }
- results.push(values);
- }
- Ok(results)
-}
-
-fn query_row_impl<C: SqliteConn>(conn: &C, sql: &str, params: &[Value]) -> Result<Option<Row>> {
- let rows = query_impl(conn, sql, params)?;
- Ok(rows.into_iter().next())
-}
-
-fn to_sql_params(params: &[Value]) -> Vec<SqlValue> {
- params.iter().map(to_sql_value).collect()
-}
-
-fn to_sql_value(value: &Value) -> SqlValue {
- match value {
- Value::Null => SqlValue::Null,
- Value::Integer(v) => SqlValue::Integer(*v),
- Value::Text(v) => SqlValue::Text(v.clone()),
- Value::Blob(v) => SqlValue::Blob(v.clone()),
- }
-}
-
-fn from_sql_value(value: SqlValue) -> Result<Value> {
- match value {
- SqlValue::Null => Ok(Value::Null),
- SqlValue::Integer(v) => Ok(Value::Integer(v)),
- SqlValue::Text(v) => Ok(Value::Text(v)),
- SqlValue::Blob(v) => Ok(Value::Blob(v)),
- SqlValue::Real(_) => Err(Error::UnsupportedValueType("real".to_string())),
- }
-}
diff --git a/rust/llmchat/db/src/crypto.rs b/rust/llmchat/db/src/crypto.rs
deleted file mode 100644
index 7c8b8870f6..0000000000
--- a/rust/llmchat/db/src/crypto.rs
+++ /dev/null
@@ -1,90 +0,0 @@
-use ente_core::crypto::{self, blob};
-
-use crate::{Error, Result};
-
-pub const HEADER_BYTES: usize = blob::HEADER_BYTES;
-pub const KEY_BYTES: usize = blob::KEY_BYTES;
-
-pub fn encrypt_blob(plaintext: &[u8], key: &[u8]) -> Result<Vec<u8>> {
- let encrypted = blob::encrypt(plaintext, key)?;
- let mut combined = Vec::with_capacity(HEADER_BYTES + encrypted.encrypted_data.len());
- combined.extend_from_slice(&encrypted.decryption_header);
- combined.extend_from_slice(&encrypted.encrypted_data);
- Ok(combined)
-}
-
-pub fn decrypt_blob(data: &[u8], key: &[u8]) -> Result<Vec<u8>> {
- if data.len() < HEADER_BYTES {
- return Err(Error::InvalidBlobLength {
- minimum: HEADER_BYTES,
- actual: data.len(),
- });
- }
- let (header, ciphertext) = data.split_at(HEADER_BYTES);
- Ok(blob::decrypt(ciphertext, header, key)?)
-}
-
-pub fn encrypt_string(value: &str, key: &[u8]) -> Result<Vec<u8>> {
- encrypt_blob(value.as_bytes(), key)
-}
-
-pub fn decrypt_string(data: &[u8], key: &[u8]) -> Result<String> {
- let plaintext = decrypt_blob(data, key)?;
- Ok(String::from_utf8(plaintext)?)
-}
-
-pub fn encrypt_json_field(value: &str, key: &[u8]) -> Result<String> {
- let encrypted = blob::encrypt(value.as_bytes(), key)?;
- let ciphertext_b64 = crypto::encode_b64(&encrypted.encrypted_data);
- let header_b64 = crypto::encode_b64(&encrypted.decryption_header);
- Ok(format!("enc:v1:{ciphertext_b64}:{header_b64}"))
-}
-
-pub fn decrypt_json_field(value: &str, key: &[u8]) -> Result<String> {
- let mut parts = value.split(':');
- let prefix = parts.next();
- let version = parts.next();
- let ciphertext_b64 = parts.next();
- let header_b64 = parts.next();
- if prefix != Some("enc") || version != Some("v1") || parts.next().is_some() {
- return Err(Error::InvalidEncryptedField);
- }
- let ciphertext_b64 = ciphertext_b64.ok_or(Error::InvalidEncryptedField)?;
- let header_b64 = header_b64.ok_or(Error::InvalidEncryptedField)?;
- let ciphertext = crypto::decode_b64(ciphertext_b64)?;
- let header = crypto::decode_b64(header_b64)?;
- if header.len() != HEADER_BYTES {
- return Err(Error::InvalidEncryptedField);
- }
- let plaintext = blob::decrypt(&ciphertext, &header, key)?;
- Ok(String::from_utf8(plaintext)?)
-}
-
-#[cfg(test)]
-mod tests {
- use super::*;
-
- #[test]
- fn blob_roundtrip() {
- let key = vec![7u8; KEY_BYTES];
- let plaintext = b"hello";
-
- let encrypted = encrypt_blob(plaintext, &key).unwrap();
- assert!(encrypted.len() > plaintext.len());
-
- let decrypted = decrypt_blob(&encrypted, &key).unwrap();
- assert_eq!(decrypted, plaintext);
- }
-
- #[test]
- fn json_field_roundtrip() {
- let key = vec![9u8; KEY_BYTES];
- let plaintext = "file-name.png";
-
- let encrypted = encrypt_json_field(plaintext, &key).unwrap();
- assert!(encrypted.starts_with("enc:v1:"));
-
- let decrypted = decrypt_json_field(&encrypted, &key).unwrap();
- assert_eq!(decrypted, plaintext);
- }
-}
diff --git a/rust/llmchat/db/src/db.rs b/rust/llmchat/db/src/db.rs
deleted file mode 100644
index ca529ba99f..0000000000
--- a/rust/llmchat/db/src/db.rs
+++ /dev/null
@@ -1,1121 +0,0 @@
-use std::sync::Arc;
-
-use uuid::Uuid;
-use zeroize::Zeroizing;
-
-use crate::backend::{Backend, BackendTx, RowExt, Value};
-use crate::crypto;
-use crate::migrations;
-use crate::models::{AttachmentMeta, EntityType, Message, Sender, Session, StoredAttachment};
-use crate::traits::{Clock, RandomUuidGen, SystemClock, UuidGen};
-use crate::{Error, Result};
-
-const SESSION_NEEDS_SYNC_PREDICATE: &str = "deleted_at IS NULL \
- AND (needs_sync = 1 OR EXISTS (\
- SELECT 1 FROM messages \
- WHERE messages.session_uuid = sessions.session_uuid \
- AND messages.needs_sync = 1 \
- AND messages.deleted_at IS NULL\
- ))";
-
-pub struct ChatDb<B: Backend> {
- backend: B,
- key: Zeroizing<Vec<u8>>,
- clock: Arc<dyn Clock>,
- uuid_gen: Arc<dyn UuidGen>,
-}
-
-impl<B: Backend> ChatDb<B> {
- pub fn new(
- backend: B,
- key: Vec<u8>,
- clock: Arc<dyn Clock>,
- uuid_gen: Arc<dyn UuidGen>,
- ) -> Result<Self> {
- let key = validate_key(key)?;
- migrations::migrate(&backend)?;
- Ok(Self {
- backend,
- key,
- clock,
- uuid_gen,
- })
- }
-
- pub fn new_with_defaults(backend: B, key: Vec<u8>) -> Result<Self> {
- Self::new(backend, key, Arc::new(SystemClock), Arc::new(RandomUuidGen))
- }
-
- pub fn create_session(&self, title: &str) -> Result<Session> {
- let now = self.clock.now_us();
- let session_uuid = self.uuid_gen.new_uuid();
- let encrypted_title = crypto::encrypt_string(title, &self.key)?;
-
- let affected = self.backend.execute(
- "INSERT INTO sessions (session_uuid, title, created_at, updated_at, remote_id, needs_sync, deleted_at) \
- VALUES (?, ?, ?, ?, NULL, 1, NULL)",
- &[
- Value::Text(session_uuid.to_string()),
- Value::Blob(encrypted_title),
- Value::Integer(now),
- Value::Integer(now),
- ],
- )?;
-
- if affected != 1 {
- return Err(Error::NotFound {
- entity: EntityType::Session,
- id: session_uuid,
- });
- }
-
- Ok(Session {
- uuid: session_uuid,
- title: title.to_string(),
- created_at: now,
- updated_at: now,
- server_updated_at: None,
- remote_id: None,
- needs_sync: true,
- deleted_at: None,
- })
- }
-
- pub fn get_session(&self, uuid: Uuid) -> Result<Option<Session>> {
- let row = self.backend.query_row(
- "SELECT session_uuid, title, created_at, updated_at, server_updated_at, remote_id, needs_sync, deleted_at \
- FROM sessions WHERE session_uuid = ? AND deleted_at IS NULL",
- &[Value::Text(uuid.to_string())],
- )?;
-
- row.map(|row| self.session_from_row(&row)).transpose()
- }
-
- pub fn list_sessions(&self) -> Result<Vec<Session>> {
- let rows = self.backend.query(
- "SELECT session_uuid, title, created_at, updated_at, server_updated_at, remote_id, needs_sync, deleted_at \
- FROM sessions WHERE deleted_at IS NULL ORDER BY updated_at DESC",
- &[],
- )?;
- rows.iter().map(|row| self.session_from_row(row)).collect()
- }
-
- pub fn update_session_title(&self, uuid: Uuid, title: &str) -> Result<()> {
- let now = self.clock.now_us();
- let encrypted_title = crypto::encrypt_string(title, &self.key)?;
- let affected = self.backend.execute(
- "UPDATE sessions SET title = ?, updated_at = ?, needs_sync = 1, server_updated_at = NULL \
- WHERE session_uuid = ? AND deleted_at IS NULL",
- &[
- Value::Blob(encrypted_title),
- Value::Integer(now),
- Value::Text(uuid.to_string()),
- ],
- )?;
- ensure_row_updated(affected, EntityType::Session, uuid)
- }
-
- pub fn delete_session(&self, uuid: Uuid) -> Result<()> {
- let now = self.clock.now_us();
- self.backend.transaction(|tx| {
- tx.execute(
- "UPDATE messages SET deleted_at = ?, server_updated_at = NULL WHERE session_uuid = ? AND deleted_at IS NULL",
- &[Value::Integer(now), Value::Text(uuid.to_string())],
- )?;
- let affected = tx.execute(
- "UPDATE sessions SET deleted_at = ?, server_updated_at = NULL WHERE session_uuid = ? AND deleted_at IS NULL",
- &[Value::Integer(now), Value::Text(uuid.to_string())],
- )?;
- ensure_row_updated(affected, EntityType::Session, uuid)
- })
- }
-
- pub fn upsert_session(
- &self,
- session_uuid: Uuid,
- title: &str,
- created_at: i64,
- updated_at: i64,
- remote_id: Option<String>,
- needs_sync: bool,
- deleted_at: Option<i64>,
- ) -> Result<Session> {
- let encrypted_title = crypto::encrypt_string(title, &self.key)?;
- let needs_sync_value = if needs_sync { 1 } else { 0 };
- let remote_value = remote_id.map(Value::Text).unwrap_or(Value::Null);
- let deleted_value = deleted_at.map(Value::Integer).unwrap_or(Value::Null);
-
- self.backend.execute(
- "INSERT INTO sessions (session_uuid, title, created_at, updated_at, remote_id, needs_sync, deleted_at) \
- VALUES (?, ?, ?, ?, ?, ?, ?) \
- ON CONFLICT(session_uuid) DO UPDATE SET \
- title = excluded.title, \
- created_at = excluded.created_at, \
- updated_at = excluded.updated_at, \
- remote_id = COALESCE(excluded.remote_id, sessions.remote_id), \
- needs_sync = excluded.needs_sync, \
- deleted_at = excluded.deleted_at",
- &[
- Value::Text(session_uuid.to_string()),
- Value::Blob(encrypted_title),
- Value::Integer(created_at),
- Value::Integer(updated_at),
- remote_value,
- Value::Integer(needs_sync_value),
- deleted_value,
- ],
- )?;
-
- let row = self.backend.query_row(
- "SELECT session_uuid, title, created_at, updated_at, server_updated_at, remote_id, needs_sync, deleted_at \
- FROM sessions WHERE session_uuid = ?",
- &[Value::Text(session_uuid.to_string())],
- )?;
- let row = row.ok_or(Error::NotFound {
- entity: EntityType::Session,
- id: session_uuid,
- })?;
- self.session_from_row(&row)
- }
-
- pub fn get_sessions_needing_sync(&self) -> Result<Vec<Session>> {
- let query = format!(
- "SELECT session_uuid, title, created_at, updated_at, server_updated_at, remote_id, needs_sync, deleted_at \
- FROM sessions \
- WHERE {SESSION_NEEDS_SYNC_PREDICATE} \
- ORDER BY updated_at DESC"
- );
- let rows = self.backend.query(&query, &[])?;
- rows.iter().map(|row| self.session_from_row(row)).collect()
- }
-
- pub fn count_needing_sync(&self) -> Result<i64> {
- let query = format!("SELECT COUNT(*) FROM sessions WHERE {SESSION_NEEDS_SYNC_PREDICATE}");
- let row = self.backend.query_row(&query, &[])?;
- Ok(row.map(|row| row.get_i64(0)).transpose()?.unwrap_or(0))
- }
-
- pub fn get_sessions_needing_sync_batch(
- &self,
- limit: i64,
- order_desc: bool,
- ) -> Result<Vec<Session>> {
- if limit <= 0 {
- return Ok(Vec::new());
- }
- let order_clause = if order_desc { "DESC" } else { "ASC" };
- let query = format!(
- "SELECT session_uuid, title, created_at, updated_at, server_updated_at, remote_id, needs_sync, deleted_at \
- FROM sessions \
- WHERE {SESSION_NEEDS_SYNC_PREDICATE} \
- ORDER BY updated_at {order_clause} \
- LIMIT ?"
- );
- let rows = self.backend.query(&query, &[Value::Integer(limit)])?;
- rows.iter().map(|row| self.session_from_row(row)).collect()
- }
-
- pub fn insert_message(
- &self,
- session_uuid: Uuid,
- sender: &str,
- text: &str,
- parent: Option<Uuid>,
- attachments: Vec<AttachmentMeta>,
- ) -> Result<Message> {
- let sender: Sender = sender.parse()?;
- let now = self.clock.now_us();
- let message_uuid = self.uuid_gen.new_uuid();
- let encrypted_text = crypto::encrypt_string(text, &self.key)?;
- let attachments_json = self.serialize_attachments(&attachments)?;
-
- self.backend.transaction(|tx| {
- tx.execute(
- "INSERT INTO messages (message_uuid, session_uuid, parent_message_uuid, sender, text, attachments, created_at, needs_sync, deleted_at) \
- VALUES (?, ?, ?, ?, ?, ?, ?, 1, NULL)",
- &[
- Value::Text(message_uuid.to_string()),
- Value::Text(session_uuid.to_string()),
- parent
- .map(|value| Value::Text(value.to_string()))
- .unwrap_or(Value::Null),
- Value::Text(sender.as_str().to_string()),
- Value::Blob(encrypted_text),
- attachments_json
- .map(Value::Text)
- .unwrap_or(Value::Null),
- Value::Integer(now),
- ],
- )?;
-
- self.touch_session(tx, session_uuid, now)?;
- Ok(())
- })?;
-
- Ok(Message {
- uuid: message_uuid,
- session_uuid,
- parent_message_uuid: parent,
- sender,
- text: text.to_string(),
- attachments,
- created_at: now,
- remote_id: None,
- server_updated_at: None,
- needs_sync: true,
- deleted_at: None,
- })
- }
-
- pub fn insert_message_with_uuid_and_state(
- &self,
- message_uuid: Uuid,
- session_uuid: Uuid,
- sender: &str,
- text: &str,
- parent: Option<Uuid>,
- attachments: Vec<AttachmentMeta>,
- created_at: i64,
- deleted_at: Option<i64>,
- needs_sync: bool,
- ) -> Result<Message> {
- let sender: Sender = sender.parse()?;
- let encrypted_text = crypto::encrypt_string(text, &self.key)?;
- let attachments_json = self.serialize_attachments(&attachments)?;
- let deleted_value = deleted_at.map(Value::Integer).unwrap_or(Value::Null);
- let needs_sync_value = if needs_sync { 1 } else { 0 };
-
- self.backend.execute(
- "INSERT INTO messages (message_uuid, session_uuid, parent_message_uuid, sender, text, attachments, created_at, remote_id, server_updated_at, needs_sync, deleted_at) \
- VALUES (?, ?, ?, ?, ?, ?, ?, NULL, NULL, ?, ?) \
- ON CONFLICT(message_uuid) DO NOTHING",
- &[
- Value::Text(message_uuid.to_string()),
- Value::Text(session_uuid.to_string()),
- parent
- .map(|value| Value::Text(value.to_string()))
- .unwrap_or(Value::Null),
- Value::Text(sender.as_str().to_string()),
- Value::Blob(encrypted_text),
- attachments_json
- .map(Value::Text)
- .unwrap_or(Value::Null),
- Value::Integer(created_at),
- Value::Integer(needs_sync_value),
- deleted_value,
- ],
- )?;
-
- Ok(Message {
- uuid: message_uuid,
- session_uuid,
- parent_message_uuid: parent,
- sender,
- text: text.to_string(),
- attachments,
- created_at,
- remote_id: None,
- server_updated_at: None,
- needs_sync,
- deleted_at,
- })
- }
-
- pub fn get_messages(&self, session_uuid: Uuid) -> Result<Vec<Message>> {
- let rows = self.backend.query(
- "SELECT message_uuid, session_uuid, parent_message_uuid, sender, text, attachments, created_at, remote_id, server_updated_at, needs_sync, deleted_at \
- FROM messages WHERE session_uuid = ? AND deleted_at IS NULL ORDER BY created_at ASC, message_uuid ASC",
- &[Value::Text(session_uuid.to_string())],
- )?;
- rows.iter().map(|row| self.message_from_row(row)).collect()
- }
-
- pub fn get_messages_needing_sync(&self, session_uuid: Uuid) -> Result<Vec<Message>> {
- let rows = self.backend.query(
- "SELECT message_uuid, session_uuid, parent_message_uuid, sender, text, attachments, created_at, remote_id, server_updated_at, needs_sync, deleted_at \
- FROM messages WHERE session_uuid = ? AND needs_sync = 1 AND deleted_at IS NULL ORDER BY created_at ASC, message_uuid ASC",
- &[Value::Text(session_uuid.to_string())],
- )?;
- rows.iter().map(|row| self.message_from_row(row)).collect()
- }
-
- pub fn update_message_text(&self, uuid: Uuid, text: &str) -> Result<()> {
- let now = self.clock.now_us();
- let encrypted_text = crypto::encrypt_string(text, &self.key)?;
- self.backend.transaction(|tx| {
- let row = tx.query_row(
- "SELECT session_uuid FROM messages WHERE message_uuid = ? AND deleted_at IS NULL",
- &[Value::Text(uuid.to_string())],
- )?;
- let row = row.ok_or(Error::NotFound {
- entity: EntityType::Message,
- id: uuid,
- })?;
- let session_uuid = Uuid::parse_str(&row.get_string(0)?)?;
-
- let affected = tx.execute(
- "UPDATE messages SET text = ?, needs_sync = 1, server_updated_at = NULL WHERE message_uuid = ? AND deleted_at IS NULL",
- &[Value::Blob(encrypted_text), Value::Text(uuid.to_string())],
- )?;
- ensure_row_updated(affected, EntityType::Message, uuid)?;
-
- self.touch_session(tx, session_uuid, now)
- })
- }
-
- pub fn delete_message(&self, uuid: Uuid) -> Result<()> {
- let now = self.clock.now_us();
- self.backend.transaction(|tx| {
- let row = tx.query_row(
- "SELECT session_uuid FROM messages WHERE message_uuid = ? AND deleted_at IS NULL",
- &[Value::Text(uuid.to_string())],
- )?;
- let row = row.ok_or(Error::NotFound {
- entity: EntityType::Message,
- id: uuid,
- })?;
- let session_uuid = Uuid::parse_str(&row.get_string(0)?)?;
-
- let affected = tx.execute(
- "UPDATE messages SET deleted_at = ?, server_updated_at = NULL WHERE message_uuid = ? AND deleted_at IS NULL",
- &[Value::Integer(now), Value::Text(uuid.to_string())],
- )?;
- ensure_row_updated(affected, EntityType::Message, uuid)?;
-
- self.touch_session(tx, session_uuid, now)
- })
- }
-
- pub fn mark_session_synced(&self, uuid: Uuid, remote_id: &str) -> Result<()> {
- let affected = self.backend.execute(
- "UPDATE sessions SET remote_id = ?, needs_sync = 0 WHERE session_uuid = ?",
- &[
- Value::Text(remote_id.to_string()),
- Value::Text(uuid.to_string()),
- ],
- )?;
- ensure_row_updated(affected, EntityType::Session, uuid)
- }
-
- pub fn get_session_remote_id(&self, uuid: Uuid) -> Result<Option<String>> {
- let row = self.backend.query_row(
- "SELECT remote_id FROM sessions WHERE session_uuid = ?",
- &[Value::Text(uuid.to_string())],
- )?;
- let remote_id = match row {
- Some(row) => row.get_optional_string(0)?,
- None => None,
- };
- Ok(remote_id)
- }
-
- pub fn set_session_remote_id(&self, uuid: Uuid, remote_id: &str) -> Result<()> {
- let affected = self.backend.execute(
- "UPDATE sessions SET remote_id = ? WHERE session_uuid = ?",
- &[
- Value::Text(remote_id.to_string()),
- Value::Text(uuid.to_string()),
- ],
- )?;
- ensure_row_updated(affected, EntityType::Session, uuid)
- }
-
- pub fn get_session_uuid_by_remote_id(&self, remote_id: &str) -> Result<Option<Uuid>> {
- let row = self.backend.query_row(
- "SELECT session_uuid FROM sessions WHERE remote_id = ?",
- &[Value::Text(remote_id.to_string())],
- )?;
- let uuid = match row {
- Some(row) => {
- let value = row.get_string(0)?;
- Some(Uuid::parse_str(&value)?)
- }
- None => None,
- };
- Ok(uuid)
- }
-
- pub fn set_session_server_updated_at(&self, uuid: Uuid, updated_at: i64) -> Result<()> {
- let affected = self.backend.execute(
- "UPDATE sessions SET server_updated_at = ? WHERE session_uuid = ?",
- &[Value::Integer(updated_at), Value::Text(uuid.to_string())],
- )?;
- ensure_row_updated(affected, EntityType::Session, uuid)
- }
-
- pub fn set_message_server_updated_at(&self, uuid: Uuid, updated_at: i64) -> Result<()> {
- let affected = self.backend.execute(
- "UPDATE messages SET server_updated_at = ? WHERE message_uuid = ?",
- &[Value::Integer(updated_at), Value::Text(uuid.to_string())],
- )?;
- ensure_row_updated(affected, EntityType::Message, uuid)
- }
-
- pub fn set_message_remote_id(&self, uuid: Uuid, remote_id: &str) -> Result<()> {
- let affected = self.backend.execute(
- "UPDATE messages SET remote_id = ? WHERE message_uuid = ?",
- &[
- Value::Text(remote_id.to_string()),
- Value::Text(uuid.to_string()),
- ],
- )?;
- ensure_row_updated(affected, EntityType::Message, uuid)
- }
-
- pub fn get_message_remote_id(&self, uuid: Uuid) -> Result<Option<String>> {
- let row = self.backend.query_row(
- "SELECT remote_id FROM messages WHERE message_uuid = ?",
- &[Value::Text(uuid.to_string())],
- )?;
- let remote_id = match row {
- Some(row) => row.get_optional_string(0)?,
- None => None,
- };
- Ok(remote_id)
- }
-
- pub fn get_message_uuid_by_remote_id(&self, remote_id: &str) -> Result<Option<Uuid>> {
- let row = self.backend.query_row(
- "SELECT message_uuid FROM messages WHERE remote_id = ?",
- &[Value::Text(remote_id.to_string())],
- )?;
- let uuid = match row {
- Some(row) => {
- let value = row.get_string(0)?;
- Some(Uuid::parse_str(&value)?)
- }
- None => None,
- };
- Ok(uuid)
- }
-
- pub fn mark_all_needs_sync(&self) -> Result<()> {
- self.backend.execute(
- "UPDATE sessions SET needs_sync = 1 WHERE deleted_at IS NULL",
- &[],
- )?;
- self.backend.execute(
- "UPDATE messages SET needs_sync = 1 WHERE deleted_at IS NULL",
- &[],
- )?;
- Ok(())
- }
-
- pub fn clear_all_server_timestamps(&self) -> Result<()> {
- self.backend
- .execute("UPDATE sessions SET server_updated_at = NULL", &[])?;
- self.backend
- .execute("UPDATE messages SET server_updated_at = NULL", &[])?;
- Ok(())
- }
-
- pub fn reset_sync_state(&self) -> Result<()> {
- self.backend.execute(
- "UPDATE sessions SET remote_id = NULL, server_updated_at = NULL, \
- needs_sync = CASE WHEN deleted_at IS NULL THEN 1 ELSE needs_sync END",
- &[],
- )?;
- self.backend.execute(
- "UPDATE messages SET remote_id = NULL, server_updated_at = NULL, \
- needs_sync = CASE WHEN deleted_at IS NULL THEN 1 ELSE needs_sync END",
- &[],
- )?;
- Ok(())
- }
-
- pub fn mark_message_synced(&self, uuid: Uuid) -> Result<()> {
- let affected = self.backend.execute(
- "UPDATE messages SET needs_sync = 0 WHERE message_uuid = ? AND deleted_at IS NULL",
- &[Value::Text(uuid.to_string())],
- )?;
- ensure_row_updated(affected, EntityType::Message, uuid)
- }
-
- pub fn upsert_session_from_remote(
- &self,
- session_uuid: Uuid,
- remote_id: &str,
- title: &str,
- created_at: i64,
- updated_at: i64,
- ) -> Result<Session> {
- let encrypted_title = crypto::encrypt_string(title, &self.key)?;
- self.backend.execute(
- "INSERT INTO sessions (session_uuid, title, created_at, updated_at, remote_id, needs_sync, deleted_at) \
- VALUES (?, ?, ?, ?, ?, 0, NULL) \
- ON CONFLICT(session_uuid) DO UPDATE SET \
- title = CASE WHEN sessions.needs_sync = 1 THEN sessions.title ELSE excluded.title END, \
- created_at = MIN(sessions.created_at, excluded.created_at), \
- updated_at = MAX(sessions.updated_at, excluded.updated_at), \
- remote_id = COALESCE(sessions.remote_id, excluded.remote_id), \
- needs_sync = CASE WHEN sessions.needs_sync = 1 THEN 1 ELSE excluded.needs_sync END, \
- deleted_at = NULL",
- &[
- Value::Text(session_uuid.to_string()),
- Value::Blob(encrypted_title),
- Value::Integer(created_at),
- Value::Integer(updated_at),
- Value::Text(remote_id.to_string()),
- ],
- )?;
-
- let session = self.get_session(session_uuid)?.ok_or(Error::NotFound {
- entity: EntityType::Session,
- id: session_uuid,
- })?;
- Ok(session)
- }
-
- pub fn apply_session_tombstone(&self, session_uuid: Uuid, deleted_at: i64) -> Result<()> {
- self.backend.transaction(|tx| {
- tx.execute(
- "UPDATE messages SET deleted_at = ? WHERE session_uuid = ? AND deleted_at IS NULL",
- &[
- Value::Integer(deleted_at),
- Value::Text(session_uuid.to_string()),
- ],
- )?;
- tx.execute(
- "UPDATE sessions SET deleted_at = ?, needs_sync = 0 WHERE session_uuid = ?",
- &[
- Value::Integer(deleted_at),
- Value::Text(session_uuid.to_string()),
- ],
- )?;
- Ok(())
- })
- }
-
- pub fn upsert_message_from_remote(
- &self,
- message_uuid: Uuid,
- session_uuid: Uuid,
- remote_id: &str,
- sender: &str,
- text: &str,
- parent: Option<Uuid>,
- attachments: Vec<AttachmentMeta>,
- created_at: i64,
- ) -> Result<Message> {
- let sender: Sender = sender.parse()?;
- let encrypted_text = crypto::encrypt_string(text, &self.key)?;
- let attachments_json = self.serialize_attachments(&attachments)?;
-
- self.backend.execute(
- "INSERT INTO messages (message_uuid, session_uuid, parent_message_uuid, sender, text, attachments, created_at, remote_id, needs_sync, deleted_at) \
- VALUES (?, ?, ?, ?, ?, ?, ?, ?, 0, NULL) \
- ON CONFLICT(message_uuid) DO UPDATE SET \
- session_uuid = excluded.session_uuid, \
- parent_message_uuid = excluded.parent_message_uuid, \
- sender = excluded.sender, \
- text = excluded.text, \
- attachments = excluded.attachments, \
- created_at = MIN(messages.created_at, excluded.created_at), \
- remote_id = COALESCE(messages.remote_id, excluded.remote_id), \
- needs_sync = CASE WHEN messages.needs_sync = 1 THEN 1 ELSE excluded.needs_sync END, \
- deleted_at = NULL",
- &[
- Value::Text(message_uuid.to_string()),
- Value::Text(session_uuid.to_string()),
- parent
- .map(|value| Value::Text(value.to_string()))
- .unwrap_or(Value::Null),
- Value::Text(sender.as_str().to_string()),
- Value::Blob(encrypted_text),
- attachments_json
- .map(Value::Text)
- .unwrap_or(Value::Null),
- Value::Integer(created_at),
- Value::Text(remote_id.to_string()),
- ],
- )?;
-
- let _ = self.touch_session_remote(session_uuid, created_at);
-
- Ok(Message {
- uuid: message_uuid,
- session_uuid,
- parent_message_uuid: parent,
- sender,
- text: text.to_string(),
- attachments,
- created_at,
- remote_id: Some(remote_id.to_string()),
- server_updated_at: None,
- needs_sync: false,
- deleted_at: None,
- })
- }
-
- pub fn apply_message_tombstone(&self, message_uuid: Uuid, deleted_at: i64) -> Result<()> {
- self.backend.execute(
- "UPDATE messages SET deleted_at = ? WHERE message_uuid = ?",
- &[
- Value::Integer(deleted_at),
- Value::Text(message_uuid.to_string()),
- ],
- )?;
- Ok(())
- }
-
- pub fn get_pending_deletions(&self) -> Result<Vec<(EntityType, Uuid)>> {
- let session_rows = self.backend.query(
- "SELECT session_uuid FROM sessions WHERE remote_id IS NOT NULL AND deleted_at IS NOT NULL ORDER BY deleted_at ASC",
- &[],
- )?;
-
- let mut deletions = Vec::new();
- for row in session_rows {
- let uuid = Uuid::parse_str(&row.get_string(0)?)?;
- deletions.push((EntityType::Session, uuid));
- }
-
- let message_rows = self.backend.query(
- "SELECT messages.message_uuid \
- FROM messages \
- JOIN sessions ON messages.session_uuid = sessions.session_uuid \
- WHERE messages.deleted_at IS NOT NULL \
- AND sessions.remote_id IS NOT NULL \
- AND sessions.deleted_at IS NULL \
- ORDER BY messages.deleted_at ASC",
- &[],
- )?;
-
- for row in message_rows {
- let uuid = Uuid::parse_str(&row.get_string(0)?)?;
- deletions.push((EntityType::Message, uuid));
- }
-
- Ok(deletions)
- }
-
- pub fn get_deleted_sessions(&self) -> Result<Vec<(Uuid, i64)>> {
- let rows = self.backend.query(
- "SELECT session_uuid, deleted_at FROM sessions WHERE deleted_at IS NOT NULL ORDER BY deleted_at ASC",
- &[],
- )?;
- rows.iter()
- .map(|row| {
- let uuid = Uuid::parse_str(&row.get_string(0)?)?;
- let deleted_at = row.get_i64(1)?;
- Ok((uuid, deleted_at))
- })
- .collect()
- }
-
- pub fn get_deleted_messages(&self) -> Result<Vec<(Uuid, i64)>> {
- let rows = self.backend.query(
- "SELECT messages.message_uuid, messages.deleted_at \
- FROM messages \
- JOIN sessions ON messages.session_uuid = sessions.session_uuid \
- WHERE messages.deleted_at IS NOT NULL \
- AND sessions.deleted_at IS NULL \
- ORDER BY messages.deleted_at ASC",
- &[],
- )?;
- rows.iter()
- .map(|row| {
- let uuid = Uuid::parse_str(&row.get_string(0)?)?;
- let deleted_at = row.get_i64(1)?;
- Ok((uuid, deleted_at))
- })
- .collect()
- }
-
- pub fn hard_delete(&self, entity_type: EntityType, uuid: Uuid) -> Result<()> {
- match entity_type {
- EntityType::Session => {
- self.backend.execute(
- "DELETE FROM sessions WHERE session_uuid = ?",
- &[Value::Text(uuid.to_string())],
- )?;
- }
- EntityType::Message => {
- self.backend.execute(
- "DELETE FROM messages WHERE message_uuid = ?",
- &[Value::Text(uuid.to_string())],
- )?;
- }
- }
- Ok(())
- }
-
- fn session_from_row(&self, row: &crate::backend::Row) -> Result<Session> {
- let uuid = Uuid::parse_str(&row.get_string(0)?)?;
- let title_blob = row.get_blob(1)?;
- let title = crypto::decrypt_string(&title_blob, &self.key)?;
- let created_at = row.get_i64(2)?;
- let updated_at = row.get_i64(3)?;
- let server_updated_at = row.get_optional_i64(4)?;
- let remote_id = row.get_optional_string(5)?;
- let needs_sync = bool_from_i64(row.get_i64(6)?)?;
- let deleted_at = row.get_optional_i64(7)?;
- Ok(Session {
- uuid,
- title,
- created_at,
- updated_at,
- server_updated_at,
- remote_id,
- needs_sync,
- deleted_at,
- })
- }
-
- fn message_from_row(&self, row: &crate::backend::Row) -> Result<Message> {
- let uuid = Uuid::parse_str(&row.get_string(0)?)?;
- let session_uuid = Uuid::parse_str(&row.get_string(1)?)?;
- let parent_message_uuid = row
- .get_optional_string(2)?
- .map(|value| Uuid::parse_str(&value))
- .transpose()?;
- let sender: Sender = row.get_string(3)?.parse()?;
- let text_blob = row.get_blob(4)?;
- let text = crypto::decrypt_string(&text_blob, &self.key)?;
- let attachments_json = row.get_optional_string(5)?;
- let attachments = self.deserialize_attachments(attachments_json)?;
- let created_at = row.get_i64(6)?;
- let remote_id = row.get_optional_string(7)?;
- let server_updated_at = row.get_optional_i64(8)?;
- let needs_sync = bool_from_i64(row.get_i64(9)?)?;
- let deleted_at = row.get_optional_i64(10)?;
-
- Ok(Message {
- uuid,
- session_uuid,
- parent_message_uuid,
- sender,
- text,
- attachments,
- created_at,
- remote_id,
- server_updated_at,
- needs_sync,
- deleted_at,
- })
- }
-
- fn serialize_attachments(&self, attachments: &[AttachmentMeta]) -> Result<Option<String>> {
- if attachments.is_empty() {
- return Ok(None);
- }
- let mut stored = Vec::with_capacity(attachments.len());
- for attachment in attachments {
- stored.push(self.attachment_to_stored(attachment)?);
- }
- Ok(Some(serde_json::to_string(&stored)?))
- }
-
- fn deserialize_attachments(&self, raw: Option<String>) -> Result<Vec<AttachmentMeta>> {
- let stored = parse_stored_attachments(raw)?;
- stored
- .into_iter()
- .map(|attachment| self.stored_to_attachment(attachment))
- .collect()
- }
-
- fn attachment_to_stored(&self, attachment: &AttachmentMeta) -> Result<StoredAttachment> {
- Ok(StoredAttachment {
- id: attachment.id.clone(),
- kind: attachment.kind,
- size: attachment.size,
- encrypted_name: crypto::encrypt_json_field(&attachment.name, &self.key)?,
- })
- }
-
- fn stored_to_attachment(&self, attachment: StoredAttachment) -> Result<AttachmentMeta> {
- Ok(AttachmentMeta {
- id: attachment.id,
- kind: attachment.kind,
- size: attachment.size,
- name: crypto::decrypt_json_field(&attachment.encrypted_name, &self.key)?,
- })
- }
-
- fn touch_session<T: BackendTx>(
- &self,
- backend: &T,
- session_uuid: Uuid,
- updated_at: i64,
- ) -> Result<()> {
- let affected = backend.execute(
- "UPDATE sessions SET updated_at = ?, needs_sync = 1, server_updated_at = NULL WHERE session_uuid = ? AND deleted_at IS NULL",
- &[Value::Integer(updated_at), Value::Text(session_uuid.to_string())],
- )?;
- ensure_row_updated(affected, EntityType::Session, session_uuid)
- }
-
- fn touch_session_remote(&self, session_uuid: Uuid, updated_at: i64) -> Result<()> {
- let affected = self.backend.execute(
- "UPDATE sessions SET updated_at = MAX(updated_at, ?) WHERE session_uuid = ? AND deleted_at IS NULL",
- &[Value::Integer(updated_at), Value::Text(session_uuid.to_string())],
- )?;
- ensure_row_updated(affected, EntityType::Session, session_uuid)
- }
-}
-
-#[cfg(feature = "sqlite")]
-impl ChatDb<crate::backend::sqlite::SqliteBackend> {
- pub fn open_sqlite(
- path: impl AsRef<std::path::Path>,
- key: Vec<u8>,
- clock: Arc<dyn Clock>,
- uuid_gen: Arc<dyn UuidGen>,
- ) -> Result<Self> {
- let backend = crate::backend::sqlite::SqliteBackend::open(path)?;
- Self::new(backend, key, clock, uuid_gen)
- }
-
- pub fn open_sqlite_with_defaults(
- path: impl AsRef<std::path::Path>,
- key: Vec<u8>,
- ) -> Result<Self> {
- let backend = crate::backend::sqlite::SqliteBackend::open(path)?;
- Self::new_with_defaults(backend, key)
- }
-
- pub fn open_in_memory(key: Vec<u8>) -> Result<Self> {
- let backend = crate::backend::sqlite::SqliteBackend::open_in_memory()?;
- Self::new_with_defaults(backend, key)
- }
-}
-
-fn validate_key(key: Vec<u8>) -> Result<Zeroizing<Vec<u8>>> {
- if key.len() != crypto::KEY_BYTES {
- return Err(Error::InvalidKeyLength {
- expected: crypto::KEY_BYTES,
- actual: key.len(),
- });
- }
- Ok(Zeroizing::new(key))
-}
-
-fn bool_from_i64(value: i64) -> Result<bool> {
- match value {
- 0 => Ok(false),
- 1 => Ok(true),
- other => Err(Error::Row(format!("invalid bool value {other}"))),
- }
-}
-
-fn ensure_row_updated(affected: usize, entity: EntityType, uuid: Uuid) -> Result<()> {
- if affected == 0 {
- return Err(Error::NotFound { entity, id: uuid });
- }
- Ok(())
-}
-
-fn parse_stored_attachments(raw: Option<String>) -> Result<Vec<StoredAttachment>> {
- let Some(raw) = raw else {
- return Ok(Vec::new());
- };
- if raw.trim().is_empty() {
- return Ok(Vec::new());
- }
- Ok(serde_json::from_str(&raw)?)
-}
-
-#[cfg(all(test, feature = "sqlite"))]
-mod tests {
- use std::collections::VecDeque;
- use std::sync::atomic::{AtomicI64, Ordering};
- use std::sync::{Arc, Mutex};
-
- use uuid::Uuid;
-
- use super::*;
- use crate::backend::sqlite::SqliteBackend;
- use crate::backend::{BackendTx, RowExt, Value};
- use crate::crypto::KEY_BYTES;
- use crate::models::{AttachmentKind, AttachmentMeta};
-
- #[derive(Debug)]
- struct StepClock {
- current: AtomicI64,
- step: i64,
- }
-
- impl StepClock {
- fn new(start: i64, step: i64) -> Self {
- Self {
- current: AtomicI64::new(start),
- step,
- }
- }
- }
-
- impl Clock for StepClock {
- fn now_us(&self) -> i64 {
- self.current.fetch_add(self.step, Ordering::SeqCst)
- }
- }
-
- #[derive(Debug)]
- struct TestUuidGen {
- uuids: Mutex<VecDeque<Uuid>>,
- }
-
- impl TestUuidGen {
- fn new(uuids: Vec<Uuid>) -> Self {
- Self {
- uuids: Mutex::new(uuids.into()),
- }
- }
- }
-
- impl UuidGen for TestUuidGen {
- fn new_uuid(&self) -> Uuid {
- self.uuids
- .lock()
- .expect("uuid lock poisoned")
- .pop_front()
- .expect("uuid queue empty")
- }
- }
-
- fn make_db(uuids: Vec<Uuid>, clock: Arc<dyn Clock>) -> ChatDb<SqliteBackend> {
- let backend = SqliteBackend::open_in_memory().unwrap();
- ChatDb::new(
- backend,
- vec![1u8; KEY_BYTES],
- clock,
- Arc::new(TestUuidGen::new(uuids)),
- )
- .unwrap()
- }
-
- #[test]
- fn create_and_get_session_encrypts_title() {
- let session_id = Uuid::from_u128(1);
- let clock = Arc::new(StepClock::new(100, 1));
- let db = make_db(vec![session_id], clock);
-
- let session = db.create_session("hello").unwrap();
- assert_eq!(session.uuid, session_id);
- assert_eq!(session.title, "hello");
- assert!(session.needs_sync);
-
- let fetched = db.get_session(session_id).unwrap().unwrap();
- assert_eq!(fetched.title, "hello");
-
- let row = db
- .backend
- .query_row(
- "SELECT title FROM sessions WHERE session_uuid = ?",
- &[Value::Text(session_id.to_string())],
- )
- .unwrap()
- .unwrap();
- let stored = row.get_blob(0).unwrap();
- assert!(stored.len() >= crypto::HEADER_BYTES);
- assert_ne!(stored, b"hello".to_vec());
- }
-
- #[test]
- fn message_updates_touch_session() {
- let session_id = Uuid::from_u128(2);
- let message_id = Uuid::from_u128(3);
- let clock = Arc::new(StepClock::new(10, 1));
- let db = make_db(vec![session_id, message_id], clock.clone());
-
- db.create_session("title").unwrap();
- let after_create = db.get_session(session_id).unwrap().unwrap().updated_at;
-
- let message = db
- .insert_message(session_id, "self", "hello", None, Vec::new())
- .unwrap();
- assert_eq!(message.uuid, message_id);
-
- let after_insert = db.get_session(session_id).unwrap().unwrap().updated_at;
- assert!(after_insert > after_create);
-
- db.update_message_text(message_id, "updated").unwrap();
- let after_update = db.get_session(session_id).unwrap().unwrap().updated_at;
- assert!(after_update > after_insert);
- }
-
- #[test]
- fn delete_session_soft_deletes_messages() {
- let session_id = Uuid::from_u128(4);
- let message_id = Uuid::from_u128(5);
- let clock = Arc::new(StepClock::new(1, 1));
- let db = make_db(vec![session_id, message_id], clock);
-
- db.create_session("title").unwrap();
- db.insert_message(session_id, "other", "hi", None, Vec::new())
- .unwrap();
-
- db.delete_session(session_id).unwrap();
- assert!(db.get_session(session_id).unwrap().is_none());
-
- let row = db
- .backend
- .query_row(
- "SELECT deleted_at FROM messages WHERE message_uuid = ?",
- &[Value::Text(message_id.to_string())],
- )
- .unwrap()
- .unwrap();
- assert!(row.get_optional_i64(0).unwrap().is_some());
- }
-
- #[test]
- fn attachment_metadata_is_encrypted_in_json() {
- let session_id = Uuid::from_u128(6);
- let message_id = Uuid::from_u128(7);
- let clock = Arc::new(StepClock::new(50, 1));
- let db = make_db(vec![session_id, message_id], clock.clone());
-
- db.create_session("title").unwrap();
-
- let attachments = vec![
- AttachmentMeta {
- id: "att-1".to_string(),
- kind: AttachmentKind::Image,
- size: 123,
- name: "photo.jpg".to_string(),
- },
- AttachmentMeta {
- id: "att-2".to_string(),
- kind: AttachmentKind::Document,
- size: 456,
- name: "doc.pdf".to_string(),
- },
- ];
-
- db.insert_message(session_id, "self", "hello", None, attachments)
- .unwrap();
-
- let row = db
- .backend
- .query_row(
- "SELECT attachments FROM messages WHERE message_uuid = ?",
- &[Value::Text(message_id.to_string())],
- )
- .unwrap()
- .unwrap();
- let json = row.get_optional_string(0).unwrap().unwrap();
- let stored: Vec<StoredAttachment> = serde_json::from_str(&json).unwrap();
- assert_eq!(stored.len(), 2);
- assert!(stored[0].encrypted_name.starts_with("enc:v1:"));
- assert!(!stored[0].encrypted_name.contains("photo.jpg"));
- }
-
- #[test]
- fn invalid_sender_is_rejected() {
- let session_id = Uuid::from_u128(8);
- let message_id = Uuid::from_u128(9);
- let clock = Arc::new(StepClock::new(1, 1));
- let db = make_db(vec![session_id, message_id], clock);
-
- db.create_session("title").unwrap();
- let err = db
- .insert_message(session_id, "invalid", "hello", None, Vec::new())
- .unwrap_err();
-
- match err {
- Error::InvalidSender(_) => {}
- other => panic!("unexpected error: {other:?}"),
- }
- }
-}
diff --git a/rust/llmchat/db/src/error.rs b/rust/llmchat/db/src/error.rs
deleted file mode 100644
index 5f9b65762c..0000000000
--- a/rust/llmchat/db/src/error.rs
+++ /dev/null
@@ -1,54 +0,0 @@
-use thiserror::Error;
-
-use crate::models::EntityType;
-
-pub type Result<T> = std::result::Result<T, Error>;
-
-#[derive(Error, Debug)]
-pub enum Error {
- #[error("invalid encryption key length: expected {expected}, got {actual}")]
- InvalidKeyLength { expected: usize, actual: usize },
-
- #[error("invalid blob length: expected at least {minimum} bytes, got {actual}")]
- InvalidBlobLength { minimum: usize, actual: usize },
-
- #[error("invalid encrypted field format")]
- InvalidEncryptedField,
-
- #[error("unsupported value type: {0}")]
- UnsupportedValueType(String),
-
- #[error("row error: {0}")]
- Row(String),
-
- #[error("invalid sender: {0}")]
- InvalidSender(String),
-
- #[error("{entity:?} not found: {id}")]
- NotFound { entity: EntityType, id: uuid::Uuid },
-
- #[error(transparent)]
- Crypto(#[from] ente_core::crypto::CryptoError),
-
- #[error(transparent)]
- SerdeJson(#[from] serde_json::Error),
-
- #[error(transparent)]
- Uuid(#[from] uuid::Error),
-
- #[error(transparent)]
- Utf8(#[from] std::string::FromUtf8Error),
-
- #[error(transparent)]
- Io(#[from] std::io::Error),
-
- #[cfg(feature = "sqlite")]
- #[error(transparent)]
- Sqlite(#[from] rusqlite::Error),
-
- #[error("unsupported operation: {0}")]
- UnsupportedOperation(String),
-
- #[error("migration error: {0}")]
- Migration(String),
-}
diff --git a/rust/llmchat/db/src/lib.rs b/rust/llmchat/db/src/lib.rs
deleted file mode 100644
index 54c7a9e60d..0000000000
--- a/rust/llmchat/db/src/lib.rs
+++ /dev/null
@@ -1,31 +0,0 @@
-#![forbid(unsafe_code)]
-
-pub mod attachments_db;
-pub mod attachments_migrations;
-pub mod attachments_schema;
-pub mod backend;
-pub mod crypto;
-pub mod db;
-pub mod error;
-pub mod llmchat;
-pub mod migrations;
-pub mod models;
-pub mod schema;
-pub mod sync_state_db;
-pub mod sync_state_schema;
-pub mod traits;
-
-pub use crate::attachments_db::{AttachmentUploadRow, AttachmentsDb, UploadState};
-pub use crate::backend::{Backend, BackendTx, Row, Value};
-pub use crate::db::ChatDb;
-pub use crate::error::{Error, Result};
-pub use crate::llmchat::LlmChatDb;
-pub use crate::models::{AttachmentKind, AttachmentMeta, EntityType, Message, Sender, Session};
-pub use crate::sync_state_db::{SyncEntityState, SyncStateDb};
-pub use crate::traits::{
- AttachmentStore, Clock, FileMetaStore, FsAttachmentStore, MetaStore, RandomUuidGen,
- SystemClock, UuidGen,
-};
-
-#[cfg(feature = "sqlite")]
-pub use crate::backend::sqlite::SqliteBackend;
diff --git a/rust/llmchat/db/src/llmchat.rs b/rust/llmchat/db/src/llmchat.rs
deleted file mode 100644
index b2b9793eb6..0000000000
--- a/rust/llmchat/db/src/llmchat.rs
+++ /dev/null
@@ -1,381 +0,0 @@
-use std::sync::Arc;
-
-use uuid::Uuid;
-
-use crate::Result;
-use crate::attachments_db::{AttachmentUploadRow, AttachmentsDb, UploadState};
-use crate::db::ChatDb;
-use crate::models::{AttachmentMeta, EntityType, Message, Session};
-use crate::traits::{Clock, UuidGen};
-
-/// High-level DB that ties together the main chat DB and the attachments upload-state DB.
-pub struct LlmChatDb<B: crate::Backend> {
- pub chat: ChatDb<B>,
- pub attachments: AttachmentsDb<B>,
-}
-
-impl<B: crate::Backend> LlmChatDb<B> {
- pub fn new(chat: ChatDb<B>, attachments: AttachmentsDb<B>) -> Self {
- Self { chat, attachments }
- }
-
- pub fn create_session(&self, title: &str) -> Result<Session> {
- self.chat.create_session(title)
- }
-
- pub fn get_session(&self, uuid: Uuid) -> Result<Option<Session>> {
- self.chat.get_session(uuid)
- }
-
- pub fn list_sessions(&self) -> Result<Vec<Session>> {
- self.chat.list_sessions()
- }
-
- pub fn update_session_title(&self, uuid: Uuid, title: &str) -> Result<()> {
- self.chat.update_session_title(uuid, title)
- }
-
- pub fn delete_session(&self, uuid: Uuid) -> Result<()> {
- // Best-effort cleanup in attachments DB. If this fails, still delete session.
- let _ = self
- .attachments
- .delete_attachment_tracking_for_session(uuid);
- self.chat.delete_session(uuid)
- }
-
- pub fn upsert_session(
- &self,
- session_uuid: Uuid,
- title: &str,
- created_at: i64,
- updated_at: i64,
- remote_id: Option<String>,
- needs_sync: bool,
- deleted_at: Option<i64>,
- ) -> Result<Session> {
- self.chat.upsert_session(
- session_uuid,
- title,
- created_at,
- updated_at,
- remote_id,
- needs_sync,
- deleted_at,
- )
- }
-
- pub fn insert_message(
- &self,
- session_uuid: Uuid,
- sender: &str,
- text: &str,
- parent: Option<Uuid>,
- attachments: Vec<AttachmentMeta>,
- ) -> Result<Message> {
- let message =
- self.chat
- .insert_message(session_uuid, sender, text, parent, attachments.clone())?;
-
- for attachment in attachments {
- self.attachments.upsert_pending_attachment(
- &attachment.id,
- session_uuid,
- message.uuid,
- attachment.size,
- )?;
- }
-
- Ok(message)
- }
-
- pub fn insert_message_with_uuid_and_state(
- &self,
- message_uuid: Uuid,
- session_uuid: Uuid,
- sender: &str,
- text: &str,
- parent: Option<Uuid>,
- attachments: Vec<AttachmentMeta>,
- created_at: i64,
- deleted_at: Option<i64>,
- needs_sync: bool,
- ) -> Result<Message> {
- self.chat.insert_message_with_uuid_and_state(
- message_uuid,
- session_uuid,
- sender,
- text,
- parent,
- attachments,
- created_at,
- deleted_at,
- needs_sync,
- )
- }
-
- pub fn get_messages(&self, session_uuid: Uuid) -> Result<Vec<Message>> {
- self.chat.get_messages(session_uuid)
- }
-
- pub fn get_messages_needing_sync(&self, session_uuid: Uuid) -> Result<Vec<Message>> {
- self.chat.get_messages_needing_sync(session_uuid)
- }
-
- pub fn update_message_text(&self, uuid: Uuid, text: &str) -> Result<()> {
- self.chat.update_message_text(uuid, text)
- }
-
- pub fn delete_message(&self, uuid: Uuid) -> Result<()> {
- let _ = self
- .attachments
- .delete_attachment_tracking_for_message(uuid);
- self.chat.delete_message(uuid)
- }
-
- // Attachments DB APIs
- pub fn upsert_pending_attachment(
- &self,
- attachment_id: &str,
- session_uuid: Uuid,
- message_uuid: Uuid,
- size: i64,
- ) -> Result<()> {
- self.attachments
- .upsert_pending_attachment(attachment_id, session_uuid, message_uuid, size)
- }
-
- pub fn set_attachment_upload_state(
- &self,
- attachment_id: &str,
- state: UploadState,
- ) -> Result<()> {
- self.attachments
- .set_attachment_upload_state(attachment_id, state)
- }
-
- pub fn mark_attachment_uploaded(&self, attachment_id: &str) -> Result<()> {
- self.attachments.mark_attachment_uploaded(attachment_id)
- }
-
- pub fn get_pending_uploads_for_session(
- &self,
- session_uuid: Uuid,
- ) -> Result<Vec<AttachmentUploadRow>> {
- self.attachments
- .get_pending_uploads_for_session(session_uuid)
- }
-
- pub fn get_pending_uploads_for_message(
- &self,
- message_uuid: Uuid,
- ) -> Result<Vec<AttachmentUploadRow>> {
- self.attachments
- .get_pending_uploads_for_message(message_uuid)
- }
-
- pub fn delete_attachment_tracking_for_message(&self, message_uuid: Uuid) -> Result<()> {
- self.attachments
- .delete_attachment_tracking_for_message(message_uuid)
- }
-
- pub fn delete_attachment_tracking_for_session(&self, session_uuid: Uuid) -> Result<()> {
- self.attachments
- .delete_attachment_tracking_for_session(session_uuid)
- }
-
- // Sync helpers
- pub fn mark_session_synced(&self, uuid: Uuid, remote_id: &str) -> Result<()> {
- self.chat.mark_session_synced(uuid, remote_id)
- }
-
- pub fn get_session_remote_id(&self, uuid: Uuid) -> Result<Option<String>> {
- self.chat.get_session_remote_id(uuid)
- }
-
- pub fn set_session_remote_id(&self, uuid: Uuid, remote_id: &str) -> Result<()> {
- self.chat.set_session_remote_id(uuid, remote_id)
- }
-
- pub fn get_session_uuid_by_remote_id(&self, remote_id: &str) -> Result<Option<Uuid>> {
- self.chat.get_session_uuid_by_remote_id(remote_id)
- }
-
- pub fn mark_message_synced(&self, uuid: Uuid) -> Result<()> {
- self.chat.mark_message_synced(uuid)
- }
-
- pub fn set_message_remote_id(&self, uuid: Uuid, remote_id: &str) -> Result<()> {
- self.chat.set_message_remote_id(uuid, remote_id)
- }
-
- pub fn get_message_remote_id(&self, uuid: Uuid) -> Result<Option<String>> {
- self.chat.get_message_remote_id(uuid)
- }
-
- pub fn get_message_uuid_by_remote_id(&self, remote_id: &str) -> Result<Option<Uuid>> {
- self.chat.get_message_uuid_by_remote_id(remote_id)
- }
-
- pub fn get_sessions_needing_sync(&self) -> Result<Vec<Session>> {
- self.chat.get_sessions_needing_sync()
- }
-
- pub fn count_needing_sync(&self) -> Result<i64> {
- self.chat.count_needing_sync()
- }
-
- pub fn get_sessions_needing_sync_batch(
- &self,
- limit: i64,
- order_desc: bool,
- ) -> Result<Vec<Session>> {
- self.chat.get_sessions_needing_sync_batch(limit, order_desc)
- }
-
- pub fn set_session_server_updated_at(&self, uuid: Uuid, updated_at: i64) -> Result<()> {
- self.chat.set_session_server_updated_at(uuid, updated_at)
- }
-
- pub fn set_message_server_updated_at(&self, uuid: Uuid, updated_at: i64) -> Result<()> {
- self.chat.set_message_server_updated_at(uuid, updated_at)
- }
-
- pub fn get_pending_deletions(&self) -> Result<Vec<(EntityType, Uuid)>> {
- self.chat.get_pending_deletions()
- }
-
- pub fn get_deleted_sessions(&self) -> Result<Vec<(Uuid, i64)>> {
- self.chat.get_deleted_sessions()
- }
-
- pub fn get_deleted_messages(&self) -> Result<Vec<(Uuid, i64)>> {
- self.chat.get_deleted_messages()
- }
-
- pub fn hard_delete(&self, entity_type: EntityType, uuid: Uuid) -> Result<()> {
- self.chat.hard_delete(entity_type, uuid)
- }
-
- // Sync apply helpers
- pub fn upsert_session_from_remote(
- &self,
- session_uuid: Uuid,
- remote_id: &str,
- title: &str,
- created_at: i64,
- updated_at: i64,
- ) -> Result<Session> {
- self.chat
- .upsert_session_from_remote(session_uuid, remote_id, title, created_at, updated_at)
- }
-
- pub fn apply_session_tombstone(&self, session_uuid: Uuid, deleted_at: i64) -> Result<()> {
- self.chat.apply_session_tombstone(session_uuid, deleted_at)
- }
-
- pub fn upsert_message_from_remote(
- &self,
- message_uuid: Uuid,
- session_uuid: Uuid,
- remote_id: &str,
- sender: &str,
- text: &str,
- parent: Option<Uuid>,
- attachments: Vec<AttachmentMeta>,
- created_at: i64,
- ) -> Result<Message> {
- self.chat.upsert_message_from_remote(
- message_uuid,
- session_uuid,
- remote_id,
- sender,
- text,
- parent,
- attachments,
- created_at,
- )
- }
-
- pub fn apply_message_tombstone(&self, message_uuid: Uuid, deleted_at: i64) -> Result<()> {
- self.chat.apply_message_tombstone(message_uuid, deleted_at)
- }
-
- pub fn upsert_attachment_with_state(
- &self,
- attachment_id: &str,
- session_uuid: Uuid,
- message_uuid: Uuid,
- size: i64,
- remote_id: Option<&str>,
- state: UploadState,
- ) -> Result<()> {
- self.attachments.upsert_attachment_with_state(
- attachment_id,
- session_uuid,
- message_uuid,
- size,
- remote_id,
- state,
- )
- }
-
- pub fn set_attachment_remote_id(
- &self,
- attachment_id: &str,
- remote_id: Option<&str>,
- ) -> Result<()> {
- self.attachments
- .set_attachment_remote_id(attachment_id, remote_id)
- }
-
- pub fn get_attachment_remote_id(&self, attachment_id: &str) -> Result<Option<String>> {
- self.attachments.get_attachment_remote_id(attachment_id)
- }
-
- pub fn get_attachment_upload_state(&self, attachment_id: &str) -> Result<Option<UploadState>> {
- self.attachments.get_upload_state(attachment_id)
- }
-
- pub fn mark_all_needs_sync(&self) -> Result<()> {
- self.chat.mark_all_needs_sync()
- }
-
- pub fn clear_all_server_timestamps(&self) -> Result<()> {
- self.chat.clear_all_server_timestamps()
- }
-
- pub fn reset_sync_state(&self) -> Result<()> {
- self.chat.reset_sync_state()?;
- self.attachments.reset_all_upload_state()?;
- Ok(())
- }
-
- pub fn reset_attachment_sync_state(&self) -> Result<()> {
- self.attachments.reset_all_upload_state()
- }
-}
-
-#[cfg(feature = "sqlite")]
-impl LlmChatDb<crate::backend::sqlite::SqliteBackend> {
- pub fn open_sqlite(
- main_path: impl AsRef<std::path::Path>,
- attachments_path: impl AsRef<std::path::Path>,
- key: Vec<u8>,
- clock: Arc<dyn Clock>,
- uuid_gen: Arc<dyn UuidGen>,
- ) -> Result<Self> {
- let chat = ChatDb::open_sqlite(main_path, key, clock.clone(), uuid_gen)?;
- let attachments = AttachmentsDb::open_sqlite(attachments_path, clock)?;
- Ok(Self { chat, attachments })
- }
-
- pub fn open_sqlite_with_defaults(
- main_path: impl AsRef<std::path::Path>,
- attachments_path: impl AsRef<std::path::Path>,
- key: Vec<u8>,
- ) -> Result<Self> {
- let chat = ChatDb::open_sqlite_with_defaults(main_path, key)?;
- let attachments = AttachmentsDb::open_sqlite_with_defaults(attachments_path)?;
- Ok(Self { chat, attachments })
- }
-}
diff --git a/rust/llmchat/db/src/migrations.rs b/rust/llmchat/db/src/migrations.rs
deleted file mode 100644
index 6cc7968511..0000000000
--- a/rust/llmchat/db/src/migrations.rs
+++ /dev/null
@@ -1,97 +0,0 @@
-use crate::backend::RowExt;
-use crate::schema;
-use crate::{Backend, Error, Result};
-
-pub const LATEST_VERSION: i64 = 4;
-
-pub fn migrate<B: Backend>(backend: &B) -> Result<()> {
- let mut version = user_version(backend)?;
-
- while version < LATEST_VERSION {
- match version {
- 0 => {
- backend.execute_batch(schema::CREATE_ALL)?;
- version = LATEST_VERSION;
- }
- 1 => {
- backend.execute(
- "ALTER TABLE messages ADD COLUMN needs_sync INTEGER NOT NULL DEFAULT 1 CHECK(needs_sync IN (0,1));",
- &[],
- )?;
- backend.execute(
- "UPDATE messages SET needs_sync = 0 WHERE session_uuid IN (SELECT session_uuid FROM sessions WHERE needs_sync = 0);",
- &[],
- )?;
- version = 2;
- }
- 2 => {
- backend.execute(
- "ALTER TABLE sessions ADD COLUMN server_updated_at INTEGER;",
- &[],
- )?;
- backend.execute(
- "ALTER TABLE messages ADD COLUMN server_updated_at INTEGER;",
- &[],
- )?;
- version = 3;
- }
- 3 => {
- backend.execute("ALTER TABLE messages ADD COLUMN remote_id TEXT;", &[])?;
- version = 4;
- }
- other => {
- return Err(Error::Migration(format!(
- "unsupported schema version {other}"
- )));
- }
- }
-
- backend.execute(&format!("PRAGMA user_version = {version};"), &[])?;
- }
-
- Ok(())
-}
-
-fn user_version<B: Backend>(backend: &B) -> Result<i64> {
- let row = backend
- .query_row("PRAGMA user_version;", &[])?
- .ok_or_else(|| Error::Migration("missing user_version pragma".to_string()))?;
- row.get_i64(0)
-}
-
-#[cfg(all(test, feature = "sqlite"))]
-mod tests {
- use super::*;
- use crate::backend::sqlite::SqliteBackend;
- use crate::backend::{BackendTx, RowExt, Value};
-
- #[test]
- fn creates_schema_and_indexes() {
- let backend = SqliteBackend::open_in_memory().unwrap();
- migrate(&backend).unwrap();
-
- for table in ["sessions", "messages"] {
- let row = backend
- .query_row(
- "SELECT name FROM sqlite_master WHERE type = 'table' AND name = ?",
- &[Value::Text(table.to_string())],
- )
- .unwrap();
- assert!(row.is_some(), "missing table {table}");
- }
-
- for index in ["idx_messages_order", "idx_sessions_updated"] {
- let row = backend
- .query_row(
- "SELECT name FROM sqlite_master WHERE type = 'index' AND name = ?",
- &[Value::Text(index.to_string())],
- )
- .unwrap();
- assert!(row.is_some(), "missing index {index}");
- }
-
- let row = backend.query_row("PRAGMA user_version;", &[]).unwrap();
- let version = row.unwrap().get_i64(0).unwrap();
- assert_eq!(version, LATEST_VERSION);
- }
-}
diff --git a/rust/llmchat/db/src/models.rs b/rust/llmchat/db/src/models.rs
deleted file mode 100644
index b735631355..0000000000
--- a/rust/llmchat/db/src/models.rs
+++ /dev/null
@@ -1,85 +0,0 @@
-use serde::{Deserialize, Serialize};
-use uuid::Uuid;
-
-#[derive(Debug, Clone, PartialEq, Eq)]
-pub struct Session {
- pub uuid: Uuid,
- pub title: String,
- pub created_at: i64,
- pub updated_at: i64,
- pub server_updated_at: Option<i64>,
- pub remote_id: Option<String>,
- pub needs_sync: bool,
- pub deleted_at: Option<i64>,
-}
-
-#[derive(Debug, Clone, PartialEq, Eq)]
-pub struct Message {
- pub uuid: Uuid,
- pub session_uuid: Uuid,
- pub parent_message_uuid: Option<Uuid>,
- pub sender: Sender,
- pub text: String,
- pub attachments: Vec<AttachmentMeta>,
- pub created_at: i64,
- pub remote_id: Option<String>,
- pub server_updated_at: Option<i64>,
- pub needs_sync: bool,
- pub deleted_at: Option<i64>,
-}
-
-#[derive(Debug, Clone, PartialEq, Eq)]
-pub struct AttachmentMeta {
- pub id: String,
- pub kind: AttachmentKind,
- pub size: i64,
- pub name: String,
-}
-
-#[derive(Debug, Clone, Copy, PartialEq, Eq, Serialize, Deserialize)]
-#[serde(rename_all = "lowercase")]
-pub enum AttachmentKind {
- Image,
- Document,
-}
-
-#[derive(Debug, Clone, Copy, PartialEq, Eq)]
-pub enum Sender {
- SelfUser,
- Other,
-}
-
-impl Sender {
- pub fn as_str(&self) -> &'static str {
- match self {
- Sender::SelfUser => "self",
- Sender::Other => "other",
- }
- }
-}
-
-impl std::str::FromStr for Sender {
- type Err = crate::Error;
-
- fn from_str(value: &str) -> Result<Self, Self::Err> {
- match value {
- "self" => Ok(Sender::SelfUser),
- "other" => Ok(Sender::Other),
- _ => Err(crate::Error::InvalidSender(value.to_string())),
- }
- }
-}
-
-#[derive(Debug, Clone, Copy, PartialEq, Eq)]
-pub enum EntityType {
- Session,
- Message,
-}
-
-#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)]
-pub(crate) struct StoredAttachment {
- pub id: String,
- pub kind: AttachmentKind,
- pub size: i64,
- pub encrypted_name: String,
-}
diff --git a/rust/llmchat/db/src/schema.rs b/rust/llmchat/db/src/schema.rs
deleted file mode 100644
index 3a9580f317..0000000000
--- a/rust/llmchat/db/src/schema.rs
+++ /dev/null
@@ -1,69 +0,0 @@
-pub const PRAGMA_FOREIGN_KEYS: &str = "PRAGMA foreign_keys = ON;";
-
-pub const CREATE_SESSIONS: &str = "
-CREATE TABLE IF NOT EXISTS sessions (
- session_uuid TEXT PRIMARY KEY NOT NULL,
- title BLOB NOT NULL,
- created_at INTEGER NOT NULL,
- updated_at INTEGER NOT NULL,
- server_updated_at INTEGER,
- remote_id TEXT UNIQUE,
- needs_sync INTEGER NOT NULL DEFAULT 1 CHECK(needs_sync IN (0,1)),
- deleted_at INTEGER
-);
-";
-
-pub const CREATE_MESSAGES: &str = "
-CREATE TABLE IF NOT EXISTS messages (
- message_uuid TEXT PRIMARY KEY NOT NULL,
- session_uuid TEXT NOT NULL,
- parent_message_uuid TEXT,
- sender TEXT NOT NULL CHECK(sender IN ('self','other')),
- text BLOB NOT NULL,
- attachments TEXT,
- created_at INTEGER NOT NULL,
- remote_id TEXT,
- server_updated_at INTEGER,
- needs_sync INTEGER NOT NULL DEFAULT 1 CHECK(needs_sync IN (0,1)),
- deleted_at INTEGER,
- FOREIGN KEY (session_uuid) REFERENCES sessions(session_uuid) ON DELETE CASCADE
-);
-";
-
-pub const CREATE_INDEXES: &str = "
-CREATE INDEX IF NOT EXISTS idx_messages_order ON messages(session_uuid, created_at, message_uuid);
-CREATE INDEX IF NOT EXISTS idx_sessions_updated ON sessions(updated_at);
-";
-
-pub const CREATE_ALL: &str = "
-PRAGMA foreign_keys = ON;
-
-CREATE TABLE IF NOT EXISTS sessions (
- session_uuid TEXT PRIMARY KEY NOT NULL,
- title BLOB NOT NULL,
- created_at INTEGER NOT NULL,
- updated_at INTEGER NOT NULL,
- server_updated_at INTEGER,
- remote_id TEXT UNIQUE,
- needs_sync INTEGER NOT NULL DEFAULT 1 CHECK(needs_sync IN (0,1)),
- deleted_at INTEGER
-);
-
-CREATE TABLE IF NOT EXISTS messages (
- message_uuid TEXT PRIMARY KEY NOT NULL,
- session_uuid TEXT NOT NULL,
- parent_message_uuid TEXT,
- sender TEXT NOT NULL CHECK(sender IN ('self','other')),
- text BLOB NOT NULL,
- attachments TEXT,
- created_at INTEGER NOT NULL,
- remote_id TEXT,
- server_updated_at INTEGER,
- needs_sync INTEGER NOT NULL DEFAULT 1 CHECK(needs_sync IN (0,1)),
- deleted_at INTEGER,
- FOREIGN KEY (session_uuid) REFERENCES sessions(session_uuid) ON DELETE CASCADE
-);
-
-CREATE INDEX IF NOT EXISTS idx_messages_order ON messages(session_uuid, created_at, message_uuid);
-CREATE INDEX IF NOT EXISTS idx_sessions_updated ON sessions(updated_at);
-";
diff --git a/rust/llmchat/db/src/sync_state_db.rs b/rust/llmchat/db/src/sync_state_db.rs
deleted file mode 100644
index 6334e54b96..0000000000
--- a/rust/llmchat/db/src/sync_state_db.rs
+++ /dev/null
@@ -1,230 +0,0 @@
-use std::path::Path;
-
-use uuid::Uuid;
-
-use crate::Result;
-use crate::backend::{Backend, RowExt, Value};
-use crate::sync_state_schema;
-
-#[derive(Debug, Clone, Default, PartialEq, Eq)]
-pub struct SyncEntityState {
- pub remote_id: Option<String>,
- pub server_updated_at: Option<i64>,
-}
-
-pub struct SyncStateDb<B: Backend> {
- backend: B,
-}
-
-impl<B: Backend> SyncStateDb<B> {
- pub fn new(backend: B) -> Result<Self> {
- backend.execute_batch(sync_state_schema::CREATE_ALL)?;
- Ok(Self { backend })
- }
-
- pub fn get_session_state(&self, uuid: Uuid) -> Result<Option<SyncEntityState>> {
- self.get_entity_state("sync_sessions", uuid)
- }
-
- pub fn get_message_state(&self, uuid: Uuid) -> Result<Option<SyncEntityState>> {
- self.get_entity_state("sync_messages", uuid)
- }
-
- pub fn get_session_remote_id(&self, uuid: Uuid) -> Result<Option<String>> {
- self.get_entity_remote_id("sync_sessions", uuid)
- }
-
- pub fn get_message_remote_id(&self, uuid: Uuid) -> Result<Option<String>> {
- self.get_entity_remote_id("sync_messages", uuid)
- }
-
- pub fn get_session_uuid_by_remote_id(&self, remote_id: &str) -> Result<Option<Uuid>> {
- self.get_uuid_by_remote_id("sync_sessions", remote_id)
- }
-
- pub fn get_message_uuid_by_remote_id(&self, remote_id: &str) -> Result<Option<Uuid>> {
- self.get_uuid_by_remote_id("sync_messages", remote_id)
- }
-
- pub fn set_session_state(
- &self,
- uuid: Uuid,
- remote_id: Option<&str>,
- server_updated_at: Option<i64>,
- ) -> Result<()> {
- self.set_entity_state("sync_sessions", uuid, remote_id, server_updated_at)
- }
-
- pub fn set_message_state(
- &self,
- uuid: Uuid,
- remote_id: Option<&str>,
- server_updated_at: Option<i64>,
- ) -> Result<()> {
- self.set_entity_state("sync_messages", uuid, remote_id, server_updated_at)
- }
-
- pub fn set_session_remote_id(&self, uuid: Uuid, remote_id: Option<&str>) -> Result<()> {
- self.set_entity_remote_id("sync_sessions", uuid, remote_id)
- }
-
- pub fn set_message_remote_id(&self, uuid: Uuid, remote_id: Option<&str>) -> Result<()> {
- self.set_entity_remote_id("sync_messages", uuid, remote_id)
- }
-
- pub fn set_session_server_updated_at(&self, uuid: Uuid, updated_at: i64) -> Result<()> {
- self.set_entity_server_updated_at("sync_sessions", uuid, updated_at)
- }
-
- pub fn set_message_server_updated_at(&self, uuid: Uuid, updated_at: i64) -> Result<()> {
- self.set_entity_server_updated_at("sync_messages", uuid, updated_at)
- }
-
- pub fn delete_session_state(&self, uuid: Uuid) -> Result<()> {
- self.delete_entity_state("sync_sessions", uuid)
- }
-
- pub fn delete_message_state(&self, uuid: Uuid) -> Result<()> {
- self.delete_entity_state("sync_messages", uuid)
- }
-
- pub fn clear_state(&self) -> Result<()> {
- self.backend.execute("DELETE FROM sync_sessions", &[])?;
- self.backend.execute("DELETE FROM sync_messages", &[])?;
- Ok(())
- }
-
- pub fn get_meta(&self, key: &str) -> Result<Option<Vec<u8>>> {
- let row = self.backend.query_row(
- "SELECT value FROM sync_meta WHERE key = ?",
- &[Value::Text(key.to_string())],
- )?;
- row.map(|row| row.get_blob(0)).transpose()
- }
-
- pub fn set_meta(&self, key: &str, value: &[u8]) -> Result<()> {
- self.backend.execute(
- "INSERT INTO sync_meta (key, value) VALUES (?, ?) \n ON CONFLICT(key) DO UPDATE SET value = excluded.value",
- &[Value::Text(key.to_string()), Value::Blob(value.to_vec())],
- )?;
- Ok(())
- }
-
- pub fn delete_meta(&self, key: &str) -> Result<()> {
- self.backend.execute(
- "DELETE FROM sync_meta WHERE key = ?",
- &[Value::Text(key.to_string())],
- )?;
- Ok(())
- }
-
- pub fn clear_meta(&self) -> Result<()> {
- self.backend.execute("DELETE FROM sync_meta", &[])?;
- Ok(())
- }
-
- fn get_entity_state(&self, table: &str, uuid: Uuid) -> Result<Option<SyncEntityState>> {
- let query = format!("SELECT remote_id, server_updated_at FROM {table} WHERE client_id = ?");
- let row = self
- .backend
- .query_row(&query, &[Value::Text(uuid.to_string())])?;
- row.map(|row| {
- Ok(SyncEntityState {
- remote_id: row.get_optional_string(0)?,
- server_updated_at: row.get_optional_i64(1)?,
- })
- })
- .transpose()
- }
-
- fn get_entity_remote_id(&self, table: &str, uuid: Uuid) -> Result<Option<String>> {
- let query = format!("SELECT remote_id FROM {table} WHERE client_id = ?");
- let row = self
- .backend
- .query_row(&query, &[Value::Text(uuid.to_string())])?;
- match row {
- Some(row) => row.get_optional_string(0),
- None => Ok(None),
- }
- }
-
- fn get_uuid_by_remote_id(&self, table: &str, remote_id: &str) -> Result<Option<Uuid>> {
- let query = format!("SELECT client_id FROM {table} WHERE remote_id = ?");
- let row = self
- .backend
- .query_row(&query, &[Value::Text(remote_id.to_string())])?;
- match row {
- Some(row) => Ok(Some(Uuid::parse_str(&row.get_string(0)?)?)),
- None => Ok(None),
- }
- }
-
- fn set_entity_state(
- &self,
- table: &str,
- uuid: Uuid,
- remote_id: Option<&str>,
- server_updated_at: Option<i64>,
- ) -> Result<()> {
- let query = format!(
- "INSERT INTO {table} (client_id, remote_id, server_updated_at) VALUES (?, ?, ?) \n ON CONFLICT(client_id) DO UPDATE SET \n remote_id = COALESCE(excluded.remote_id, {table}.remote_id), \n server_updated_at = COALESCE(excluded.server_updated_at, {table}.server_updated_at)"
- );
- self.backend.execute(
- &query,
- &[
- Value::Text(uuid.to_string()),
- remote_id
- .map(|value| Value::Text(value.to_string()))
- .unwrap_or(Value::Null),
- server_updated_at.map(Value::Integer).unwrap_or(Value::Null),
- ],
- )?;
- Ok(())
- }
-
- fn set_entity_remote_id(&self, table: &str, uuid: Uuid, remote_id: Option<&str>) -> Result<()> {
- let query = format!(
- "INSERT INTO {table} (client_id, remote_id) VALUES (?, ?) \n ON CONFLICT(client_id) DO UPDATE SET remote_id = excluded.remote_id"
- );
- self.backend.execute(
- &query,
- &[
- Value::Text(uuid.to_string()),
- remote_id
- .map(|value| Value::Text(value.to_string()))
- .unwrap_or(Value::Null),
- ],
- )?;
- Ok(())
- }
-
- fn set_entity_server_updated_at(&self, table: &str, uuid: Uuid, updated_at: i64) -> Result<()> {
- let query = format!(
- "INSERT INTO {table} (client_id, server_updated_at) VALUES (?, ?) \n ON CONFLICT(client_id) DO UPDATE SET server_updated_at = excluded.server_updated_at"
- );
- self.backend.execute(
- &query,
- &[Value::Text(uuid.to_string()), Value::Integer(updated_at)],
- )?;
- Ok(())
- }
-
- fn delete_entity_state(&self, table: &str, uuid: Uuid) -> Result<()> {
- let query = format!("DELETE FROM {table} WHERE client_id = ?");
- self.backend
- .execute(&query, &[Value::Text(uuid.to_string())])?;
- Ok(())
- }
-}
-
-#[cfg(feature = "sqlite")]
-impl SyncStateDb<crate::backend::sqlite::SqliteBackend> {
- pub fn open_sqlite(path: impl AsRef<Path>) -> Result<Self> {
- let backend = crate::backend::sqlite::SqliteBackend::open(path)?;
- Self::new(backend)
- }
-
- pub fn open_sqlite_with_defaults(path: impl AsRef<Path>) -> Result<Self> {
- Self::open_sqlite(path)
- }
-}
diff --git a/rust/llmchat/db/src/sync_state_schema.rs b/rust/llmchat/db/src/sync_state_schema.rs
deleted file mode 100644
index 7f4d311b10..0000000000
--- a/rust/llmchat/db/src/sync_state_schema.rs
+++ /dev/null
@@ -1,49 +0,0 @@
-pub const CREATE_SYNC_SESSIONS: &str = "
-CREATE TABLE IF NOT EXISTS sync_sessions (
- client_id TEXT PRIMARY KEY NOT NULL,
- remote_id TEXT,
- server_updated_at INTEGER
-);
-";
-
-pub const CREATE_SYNC_MESSAGES: &str = "
-CREATE TABLE IF NOT EXISTS sync_messages (
- client_id TEXT PRIMARY KEY NOT NULL,
- remote_id TEXT,
- server_updated_at INTEGER
-);
-";
-
-pub const CREATE_SYNC_META: &str = "
-CREATE TABLE IF NOT EXISTS sync_meta (
- key TEXT PRIMARY KEY NOT NULL,
- value BLOB NOT NULL
-);
-";
-
-pub const CREATE_INDEXES: &str = "
-CREATE INDEX IF NOT EXISTS idx_sync_sessions_remote ON sync_sessions(remote_id);
-CREATE INDEX IF NOT EXISTS idx_sync_messages_remote ON sync_messages(remote_id);
-";
-
-pub const CREATE_ALL: &str = "
-CREATE TABLE IF NOT EXISTS sync_sessions (
- client_id TEXT PRIMARY KEY NOT NULL,
- remote_id TEXT,
- server_updated_at INTEGER
-);
-
-CREATE TABLE IF NOT EXISTS sync_messages (
- client_id TEXT PRIMARY KEY NOT NULL,
- remote_id TEXT,
- server_updated_at INTEGER
-);
-
-CREATE TABLE IF NOT EXISTS sync_meta (
- key TEXT PRIMARY KEY NOT NULL,
- value BLOB NOT NULL
-);
-
-CREATE INDEX IF NOT EXISTS idx_sync_sessions_remote ON sync_sessions(remote_id);
-CREATE INDEX IF NOT EXISTS idx_sync_messages_remote ON sync_messages(remote_id);
-";
diff --git a/rust/llmchat/db/src/traits.rs b/rust/llmchat/db/src/traits.rs
deleted file mode 100644
index f28d408962..0000000000
--- a/rust/llmchat/db/src/traits.rs
+++ /dev/null
@@ -1,167 +0,0 @@
-use std::{
- fs,
- path::{Path, PathBuf},
- time::{SystemTime, UNIX_EPOCH},
-};
-
-use uuid::Uuid;
-
-use crate::Result;
-
-pub trait MetaStore: Send + Sync {
- fn get(&self, key: &str) -> Result<Option<Vec<u8>>>;
- fn set(&self, key: &str, value: &[u8]) -> Result<()>;
- fn delete(&self, key: &str) -> Result<()>;
-}
-
-pub trait AttachmentStore: Send + Sync {
- fn write(&self, id: &str, data: &[u8]) -> Result<()>;
- fn read(&self, id: &str) -> Result<Vec<u8>>;
- fn delete(&self, id: &str) -> Result<()>;
- fn exists(&self, id: &str) -> Result<bool>;
-}
-
-pub trait Clock: Send + Sync {
- fn now_us(&self) -> i64;
-}
-
-pub trait UuidGen: Send + Sync {
- fn new_uuid(&self) -> Uuid;
-}
-
-#[derive(Debug, Default, Clone)]
-pub struct SystemClock;
-
-impl Clock for SystemClock {
- fn now_us(&self) -> i64 {
- let duration = SystemTime::now()
- .duration_since(UNIX_EPOCH)
- .unwrap_or_default();
- let micros = duration.as_secs() as i64 * 1_000_000;
- let sub_micros = (duration.subsec_nanos() / 1_000) as i64;
- micros + sub_micros
- }
-}
-
-#[derive(Debug, Default, Clone)]
-pub struct RandomUuidGen;
-
-impl UuidGen for RandomUuidGen {
- fn new_uuid(&self) -> Uuid {
- Uuid::new_v4()
- }
-}
-
-#[derive(Debug, Clone)]
-pub struct FileMetaStore {
- root: PathBuf,
-}
-
-impl FileMetaStore {
- pub fn new(root: impl Into<PathBuf>) -> Self {
- Self { root: root.into() }
- }
-
- fn key_path(&self, key: &str) -> PathBuf {
- let encoded = ente_core::crypto::bin2base64(key.as_bytes(), true);
- self.root.join(encoded)
- }
-
- fn ensure_root(&self) -> Result<()> {
- fs::create_dir_all(&self.root)?;
- Ok(())
- }
-}
-
-impl MetaStore for FileMetaStore {
- fn get(&self, key: &str) -> Result<Option<Vec<u8>>> {
- let path = self.key_path(key);
- match fs::read(&path) {
- Ok(bytes) => Ok(Some(bytes)),
- Err(err) if err.kind() == std::io::ErrorKind::NotFound => Ok(None),
- Err(err) => Err(err.into()),
- }
- }
-
- fn set(&self, key: &str, value: &[u8]) -> Result<()> {
- self.ensure_root()?;
- let path = self.key_path(key);
- fs::write(path, value)?;
- Ok(())
- }
-
- fn delete(&self, key: &str) -> Result<()> {
- let path = self.key_path(key);
- match fs::remove_file(path) {
- Ok(()) => Ok(()),
- Err(err) if err.kind() == std::io::ErrorKind::NotFound => Ok(()),
- Err(err) => Err(err.into()),
- }
- }
-}
-
-#[derive(Debug, Clone)]
-pub struct FsAttachmentStore {
- root: PathBuf,
-}
-
-impl FsAttachmentStore {
- pub fn new(root: impl Into<PathBuf>) -> Self {
- Self { root: root.into() }
- }
-
- pub fn size(&self, id: &str) -> Result<u64> {
- let path = self.attachment_path(id);
- Ok(fs::metadata(path)?.len())
- }
-
- pub fn clear_all(&self) -> Result<()> {
- if self.root.exists() {
- fs::remove_dir_all(&self.root)?;
- }
- fs::create_dir_all(&self.root)?;
- Ok(())
- }
-
- fn attachment_path(&self, id: &str) -> PathBuf {
- self.root.join(id)
- }
-
- fn ensure_root(&self) -> Result<()> {
- fs::create_dir_all(&self.root)?;
- Ok(())
- }
-}
-
-impl AttachmentStore for FsAttachmentStore {
- fn write(&self, id: &str, data: &[u8]) -> Result<()> {
- self.ensure_root()?;
- let path = self.attachment_path(id);
- fs::write(path, data)?;
- Ok(())
- }
-
- fn read(&self, id: &str) -> Result<Vec<u8>> {
- let path = self.attachment_path(id);
- Ok(fs::read(path)?)
- }
-
- fn delete(&self, id: &str) -> Result<()> {
- let path = self.attachment_path(id);
- match fs::remove_file(path) {
- Ok(()) => Ok(()),
- Err(err) if err.kind() == std::io::ErrorKind::NotFound => Ok(()),
- Err(err) => Err(err.into()),
- }
- }
-
- fn exists(&self, id: &str) -> Result<bool> {
- let path = self.attachment_path(id);
- Ok(path.exists())
- }
-}
-
-pub fn ensure_directory(path: impl AsRef<Path>) -> Result<()> {
- fs::create_dir_all(path)?;
- Ok(())
-}
diff --git a/rust/llmchat/inference/Cargo.lock b/rust/llmchat/inference/Cargo.lock
deleted file mode 100644
index 26c7389f68..0000000000
--- a/rust/llmchat/inference/Cargo.lock
+++ /dev/null
@@ -1,611 +0,0 @@
-# This file is automatically @generated by Cargo.
-# It is not intended for manual editing.
-version = 4
-
-[[package]]
-name = "aho-corasick"
-version = "1.1.4"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "ddd31a130427c27518df266943a5308ed92d4b226cc639f5a8f1002816174301"
-dependencies = [
- "memchr",
-]
-
-[[package]]
-name = "bindgen"
-version = "0.72.1"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "993776b509cfb49c750f11b8f07a46fa23e0a1386ffc01fb1e7d343efc387895"
-dependencies = [
- "bitflags",
- "cexpr",
- "clang-sys",
- "itertools",
- "log",
- "prettyplease",
- "proc-macro2",
- "quote",
- "regex",
- "rustc-hash",
- "shlex",
- "syn",
-]
-
-[[package]]
-name = "bitflags"
-version = "2.10.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "812e12b5285cc515a9c72a5c1d3b6d46a19dac5acfef5265968c166106e31dd3"
-
-[[package]]
-name = "cc"
-version = "1.2.56"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "aebf35691d1bfb0ac386a69bac2fde4dd276fb618cf8bf4f5318fe285e821bb2"
-dependencies = [
- "find-msvc-tools",
- "jobserver",
- "libc",
- "shlex",
-]
-
-[[package]]
-name = "cexpr"
-version = "0.6.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "6fac387a98bb7c37292057cffc56d62ecb629900026402633ae9160df93a8766"
-dependencies = [
- "nom",
-]
-
-[[package]]
-name = "cfg-if"
-version = "1.0.4"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "9330f8b2ff13f34540b44e946ef35111825727b38d33286ef986142615121801"
-
-[[package]]
-name = "clang-sys"
-version = "1.8.1"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "0b023947811758c97c59bf9d1c188fd619ad4718dcaa767947df1cadb14f39f4"
-dependencies = [
- "glob",
- "libc",
- "libloading",
-]
-
-[[package]]
-name = "cmake"
-version = "0.1.57"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "75443c44cd6b379beb8c5b45d85d0773baf31cce901fe7bb252f4eff3008ef7d"
-dependencies = [
- "cc",
-]
-
-[[package]]
-name = "either"
-version = "1.15.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "48c757948c5ede0e46177b7add2e67155f70e33c07fea8284df6576da70b3719"
-
-[[package]]
-name = "encoding_rs"
-version = "0.8.35"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "75030f3c4f45dafd7586dd6780965a8c7e8e285a5ecb86713e63a79c5b2766f3"
-dependencies = [
- "cfg-if",
-]
-
-[[package]]
-name = "enumflags2"
-version = "0.7.12"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "1027f7680c853e056ebcec683615fb6fbbc07dbaa13b4d5d9442b146ded4ecef"
-dependencies = [
- "enumflags2_derive",
-]
-
-[[package]]
-name = "enumflags2_derive"
-version = "0.7.12"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "67c78a4d8fdf9953a5c9d458f9efe940fd97a0cab0941c075a813ac594733827"
-dependencies = [
- "proc-macro2",
- "quote",
- "syn",
-]
-
-[[package]]
-name = "find-msvc-tools"
-version = "0.1.9"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "5baebc0774151f905a1a2cc41989300b1e6fbb29aff0ceffa1064fdd3088d582"
-
-[[package]]
-name = "find_cuda_helper"
-version = "0.2.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "f9f9e65c593dd01ac77daad909ea4ad17f0d6d1776193fc8ea766356177abdad"
-dependencies = [
- "glob",
-]
-
-[[package]]
-name = "getrandom"
-version = "0.3.4"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "899def5c37c4fd7b2664648c28120ecec138e4d395b459e5ca34f9cce2dd77fd"
-dependencies = [
- "cfg-if",
- "libc",
- "r-efi",
- "wasip2",
-]
-
-[[package]]
-name = "glob"
-version = "0.3.3"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "0cc23270f6e1808e30a928bdc84dea0b9b4136a8bc82338574f23baf47bbd280"
-
-[[package]]
-name = "inference_rs"
-version = "0.1.0"
-dependencies = [
- "llama-cpp-2",
- "llama-cpp-sys-2",
- "parking_lot",
- "self_cell",
- "serde",
- "serde_json",
- "thiserror 1.0.69",
-]
-
-[[package]]
-name = "itertools"
-version = "0.13.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "413ee7dfc52ee1a4949ceeb7dbc8a33f2d6c088194d9f922fb8318faf1f01186"
-dependencies = [
- "either",
-]
-
-[[package]]
-name = "itoa"
-version = "1.0.17"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "92ecc6618181def0457392ccd0ee51198e065e016d1d527a7ac1b6dc7c1f09d2"
-
-[[package]]
-name = "jobserver"
-version = "0.1.34"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "9afb3de4395d6b3e67a780b6de64b51c978ecf11cb9a462c66be7d4ca9039d33"
-dependencies = [
- "getrandom",
- "libc",
-]
-
-[[package]]
-name = "libc"
-version = "0.2.180"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "bcc35a38544a891a5f7c865aca548a982ccb3b8650a5b06d0fd33a10283c56fc"
-
-[[package]]
-name = "libloading"
-version = "0.8.9"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "d7c4b02199fee7c5d21a5ae7d8cfa79a6ef5bb2fc834d6e9058e89c825efdc55"
-dependencies = [
- "cfg-if",
- "windows-link",
-]
-
-[[package]]
-name = "llama-cpp-2"
-version = "0.1.138"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "2947ab625c59d1fdf42e61f538c3fa66f43de2f78316971920873f359483d1d8"
-dependencies = [
- "encoding_rs",
- "enumflags2",
- "llama-cpp-sys-2",
- "thiserror 2.0.18",
- "tracing",
- "tracing-core",
-]
-
-[[package]]
-name = "llama-cpp-sys-2"
-version = "0.1.138"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "84a529006bf16af70c7485ba957820dc2bc9467d75697e97970c81d2da73c76f"
-dependencies = [
- "bindgen",
- "cc",
- "cmake",
- "find_cuda_helper",
- "glob",
- "walkdir",
-]
-
-[[package]]
-name = "lock_api"
-version = "0.4.14"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "224399e74b87b5f3557511d98dff8b14089b3dadafcab6bb93eab67d3aace965"
-dependencies = [
- "scopeguard",
-]
-
-[[package]]
-name = "log"
-version = "0.4.29"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "5e5032e24019045c762d3c0f28f5b6b8bbf38563a65908389bf7978758920897"
-
-[[package]]
-name = "memchr"
-version = "2.7.6"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "f52b00d39961fc5b2736ea853c9cc86238e165017a493d1d5c8eac6bdc4cc273"
-
-[[package]]
-name = "minimal-lexical"
-version = "0.2.1"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "68354c5c6bd36d73ff3feceb05efa59b6acb7626617f4962be322a825e61f79a"
-
-[[package]]
-name = "nom"
-version = "7.1.3"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "d273983c5a657a70a3e8f2a01329822f3b8c8172b73826411a55751e404a0a4a"
-dependencies = [
- "memchr",
- "minimal-lexical",
-]
-
-[[package]]
-name = "once_cell"
-version = "1.21.3"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "42f5e15c9953c5e4ccceeb2e7382a716482c34515315f7b03532b8b4e8393d2d"
-
-[[package]]
-name = "parking_lot"
-version = "0.12.5"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "93857453250e3077bd71ff98b6a65ea6621a19bb0f559a85248955ac12c45a1a"
-dependencies = [
- "lock_api",
- "parking_lot_core",
-]
-
-[[package]]
-name = "parking_lot_core"
-version = "0.9.12"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "2621685985a2ebf1c516881c026032ac7deafcda1a2c9b7850dc81e3dfcb64c1"
-dependencies = [
- "cfg-if",
- "libc",
- "redox_syscall",
- "smallvec",
- "windows-link",
-]
-
-[[package]]
-name = "pin-project-lite"
-version = "0.2.16"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "3b3cff922bd51709b605d9ead9aa71031d81447142d828eb4a6eba76fe619f9b"
-
-[[package]]
-name = "prettyplease"
-version = "0.2.37"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "479ca8adacdd7ce8f1fb39ce9ecccbfe93a3f1344b3d0d97f20bc0196208f62b"
-dependencies = [
- "proc-macro2",
- "syn",
-]
-
-[[package]]
-name = "proc-macro2"
-version = "1.0.106"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "8fd00f0bb2e90d81d1044c2b32617f68fcb9fa3bb7640c23e9c748e53fb30934"
-dependencies = [
- "unicode-ident",
-]
-
-[[package]]
-name = "quote"
-version = "1.0.44"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "21b2ebcf727b7760c461f091f9f0f539b77b8e87f2fd88131e7f1b433b3cece4"
-dependencies = [
- "proc-macro2",
-]
-
-[[package]]
-name = "r-efi"
-version = "5.3.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "69cdb34c158ceb288df11e18b4bd39de994f6657d83847bdffdbd7f346754b0f"
-
-[[package]]
-name = "redox_syscall"
-version = "0.5.18"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "ed2bf2547551a7053d6fdfafda3f938979645c44812fbfcda098faae3f1a362d"
-dependencies = [
- "bitflags",
-]
-
-[[package]]
-name = "regex"
-version = "1.12.2"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "843bc0191f75f3e22651ae5f1e72939ab2f72a4bc30fa80a066bd66edefc24d4"
-dependencies = [
- "aho-corasick",
- "memchr",
- "regex-automata",
- "regex-syntax",
-]
-
-[[package]]
-name = "regex-automata"
-version = "0.4.13"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "5276caf25ac86c8d810222b3dbb938e512c55c6831a10f3e6ed1c93b84041f1c"
-dependencies = [
- "aho-corasick",
- "memchr",
- "regex-syntax",
-]
-
-[[package]]
-name = "regex-syntax"
-version = "0.8.8"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "7a2d987857b319362043e95f5353c0535c1f58eec5336fdfcf626430af7def58"
-
-[[package]]
-name = "rustc-hash"
-version = "2.1.1"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "357703d41365b4b27c590e3ed91eabb1b663f07c4c084095e60cbed4362dff0d"
-
-[[package]]
-name = "same-file"
-version = "1.0.6"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "93fc1dc3aaa9bfed95e02e6eadabb4baf7e3078b0bd1b4d7b6b0b68378900502"
-dependencies = [
- "winapi-util",
-]
-
-[[package]]
-name = "scopeguard"
-version = "1.2.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "94143f37725109f92c262ed2cf5e59bce7498c01bcc1502d7b9afe439a4e9f49"
-
-[[package]]
-name = "self_cell"
-version = "1.2.2"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "b12e76d157a900eb52e81bc6e9f3069344290341720e9178cde2407113ac8d89"
-
-[[package]]
-name = "serde"
-version = "1.0.228"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "9a8e94ea7f378bd32cbbd37198a4a91436180c5bb472411e48b5ec2e2124ae9e"
-dependencies = [
- "serde_core",
- "serde_derive",
-]
-
-[[package]]
-name = "serde_core"
-version = "1.0.228"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "41d385c7d4ca58e59fc732af25c3983b67ac852c1a25000afe1175de458b67ad"
-dependencies = [
- "serde_derive",
-]
-
-[[package]]
-name = "serde_derive"
-version = "1.0.228"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "d540f220d3187173da220f885ab66608367b6574e925011a9353e4badda91d79"
-dependencies = [
- "proc-macro2",
- "quote",
- "syn",
-]
-
-[[package]]
-name = "serde_json"
-version = "1.0.149"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "83fc039473c5595ace860d8c4fafa220ff474b3fc6bfdb4293327f1a37e94d86"
-dependencies = [
- "itoa",
- "memchr",
- "serde",
- "serde_core",
- "zmij",
-]
-
-[[package]]
-name = "shlex"
-version = "1.3.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "0fda2ff0d084019ba4d7c6f371c95d8fd75ce3524c3cb8fb653a3023f6323e64"
-
-[[package]]
-name = "smallvec"
-version = "1.15.1"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "67b1b7a3b5fe4f1376887184045fcf45c69e92af734b7aaddc05fb777b6fbd03"
-
-[[package]]
-name = "syn"
-version = "2.0.114"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "d4d107df263a3013ef9b1879b0df87d706ff80f65a86ea879bd9c31f9b307c2a"
-dependencies = [
- "proc-macro2",
- "quote",
- "unicode-ident",
-]
-
-[[package]]
-name = "thiserror"
-version = "1.0.69"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "b6aaf5339b578ea85b50e080feb250a3e8ae8cfcdff9a461c9ec2904bc923f52"
-dependencies = [
- "thiserror-impl 1.0.69",
-]
-
-[[package]]
-name = "thiserror"
-version = "2.0.18"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "4288b5bcbc7920c07a1149a35cf9590a2aa808e0bc1eafaade0b80947865fbc4"
-dependencies = [
- "thiserror-impl 2.0.18",
-]
-
-[[package]]
-name = "thiserror-impl"
-version = "1.0.69"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "4fee6c4efc90059e10f81e6d42c60a18f76588c3d74cb83a0b242a2b6c7504c1"
-dependencies = [
- "proc-macro2",
- "quote",
- "syn",
-]
-
-[[package]]
-name = "thiserror-impl"
-version = "2.0.18"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "ebc4ee7f67670e9b64d05fa4253e753e016c6c95ff35b89b7941d6b856dec1d5"
-dependencies = [
- "proc-macro2",
- "quote",
- "syn",
-]
-
-[[package]]
-name = "tracing"
-version = "0.1.44"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "63e71662fa4b2a2c3a26f570f037eb95bb1f85397f3cd8076caed2f026a6d100"
-dependencies = [
- "pin-project-lite",
- "tracing-attributes",
- "tracing-core",
-]
-
-[[package]]
-name = "tracing-attributes"
-version = "0.1.31"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "7490cfa5ec963746568740651ac6781f701c9c5ea257c58e057f3ba8cf69e8da"
-dependencies = [
- "proc-macro2",
- "quote",
- "syn",
-]
-
-[[package]]
-name = "tracing-core"
-version = "0.1.36"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "db97caf9d906fbde555dd62fa95ddba9eecfd14cb388e4f491a66d74cd5fb79a"
-dependencies = [
- "once_cell",
- "valuable",
-]
-
-[[package]]
-name = "unicode-ident"
-version = "1.0.22"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "9312f7c4f6ff9069b165498234ce8be658059c6728633667c526e27dc2cf1df5"
-
-[[package]]
-name = "valuable"
-version = "0.1.1"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "ba73ea9cf16a25df0c8caa16c51acb937d5712a8429db78a3ee29d5dcacd3a65"
-
-[[package]]
-name = "walkdir"
-version = "2.5.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "29790946404f91d9c5d06f9874efddea1dc06c5efe94541a7d6863108e3a5e4b"
-dependencies = [
- "same-file",
- "winapi-util",
-]
-
-[[package]]
-name = "wasip2"
-version = "1.0.2+wasi-0.2.9"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "9517f9239f02c069db75e65f174b3da828fe5f5b945c4dd26bd25d89c03ebcf5"
-dependencies = [
- "wit-bindgen",
-]
-
-[[package]]
-name = "winapi-util"
-version = "0.1.11"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "c2a7b1c03c876122aa43f3020e6c3c3ee5c05081c9a00739faf7503aeba10d22"
-dependencies = [
- "windows-sys",
-]
-
-[[package]]
-name = "windows-link"
-version = "0.2.1"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "f0805222e57f7521d6a62e36fa9163bc891acd422f971defe97d64e70d0a4fe5"
-
-[[package]]
-name = "windows-sys"
-version = "0.61.2"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "ae137229bcbd6cdf0f7b80a31df61766145077ddf49416a728b02cb3921ff3fc"
-dependencies = [
- "windows-link",
-]
-
-[[package]]
-name = "wit-bindgen"
-version = "0.51.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "d7249219f66ced02969388cf2bb044a09756a083d0fab1e566056b04d9fbcaa5"
-
-[[package]]
-name = "zmij"
-version = "1.0.16"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "dfcd145825aace48cff44a8844de64bf75feec3080e0aa5cdbde72961ae51a65"
diff --git a/rust/llmchat/inference/Cargo.toml b/rust/llmchat/inference/Cargo.toml
deleted file mode 100644
index 2e0f4dee31..0000000000
--- a/rust/llmchat/inference/Cargo.toml
+++ /dev/null
@@ -1,22 +0,0 @@
-[package]
-name = "inference_rs"
-version = "0.1.0"
-edition = "2024"
-
-[lib]
-name = "inference_rs"
-crate-type = ["rlib"]
-
-[dependencies]
-llama-cpp-sys-2 = { version = "=0.1.138", features = ["mtmd"] }
-parking_lot = "0.12"
-self_cell = "1"
-serde = { version = "1", features = ["derive"] }
-serde_json = "1"
-thiserror = "1"
-
-[target.'cfg(target_os = "macos")'.dependencies]
-llama-cpp-2 = { version = "=0.1.138", default-features = false, features = ["mtmd"] }
-
-[target.'cfg(not(target_os = "macos"))'.dependencies]
-llama-cpp-2 = { version = "=0.1.138", features = ["mtmd"] }
diff --git a/rust/llmchat/inference/src/api.rs b/rust/llmchat/inference/src/api.rs
deleted file mode 100644
index 9245db3871..0000000000
--- a/rust/llmchat/inference/src/api.rs
+++ /dev/null
@@ -1,1201 +0,0 @@
-use llama_cpp_2::context::LlamaContext;
-use llama_cpp_2::context::params::LlamaContextParams;
-use llama_cpp_2::llama_backend::LlamaBackend;
-use llama_cpp_2::llama_batch::LlamaBatch;
-use llama_cpp_2::model::{AddBos, LlamaChatMessage, LlamaChatTemplate, LlamaModel, Special};
-use llama_cpp_2::mtmd::{
- MtmdBitmap, MtmdContext, MtmdContextParams, MtmdInputText, mtmd_default_marker,
-};
-use llama_cpp_2::openai::OpenAIChatTemplateParams;
-use llama_cpp_2::sampling::LlamaSampler;
-use llama_cpp_2::token::LlamaToken;
-use llama_cpp_sys_2::{
- GGML_LOG_LEVEL_ERROR, GGML_LOG_LEVEL_WARN, ggml_log_level, mtmd_helper_log_set,
-};
-use parking_lot::Mutex;
-use self_cell::self_cell;
-use serde::{Deserialize, Serialize};
-use std::collections::HashMap;
-use std::ffi::{CStr, CString};
-use std::num::NonZeroU32;
-use std::panic::{AssertUnwindSafe, catch_unwind};
-use std::path::Path;
-use std::sync::atomic::{AtomicBool, AtomicI64, Ordering};
-use std::sync::{Arc, OnceLock};
-use std::time::Instant;
-
-pub type JobId = i64;
-
-pub trait EventSink {
- fn add(&mut self, event: GenerateEvent);
-}
-
-impl<F> EventSink for F
-where
- F: FnMut(GenerateEvent),
-{
- fn add(&mut self, event: GenerateEvent) {
- (self)(event);
- }
-}
-
-static BACKEND: OnceLock<Result<LlamaBackend, String>> = OnceLock::new();
-static JOB_COUNTER: AtomicI64 = AtomicI64::new(1);
-static CANCEL_FLAGS: OnceLock<Mutex<HashMap<JobId, Arc<AtomicBool>>>> = OnceLock::new();
-static MTMD_LOG_BUFFER: OnceLock<Mutex<String>> = OnceLock::new();
-static MTMD_LOG_HOOK: OnceLock<()> = OnceLock::new();
-
-const CANCEL_MESSAGE: &str = "Generation cancelled";
-const DEFAULT_GENERATION_MAX_TOKENS: i32 = 8_192;
-
-fn backend() -> Result<&'static LlamaBackend, String> {
- match BACKEND.get_or_init(|| LlamaBackend::init().map_err(|err| err.to_string())) {
- Ok(backend) => Ok(backend),
- Err(err) => Err(format!("Failed to initialize backend: {err}")),
- }
-}
-
-fn cancel_flags() -> &'static Mutex<HashMap<JobId, Arc<AtomicBool>>> {
- CANCEL_FLAGS.get_or_init(|| Mutex::new(HashMap::new()))
-}
-
-fn mtmd_log_buffer() -> &'static Mutex<String> {
- MTMD_LOG_BUFFER.get_or_init(|| Mutex::new(String::new()))
-}
-
-unsafe extern "C" fn mtmd_log_callback(
- level: ggml_log_level,
- text: *const ::std::os::raw::c_char,
- _user_data: *mut ::std::os::raw::c_void,
-) {
- if text.is_null() {
- return;
- }
- if level != GGML_LOG_LEVEL_WARN && level != GGML_LOG_LEVEL_ERROR {
- return;
- }
- let cstr = unsafe { CStr::from_ptr(text) };
- if let Ok(message) = cstr.to_str() {
- let mut guard = mtmd_log_buffer().lock();
- guard.push_str(message);
- const MAX_LEN: usize = 8192;
- if guard.len() > MAX_LEN {
- let drain = guard.len() - MAX_LEN;
- guard.drain(..drain);
- }
- }
-}
-
-fn init_mtmd_logging() {
- MTMD_LOG_HOOK.get_or_init(|| unsafe {
- mtmd_helper_log_set(Some(mtmd_log_callback), std::ptr::null_mut());
- });
-}
-
-fn take_mtmd_logs() -> String {
- let mut guard = mtmd_log_buffer().lock();
- let logs = guard.clone();
- guard.clear();
- logs
-}
-
-fn register_job() -> (JobId, Arc<AtomicBool>) {
- let job_id = JOB_COUNTER.fetch_add(1, Ordering::Relaxed);
- let flag = Arc::new(AtomicBool::new(false));
- cancel_flags().lock().insert(job_id, flag.clone());
- (job_id, flag)
-}
-
-fn cancel_all() {
- for flag in cancel_flags().lock().values() {
- flag.store(true, Ordering::Relaxed);
- }
-}
-
-fn check_cancelled(cancel_flag: &AtomicBool) -> Result<(), String> {
- if cancel_flag.load(Ordering::Relaxed) {
- Err(CANCEL_MESSAGE.to_string())
- } else {
- Ok(())
- }
-}
-
-struct JobGuard(JobId);
-
-impl Drop for JobGuard {
- fn drop(&mut self) {
- cancel_flags().lock().remove(&self.0);
- }
-}
-
-fn format_error(context: &str, err: impl std::fmt::Display) -> String {
- format!("{context}: {err}")
-}
-
-fn build_chat_prompt(
- model: &LlamaModel,
- messages: Vec<ChatMessage>,
- template_override: Option<String>,
- add_assistant: bool,
-) -> Result<String, String> {
- let template_text = match template_override {
- Some(template) => template,
- None => model
- .chat_template(None)
- .ok()
- .and_then(|template| template.to_string().ok())
- .unwrap_or_else(|| "chatml".to_string()),
- };
- let template = LlamaChatTemplate::new(&template_text)
- .map_err(|err| format_error("Invalid chat template", err))?;
-
- if template_text.contains("enable_thinking") {
- let messages_json =
- serde_json::to_string(&messages).map_err(|err| format_error("Invalid chat messages", err))?;
- let params = OpenAIChatTemplateParams {
- messages_json: &messages_json,
- tools_json: None,
- tool_choice: None,
- json_schema: None,
- grammar: None,
- reasoning_format: None,
- chat_template_kwargs: Some(r#"{"enable_thinking":false}"#),
- add_generation_prompt: add_assistant,
- use_jinja: true,
- parallel_tool_calls: false,
- enable_thinking: false,
- add_bos: false,
- add_eos: false,
- parse_tool_calls: false,
- };
- let result = model
- .apply_chat_template_oaicompat(&template, &params)
- .map_err(|err| format_error("Failed to apply chat template", err))?;
- return Ok(result.prompt);
- }
-
- let chat_messages = messages
- .into_iter()
- .map(|message| {
- LlamaChatMessage::new(message.role, message.content)
- .map_err(|err| format_error("Invalid chat message", err))
- })
- .collect::<Result<Vec<_>, String>>()?;
-
- model
- .apply_chat_template(&template, &chat_messages, add_assistant)
- .map_err(|err| format_error("Failed to apply chat template", err))
-}
-
-fn should_add_bos(model: &LlamaModel, prompt: &str) -> AddBos {
- if let Ok(bos) = model.token_to_str(model.token_bos(), Special::Tokenize)
- && !bos.is_empty()
- && prompt.starts_with(&bos)
- {
- return AddBos::Never;
- }
- AddBos::Always
-}
-
-fn find_stop_index(text: &str, stop_sequences: &[String], start: usize) -> Option<usize> {
- let mut found: Option<usize> = None;
- let search = &text[start.min(text.len())..];
-
- for stop in stop_sequences {
- if stop.is_empty() {
- continue;
- }
- if let Some(idx) = search.find(stop) {
- let idx = start + idx;
- found = match found {
- Some(existing) if existing <= idx => Some(existing),
- _ => Some(idx),
- };
- }
- }
-
- found
-}
-
-fn drain_utf8(pending: &mut Vec<u8>) -> String {
- let mut output = String::new();
- loop {
- match std::str::from_utf8(pending) {
- Ok(text) => {
- output.push_str(text);
- pending.clear();
- break;
- }
- Err(err) => {
- let valid_up_to = err.valid_up_to();
- if valid_up_to > 0 {
- let valid = std::str::from_utf8(&pending[..valid_up_to])
- .expect("valid UTF-8 prefix");
- output.push_str(valid);
- pending.drain(..valid_up_to);
- }
-
- match err.error_len() {
- None => break,
- Some(len) => {
- let len = len.min(pending.len());
- let lossy = String::from_utf8_lossy(&pending[..len]);
- output.push_str(&lossy);
- pending.drain(..len);
- }
- }
- }
- }
- }
- output
-}
-
-struct DecodeStep {
- text: Option<String>,
- stop: bool,
-}
-
-/// Incremental UTF-8 streaming decoder with stop-sequence handling.
-struct StreamDecoder {
- generated_text: String,
- pending_bytes: Vec<u8>,
- stop_sequences: Vec<String>,
- max_stop_len: usize,
-}
-
-impl StreamDecoder {
- fn new(stop_sequences: &[String]) -> Self {
- let max_stop_len = stop_sequences.iter().map(|s| s.len()).max().unwrap_or(0);
- Self {
- generated_text: String::new(),
- pending_bytes: Vec::new(),
- stop_sequences: stop_sequences.to_vec(),
- max_stop_len,
- }
- }
-
- fn push_bytes(&mut self, bytes: &[u8]) -> DecodeStep {
- if !bytes.is_empty() {
- self.pending_bytes.extend_from_slice(bytes);
- }
- let piece = drain_utf8(&mut self.pending_bytes);
- self.push_text(piece)
- }
-
- fn flush(&mut self) -> DecodeStep {
- if self.pending_bytes.is_empty() {
- return DecodeStep { text: None, stop: false };
- }
- let piece = String::from_utf8_lossy(&self.pending_bytes).to_string();
- self.pending_bytes.clear();
- self.push_text(piece)
- }
-
- fn push_text(&mut self, piece: String) -> DecodeStep {
- if piece.is_empty() {
- return DecodeStep { text: None, stop: false };
- }
-
- let prev_len = self.generated_text.len();
- self.generated_text.push_str(&piece);
-
- if self.max_stop_len > 0 {
- let search_start = prev_len.saturating_sub(self.max_stop_len);
- if let Some(stop_index) =
- find_stop_index(&self.generated_text, &self.stop_sequences, search_start)
- {
- let new_piece = self.generated_text[prev_len..stop_index].to_string();
- self.generated_text.truncate(stop_index);
- return DecodeStep {
- text: if new_piece.is_empty() { None } else { Some(new_piece) },
- stop: true,
- };
- }
- }
-
- DecodeStep {
- text: Some(piece),
- stop: false,
- }
- }
-}
-
-#[allow(clippy::too_many_arguments)]
-fn run_generation_loop(
- ctx: &mut LlamaContext,
- sampler: &mut LlamaSampler,
- cancel_flag: &AtomicBool,
- sink: &mut dyn EventSink,
- job_id: JobId,
- max_tokens: usize,
- stop_sequences: &[String],
- generated_tokens_count: &mut i32,
- mut pos: i32,
- mut logits_index: i32,
-) -> Result<(), String> {
- let mut decoder = StreamDecoder::new(stop_sequences);
- let mut stop_triggered = false;
- let n_ctx = ctx.n_ctx();
-
- for _ in 0..max_tokens {
- if cancel_flag.load(Ordering::Relaxed) {
- return Err("Generation cancelled".to_string());
- }
- if pos >= n_ctx as i32 {
- break;
- }
-
- let token = sampler.sample(ctx, logits_index);
- sampler.accept(token);
- *generated_tokens_count = generated_tokens_count.saturating_add(1);
-
- if ctx.model.is_eog_token(token) {
- break;
- }
-
- let bytes = ctx
- .model
- .token_to_bytes(token, Special::Tokenize)
- .map_err(|err| format_error("Detokenize failed", err))?;
- let step = decoder.push_bytes(&bytes);
-
- if let Some(text) = step.text {
- sink.add(GenerateEvent::Text {
- job_id,
- text,
- token_id: Some(token.0),
- });
- }
-
- if step.stop {
- stop_triggered = true;
- break;
- }
-
- let mut step_batch = LlamaBatch::new(1, 1);
- step_batch
- .add(token, pos, &[0], true)
- .map_err(|err| format_error("Failed to add token", err))?;
- ctx.decode(&mut step_batch)
- .map_err(|err| format_error("Decode failed", err))?;
-
- logits_index = 0;
- pos += 1;
- }
-
- if !stop_triggered {
- let step = decoder.flush();
- if let Some(text) = step.text {
- sink.add(GenerateEvent::Text {
- job_id,
- text,
- token_id: None,
- });
- }
- }
-
- Ok(())
-}
-
-fn build_sampler(model: &LlamaModel, request: &GenerateRequest) -> Result<LlamaSampler, String> {
- let mut samplers = Vec::new();
-
- let mut repeat_penalty = request.repeat_penalty.unwrap_or(1.0);
- if repeat_penalty <= 0.0 {
- repeat_penalty = 1.0;
- }
- let mut frequency_penalty = request.frequency_penalty.unwrap_or(0.0);
- if frequency_penalty < 0.0 {
- frequency_penalty = 0.0;
- }
- let mut presence_penalty = request.presence_penalty.unwrap_or(0.0);
- if presence_penalty < 0.0 {
- presence_penalty = 0.0;
- }
-
- if (repeat_penalty - 1.0).abs() > f32::EPSILON
- || frequency_penalty != 0.0
- || presence_penalty != 0.0
- {
- samplers.push(LlamaSampler::penalties(
- -1,
- repeat_penalty,
- frequency_penalty,
- presence_penalty,
- ));
- }
-
- if let Some(grammar) = request.grammar.as_deref() {
- samplers.push(
- LlamaSampler::grammar(model, grammar, "root")
- .map_err(|err| format_error("Invalid grammar", err))?,
- );
- }
-
- if let Some(top_k) = request.top_k
- && top_k > 0
- {
- samplers.push(LlamaSampler::top_k(top_k));
- }
-
- if let Some(top_p) = request.top_p
- && top_p > 0.0
- && top_p < 1.0
- {
- samplers.push(LlamaSampler::top_p(top_p, 1));
- }
-
- let temperature = request.temperature.unwrap_or(1.0);
- if temperature > 0.0 {
- samplers.push(LlamaSampler::temp(temperature));
- let seed = request.seed.unwrap_or(0);
- let seed = u32::try_from(seed).unwrap_or(0);
- samplers.push(LlamaSampler::dist(seed));
- } else {
- samplers.push(LlamaSampler::greedy());
- }
-
- Ok(LlamaSampler::chain_simple(samplers))
-}
-
-#[derive(Debug, Clone, Serialize, Deserialize)]
-pub struct ModelLoadParams {
- pub model_path: String,
- pub n_gpu_layers: Option<i32>,
- pub use_mmap: Option<bool>,
- pub use_mlock: Option<bool>,
-}
-
-#[derive(Debug, Clone, Serialize, Deserialize)]
-pub struct ContextParams {
- pub context_size: Option<i32>,
- pub n_threads: Option<i32>,
- pub n_batch: Option<i32>,
-}
-
-#[derive(Debug, Clone, Serialize, Deserialize)]
-pub struct ModelInfo {
- pub bos_token_id: Option<i32>,
- pub eos_token_id: Option<i32>,
- pub bos_token: Option<String>,
- pub eos_token: Option<String>,
- pub chat_template: Option<String>,
- pub metadata_json: Option<String>,
-}
-
-#[derive(Debug, Clone, Serialize, Deserialize)]
-pub struct ChatMessage {
- pub role: String,
- pub content: String,
-}
-
-#[derive(Debug, Clone, Serialize, Deserialize)]
-pub struct GenerateRequest {
- pub prompt: String,
- pub max_tokens: Option<i32>,
- pub temperature: Option<f32>,
- pub top_p: Option<f32>,
- pub top_k: Option<i32>,
- pub repeat_penalty: Option<f32>,
- pub frequency_penalty: Option<f32>,
- pub presence_penalty: Option<f32>,
- pub seed: Option<i64>,
- pub stop_sequences: Option<Vec<String>>,
- pub grammar: Option<String>,
-}
-
-#[derive(Debug, Clone, Serialize, Deserialize)]
-pub struct GenerateChatRequest {
- pub messages: Vec<ChatMessage>,
- pub template_override: Option<String>,
- pub add_assistant: Option<bool>,
- pub image_paths: Option<Vec<String>>,
- pub mmproj_path: Option<String>,
- pub media_marker: Option<String>,
- pub max_tokens: Option<i32>,
- pub temperature: Option<f32>,
- pub top_p: Option<f32>,
- pub top_k: Option<i32>,
- pub repeat_penalty: Option<f32>,
- pub frequency_penalty: Option<f32>,
- pub presence_penalty: Option<f32>,
- pub seed: Option<i64>,
- pub stop_sequences: Option<Vec<String>>,
- pub grammar: Option<String>,
-}
-
-#[derive(Debug, Clone, Serialize, Deserialize)]
-pub struct GenerateSummary {
- pub job_id: JobId,
- pub prompt_tokens: Option<i32>,
- pub generated_tokens: Option<i32>,
- pub total_time_ms: Option<i64>,
-}
-
-#[derive(Debug, Clone, Serialize, Deserialize)]
-pub enum GenerateEvent {
- Text {
- job_id: JobId,
- text: String,
- token_id: Option<i32>,
- },
- Done {
- summary: GenerateSummary,
- },
- Error {
- job_id: JobId,
- message: String,
- },
-}
-
-pub struct ModelHandle {
- model: LlamaModel,
-}
-
-pub type ModelHandleRef = Arc<ModelHandle>;
-
-impl ModelHandle {
- fn model(&self) -> &LlamaModel {
- &self.model
- }
-}
-
-self_cell!(
- struct ContextHandleCell {
- owner: ModelHandleRef,
-
- #[covariant]
- dependent: LlamaContext,
- }
-);
-
-pub struct ContextHandle(Mutex<ContextHandleCell>);
-
-pub type ContextHandleRef = Arc<ContextHandle>;
-
-unsafe impl Send for ContextHandle {}
-unsafe impl Sync for ContextHandle {}
-
-impl ContextHandle {
- fn try_new(
- owner: ModelHandleRef,
- builder: impl for<'a> FnOnce(&'a ModelHandleRef) -> Result<LlamaContext<'a>, String>,
- ) -> Result<Self, String> {
- ContextHandleCell::try_new(owner, builder).map(|cell| ContextHandle(Mutex::new(cell)))
- }
-
- fn with_context_mut<R>(
- &self,
- func: impl for<'a, 'b> FnOnce(&'b mut LlamaContext<'a>) -> R,
- ) -> R {
- let mut guard = self.0.lock();
- guard.with_dependent_mut(|_owner, context| func(context))
- }
-}
-
-pub fn init_backend() -> Result<(), String> {
- backend().map(|_| ())
-}
-
-pub fn load_model(params: ModelLoadParams) -> Result<ModelHandleRef, String> {
- let backend = backend()?;
- let mut model_params = llama_cpp_2::model::params::LlamaModelParams::default();
-
- if let Some(n_gpu_layers) = params.n_gpu_layers {
- let layers =
- u32::try_from(n_gpu_layers).map_err(|_| "n_gpu_layers must be >= 0".to_string())?;
- model_params = model_params.with_n_gpu_layers(layers);
- }
-
- if let Some(use_mlock) = params.use_mlock {
- model_params = model_params.with_use_mlock(use_mlock);
- }
-
- let model = LlamaModel::load_from_file(backend, Path::new(&params.model_path), &model_params)
- .map_err(|err| format_error("Failed to load model", err))?;
-
- Ok(Arc::new(ModelHandle { model }))
-}
-
-pub fn create_context(
- model: ModelHandleRef,
- params: ContextParams,
-) -> Result<ContextHandleRef, String> {
- let mut context_params = LlamaContextParams::default();
-
- if let Some(context_size) = params.context_size {
- let context_size =
- u32::try_from(context_size).map_err(|_| "context_size must be > 0".to_string())?;
- let context_size =
- NonZeroU32::new(context_size).ok_or_else(|| "context_size must be > 0".to_string())?;
- context_params = context_params.with_n_ctx(Some(context_size));
- }
-
- if let Some(n_threads) = params.n_threads {
- if n_threads <= 0 {
- return Err("n_threads must be > 0".to_string());
- }
- context_params = context_params
- .with_n_threads(n_threads)
- .with_n_threads_batch(n_threads);
- }
-
- if let Some(n_batch) = params.n_batch {
- let n_batch = u32::try_from(n_batch).map_err(|_| "n_batch must be > 0".to_string())?;
- context_params = context_params.with_n_batch(n_batch);
- }
-
- let context = ContextHandle::try_new(model, |model| {
- let backend = backend()?;
- model
- .model()
- .new_context(backend, context_params)
- .map_err(|err| format_error("Failed to create context", err))
- })?;
-
- Ok(Arc::new(context))
-}
-
-pub fn tokenize(
- model: &ModelHandle,
- text: String,
- add_bos: bool,
- special: bool,
-) -> Result<Vec<i32>, String> {
- let add_bos = if add_bos {
- AddBos::Always
- } else {
- AddBos::Never
- };
- let _ = special;
-
- let tokens = model
- .model()
- .str_to_token(&text, add_bos)
- .map_err(|err| format_error("Tokenize failed", err))?;
-
- Ok(tokens.into_iter().map(|token| token.0).collect())
-}
-
-pub fn detokenize(model: &ModelHandle, tokens: Vec<i32>) -> Result<String, String> {
- let tokens = tokens.into_iter().map(LlamaToken::new).collect::<Vec<_>>();
- model
- .model()
- .tokens_to_str(&tokens, Special::Tokenize)
- .map_err(|err| format_error("Detokenize failed", err))
-}
-
-pub fn get_model_info(model: &ModelHandle) -> Result<ModelInfo, String> {
- let model_ref = model.model();
- let bos_token = model_ref.token_bos();
- let eos_token = model_ref.token_eos();
-
- let bos_token_str = model_ref
- .token_to_str(bos_token, Special::Tokenize)
- .ok()
- .filter(|value| !value.is_empty());
- let eos_token_str = model_ref
- .token_to_str(eos_token, Special::Tokenize)
- .ok()
- .filter(|value| !value.is_empty());
-
- let chat_template = model_ref
- .chat_template(None)
- .ok()
- .and_then(|tmpl| tmpl.to_string().ok());
-
- let meta_count = model_ref.meta_count();
- let mut metadata_json = None;
-
- if meta_count > 0 {
- let mut map = serde_json::Map::new();
- for index in 0..meta_count {
- let key = model_ref
- .meta_key_by_index(index)
- .map_err(|err| format_error("Failed to read metadata key", err))?;
- let value = model_ref
- .meta_val_str_by_index(index)
- .map_err(|err| format_error("Failed to read metadata value", err))?;
- map.insert(key, serde_json::Value::String(value));
- }
- if !map.is_empty() {
- metadata_json = Some(serde_json::Value::Object(map).to_string());
- }
- }
-
- Ok(ModelInfo {
- bos_token_id: Some(bos_token.0),
- eos_token_id: Some(eos_token.0),
- bos_token: bos_token_str,
- eos_token: eos_token_str,
- chat_template,
- metadata_json,
- })
-}
-
-pub fn apply_chat_template(
- model: &ModelHandle,
- messages: Vec<ChatMessage>,
- template_override: Option<String>,
- add_assistant: bool,
-) -> Result<String, String> {
- build_chat_prompt(model.model(), messages, template_override, add_assistant)
-}
-
-pub fn generate_chat_stream(
- context: &ContextHandle,
- request: GenerateChatRequest,
- sink: &mut dyn EventSink,
-) -> Result<GenerateSummary, String> {
- let GenerateChatRequest {
- messages,
- template_override,
- add_assistant,
- image_paths,
- mmproj_path,
- media_marker,
- max_tokens,
- temperature,
- top_p,
- top_k,
- repeat_penalty,
- frequency_penalty,
- presence_penalty,
- seed,
- stop_sequences,
- grammar,
- } = request;
-
- let (job_id, cancel_flag) = register_job();
- let _job_guard = JobGuard(job_id);
- let start = Instant::now();
-
- sink.add(GenerateEvent::Text {
- job_id,
- text: String::new(),
- token_id: None,
- });
-
- let max_tokens = max_tokens.unwrap_or(DEFAULT_GENERATION_MAX_TOKENS);
- let max_tokens = usize::try_from(max_tokens.max(0)).unwrap_or(0);
- let stop_sequences = stop_sequences.unwrap_or_default();
-
- let mut prompt_tokens_count: i32 = 0;
- let mut generated_tokens_count: i32 = 0;
- let mut error_message: Option<String> = None;
-
- let result = match catch_unwind(AssertUnwindSafe(|| {
- context.with_context_mut(|ctx| -> Result<(), String> {
- let add_assistant = add_assistant.unwrap_or(true);
- let mut messages = messages;
- let image_paths = image_paths.unwrap_or_default();
- let marker = media_marker
- .clone()
- .unwrap_or_else(|| mtmd_default_marker().to_string());
-
- if !image_paths.is_empty() {
- let mut marker_count = messages
- .iter()
- .map(|message| message.content.matches(&marker).count())
- .sum::<usize>();
- if marker_count == 0 {
- let target_index = messages
- .iter()
- .rposition(|message| message.role == "user")
- .or_else(|| messages.len().checked_sub(1))
- .ok_or_else(|| "No chat messages provided".to_string())?;
- if !messages[target_index].content.ends_with('\n') {
- messages[target_index].content.push('\n');
- }
- messages[target_index].content.push_str(&marker);
- marker_count = messages
- .iter()
- .map(|message| message.content.matches(&marker).count())
- .sum();
- }
- if marker_count != image_paths.len() {
- return Err(format!(
- "Found {marker_count} media markers but {} images were provided",
- image_paths.len()
- ));
- }
- }
-
- let prompt = build_chat_prompt(ctx.model, messages, template_override, add_assistant)?;
-
- let sampler_request = GenerateRequest {
- prompt: prompt.clone(),
- max_tokens: None,
- temperature,
- top_p,
- top_k,
- repeat_penalty,
- frequency_penalty,
- presence_penalty,
- seed,
- stop_sequences: Some(stop_sequences.clone()),
- grammar: grammar.clone(),
- };
-
- if image_paths.is_empty() {
- let add_bos = should_add_bos(ctx.model, &prompt);
- let prompt_tokens = ctx
- .model
- .str_to_token(&prompt, add_bos)
- .map_err(|err| format_error("Tokenize failed", err))?;
-
- if prompt_tokens.is_empty() {
- return Err("Prompt produced no tokens".to_string());
- }
-
- prompt_tokens_count = i32::try_from(prompt_tokens.len())
- .map_err(|_| "Prompt is too long".to_string())?;
-
- let n_ctx = ctx.n_ctx();
- if prompt_tokens.len() as u32 > n_ctx {
- return Err(format!(
- "Prompt length {} exceeds context size {}",
- prompt_tokens.len(),
- n_ctx
- ));
- }
-
- let n_batch = ctx.n_batch() as usize;
- if n_batch == 0 {
- return Err("Context batch size is 0".to_string());
- }
-
- ctx.clear_kv_cache();
-
- let mut token_offset = 0usize;
- let mut logits_index: i32 = 0;
- while token_offset < prompt_tokens.len() {
- check_cancelled(&cancel_flag)?;
- let end = (token_offset + n_batch).min(prompt_tokens.len());
- let chunk = &prompt_tokens[token_offset..end];
- let mut batch = LlamaBatch::new(chunk.len(), 1);
- for (idx, token) in chunk.iter().enumerate() {
- let pos = (token_offset + idx) as i32;
- let logits = token_offset + idx + 1 == prompt_tokens.len();
- batch
- .add(*token, pos, &[0], logits)
- .map_err(|err| format_error("Failed to add prompt token", err))?;
- }
- ctx.decode(&mut batch)
- .map_err(|err| format_error("Prompt decode failed", err))?;
- if end == prompt_tokens.len() {
- logits_index = (chunk.len() - 1) as i32;
- }
- token_offset = end;
- }
-
- let mut sampler = build_sampler(ctx.model, &sampler_request)?;
- sampler.accept_many(prompt_tokens.iter());
-
- let pos = prompt_tokens.len() as i32;
- run_generation_loop(
- ctx,
- &mut sampler,
- &cancel_flag,
- sink,
- job_id,
- max_tokens,
- &stop_sequences,
- &mut generated_tokens_count,
- pos,
- logits_index,
- )?;
-
- return Ok(());
- }
-
- let mmproj_path = mmproj_path.ok_or_else(|| {
- "mmproj_path is required when image_paths are provided".to_string()
- })?;
- if !Path::new(&mmproj_path).exists() {
- return Err(format!("mmproj file not found at {mmproj_path}"));
- }
-
- init_mtmd_logging();
- take_mtmd_logs();
-
- let media_marker = CString::new(marker.clone())
- .map_err(|err| format_error("Invalid media marker", err))?;
- let mtmd_params = MtmdContextParams {
- use_gpu: false,
- print_timings: false,
- media_marker,
- ..Default::default()
- };
-
- let mtmd_ctx = MtmdContext::init_from_file(&mmproj_path, ctx.model, &mtmd_params)
- .map_err(|err| {
- let logs = take_mtmd_logs();
- if logs.trim().is_empty() {
- format_error("Failed to initialize mmproj", err)
- } else {
- format!("Failed to initialize mmproj: {err}. Logs: {logs}")
- }
- })?;
-
- if !mtmd_ctx.support_vision() {
- return Err("Model does not support vision input".to_string());
- }
-
- let mut bitmaps = Vec::with_capacity(image_paths.len());
- for image_path in &image_paths {
- check_cancelled(&cancel_flag)?;
- if !Path::new(image_path).exists() {
- return Err(format!("Image file not found at {image_path}"));
- }
- let bitmap = MtmdBitmap::from_file(&mtmd_ctx, image_path)
- .map_err(|err| format_error("Failed to load image", err))?;
- if bitmap.is_audio() {
- return Err("Audio inputs are not supported".to_string());
- }
- bitmaps.push(bitmap);
- }
- let bitmap_refs = bitmaps.iter().collect::<Vec<_>>();
-
- let add_special = matches!(should_add_bos(ctx.model, &prompt), AddBos::Always);
- let input_text = MtmdInputText {
- text: prompt,
- add_special,
- parse_special: true,
- };
-
- let chunks = mtmd_ctx
- .tokenize(input_text, &bitmap_refs)
- .map_err(|err| format_error("Failed to tokenize multimodal input", err))?;
-
- if chunks.is_empty() {
- return Err("Prompt produced no tokens".to_string());
- }
-
- prompt_tokens_count = i32::try_from(chunks.total_tokens())
- .map_err(|_| "Prompt is too long".to_string())?;
-
- let n_ctx = ctx.n_ctx();
- let total_positions = chunks.total_positions();
- if total_positions as u32 > n_ctx {
- return Err(format!(
- "Prompt length {} exceeds context size {}",
- total_positions, n_ctx
- ));
- }
-
- let n_batch = ctx.n_batch() as i32;
- if n_batch <= 0 {
- return Err("Context batch size is 0".to_string());
- }
-
- ctx.clear_kv_cache();
- check_cancelled(&cancel_flag)?;
-
- let n_past = chunks
- .eval_chunks(&mtmd_ctx, ctx, 0, 0, n_batch, true)
- .map_err(|err| format_error("Failed to evaluate multimodal prompt", err))?;
- check_cancelled(&cancel_flag)?;
-
- let mut sampler = build_sampler(ctx.model, &sampler_request)?;
- let mut prompt_tokens = Vec::new();
- for index in 0..chunks.len() {
- if let Some(chunk) = chunks.get(index)
- && let Some(tokens) = chunk.text_tokens()
- {
- prompt_tokens.extend_from_slice(tokens);
- }
- }
- sampler.accept_many(prompt_tokens.iter());
-
- run_generation_loop(
- ctx,
- &mut sampler,
- &cancel_flag,
- sink,
- job_id,
- max_tokens,
- &stop_sequences,
- &mut generated_tokens_count,
- n_past,
- -1,
- )?;
-
- Ok(())
- })
- })) {
- Ok(inner) => inner,
- Err(_) => Err("Generation panicked".to_string()),
- };
-
- if let Err(err) = result {
- error_message = Some(err);
- }
-
- let summary = GenerateSummary {
- job_id,
- prompt_tokens: Some(prompt_tokens_count),
- generated_tokens: Some(generated_tokens_count),
- total_time_ms: Some(start.elapsed().as_millis() as i64),
- };
-
- if let Some(message) = error_message {
- sink.add(GenerateEvent::Error { job_id, message });
- }
-
- sink.add(GenerateEvent::Done {
- summary: summary.clone(),
- });
-
- Ok(summary)
-}
-
-pub fn generate_stream(
- context: &ContextHandle,
- request: GenerateRequest,
- sink: &mut dyn EventSink,
-) -> Result<GenerateSummary, String> {
- let (job_id, cancel_flag) = register_job();
- let _job_guard = JobGuard(job_id);
- let start = Instant::now();
-
- sink.add(GenerateEvent::Text {
- job_id,
- text: String::new(),
- token_id: None,
- });
-
- let max_tokens = request.max_tokens.unwrap_or(DEFAULT_GENERATION_MAX_TOKENS);
- let max_tokens = usize::try_from(max_tokens.max(0)).unwrap_or(0);
- let stop_sequences = request.stop_sequences.clone().unwrap_or_default();
-
- let mut prompt_tokens_count: i32 = 0;
- let mut generated_tokens_count: i32 = 0;
- let mut error_message: Option<String> = None;
-
- let result = match catch_unwind(AssertUnwindSafe(|| {
- context.with_context_mut(|ctx| -> Result<(), String> {
- let add_bos = should_add_bos(ctx.model, &request.prompt);
- let prompt_tokens = ctx
- .model
- .str_to_token(&request.prompt, add_bos)
- .map_err(|err| format_error("Tokenize failed", err))?;
-
- if prompt_tokens.is_empty() {
- return Err("Prompt produced no tokens".to_string());
- }
-
- prompt_tokens_count =
- i32::try_from(prompt_tokens.len()).map_err(|_| "Prompt is too long".to_string())?;
-
- let n_ctx = ctx.n_ctx();
- if prompt_tokens.len() as u32 > n_ctx {
- return Err(format!(
- "Prompt length {} exceeds context size {}",
- prompt_tokens.len(),
- n_ctx
- ));
- }
-
- let n_batch = ctx.n_batch() as usize;
- if n_batch == 0 {
- return Err("Context batch size is 0".to_string());
- }
-
- ctx.clear_kv_cache();
-
- let mut token_offset = 0usize;
- let mut logits_index: i32 = 0;
- while token_offset < prompt_tokens.len() {
- check_cancelled(&cancel_flag)?;
- let end = (token_offset + n_batch).min(prompt_tokens.len());
- let chunk = &prompt_tokens[token_offset..end];
- let mut batch = LlamaBatch::new(chunk.len(), 1);
- for (idx, token) in chunk.iter().enumerate() {
- let pos = (token_offset + idx) as i32;
- let logits = token_offset + idx + 1 == prompt_tokens.len();
- batch
- .add(*token, pos, &[0], logits)
- .map_err(|err| format_error("Failed to add prompt token", err))?;
- }
- ctx.decode(&mut batch)
- .map_err(|err| format_error("Prompt decode failed", err))?;
- if end == prompt_tokens.len() {
- logits_index = (chunk.len() - 1) as i32;
- }
- token_offset = end;
- }
-
- let mut sampler = build_sampler(ctx.model, &request)?;
- sampler.accept_many(prompt_tokens.iter());
-
- let pos = prompt_tokens.len() as i32;
- run_generation_loop(
- ctx,
- &mut sampler,
- &cancel_flag,
- sink,
- job_id,
- max_tokens,
- &stop_sequences,
- &mut generated_tokens_count,
- pos,
- logits_index,
- )?;
-
- Ok(())
- })
- })) {
- Ok(inner) => inner,
- Err(_) => Err("Generation panicked".to_string()),
- };
-
- if let Err(err) = result {
- error_message = Some(err);
- }
-
- let summary = GenerateSummary {
- job_id,
- prompt_tokens: Some(prompt_tokens_count),
- generated_tokens: Some(generated_tokens_count),
- total_time_ms: Some(start.elapsed().as_millis() as i64),
- };
-
- if let Some(message) = error_message {
- sink.add(GenerateEvent::Error { job_id, message });
- }
-
- sink.add(GenerateEvent::Done {
- summary: summary.clone(),
- });
-
- Ok(summary)
-}
-
-pub fn cancel(job_id: JobId) -> Result<(), String> {
- if job_id <= 0 {
- cancel_all();
- return Ok(());
- }
- if let Some(flag) = cancel_flags().lock().get(&job_id) {
- flag.store(true, Ordering::Relaxed);
- }
- Ok(())
-}
-
-#[cfg(test)]
-mod tests {
- use super::StreamDecoder;
-
- #[test]
- fn stream_decoder_emits_complete_utf8() {
- let mut decoder = StreamDecoder::new(&[]);
- let step = decoder.push_bytes(&[0xF0, 0x9F]);
- assert!(step.text.is_none());
- assert!(!step.stop);
-
- let step = decoder.push_bytes(&[0x99, 0x82]);
- assert_eq!(step.text.as_deref(), Some("πŸ™‚"));
- assert!(!step.stop);
- }
-}
diff --git a/rust/llmchat/inference/src/capi.rs b/rust/llmchat/inference/src/capi.rs
deleted file mode 100644
index 9c1fbfd981..0000000000
--- a/rust/llmchat/inference/src/capi.rs
+++ /dev/null
@@ -1,377 +0,0 @@
-use crate::api::{
- self, ChatMessage, ContextHandleRef, GenerateChatRequest, GenerateEvent, GenerateRequest,
- GenerateSummary, ModelHandleRef,
-};
-use serde::Serialize;
-use std::ffi::{CStr, CString};
-use std::os::raw::{c_char, c_void};
-use std::panic::{catch_unwind, AssertUnwindSafe};
-use std::ptr;
-
-#[repr(C)]
-pub struct inference_model {
- handle: ModelHandleRef,
-}
-
-#[repr(C)]
-pub struct inference_context {
- handle: ContextHandleRef,
-}
-
-type EventCallback = Option<extern "C" fn(*const u8, usize, *mut c_void)>;
-
-#[derive(Serialize)]
-#[serde(tag = "type", rename_all = "snake_case")]
-enum CapiEvent {
- Text {
- job_id: api::JobId,
- text: String,
- token_id: Option<i32>,
- },
- Done { summary: GenerateSummary },
- Error {
- job_id: api::JobId,
- message: String,
- },
-}
-
-impl From<GenerateEvent> for CapiEvent {
- fn from(value: GenerateEvent) -> Self {
- match value {
- GenerateEvent::Text {
- job_id,
- text,
- token_id,
- } => Self::Text {
- job_id,
- text,
- token_id,
- },
- GenerateEvent::Done { summary } => Self::Done { summary },
- GenerateEvent::Error { job_id, message } => Self::Error { job_id, message },
- }
- }
-}
-
-struct CapiEventSink {
- callback: EventCallback,
- user_data: *mut c_void,
-}
-
-impl api::EventSink for CapiEventSink {
- fn add(&mut self, event: GenerateEvent) {
- let Some(callback) = self.callback else {
- return;
- };
-
- let payload = CapiEvent::from(event);
- let json = serde_json::to_vec(&payload)
- .unwrap_or_else(|_| br#"{"type":"error","message":"serialization_failed"}"#.to_vec());
- callback(json.as_ptr(), json.len(), self.user_data);
- }
-}
-
-fn clear_error(error_out: *mut *mut c_char) {
- if error_out.is_null() {
- return;
- }
- unsafe {
- *error_out = ptr::null_mut();
- }
-}
-
-fn set_error(error_out: *mut *mut c_char, message: impl AsRef<str>) {
- if error_out.is_null() {
- return;
- }
- let message = message.as_ref();
- let cstring = CString::new(message).unwrap_or_else(|_| CString::new("invalid error").unwrap());
- unsafe {
- *error_out = cstring.into_raw();
- }
-}
-
-fn with_error<T>(error_out: *mut *mut c_char, result: Result<T, String>) -> Option<T> {
- match result {
- Ok(value) => {
- clear_error(error_out);
- Some(value)
- }
- Err(err) => {
- set_error(error_out, err);
- None
- }
- }
-}
-
-fn cstr_to_string(ptr: *const c_char, field: &str) -> Result<String, String> {
- if ptr.is_null() {
- return Err(format!("{field} is required"));
- }
- let cstr = unsafe { CStr::from_ptr(ptr) };
- cstr.to_str()
- .map(|value| value.to_string())
- .map_err(|err| format!("Invalid {field}: {err}"))
-}
-
-fn optional_cstr(ptr: *const c_char) -> Result<Option<String>, String> {
- if ptr.is_null() {
- return Ok(None);
- }
- let cstr = unsafe { CStr::from_ptr(ptr) };
- let value = cstr
- .to_str()
- .map_err(|err| format!("Invalid string: {err}"))?;
- if value.is_empty() {
- Ok(None)
- } else {
- Ok(Some(value.to_string()))
- }
-}
-
-fn parse_json<T>(json_ptr: *const c_char, field: &str) -> Result<T, String>
-where
- T: serde::de::DeserializeOwned,
-{
- let json = cstr_to_string(json_ptr, field)?;
- serde_json::from_str(&json).map_err(|err| format!("Invalid {field} JSON: {err}"))
-}
-
-fn to_json_string<T: Serialize>(value: &T) -> Result<*mut c_char, String> {
- let json = serde_json::to_string(value).map_err(|err| err.to_string())?;
- CString::new(json)
- .map_err(|err| err.to_string())
- .map(|value| value.into_raw())
-}
-
-#[unsafe(no_mangle)]
-pub extern "C" fn inference_string_free(value: *mut c_char) {
- if value.is_null() {
- return;
- }
- unsafe {
- drop(CString::from_raw(value));
- }
-}
-
-#[unsafe(no_mangle)]
-pub extern "C" fn inference_init_backend(error_out: *mut *mut c_char) -> bool {
- let result = catch_unwind(AssertUnwindSafe(|| api::init_backend()));
- let result = match result {
- Ok(inner) => inner,
- Err(_) => Err("init_backend panicked".to_string()),
- };
- with_error(error_out, result).is_some()
-}
-
-#[unsafe(no_mangle)]
-pub extern "C" fn inference_load_model(
- params_json: *const c_char,
- error_out: *mut *mut c_char,
-) -> *mut inference_model {
- let result = catch_unwind(AssertUnwindSafe(|| {
- let params = parse_json::<api::ModelLoadParams>(params_json, "params_json")?;
- api::load_model(params)
- }));
-
- let result = match result {
- Ok(inner) => inner,
- Err(_) => Err("load_model panicked".to_string()),
- };
-
- let Some(handle) = with_error(error_out, result) else {
- return ptr::null_mut();
- };
-
- Box::into_raw(Box::new(inference_model { handle }))
-}
-
-#[unsafe(no_mangle)]
-pub extern "C" fn inference_model_free(model: *mut inference_model) {
- if model.is_null() {
- return;
- }
- unsafe {
- drop(Box::from_raw(model));
- }
-}
-
-#[unsafe(no_mangle)]
-pub extern "C" fn inference_create_context(
- model: *const inference_model,
- params_json: *const c_char,
- error_out: *mut *mut c_char,
-) -> *mut inference_context {
- let result = catch_unwind(AssertUnwindSafe(|| {
- let model = unsafe { model.as_ref() }.ok_or_else(|| "model is required".to_string())?;
- let params = parse_json::<api::ContextParams>(params_json, "params_json")?;
- api::create_context(model.handle.clone(), params)
- }));
-
- let result = match result {
- Ok(inner) => inner,
- Err(_) => Err("create_context panicked".to_string()),
- };
-
- let Some(handle) = with_error(error_out, result) else {
- return ptr::null_mut();
- };
-
- Box::into_raw(Box::new(inference_context { handle }))
-}
-
-#[unsafe(no_mangle)]
-pub extern "C" fn inference_context_free(context: *mut inference_context) {
- if context.is_null() {
- return;
- }
- unsafe {
- drop(Box::from_raw(context));
- }
-}
-
-#[unsafe(no_mangle)]
-pub extern "C" fn inference_tokenize_json(
- model: *const inference_model,
- text: *const c_char,
- add_bos: bool,
- special: bool,
- error_out: *mut *mut c_char,
-) -> *mut c_char {
- let result = catch_unwind(AssertUnwindSafe(|| {
- let model = unsafe { model.as_ref() }.ok_or_else(|| "model is required".to_string())?;
- let text = cstr_to_string(text, "text")?;
- let tokens = api::tokenize(model.handle.as_ref(), text, add_bos, special)?;
- to_json_string(&tokens)
- }));
-
- let result = match result {
- Ok(inner) => inner,
- Err(_) => Err("tokenize panicked".to_string()),
- };
-
- with_error(error_out, result).unwrap_or(ptr::null_mut())
-}
-
-#[unsafe(no_mangle)]
-pub extern "C" fn inference_detokenize_json(
- model: *const inference_model,
- tokens_json: *const c_char,
- error_out: *mut *mut c_char,
-) -> *mut c_char {
- let result = catch_unwind(AssertUnwindSafe(|| {
- let model = unsafe { model.as_ref() }.ok_or_else(|| "model is required".to_string())?;
- let tokens = parse_json::<Vec<i32>>(tokens_json, "tokens_json")?;
- let text = api::detokenize(model.handle.as_ref(), tokens)?;
- to_json_string(&text)
- }));
-
- let result = match result {
- Ok(inner) => inner,
- Err(_) => Err("detokenize panicked".to_string()),
- };
-
- with_error(error_out, result).unwrap_or(ptr::null_mut())
-}
-
-#[unsafe(no_mangle)]
-pub extern "C" fn inference_get_model_info_json(
- model: *const inference_model,
- error_out: *mut *mut c_char,
-) -> *mut c_char {
- let result = catch_unwind(AssertUnwindSafe(|| {
- let model = unsafe { model.as_ref() }.ok_or_else(|| "model is required".to_string())?;
- let info = api::get_model_info(model.handle.as_ref())?;
- to_json_string(&info)
- }));
-
- let result = match result {
- Ok(inner) => inner,
- Err(_) => Err("get_model_info panicked".to_string()),
- };
-
- with_error(error_out, result).unwrap_or(ptr::null_mut())
-}
-
-#[unsafe(no_mangle)]
-pub extern "C" fn inference_apply_chat_template_json(
- model: *const inference_model,
- messages_json: *const c_char,
- template_override: *const c_char,
- add_assistant: bool,
- error_out: *mut *mut c_char,
-) -> *mut c_char {
- let result = catch_unwind(AssertUnwindSafe(|| {
- let model = unsafe { model.as_ref() }.ok_or_else(|| "model is required".to_string())?;
- let messages = parse_json::<Vec<ChatMessage>>(messages_json, "messages_json")?;
- let template_override = optional_cstr(template_override)?;
- let rendered = api::apply_chat_template(
- model.handle.as_ref(),
- messages,
- template_override,
- add_assistant,
- )?;
- to_json_string(&rendered)
- }));
-
- let result = match result {
- Ok(inner) => inner,
- Err(_) => Err("apply_chat_template panicked".to_string()),
- };
-
- with_error(error_out, result).unwrap_or(ptr::null_mut())
-}
-
-#[unsafe(no_mangle)]
-pub extern "C" fn inference_generate_chat_stream(
- context: *const inference_context,
- request_json: *const c_char,
- callback: EventCallback,
- user_data: *mut c_void,
- error_out: *mut *mut c_char,
-) -> bool {
- let result = catch_unwind(AssertUnwindSafe(|| {
- let context =
- unsafe { context.as_ref() }.ok_or_else(|| "context is required".to_string())?;
- let request = parse_json::<GenerateChatRequest>(request_json, "request_json")?;
- let mut sink = CapiEventSink { callback, user_data };
- api::generate_chat_stream(context.handle.as_ref(), request, &mut sink)
- .map(|_| ())
- }));
-
- let result = match result {
- Ok(inner) => inner,
- Err(_) => Err("generate_chat_stream panicked".to_string()),
- };
-
- with_error(error_out, result).is_some()
-}
-
-#[unsafe(no_mangle)]
-pub extern "C" fn inference_generate_stream(
- context: *const inference_context,
- request_json: *const c_char,
- callback: EventCallback,
- user_data: *mut c_void,
- error_out: *mut *mut c_char,
-) -> bool {
- let result = catch_unwind(AssertUnwindSafe(|| {
- let context =
- unsafe { context.as_ref() }.ok_or_else(|| "context is required".to_string())?;
- let request = parse_json::<GenerateRequest>(request_json, "request_json")?;
- let mut sink = CapiEventSink { callback, user_data };
- api::generate_stream(context.handle.as_ref(), request, &mut sink).map(|_| ())
- }));
-
- let result = match result {
- Ok(inner) => inner,
- Err(_) => Err("generate_stream panicked".to_string()),
- };
-
- with_error(error_out, result).is_some()
-}
-
-#[unsafe(no_mangle)]
-pub extern "C" fn inference_cancel(job_id: i64) {
- let _ = api::cancel(job_id);
-}
diff --git a/rust/llmchat/inference/src/lib.rs b/rust/llmchat/inference/src/lib.rs
deleted file mode 100644
index 571155809c..0000000000
--- a/rust/llmchat/inference/src/lib.rs
+++ /dev/null
@@ -1,4 +0,0 @@
-mod api;
-mod capi;
-
-pub use api::*;
diff --git a/rust/llmchat/inference/tool/patch_llama_mtmd.sh b/rust/llmchat/inference/tool/patch_llama_mtmd.sh
deleted file mode 100755
index baf82ef31b..0000000000
--- a/rust/llmchat/inference/tool/patch_llama_mtmd.sh
+++ /dev/null
@@ -1,190 +0,0 @@
-#!/usr/bin/env bash
-set -euo pipefail
-
-PYTHON_BIN="${PYTHON_BIN:-python3}"
-if ! command -v "$PYTHON_BIN" >/dev/null 2>&1; then
- PYTHON_BIN=python
-fi
-
-ROOT="$(cd "$(dirname "$0")/.." && pwd)"
-CRATE_DIR="$(
- "$PYTHON_BIN" - <<PY
-import json
-import os
-import subprocess
-import sys
-from pathlib import Path
-
-root = os.path.abspath("${ROOT}")
-try:
- meta = subprocess.check_output(["cargo", "metadata", "--format-version", "1"], cwd=root)
-except Exception:
- sys.exit(1)
-
-data = json.loads(meta)
-for pkg in data.get("packages", []):
- if pkg.get("name") == "llama-cpp-sys-2":
- print(Path(pkg["manifest_path"]).parent)
- sys.exit(0)
-
-sys.exit(1)
-PY
-)" || true
-
-if [[ -z "$CRATE_DIR" ]]; then
- VERSION=$(grep -E "llama-cpp-2" "$ROOT/Cargo.toml" | head -n 1 | grep -Eo 'version *= *"[^"]+"|"[0-9]+\.[0-9]+\.[0-9]+"' | head -n 1 | sed -E 's/.*"([^"]+)".*/\1/' | sed -E 's/^=//')
- CRATE_DIR=$(ls -d "$HOME/.cargo/registry/src/"*/llama-cpp-sys-2-$VERSION 2>/dev/null | head -n 1 || true)
-fi
-
-if [[ -z "$CRATE_DIR" ]]; then
- echo "llama-cpp-sys-2 not found in cargo metadata or registry. Run 'cargo fetch' in $ROOT and try again." >&2
- exit 1
-fi
-
-PY_CRATE_DIR="$CRATE_DIR"
-if command -v cygpath >/dev/null 2>&1; then
- PY_CRATE_DIR="$(cygpath -w "$CRATE_DIR")"
-fi
-
-TOOLS_DIR="$CRATE_DIR/llama.cpp/tools"
-MTMD_DIR="$TOOLS_DIR/mtmd"
-CMAKE_FILE="$TOOLS_DIR/CMakeLists.txt"
-VENDOR_DIR="$CRATE_DIR/llama.cpp/vendor"
-
-if [[ ! -d "$MTMD_DIR" ]]; then
- echo "mtmd tools directory not found at $MTMD_DIR" >&2
- exit 0
-fi
-
-if [[ ! -f "$CMAKE_FILE" ]]; then
- cat > "$CMAKE_FILE" <<'EOF'
-# Auto-generated by inference_rs_dart to enable mtmd sources in llama.cpp builds.
-if (LLAMA_BUILD_TOOLS)
- if (EXISTS "${CMAKE_CURRENT_LIST_DIR}/mtmd")
- set(LLAMA_MTMD_SOURCES
- ${CMAKE_CURRENT_LIST_DIR}/mtmd/clip.cpp
- ${CMAKE_CURRENT_LIST_DIR}/mtmd/mtmd.cpp
- ${CMAKE_CURRENT_LIST_DIR}/mtmd/mtmd-audio.cpp
- ${CMAKE_CURRENT_LIST_DIR}/mtmd/mtmd-helper.cpp
- )
- target_sources(llama PRIVATE ${LLAMA_MTMD_SOURCES})
- target_include_directories(llama PRIVATE
- ${CMAKE_CURRENT_LIST_DIR}/mtmd
- ${CMAKE_CURRENT_LIST_DIR}/../vendor
- )
- endif()
-endif()
-EOF
- echo "Patched $CMAKE_FILE for mtmd."
-fi
-
-CLIP_CPP="$MTMD_DIR/clip.cpp"
-if [[ -f "$CLIP_CPP" ]]; then
- PY_CRATE_DIR="$PY_CRATE_DIR" "$PYTHON_BIN" - <<PY
-import os
-from pathlib import Path
-import sys
-
-crate_dir = os.environ["PY_CRATE_DIR"]
-root = Path(crate_dir) / "llama.cpp" / "tools" / "mtmd"
-
-patches = [
- {
- "label": "legacy clip.cpp LFM2/KIMIVL optional norm tensors",
- "relpath": "clip.cpp",
- "old": """ case PROJECTOR_TYPE_LFM2:\n case PROJECTOR_TYPE_KIMIVL:\n {\n model.mm_input_norm_w = get_tensor(TN_MM_INP_NORM);\n model.mm_input_norm_b = get_tensor(TN_MM_INP_NORM_B);\n model.mm_1_w = get_tensor(string_format(TN_LLAVA_PROJ, 1, \"weight\"));\n model.mm_1_b = get_tensor(string_format(TN_LLAVA_PROJ, 1, \"bias\"));\n model.mm_2_w = get_tensor(string_format(TN_LLAVA_PROJ, 2, \"weight\"));\n model.mm_2_b = get_tensor(string_format(TN_LLAVA_PROJ, 2, \"bias\"));\n } break;\n""",
- "new": """ case PROJECTOR_TYPE_LFM2:\n case PROJECTOR_TYPE_KIMIVL:\n {\n model.mm_input_norm_w = get_tensor(TN_MM_INP_NORM, false);\n model.mm_input_norm_b = get_tensor(TN_MM_INP_NORM_B, false);\n model.mm_1_w = get_tensor(string_format(TN_LLAVA_PROJ, 1, \"weight\"));\n model.mm_1_b = get_tensor(string_format(TN_LLAVA_PROJ, 1, \"bias\"));\n model.mm_2_w = get_tensor(string_format(TN_LLAVA_PROJ, 2, \"weight\"));\n model.mm_2_b = get_tensor(string_format(TN_LLAVA_PROJ, 2, \"bias\"));\n } break;\n""",
- },
- {
- "label": "legacy clip.cpp siglip norm guard",
- "relpath": "clip.cpp",
- "old": """ cur = ggml_norm(ctx0, cur, 1e-5); // default nn.LayerNorm\n cur = ggml_mul(ctx0, cur, model.mm_input_norm_w);\n cur = ggml_add(ctx0, cur, model.mm_input_norm_b);\n\n cur = ggml_mul_mat(ctx0, model.mm_1_w, cur);\n""",
- "new": """ cur = ggml_norm(ctx0, cur, 1e-5); // default nn.LayerNorm\n if (model.mm_input_norm_w && model.mm_input_norm_b) {\n cur = ggml_mul(ctx0, cur, model.mm_input_norm_w);\n cur = ggml_add(ctx0, cur, model.mm_input_norm_b);\n }\n\n cur = ggml_mul_mat(ctx0, model.mm_1_w, cur);\n""",
- },
- {
- "label": "legacy clip.cpp kimivl norm guard",
- "relpath": "clip.cpp",
- "old": """ cur = ggml_norm(ctx0, cur, 1e-5); // default nn.LayerNorm\n cur = ggml_mul(ctx0, cur, model.mm_input_norm_w);\n cur = ggml_add(ctx0, cur, model.mm_input_norm_b);\n cur = ggml_view_2d(ctx0, cur,\n""",
- "new": """ cur = ggml_norm(ctx0, cur, 1e-5); // default nn.LayerNorm\n if (model.mm_input_norm_w && model.mm_input_norm_b) {\n cur = ggml_mul(ctx0, cur, model.mm_input_norm_w);\n cur = ggml_add(ctx0, cur, model.mm_input_norm_b);\n }\n cur = ggml_view_2d(ctx0, cur,\n""",
- },
- {
- "label": "legacy clip.cpp pixtral rms norm guard",
- "relpath": "clip.cpp",
- "old": """ cur = ggml_mul(ctx0, ggml_rms_norm(ctx0, cur, eps), model.mm_input_norm_w);\n""",
- "new": """ cur = ggml_rms_norm(ctx0, cur, eps);\n if (model.mm_input_norm_w) {\n cur = ggml_mul(ctx0, cur, model.mm_input_norm_w);\n }\n""",
- },
- {
- "label": "modern clip.cpp KIMI projector optional norm tensors",
- "relpath": "clip.cpp",
- "old": """ case PROJECTOR_TYPE_KIMIVL:\n case PROJECTOR_TYPE_PADDLEOCR:\n case PROJECTOR_TYPE_KIMIK25:\n {\n model.mm_input_norm_w = get_tensor(TN_MM_INP_NORM);\n model.mm_input_norm_b = get_tensor(TN_MM_INP_NORM_B);\n model.mm_1_w = get_tensor(string_format(TN_LLAVA_PROJ, 1, \"weight\"));\n model.mm_1_b = get_tensor(string_format(TN_LLAVA_PROJ, 1, \"bias\"));\n model.mm_2_w = get_tensor(string_format(TN_LLAVA_PROJ, 2, \"weight\"));\n model.mm_2_b = get_tensor(string_format(TN_LLAVA_PROJ, 2, \"bias\"));\n } break;\n""",
- "new": """ case PROJECTOR_TYPE_KIMIVL:\n case PROJECTOR_TYPE_PADDLEOCR:\n case PROJECTOR_TYPE_KIMIK25:\n {\n model.mm_input_norm_w = get_tensor(TN_MM_INP_NORM, false);\n model.mm_input_norm_b = get_tensor(TN_MM_INP_NORM_B, false);\n model.mm_1_w = get_tensor(string_format(TN_LLAVA_PROJ, 1, \"weight\"));\n model.mm_1_b = get_tensor(string_format(TN_LLAVA_PROJ, 1, \"bias\"));\n model.mm_2_w = get_tensor(string_format(TN_LLAVA_PROJ, 2, \"weight\"));\n model.mm_2_b = get_tensor(string_format(TN_LLAVA_PROJ, 2, \"bias\"));\n } break;\n""",
- },
- {
- "label": "modern kimivl projector norm guard",
- "relpath": "models/kimivl.cpp",
- "old": """ cur = ggml_norm(ctx0, cur, 1e-5); // default nn.LayerNorm\n cur = ggml_mul(ctx0, cur, model.mm_input_norm_w);\n cur = ggml_add(ctx0, cur, model.mm_input_norm_b);\n""",
- "new": """ cur = build_norm(cur,\n model.mm_input_norm_w, model.mm_input_norm_b,\n NORM_TYPE_NORMAL, 1e-5, -1);\n""",
- },
- {
- "label": "modern kimik25 projector norm guard",
- "relpath": "models/kimik25.cpp",
- "old": """ cur = ggml_norm(ctx0, cur, hparams.eps);\n cur = ggml_mul(ctx0, cur, model.mm_input_norm_w);\n cur = ggml_add(ctx0, cur, model.mm_input_norm_b);\n""",
- "new": """ cur = build_norm(cur,\n model.mm_input_norm_w, model.mm_input_norm_b,\n NORM_TYPE_NORMAL, hparams.eps, -1);\n""",
- },
- {
- "label": "modern pixtral projector rms norm guard",
- "relpath": "models/pixtral.cpp",
- "old": """ cur = ggml_mul(ctx0, ggml_rms_norm(ctx0, cur, eps), model.mm_input_norm_w);\n""",
- "new": """ cur = build_norm(cur,\n model.mm_input_norm_w, nullptr,\n NORM_TYPE_RMS, eps, -1);\n""",
- },
-]
-
-applied = []
-already = []
-missing = []
-changed_files = set()
-
-for patch in patches:
- path = root / patch["relpath"]
- if not path.exists():
- missing.append(f'{patch["label"]} (missing file: {path})')
- continue
-
- text = path.read_text(encoding="utf-8", errors="ignore")
- old = patch["old"]
- new = patch["new"]
-
- if new in text:
- already.append(patch["label"])
- continue
-
- if old in text:
- updated = text.replace(old, new)
- if updated != text:
- path.write_text(updated, encoding="utf-8")
- applied.append(patch["label"])
- changed_files.add(path)
- else:
- already.append(patch["label"])
- else:
- missing.append(patch["label"])
-
-marker = Path(crate_dir) / "llama.cpp" / "CMakeMtmdPatch.txt"
-needs_rebuild = bool(applied) or not marker.exists()
-if needs_rebuild:
- marker.write_text("# mtmd patch applied\n")
- cmake_root = Path(crate_dir) / "llama.cpp" / "CMakeLists.txt"
- if cmake_root.exists():
- cmake_root.touch()
-
-if applied:
- print(f"Patched mtmd sources ({len(applied)} replacements).")
-else:
- print("mtmd sources already patched or no compatible patch needed.")
-
-if missing:
- sys.stderr.write("mtmd patch: some patterns were not found (upstream may have changed):\n")
- for item in missing:
- sys.stderr.write(f" - {item}\n")
-PY
-fi
diff --git a/rust/llmchat/sync/Cargo.lock b/rust/llmchat/sync/Cargo.lock
deleted file mode 100644
index a3834418c9..0000000000
--- a/rust/llmchat/sync/Cargo.lock
+++ /dev/null
@@ -1,3043 +0,0 @@
-# This file is automatically @generated by Cargo.
-# It is not intended for manual editing.
-version = 4
-
-[[package]]
-name = "aead"
-version = "0.5.2"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "d122413f284cf2d62fb1b7db97e02edb8cda96d769b16e443a4f6195e35662b0"
-dependencies = [
- "crypto-common",
- "generic-array",
-]
-
-[[package]]
-name = "aho-corasick"
-version = "1.1.4"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "ddd31a130427c27518df266943a5308ed92d4b226cc639f5a8f1002816174301"
-dependencies = [
- "memchr",
-]
-
-[[package]]
-name = "argon2"
-version = "0.5.3"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "3c3610892ee6e0cbce8ae2700349fcf8f98adb0dbfbee85aec3c9179d29cc072"
-dependencies = [
- "base64ct",
- "blake2",
- "cpufeatures",
- "password-hash",
-]
-
-[[package]]
-name = "arrayref"
-version = "0.3.9"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "76a2e8124351fda1ef8aaaa3bbd7ebbcb486bbcd4225aca0aa0d84bb2db8fecb"
-
-[[package]]
-name = "arrayvec"
-version = "0.7.6"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "7c02d123df017efcdfbd739ef81735b36c5ba83ec3c59c80a9d7ecc718f92e50"
-
-[[package]]
-name = "ascii-canvas"
-version = "3.0.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "8824ecca2e851cec16968d54a01dd372ef8f95b244fb84b84e70128be347c3c6"
-dependencies = [
- "term",
-]
-
-[[package]]
-name = "assert-json-diff"
-version = "2.0.2"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "47e4f2b81832e72834d7518d8487a0396a28cc408186a2e8854c0f98011faf12"
-dependencies = [
- "serde",
- "serde_json",
-]
-
-[[package]]
-name = "async-attributes"
-version = "1.1.2"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "a3203e79f4dd9bdda415ed03cf14dae5a2bf775c683a00f94e9cd1faf0f596e5"
-dependencies = [
- "quote",
- "syn 1.0.109",
-]
-
-[[package]]
-name = "async-channel"
-version = "1.9.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "81953c529336010edd6d8e358f886d9581267795c61b19475b71314bffa46d35"
-dependencies = [
- "concurrent-queue",
- "event-listener 2.5.3",
- "futures-core",
-]
-
-[[package]]
-name = "async-channel"
-version = "2.5.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "924ed96dd52d1b75e9c1a3e6275715fd320f5f9439fb5a4a11fa51f4221158d2"
-dependencies = [
- "concurrent-queue",
- "event-listener-strategy",
- "futures-core",
- "pin-project-lite",
-]
-
-[[package]]
-name = "async-executor"
-version = "1.13.3"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "497c00e0fd83a72a79a39fcbd8e3e2f055d6f6c7e025f3b3d91f4f8e76527fb8"
-dependencies = [
- "async-task",
- "concurrent-queue",
- "fastrand",
- "futures-lite",
- "pin-project-lite",
- "slab",
-]
-
-[[package]]
-name = "async-global-executor"
-version = "2.4.1"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "05b1b633a2115cd122d73b955eadd9916c18c8f510ec9cd1686404c60ad1c29c"
-dependencies = [
- "async-channel 2.5.0",
- "async-executor",
- "async-io",
- "async-lock",
- "blocking",
- "futures-lite",
- "once_cell",
-]
-
-[[package]]
-name = "async-io"
-version = "2.6.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "456b8a8feb6f42d237746d4b3e9a178494627745c3c56c6ea55d92ba50d026fc"
-dependencies = [
- "autocfg",
- "cfg-if",
- "concurrent-queue",
- "futures-io",
- "futures-lite",
- "parking",
- "polling",
- "rustix",
- "slab",
- "windows-sys 0.61.2",
-]
-
-[[package]]
-name = "async-lock"
-version = "3.4.2"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "290f7f2596bd5b78a9fec8088ccd89180d7f9f55b94b0576823bbbdc72ee8311"
-dependencies = [
- "event-listener 5.4.1",
- "event-listener-strategy",
- "pin-project-lite",
-]
-
-[[package]]
-name = "async-object-pool"
-version = "0.1.5"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "333c456b97c3f2d50604e8b2624253b7f787208cb72eb75e64b0ad11b221652c"
-dependencies = [
- "async-std",
-]
-
-[[package]]
-name = "async-process"
-version = "2.5.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "fc50921ec0055cdd8a16de48773bfeec5c972598674347252c0399676be7da75"
-dependencies = [
- "async-channel 2.5.0",
- "async-io",
- "async-lock",
- "async-signal",
- "async-task",
- "blocking",
- "cfg-if",
- "event-listener 5.4.1",
- "futures-lite",
- "rustix",
-]
-
-[[package]]
-name = "async-signal"
-version = "0.2.13"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "43c070bbf59cd3570b6b2dd54cd772527c7c3620fce8be898406dd3ed6adc64c"
-dependencies = [
- "async-io",
- "async-lock",
- "atomic-waker",
- "cfg-if",
- "futures-core",
- "futures-io",
- "rustix",
- "signal-hook-registry",
- "slab",
- "windows-sys 0.61.2",
-]
-
-[[package]]
-name = "async-std"
-version = "1.13.2"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "2c8e079a4ab67ae52b7403632e4618815d6db36d2a010cfe41b02c1b1578f93b"
-dependencies = [
- "async-attributes",
- "async-channel 1.9.0",
- "async-global-executor",
- "async-io",
- "async-lock",
- "async-process",
- "crossbeam-utils",
- "futures-channel",
- "futures-core",
- "futures-io",
- "futures-lite",
- "gloo-timers",
- "kv-log-macro",
- "log",
- "memchr",
- "once_cell",
- "pin-project-lite",
- "pin-utils",
- "slab",
- "wasm-bindgen-futures",
-]
-
-[[package]]
-name = "async-task"
-version = "4.7.1"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "8b75356056920673b02621b35afd0f7dda9306d03c79a30f5c56c44cf256e3de"
-
-[[package]]
-name = "async-trait"
-version = "0.1.89"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "9035ad2d096bed7955a320ee7e2230574d28fd3c3a0f186cbea1ff3c7eed5dbb"
-dependencies = [
- "proc-macro2",
- "quote",
- "syn 2.0.114",
-]
-
-[[package]]
-name = "atomic-waker"
-version = "1.1.2"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "1505bd5d3d116872e7271a6d4e16d81d0c8570876c8de68093a09ac269d8aac0"
-
-[[package]]
-name = "autocfg"
-version = "1.5.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "c08606f8c3cbf4ce6ec8e28fb0014a2c086708fe954eaa885384a6165172e7e8"
-
-[[package]]
-name = "base64"
-version = "0.21.7"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "9d297deb1925b89f2ccc13d7635fa0714f12c87adce1c75356b39ca9b7178567"
-
-[[package]]
-name = "base64"
-version = "0.22.1"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "72b3254f16251a8381aa12e40e3c4d2f0199f8c6508fbecb9d91f575e0fbb8c6"
-
-[[package]]
-name = "base64ct"
-version = "1.8.3"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "2af50177e190e07a26ab74f8b1efbfe2ef87da2116221318cb1c2e82baf7de06"
-
-[[package]]
-name = "basic-cookies"
-version = "0.1.5"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "67bd8fd42c16bdb08688243dc5f0cc117a3ca9efeeaba3a345a18a6159ad96f7"
-dependencies = [
- "lalrpop",
- "lalrpop-util",
- "regex",
-]
-
-[[package]]
-name = "bit-set"
-version = "0.5.3"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "0700ddab506f33b20a03b13996eccd309a48e5ff77d0d95926aa0210fb4e95f1"
-dependencies = [
- "bit-vec",
-]
-
-[[package]]
-name = "bit-vec"
-version = "0.6.3"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "349f9b6a179ed607305526ca489b34ad0a41aed5f7980fa90eb03160b69598fb"
-
-[[package]]
-name = "bitflags"
-version = "2.10.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "812e12b5285cc515a9c72a5c1d3b6d46a19dac5acfef5265968c166106e31dd3"
-
-[[package]]
-name = "blake2"
-version = "0.10.6"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "46502ad458c9a52b69d4d4d32775c788b7a1b85e8bc9d482d92250fc0e3f8efe"
-dependencies = [
- "digest",
-]
-
-[[package]]
-name = "blake2b_simd"
-version = "1.0.4"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "b79834656f71332577234b50bfc009996f7449e0c056884e6a02492ded0ca2f3"
-dependencies = [
- "arrayref",
- "arrayvec",
- "constant_time_eq",
-]
-
-[[package]]
-name = "block-buffer"
-version = "0.10.4"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "3078c7629b62d3f0439517fa394996acacc5cbc91c5a20d8c658e77abd503a71"
-dependencies = [
- "generic-array",
-]
-
-[[package]]
-name = "block-padding"
-version = "0.3.3"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "a8894febbff9f758034a5b8e12d87918f56dfc64a8e1fe757d65e29041538d93"
-dependencies = [
- "generic-array",
-]
-
-[[package]]
-name = "blocking"
-version = "1.6.2"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "e83f8d02be6967315521be875afa792a316e28d57b5a2d401897e2a7921b7f21"
-dependencies = [
- "async-channel 2.5.0",
- "async-task",
- "futures-io",
- "futures-lite",
- "piper",
-]
-
-[[package]]
-name = "bumpalo"
-version = "3.19.1"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "5dd9dc738b7a8311c7ade152424974d8115f2cdad61e8dab8dac9f2362298510"
-
-[[package]]
-name = "bytes"
-version = "1.11.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "b35204fbdc0b3f4446b89fc1ac2cf84a8a68971995d0bf2e925ec7cd960f9cb3"
-
-[[package]]
-name = "cc"
-version = "1.2.53"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "755d2fce177175ffca841e9a06afdb2c4ab0f593d53b4dee48147dfaade85932"
-dependencies = [
- "find-msvc-tools",
- "shlex",
-]
-
-[[package]]
-name = "cfg-if"
-version = "1.0.4"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "9330f8b2ff13f34540b44e946ef35111825727b38d33286ef986142615121801"
-
-[[package]]
-name = "cfg_aliases"
-version = "0.2.1"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "613afe47fcd5fac7ccf1db93babcb082c5994d996f20b8b159f2ad1658eb5724"
-
-[[package]]
-name = "chacha20"
-version = "0.9.1"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "c3613f74bd2eac03dad61bd53dbe620703d4371614fe0bc3b9f04dd36fe4e818"
-dependencies = [
- "cfg-if",
- "cipher",
- "cpufeatures",
-]
-
-[[package]]
-name = "cipher"
-version = "0.4.4"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "773f3b9af64447d2ce9850330c473515014aa235e6a783b02db81ff39e4a3dad"
-dependencies = [
- "crypto-common",
- "inout",
- "zeroize",
-]
-
-[[package]]
-name = "concurrent-queue"
-version = "2.5.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "4ca0197aee26d1ae37445ee532fefce43251d24cc7c166799f4d46817f1d3973"
-dependencies = [
- "crossbeam-utils",
-]
-
-[[package]]
-name = "constant_time_eq"
-version = "0.4.2"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "3d52eff69cd5e647efe296129160853a42795992097e8af39800e1060caeea9b"
-
-[[package]]
-name = "core-foundation"
-version = "0.9.4"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "91e195e091a93c46f7102ec7818a2aa394e1e1771c3ab4825963fa03e45afb8f"
-dependencies = [
- "core-foundation-sys",
- "libc",
-]
-
-[[package]]
-name = "core-foundation"
-version = "0.10.1"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "b2a6cd9ae233e7f62ba4e9353e81a88df7fc8a5987b8d445b4d90c879bd156f6"
-dependencies = [
- "core-foundation-sys",
- "libc",
-]
-
-[[package]]
-name = "core-foundation-sys"
-version = "0.8.7"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "773648b94d0e5d620f64f280777445740e61fe701025087ec8b57f45c791888b"
-
-[[package]]
-name = "cpufeatures"
-version = "0.2.17"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "59ed5838eebb26a2bb2e58f6d5b5316989ae9d08bab10e0e6d103e656d1b0280"
-dependencies = [
- "libc",
-]
-
-[[package]]
-name = "crossbeam-utils"
-version = "0.8.21"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "d0a5c400df2834b80a4c3327b3aad3a4c4cd4de0629063962b03235697506a28"
-
-[[package]]
-name = "crunchy"
-version = "0.2.4"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "460fbee9c2c2f33933d720630a6a0bac33ba7053db5344fac858d4b8952d77d5"
-
-[[package]]
-name = "crypto-common"
-version = "0.1.7"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "78c8292055d1c1df0cce5d180393dc8cce0abec0a7102adb6c7b1eef6016d60a"
-dependencies = [
- "generic-array",
- "rand_core 0.6.4",
- "typenum",
-]
-
-[[package]]
-name = "crypto_secretstream"
-version = "0.2.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "9a6419214057ad50a13efccb3ad7714b86b848e3a5aa7b6cf5a3ff07edf387eb"
-dependencies = [
- "aead",
- "chacha20",
- "getrandom 0.2.17",
- "poly1305",
- "rand_core 0.6.4",
- "subtle",
-]
-
-[[package]]
-name = "curve25519-dalek"
-version = "4.1.3"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "97fb8b7c4503de7d6ae7b42ab72a5a59857b4c937ec27a3d4539dba95b5ab2be"
-dependencies = [
- "cfg-if",
- "cpufeatures",
- "curve25519-dalek-derive",
- "fiat-crypto",
- "rustc_version",
- "subtle",
- "zeroize",
-]
-
-[[package]]
-name = "curve25519-dalek-derive"
-version = "0.1.1"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "f46882e17999c6cc590af592290432be3bce0428cb0d5f8b6715e4dc7b383eb3"
-dependencies = [
- "proc-macro2",
- "quote",
- "syn 2.0.114",
-]
-
-[[package]]
-name = "digest"
-version = "0.10.7"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "9ed9a281f7bc9b7576e61468ba615a66a5c8cfdff42420a70aa82701a3b1e292"
-dependencies = [
- "block-buffer",
- "crypto-common",
- "subtle",
-]
-
-[[package]]
-name = "dirs-next"
-version = "2.0.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "b98cf8ebf19c3d1b223e151f99a4f9f0690dca41414773390fc824184ac833e1"
-dependencies = [
- "cfg-if",
- "dirs-sys-next",
-]
-
-[[package]]
-name = "dirs-sys-next"
-version = "0.1.2"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "4ebda144c4fe02d1f7ea1a7d9641b6fc6b580adcfa024ae48797ecdeb6825b4d"
-dependencies = [
- "libc",
- "redox_users",
- "winapi",
-]
-
-[[package]]
-name = "displaydoc"
-version = "0.2.5"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "97369cbbc041bc366949bc74d34658d6cda5621039731c6310521892a3a20ae0"
-dependencies = [
- "proc-macro2",
- "quote",
- "syn 2.0.114",
-]
-
-[[package]]
-name = "either"
-version = "1.15.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "48c757948c5ede0e46177b7add2e67155f70e33c07fea8284df6576da70b3719"
-
-[[package]]
-name = "ena"
-version = "0.14.3"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "3d248bdd43ce613d87415282f69b9bb99d947d290b10962dd6c56233312c2ad5"
-dependencies = [
- "log",
-]
-
-[[package]]
-name = "encoding_rs"
-version = "0.8.35"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "75030f3c4f45dafd7586dd6780965a8c7e8e285a5ecb86713e63a79c5b2766f3"
-dependencies = [
- "cfg-if",
-]
-
-[[package]]
-name = "ente-core"
-version = "0.0.1"
-dependencies = [
- "argon2",
- "base64 0.22.1",
- "blake2b_simd",
- "crypto_secretstream",
- "getrandom 0.2.17",
- "hex",
- "md-5",
- "rand_core 0.6.4",
- "reqwest",
- "salsa20",
- "serde",
- "serde_json",
- "subtle",
- "thiserror 2.0.18",
- "x25519-dalek",
- "xsalsa20poly1305",
- "zeroize",
-]
-
-[[package]]
-name = "equivalent"
-version = "1.0.2"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "877a4ace8713b0bcf2a4e7eec82529c029f1d0619886d18145fea96c3ffe5c0f"
-
-[[package]]
-name = "errno"
-version = "0.3.14"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "39cab71617ae0d63f51a36d69f866391735b51691dbda63cf6f96d042b63efeb"
-dependencies = [
- "libc",
- "windows-sys 0.61.2",
-]
-
-[[package]]
-name = "event-listener"
-version = "2.5.3"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "0206175f82b8d6bf6652ff7d71a1e27fd2e4efde587fd368662814d6ec1d9ce0"
-
-[[package]]
-name = "event-listener"
-version = "5.4.1"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "e13b66accf52311f30a0db42147dadea9850cb48cd070028831ae5f5d4b856ab"
-dependencies = [
- "concurrent-queue",
- "parking",
- "pin-project-lite",
-]
-
-[[package]]
-name = "event-listener-strategy"
-version = "0.5.4"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "8be9f3dfaaffdae2972880079a491a1a8bb7cbed0b8dd7a347f668b4150a3b93"
-dependencies = [
- "event-listener 5.4.1",
- "pin-project-lite",
-]
-
-[[package]]
-name = "fallible-iterator"
-version = "0.3.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "2acce4a10f12dc2fb14a218589d4f1f62ef011b2d0cc4b3cb1bba8e94da14649"
-
-[[package]]
-name = "fallible-streaming-iterator"
-version = "0.1.9"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "7360491ce676a36bf9bb3c56c1aa791658183a54d2744120f27285738d90465a"
-
-[[package]]
-name = "fastrand"
-version = "2.3.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "37909eebbb50d72f9059c3b6d82c0463f2ff062c9e95845c43a6c9c0355411be"
-
-[[package]]
-name = "fiat-crypto"
-version = "0.2.9"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "28dea519a9695b9977216879a3ebfddf92f1c08c05d984f8996aecd6ecdc811d"
-
-[[package]]
-name = "find-msvc-tools"
-version = "0.1.8"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "8591b0bcc8a98a64310a2fae1bb3e9b8564dd10e381e6e28010fde8e8e8568db"
-
-[[package]]
-name = "fixedbitset"
-version = "0.4.2"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "0ce7134b9999ecaf8bcd65542e436736ef32ddca1b3e06094cb6ec5755203b80"
-
-[[package]]
-name = "fnv"
-version = "1.0.7"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "3f9eec918d3f24069decb9af1554cad7c880e2da24a9afd88aca000531ab82c1"
-
-[[package]]
-name = "foldhash"
-version = "0.2.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "77ce24cb58228fbb8aa041425bb1050850ac19177686ea6e0f41a70416f56fdb"
-
-[[package]]
-name = "form_urlencoded"
-version = "1.2.2"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "cb4cb245038516f5f85277875cdaa4f7d2c9a0fa0468de06ed190163b1581fcf"
-dependencies = [
- "percent-encoding",
-]
-
-[[package]]
-name = "futures-channel"
-version = "0.3.31"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "2dff15bf788c671c1934e366d07e30c1814a8ef514e1af724a602e8a2fbe1b10"
-dependencies = [
- "futures-core",
- "futures-sink",
-]
-
-[[package]]
-name = "futures-core"
-version = "0.3.31"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "05f29059c0c2090612e8d742178b0580d2dc940c837851ad723096f87af6663e"
-
-[[package]]
-name = "futures-io"
-version = "0.3.31"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "9e5c1b78ca4aae1ac06c48a526a655760685149f0d465d21f37abfe57ce075c6"
-
-[[package]]
-name = "futures-lite"
-version = "2.6.1"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "f78e10609fe0e0b3f4157ffab1876319b5b0db102a2c60dc4626306dc46b44ad"
-dependencies = [
- "fastrand",
- "futures-core",
- "futures-io",
- "parking",
- "pin-project-lite",
-]
-
-[[package]]
-name = "futures-macro"
-version = "0.3.31"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "162ee34ebcb7c64a8abebc059ce0fee27c2262618d7b60ed8faf72fef13c3650"
-dependencies = [
- "proc-macro2",
- "quote",
- "syn 2.0.114",
-]
-
-[[package]]
-name = "futures-sink"
-version = "0.3.31"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "e575fab7d1e0dcb8d0c7bcf9a63ee213816ab51902e6d244a95819acacf1d4f7"
-
-[[package]]
-name = "futures-task"
-version = "0.3.31"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "f90f7dce0722e95104fcb095585910c0977252f286e354b5e3bd38902cd99988"
-
-[[package]]
-name = "futures-util"
-version = "0.3.31"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "9fa08315bb612088cc391249efdc3bc77536f16c91f6cf495e6fbe85b20a4a81"
-dependencies = [
- "futures-core",
- "futures-io",
- "futures-macro",
- "futures-sink",
- "futures-task",
- "memchr",
- "pin-project-lite",
- "pin-utils",
- "slab",
-]
-
-[[package]]
-name = "generic-array"
-version = "0.14.7"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "85649ca51fd72272d7821adaf274ad91c288277713d9c18820d8499a7ff69e9a"
-dependencies = [
- "typenum",
- "version_check",
-]
-
-[[package]]
-name = "getrandom"
-version = "0.2.17"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "ff2abc00be7fca6ebc474524697ae276ad847ad0a6b3faa4bcb027e9a4614ad0"
-dependencies = [
- "cfg-if",
- "js-sys",
- "libc",
- "wasi",
- "wasm-bindgen",
-]
-
-[[package]]
-name = "getrandom"
-version = "0.3.4"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "899def5c37c4fd7b2664648c28120ecec138e4d395b459e5ca34f9cce2dd77fd"
-dependencies = [
- "cfg-if",
- "js-sys",
- "libc",
- "r-efi",
- "wasip2",
- "wasm-bindgen",
-]
-
-[[package]]
-name = "gloo-timers"
-version = "0.3.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "bbb143cf96099802033e0d4f4963b19fd2e0b728bcf076cd9cf7f6634f092994"
-dependencies = [
- "futures-channel",
- "futures-core",
- "js-sys",
- "wasm-bindgen",
-]
-
-[[package]]
-name = "h2"
-version = "0.4.13"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "2f44da3a8150a6703ed5d34e164b875fd14c2cdab9af1252a9a1020bde2bdc54"
-dependencies = [
- "atomic-waker",
- "bytes",
- "fnv",
- "futures-core",
- "futures-sink",
- "http 1.4.0",
- "indexmap",
- "slab",
- "tokio",
- "tokio-util",
- "tracing",
-]
-
-[[package]]
-name = "hashbrown"
-version = "0.16.1"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "841d1cc9bed7f9236f321df977030373f4a4163ae1a7dbfe1a51a2c1a51d9100"
-dependencies = [
- "foldhash",
-]
-
-[[package]]
-name = "hashlink"
-version = "0.11.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "ea0b22561a9c04a7cb1a302c013e0259cd3b4bb619f145b32f72b8b4bcbed230"
-dependencies = [
- "hashbrown",
-]
-
-[[package]]
-name = "hermit-abi"
-version = "0.5.2"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "fc0fef456e4baa96da950455cd02c081ca953b141298e41db3fc7e36b1da849c"
-
-[[package]]
-name = "hex"
-version = "0.4.3"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "7f24254aa9a54b5c858eaee2f5bccdb46aaf0e486a595ed5fd8f86ba55232a70"
-
-[[package]]
-name = "hkdf"
-version = "0.12.4"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "7b5f8eb2ad728638ea2c7d47a21db23b7b58a72ed6a38256b8a1849f15fbbdf7"
-dependencies = [
- "hmac",
-]
-
-[[package]]
-name = "hmac"
-version = "0.12.1"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "6c49c37c09c17a53d937dfbb742eb3a961d65a994e6bcdcf37e7399d0cc8ab5e"
-dependencies = [
- "digest",
-]
-
-[[package]]
-name = "http"
-version = "0.2.12"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "601cbb57e577e2f5ef5be8e7b83f0f63994f25aa94d673e54a92d5c516d101f1"
-dependencies = [
- "bytes",
- "fnv",
- "itoa",
-]
-
-[[package]]
-name = "http"
-version = "1.4.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "e3ba2a386d7f85a81f119ad7498ebe444d2e22c2af0b86b069416ace48b3311a"
-dependencies = [
- "bytes",
- "itoa",
-]
-
-[[package]]
-name = "http-body"
-version = "0.4.6"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "7ceab25649e9960c0311ea418d17bee82c0dcec1bd053b5f9a66e265a693bed2"
-dependencies = [
- "bytes",
- "http 0.2.12",
- "pin-project-lite",
-]
-
-[[package]]
-name = "http-body"
-version = "1.0.1"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "1efedce1fb8e6913f23e0c92de8e62cd5b772a67e7b3946df930a62566c93184"
-dependencies = [
- "bytes",
- "http 1.4.0",
-]
-
-[[package]]
-name = "http-body-util"
-version = "0.1.3"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "b021d93e26becf5dc7e1b75b1bed1fd93124b374ceb73f43d4d4eafec896a64a"
-dependencies = [
- "bytes",
- "futures-core",
- "http 1.4.0",
- "http-body 1.0.1",
- "pin-project-lite",
-]
-
-[[package]]
-name = "httparse"
-version = "1.10.1"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "6dbf3de79e51f3d586ab4cb9d5c3e2c14aa28ed23d180cf89b4df0454a69cc87"
-
-[[package]]
-name = "httpdate"
-version = "1.0.3"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "df3b46402a9d5adb4c86a0cf463f42e19994e3ee891101b1841f30a545cb49a9"
-
-[[package]]
-name = "httpmock"
-version = "0.7.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "08ec9586ee0910472dec1a1f0f8acf52f0fdde93aea74d70d4a3107b4be0fd5b"
-dependencies = [
- "assert-json-diff",
- "async-object-pool",
- "async-std",
- "async-trait",
- "base64 0.21.7",
- "basic-cookies",
- "crossbeam-utils",
- "form_urlencoded",
- "futures-util",
- "hyper 0.14.32",
- "lazy_static",
- "levenshtein",
- "log",
- "regex",
- "serde",
- "serde_json",
- "serde_regex",
- "similar",
- "tokio",
- "url",
-]
-
-[[package]]
-name = "hyper"
-version = "0.14.32"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "41dfc780fdec9373c01bae43289ea34c972e40ee3c9f6b3c8801a35f35586ce7"
-dependencies = [
- "bytes",
- "futures-channel",
- "futures-core",
- "futures-util",
- "http 0.2.12",
- "http-body 0.4.6",
- "httparse",
- "httpdate",
- "itoa",
- "pin-project-lite",
- "socket2 0.5.10",
- "tokio",
- "tower-service",
- "tracing",
- "want",
-]
-
-[[package]]
-name = "hyper"
-version = "1.8.1"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "2ab2d4f250c3d7b1c9fcdff1cece94ea4e2dfbec68614f7b87cb205f24ca9d11"
-dependencies = [
- "atomic-waker",
- "bytes",
- "futures-channel",
- "futures-core",
- "h2",
- "http 1.4.0",
- "http-body 1.0.1",
- "httparse",
- "itoa",
- "pin-project-lite",
- "pin-utils",
- "smallvec",
- "tokio",
- "want",
-]
-
-[[package]]
-name = "hyper-rustls"
-version = "0.27.7"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "e3c93eb611681b207e1fe55d5a71ecf91572ec8a6705cdb6857f7d8d5242cf58"
-dependencies = [
- "http 1.4.0",
- "hyper 1.8.1",
- "hyper-util",
- "rustls",
- "rustls-native-certs",
- "rustls-pki-types",
- "tokio",
- "tokio-rustls",
- "tower-service",
-]
-
-[[package]]
-name = "hyper-util"
-version = "0.1.19"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "727805d60e7938b76b826a6ef209eb70eaa1812794f9424d4a4e2d740662df5f"
-dependencies = [
- "base64 0.22.1",
- "bytes",
- "futures-channel",
- "futures-core",
- "futures-util",
- "http 1.4.0",
- "http-body 1.0.1",
- "hyper 1.8.1",
- "ipnet",
- "libc",
- "percent-encoding",
- "pin-project-lite",
- "socket2 0.6.1",
- "system-configuration",
- "tokio",
- "tower-service",
- "tracing",
- "windows-registry",
-]
-
-[[package]]
-name = "icu_collections"
-version = "2.1.1"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "4c6b649701667bbe825c3b7e6388cb521c23d88644678e83c0c4d0a621a34b43"
-dependencies = [
- "displaydoc",
- "potential_utf",
- "yoke",
- "zerofrom",
- "zerovec",
-]
-
-[[package]]
-name = "icu_locale_core"
-version = "2.1.1"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "edba7861004dd3714265b4db54a3c390e880ab658fec5f7db895fae2046b5bb6"
-dependencies = [
- "displaydoc",
- "litemap",
- "tinystr",
- "writeable",
- "zerovec",
-]
-
-[[package]]
-name = "icu_normalizer"
-version = "2.1.1"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "5f6c8828b67bf8908d82127b2054ea1b4427ff0230ee9141c54251934ab1b599"
-dependencies = [
- "icu_collections",
- "icu_normalizer_data",
- "icu_properties",
- "icu_provider",
- "smallvec",
- "zerovec",
-]
-
-[[package]]
-name = "icu_normalizer_data"
-version = "2.1.1"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "7aedcccd01fc5fe81e6b489c15b247b8b0690feb23304303a9e560f37efc560a"
-
-[[package]]
-name = "icu_properties"
-version = "2.1.2"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "020bfc02fe870ec3a66d93e677ccca0562506e5872c650f893269e08615d74ec"
-dependencies = [
- "icu_collections",
- "icu_locale_core",
- "icu_properties_data",
- "icu_provider",
- "zerotrie",
- "zerovec",
-]
-
-[[package]]
-name = "icu_properties_data"
-version = "2.1.2"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "616c294cf8d725c6afcd8f55abc17c56464ef6211f9ed59cccffe534129c77af"
-
-[[package]]
-name = "icu_provider"
-version = "2.1.1"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "85962cf0ce02e1e0a629cc34e7ca3e373ce20dda4c4d7294bbd0bf1fdb59e614"
-dependencies = [
- "displaydoc",
- "icu_locale_core",
- "writeable",
- "yoke",
- "zerofrom",
- "zerotrie",
- "zerovec",
-]
-
-[[package]]
-name = "idna"
-version = "1.1.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "3b0875f23caa03898994f6ddc501886a45c7d3d62d04d2d90788d47be1b1e4de"
-dependencies = [
- "idna_adapter",
- "smallvec",
- "utf8_iter",
-]
-
-[[package]]
-name = "idna_adapter"
-version = "1.2.1"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "3acae9609540aa318d1bc588455225fb2085b9ed0c4f6bd0d9d5bcd86f1a0344"
-dependencies = [
- "icu_normalizer",
- "icu_properties",
-]
-
-[[package]]
-name = "indexmap"
-version = "2.13.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "7714e70437a7dc3ac8eb7e6f8df75fd8eb422675fc7678aff7364301092b1017"
-dependencies = [
- "equivalent",
- "hashbrown",
-]
-
-[[package]]
-name = "inout"
-version = "0.1.4"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "879f10e63c20629ecabbb64a8010319738c66a5cd0c29b02d63d272b03751d01"
-dependencies = [
- "block-padding",
- "generic-array",
-]
-
-[[package]]
-name = "ipnet"
-version = "2.11.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "469fb0b9cefa57e3ef31275ee7cacb78f2fdca44e4765491884a2b119d4eb130"
-
-[[package]]
-name = "iri-string"
-version = "0.7.10"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "c91338f0783edbd6195decb37bae672fd3b165faffb89bf7b9e6942f8b1a731a"
-dependencies = [
- "memchr",
- "serde",
-]
-
-[[package]]
-name = "itertools"
-version = "0.11.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "b1c173a5686ce8bfa551b3563d0c2170bf24ca44da99c7ca4bfdab5418c3fe57"
-dependencies = [
- "either",
-]
-
-[[package]]
-name = "itoa"
-version = "1.0.17"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "92ecc6618181def0457392ccd0ee51198e065e016d1d527a7ac1b6dc7c1f09d2"
-
-[[package]]
-name = "js-sys"
-version = "0.3.85"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "8c942ebf8e95485ca0d52d97da7c5a2c387d0e7f0ba4c35e93bfcaee045955b3"
-dependencies = [
- "once_cell",
- "wasm-bindgen",
-]
-
-[[package]]
-name = "kv-log-macro"
-version = "1.0.7"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "0de8b303297635ad57c9f5059fd9cee7a47f8e8daa09df0fcd07dd39fb22977f"
-dependencies = [
- "log",
-]
-
-[[package]]
-name = "lalrpop"
-version = "0.20.2"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "55cb077ad656299f160924eb2912aa147d7339ea7d69e1b5517326fdcec3c1ca"
-dependencies = [
- "ascii-canvas",
- "bit-set",
- "ena",
- "itertools",
- "lalrpop-util",
- "petgraph",
- "pico-args",
- "regex",
- "regex-syntax",
- "string_cache",
- "term",
- "tiny-keccak",
- "unicode-xid",
- "walkdir",
-]
-
-[[package]]
-name = "lalrpop-util"
-version = "0.20.2"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "507460a910eb7b32ee961886ff48539633b788a36b65692b95f225b844c82553"
-dependencies = [
- "regex-automata",
-]
-
-[[package]]
-name = "lazy_static"
-version = "1.5.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "bbd2bcb4c963f2ddae06a2efc7e9f3591312473c50c6685e1f298068316e66fe"
-
-[[package]]
-name = "levenshtein"
-version = "1.0.5"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "db13adb97ab515a3691f56e4dbab09283d0b86cb45abd991d8634a9d6f501760"
-
-[[package]]
-name = "libc"
-version = "0.2.180"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "bcc35a38544a891a5f7c865aca548a982ccb3b8650a5b06d0fd33a10283c56fc"
-
-[[package]]
-name = "libredox"
-version = "0.1.12"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "3d0b95e02c851351f877147b7deea7b1afb1df71b63aa5f8270716e0c5720616"
-dependencies = [
- "bitflags",
- "libc",
-]
-
-[[package]]
-name = "libsqlite3-sys"
-version = "0.36.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "95b4103cffefa72eb8428cb6b47d6627161e51c2739fc5e3b734584157bc642a"
-dependencies = [
- "cc",
- "pkg-config",
- "vcpkg",
-]
-
-[[package]]
-name = "linux-raw-sys"
-version = "0.11.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "df1d3c3b53da64cf5760482273a98e575c651a67eec7f77df96b5b642de8f039"
-
-[[package]]
-name = "litemap"
-version = "0.8.1"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "6373607a59f0be73a39b6fe456b8192fcc3585f602af20751600e974dd455e77"
-
-[[package]]
-name = "llmchat-db"
-version = "0.1.0"
-dependencies = [
- "ente-core",
- "rusqlite",
- "serde",
- "serde_json",
- "thiserror 2.0.18",
- "uuid",
- "zeroize",
-]
-
-[[package]]
-name = "llmchat-sync"
-version = "0.1.0"
-dependencies = [
- "ente-core",
- "hkdf",
- "httpmock",
- "llmchat-db",
- "reqwest",
- "serde",
- "serde_json",
- "sha2",
- "tempfile",
- "thiserror 2.0.18",
- "uuid",
- "zeroize",
-]
-
-[[package]]
-name = "lock_api"
-version = "0.4.14"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "224399e74b87b5f3557511d98dff8b14089b3dadafcab6bb93eab67d3aace965"
-dependencies = [
- "scopeguard",
-]
-
-[[package]]
-name = "log"
-version = "0.4.29"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "5e5032e24019045c762d3c0f28f5b6b8bbf38563a65908389bf7978758920897"
-dependencies = [
- "value-bag",
-]
-
-[[package]]
-name = "lru-slab"
-version = "0.1.2"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "112b39cec0b298b6c1999fee3e31427f74f676e4cb9879ed1a121b43661a4154"
-
-[[package]]
-name = "md-5"
-version = "0.10.6"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "d89e7ee0cfbedfc4da3340218492196241d89eefb6dab27de5df917a6d2e78cf"
-dependencies = [
- "cfg-if",
- "digest",
-]
-
-[[package]]
-name = "memchr"
-version = "2.7.6"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "f52b00d39961fc5b2736ea853c9cc86238e165017a493d1d5c8eac6bdc4cc273"
-
-[[package]]
-name = "mime"
-version = "0.3.17"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "6877bb514081ee2a7ff5ef9de3281f14a4dd4bceac4c09388074a6b5df8a139a"
-
-[[package]]
-name = "mio"
-version = "1.1.1"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "a69bcab0ad47271a0234d9422b131806bf3968021e5dc9328caf2d4cd58557fc"
-dependencies = [
- "libc",
- "wasi",
- "windows-sys 0.61.2",
-]
-
-[[package]]
-name = "new_debug_unreachable"
-version = "1.0.6"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "650eef8c711430f1a879fdd01d4745a7deea475becfb90269c06775983bbf086"
-
-[[package]]
-name = "once_cell"
-version = "1.21.3"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "42f5e15c9953c5e4ccceeb2e7382a716482c34515315f7b03532b8b4e8393d2d"
-
-[[package]]
-name = "opaque-debug"
-version = "0.3.1"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "c08d65885ee38876c4f86fa503fb49d7b507c2b62552df7c70b2fce627e06381"
-
-[[package]]
-name = "openssl-probe"
-version = "0.2.1"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "7c87def4c32ab89d880effc9e097653c8da5d6ef28e6b539d313baaacfbafcbe"
-
-[[package]]
-name = "parking"
-version = "2.2.1"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "f38d5652c16fde515bb1ecef450ab0f6a219d619a7274976324d5e377f7dceba"
-
-[[package]]
-name = "parking_lot"
-version = "0.12.5"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "93857453250e3077bd71ff98b6a65ea6621a19bb0f559a85248955ac12c45a1a"
-dependencies = [
- "lock_api",
- "parking_lot_core",
-]
-
-[[package]]
-name = "parking_lot_core"
-version = "0.9.12"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "2621685985a2ebf1c516881c026032ac7deafcda1a2c9b7850dc81e3dfcb64c1"
-dependencies = [
- "cfg-if",
- "libc",
- "redox_syscall",
- "smallvec",
- "windows-link",
-]
-
-[[package]]
-name = "password-hash"
-version = "0.5.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "346f04948ba92c43e8469c1ee6736c7563d71012b17d40745260fe106aac2166"
-dependencies = [
- "base64ct",
- "rand_core 0.6.4",
- "subtle",
-]
-
-[[package]]
-name = "percent-encoding"
-version = "2.3.2"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "9b4f627cb1b25917193a259e49bdad08f671f8d9708acfd5fe0a8c1455d87220"
-
-[[package]]
-name = "petgraph"
-version = "0.6.5"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "b4c5cc86750666a3ed20bdaf5ca2a0344f9c67674cae0515bec2da16fbaa47db"
-dependencies = [
- "fixedbitset",
- "indexmap",
-]
-
-[[package]]
-name = "phf_shared"
-version = "0.11.3"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "67eabc2ef2a60eb7faa00097bd1ffdb5bd28e62bf39990626a582201b7a754e5"
-dependencies = [
- "siphasher",
-]
-
-[[package]]
-name = "pico-args"
-version = "0.5.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "5be167a7af36ee22fe3115051bc51f6e6c7054c9348e28deb4f49bd6f705a315"
-
-[[package]]
-name = "pin-project-lite"
-version = "0.2.16"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "3b3cff922bd51709b605d9ead9aa71031d81447142d828eb4a6eba76fe619f9b"
-
-[[package]]
-name = "pin-utils"
-version = "0.1.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "8b870d8c151b6f2fb93e84a13146138f05d02ed11c7e7c54f8826aaaf7c9f184"
-
-[[package]]
-name = "piper"
-version = "0.2.4"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "96c8c490f422ef9a4efd2cb5b42b76c8613d7e7dfc1caf667b8a3350a5acc066"
-dependencies = [
- "atomic-waker",
- "fastrand",
- "futures-io",
-]
-
-[[package]]
-name = "pkg-config"
-version = "0.3.32"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "7edddbd0b52d732b21ad9a5fab5c704c14cd949e5e9a1ec5929a24fded1b904c"
-
-[[package]]
-name = "polling"
-version = "3.11.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "5d0e4f59085d47d8241c88ead0f274e8a0cb551f3625263c05eb8dd897c34218"
-dependencies = [
- "cfg-if",
- "concurrent-queue",
- "hermit-abi",
- "pin-project-lite",
- "rustix",
- "windows-sys 0.61.2",
-]
-
-[[package]]
-name = "poly1305"
-version = "0.8.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "8159bd90725d2df49889a078b54f4f79e87f1f8a8444194cdca81d38f5393abf"
-dependencies = [
- "cpufeatures",
- "opaque-debug",
- "universal-hash",
-]
-
-[[package]]
-name = "potential_utf"
-version = "0.1.4"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "b73949432f5e2a09657003c25bca5e19a0e9c84f8058ca374f49e0ebe605af77"
-dependencies = [
- "zerovec",
-]
-
-[[package]]
-name = "ppv-lite86"
-version = "0.2.21"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "85eae3c4ed2f50dcfe72643da4befc30deadb458a9b590d720cde2f2b1e97da9"
-dependencies = [
- "zerocopy",
-]
-
-[[package]]
-name = "precomputed-hash"
-version = "0.1.1"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "925383efa346730478fb4838dbe9137d2a47675ad789c546d150a6e1dd4ab31c"
-
-[[package]]
-name = "proc-macro2"
-version = "1.0.105"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "535d180e0ecab6268a3e718bb9fd44db66bbbc256257165fc699dadf70d16fe7"
-dependencies = [
- "unicode-ident",
-]
-
-[[package]]
-name = "quinn"
-version = "0.11.9"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "b9e20a958963c291dc322d98411f541009df2ced7b5a4f2bd52337638cfccf20"
-dependencies = [
- "bytes",
- "cfg_aliases",
- "pin-project-lite",
- "quinn-proto",
- "quinn-udp",
- "rustc-hash",
- "rustls",
- "socket2 0.6.1",
- "thiserror 2.0.18",
- "tokio",
- "tracing",
- "web-time",
-]
-
-[[package]]
-name = "quinn-proto"
-version = "0.11.13"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "f1906b49b0c3bc04b5fe5d86a77925ae6524a19b816ae38ce1e426255f1d8a31"
-dependencies = [
- "bytes",
- "getrandom 0.3.4",
- "lru-slab",
- "rand",
- "ring",
- "rustc-hash",
- "rustls",
- "rustls-pki-types",
- "slab",
- "thiserror 2.0.18",
- "tinyvec",
- "tracing",
- "web-time",
-]
-
-[[package]]
-name = "quinn-udp"
-version = "0.5.14"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "addec6a0dcad8a8d96a771f815f0eaf55f9d1805756410b39f5fa81332574cbd"
-dependencies = [
- "cfg_aliases",
- "libc",
- "once_cell",
- "socket2 0.6.1",
- "tracing",
- "windows-sys 0.60.2",
-]
-
-[[package]]
-name = "quote"
-version = "1.0.43"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "dc74d9a594b72ae6656596548f56f667211f8a97b3d4c3d467150794690dc40a"
-dependencies = [
- "proc-macro2",
-]
-
-[[package]]
-name = "r-efi"
-version = "5.3.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "69cdb34c158ceb288df11e18b4bd39de994f6657d83847bdffdbd7f346754b0f"
-
-[[package]]
-name = "rand"
-version = "0.9.2"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "6db2770f06117d490610c7488547d543617b21bfa07796d7a12f6f1bd53850d1"
-dependencies = [
- "rand_chacha",
- "rand_core 0.9.5",
-]
-
-[[package]]
-name = "rand_chacha"
-version = "0.9.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "d3022b5f1df60f26e1ffddd6c66e8aa15de382ae63b3a0c1bfc0e4d3e3f325cb"
-dependencies = [
- "ppv-lite86",
- "rand_core 0.9.5",
-]
-
-[[package]]
-name = "rand_core"
-version = "0.6.4"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "ec0be4795e2f6a28069bec0b5ff3e2ac9bafc99e6a9a7dc3547996c5c816922c"
-dependencies = [
- "getrandom 0.2.17",
-]
-
-[[package]]
-name = "rand_core"
-version = "0.9.5"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "76afc826de14238e6e8c374ddcc1fa19e374fd8dd986b0d2af0d02377261d83c"
-dependencies = [
- "getrandom 0.3.4",
-]
-
-[[package]]
-name = "redox_syscall"
-version = "0.5.18"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "ed2bf2547551a7053d6fdfafda3f938979645c44812fbfcda098faae3f1a362d"
-dependencies = [
- "bitflags",
-]
-
-[[package]]
-name = "redox_users"
-version = "0.4.6"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "ba009ff324d1fc1b900bd1fdb31564febe58a8ccc8a6fdbb93b543d33b13ca43"
-dependencies = [
- "getrandom 0.2.17",
- "libredox",
- "thiserror 1.0.69",
-]
-
-[[package]]
-name = "regex"
-version = "1.12.2"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "843bc0191f75f3e22651ae5f1e72939ab2f72a4bc30fa80a066bd66edefc24d4"
-dependencies = [
- "aho-corasick",
- "memchr",
- "regex-automata",
- "regex-syntax",
-]
-
-[[package]]
-name = "regex-automata"
-version = "0.4.13"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "5276caf25ac86c8d810222b3dbb938e512c55c6831a10f3e6ed1c93b84041f1c"
-dependencies = [
- "aho-corasick",
- "memchr",
- "regex-syntax",
-]
-
-[[package]]
-name = "regex-syntax"
-version = "0.8.8"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "7a2d987857b319362043e95f5353c0535c1f58eec5336fdfcf626430af7def58"
-
-[[package]]
-name = "reqwest"
-version = "0.12.28"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "eddd3ca559203180a307f12d114c268abf583f59b03cb906fd0b3ff8646c1147"
-dependencies = [
- "base64 0.22.1",
- "bytes",
- "encoding_rs",
- "futures-channel",
- "futures-core",
- "futures-util",
- "h2",
- "http 1.4.0",
- "http-body 1.0.1",
- "http-body-util",
- "hyper 1.8.1",
- "hyper-rustls",
- "hyper-util",
- "js-sys",
- "log",
- "mime",
- "percent-encoding",
- "pin-project-lite",
- "quinn",
- "rustls",
- "rustls-native-certs",
- "rustls-pki-types",
- "serde",
- "serde_json",
- "serde_urlencoded",
- "sync_wrapper",
- "tokio",
- "tokio-rustls",
- "tower",
- "tower-http",
- "tower-service",
- "url",
- "wasm-bindgen",
- "wasm-bindgen-futures",
- "web-sys",
-]
-
-[[package]]
-name = "ring"
-version = "0.17.14"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "a4689e6c2294d81e88dc6261c768b63bc4fcdb852be6d1352498b114f61383b7"
-dependencies = [
- "cc",
- "cfg-if",
- "getrandom 0.2.17",
- "libc",
- "untrusted",
- "windows-sys 0.52.0",
-]
-
-[[package]]
-name = "rsqlite-vfs"
-version = "0.1.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "a8a1f2315036ef6b1fbacd1972e8ee7688030b0a2121edfc2a6550febd41574d"
-dependencies = [
- "hashbrown",
- "thiserror 2.0.18",
-]
-
-[[package]]
-name = "rusqlite"
-version = "0.38.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "f1c93dd1c9683b438c392c492109cb702b8090b2bfc8fed6f6e4eb4523f17af3"
-dependencies = [
- "bitflags",
- "fallible-iterator",
- "fallible-streaming-iterator",
- "hashlink",
- "libsqlite3-sys",
- "smallvec",
- "sqlite-wasm-rs",
-]
-
-[[package]]
-name = "rustc-hash"
-version = "2.1.1"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "357703d41365b4b27c590e3ed91eabb1b663f07c4c084095e60cbed4362dff0d"
-
-[[package]]
-name = "rustc_version"
-version = "0.4.1"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "cfcb3a22ef46e85b45de6ee7e79d063319ebb6594faafcf1c225ea92ab6e9b92"
-dependencies = [
- "semver",
-]
-
-[[package]]
-name = "rustix"
-version = "1.1.3"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "146c9e247ccc180c1f61615433868c99f3de3ae256a30a43b49f67c2d9171f34"
-dependencies = [
- "bitflags",
- "errno",
- "libc",
- "linux-raw-sys",
- "windows-sys 0.61.2",
-]
-
-[[package]]
-name = "rustls"
-version = "0.23.36"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "c665f33d38cea657d9614f766881e4d510e0eda4239891eea56b4cadcf01801b"
-dependencies = [
- "once_cell",
- "ring",
- "rustls-pki-types",
- "rustls-webpki",
- "subtle",
- "zeroize",
-]
-
-[[package]]
-name = "rustls-native-certs"
-version = "0.8.3"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "612460d5f7bea540c490b2b6395d8e34a953e52b491accd6c86c8164c5932a63"
-dependencies = [
- "openssl-probe",
- "rustls-pki-types",
- "schannel",
- "security-framework",
-]
-
-[[package]]
-name = "rustls-pki-types"
-version = "1.14.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "be040f8b0a225e40375822a563fa9524378b9d63112f53e19ffff34df5d33fdd"
-dependencies = [
- "web-time",
- "zeroize",
-]
-
-[[package]]
-name = "rustls-webpki"
-version = "0.103.9"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "d7df23109aa6c1567d1c575b9952556388da57401e4ace1d15f79eedad0d8f53"
-dependencies = [
- "ring",
- "rustls-pki-types",
- "untrusted",
-]
-
-[[package]]
-name = "rustversion"
-version = "1.0.22"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "b39cdef0fa800fc44525c84ccb54a029961a8215f9619753635a9c0d2538d46d"
-
-[[package]]
-name = "ryu"
-version = "1.0.22"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "a50f4cf475b65d88e057964e0e9bb1f0aa9bbb2036dc65c64596b42932536984"
-
-[[package]]
-name = "salsa20"
-version = "0.10.2"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "97a22f5af31f73a954c10289c93e8a50cc23d971e80ee446f1f6f7137a088213"
-dependencies = [
- "cipher",
-]
-
-[[package]]
-name = "same-file"
-version = "1.0.6"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "93fc1dc3aaa9bfed95e02e6eadabb4baf7e3078b0bd1b4d7b6b0b68378900502"
-dependencies = [
- "winapi-util",
-]
-
-[[package]]
-name = "schannel"
-version = "0.1.28"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "891d81b926048e76efe18581bf793546b4c0eaf8448d72be8de2bbee5fd166e1"
-dependencies = [
- "windows-sys 0.61.2",
-]
-
-[[package]]
-name = "scopeguard"
-version = "1.2.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "94143f37725109f92c262ed2cf5e59bce7498c01bcc1502d7b9afe439a4e9f49"
-
-[[package]]
-name = "security-framework"
-version = "3.5.1"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "b3297343eaf830f66ede390ea39da1d462b6b0c1b000f420d0a83f898bbbe6ef"
-dependencies = [
- "bitflags",
- "core-foundation 0.10.1",
- "core-foundation-sys",
- "libc",
- "security-framework-sys",
-]
-
-[[package]]
-name = "security-framework-sys"
-version = "2.15.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "cc1f0cbffaac4852523ce30d8bd3c5cdc873501d96ff467ca09b6767bb8cd5c0"
-dependencies = [
- "core-foundation-sys",
- "libc",
-]
-
-[[package]]
-name = "semver"
-version = "1.0.27"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "d767eb0aabc880b29956c35734170f26ed551a859dbd361d140cdbeca61ab1e2"
-
-[[package]]
-name = "serde"
-version = "1.0.228"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "9a8e94ea7f378bd32cbbd37198a4a91436180c5bb472411e48b5ec2e2124ae9e"
-dependencies = [
- "serde_core",
- "serde_derive",
-]
-
-[[package]]
-name = "serde_core"
-version = "1.0.228"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "41d385c7d4ca58e59fc732af25c3983b67ac852c1a25000afe1175de458b67ad"
-dependencies = [
- "serde_derive",
-]
-
-[[package]]
-name = "serde_derive"
-version = "1.0.228"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "d540f220d3187173da220f885ab66608367b6574e925011a9353e4badda91d79"
-dependencies = [
- "proc-macro2",
- "quote",
- "syn 2.0.114",
-]
-
-[[package]]
-name = "serde_json"
-version = "1.0.149"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "83fc039473c5595ace860d8c4fafa220ff474b3fc6bfdb4293327f1a37e94d86"
-dependencies = [
- "itoa",
- "memchr",
- "serde",
- "serde_core",
- "zmij",
-]
-
-[[package]]
-name = "serde_regex"
-version = "1.1.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "a8136f1a4ea815d7eac4101cfd0b16dc0cb5e1fe1b8609dfd728058656b7badf"
-dependencies = [
- "regex",
- "serde",
-]
-
-[[package]]
-name = "serde_urlencoded"
-version = "0.7.1"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "d3491c14715ca2294c4d6a88f15e84739788c1d030eed8c110436aafdaa2f3fd"
-dependencies = [
- "form_urlencoded",
- "itoa",
- "ryu",
- "serde",
-]
-
-[[package]]
-name = "sha2"
-version = "0.10.9"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "a7507d819769d01a365ab707794a4084392c824f54a7a6a7862f8c3d0892b283"
-dependencies = [
- "cfg-if",
- "cpufeatures",
- "digest",
-]
-
-[[package]]
-name = "shlex"
-version = "1.3.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "0fda2ff0d084019ba4d7c6f371c95d8fd75ce3524c3cb8fb653a3023f6323e64"
-
-[[package]]
-name = "signal-hook-registry"
-version = "1.4.8"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "c4db69cba1110affc0e9f7bcd48bbf87b3f4fc7c61fc9155afd4c469eb3d6c1b"
-dependencies = [
- "errno",
- "libc",
-]
-
-[[package]]
-name = "similar"
-version = "2.7.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "bbbb5d9659141646ae647b42fe094daf6c6192d1620870b449d9557f748b2daa"
-
-[[package]]
-name = "siphasher"
-version = "1.0.2"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "b2aa850e253778c88a04c3d7323b043aeda9d3e30d5971937c1855769763678e"
-
-[[package]]
-name = "slab"
-version = "0.4.11"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "7a2ae44ef20feb57a68b23d846850f861394c2e02dc425a50098ae8c90267589"
-
-[[package]]
-name = "smallvec"
-version = "1.15.1"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "67b1b7a3b5fe4f1376887184045fcf45c69e92af734b7aaddc05fb777b6fbd03"
-
-[[package]]
-name = "socket2"
-version = "0.5.10"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "e22376abed350d73dd1cd119b57ffccad95b4e585a7cda43e286245ce23c0678"
-dependencies = [
- "libc",
- "windows-sys 0.52.0",
-]
-
-[[package]]
-name = "socket2"
-version = "0.6.1"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "17129e116933cf371d018bb80ae557e889637989d8638274fb25622827b03881"
-dependencies = [
- "libc",
- "windows-sys 0.60.2",
-]
-
-[[package]]
-name = "sqlite-wasm-rs"
-version = "0.5.2"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "2f4206ed3a67690b9c29b77d728f6acc3ce78f16bf846d83c94f76400320181b"
-dependencies = [
- "cc",
- "js-sys",
- "rsqlite-vfs",
- "wasm-bindgen",
-]
-
-[[package]]
-name = "stable_deref_trait"
-version = "1.2.1"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "6ce2be8dc25455e1f91df71bfa12ad37d7af1092ae736f3a6cd0e37bc7810596"
-
-[[package]]
-name = "string_cache"
-version = "0.8.9"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "bf776ba3fa74f83bf4b63c3dcbbf82173db2632ed8452cb2d891d33f459de70f"
-dependencies = [
- "new_debug_unreachable",
- "parking_lot",
- "phf_shared",
- "precomputed-hash",
-]
-
-[[package]]
-name = "subtle"
-version = "2.6.1"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "13c2bddecc57b384dee18652358fb23172facb8a2c51ccc10d74c157bdea3292"
-
-[[package]]
-name = "syn"
-version = "1.0.109"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "72b64191b275b66ffe2469e8af2c1cfe3bafa67b529ead792a6d0160888b4237"
-dependencies = [
- "proc-macro2",
- "quote",
- "unicode-ident",
-]
-
-[[package]]
-name = "syn"
-version = "2.0.114"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "d4d107df263a3013ef9b1879b0df87d706ff80f65a86ea879bd9c31f9b307c2a"
-dependencies = [
- "proc-macro2",
- "quote",
- "unicode-ident",
-]
-
-[[package]]
-name = "sync_wrapper"
-version = "1.0.2"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "0bf256ce5efdfa370213c1dabab5935a12e49f2c58d15e9eac2870d3b4f27263"
-dependencies = [
- "futures-core",
-]
-
-[[package]]
-name = "synstructure"
-version = "0.13.2"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "728a70f3dbaf5bab7f0c4b1ac8d7ae5ea60a4b5549c8a5914361c99147a709d2"
-dependencies = [
- "proc-macro2",
- "quote",
- "syn 2.0.114",
-]
-
-[[package]]
-name = "system-configuration"
-version = "0.6.1"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "3c879d448e9d986b661742763247d3693ed13609438cf3d006f51f5368a5ba6b"
-dependencies = [
- "bitflags",
- "core-foundation 0.9.4",
- "system-configuration-sys",
-]
-
-[[package]]
-name = "system-configuration-sys"
-version = "0.6.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "8e1d1b10ced5ca923a1fcb8d03e96b8d3268065d724548c0211415ff6ac6bac4"
-dependencies = [
- "core-foundation-sys",
- "libc",
-]
-
-[[package]]
-name = "tempfile"
-version = "3.24.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "655da9c7eb6305c55742045d5a8d2037996d61d8de95806335c7c86ce0f82e9c"
-dependencies = [
- "fastrand",
- "getrandom 0.3.4",
- "once_cell",
- "rustix",
- "windows-sys 0.61.2",
-]
-
-[[package]]
-name = "term"
-version = "0.7.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "c59df8ac95d96ff9bede18eb7300b0fda5e5d8d90960e76f8e14ae765eedbf1f"
-dependencies = [
- "dirs-next",
- "rustversion",
- "winapi",
-]
-
-[[package]]
-name = "thiserror"
-version = "1.0.69"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "b6aaf5339b578ea85b50e080feb250a3e8ae8cfcdff9a461c9ec2904bc923f52"
-dependencies = [
- "thiserror-impl 1.0.69",
-]
-
-[[package]]
-name = "thiserror"
-version = "2.0.18"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "4288b5bcbc7920c07a1149a35cf9590a2aa808e0bc1eafaade0b80947865fbc4"
-dependencies = [
- "thiserror-impl 2.0.18",
-]
-
-[[package]]
-name = "thiserror-impl"
-version = "1.0.69"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "4fee6c4efc90059e10f81e6d42c60a18f76588c3d74cb83a0b242a2b6c7504c1"
-dependencies = [
- "proc-macro2",
- "quote",
- "syn 2.0.114",
-]
-
-[[package]]
-name = "thiserror-impl"
-version = "2.0.18"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "ebc4ee7f67670e9b64d05fa4253e753e016c6c95ff35b89b7941d6b856dec1d5"
-dependencies = [
- "proc-macro2",
- "quote",
- "syn 2.0.114",
-]
-
-[[package]]
-name = "tiny-keccak"
-version = "2.0.2"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "2c9d3793400a45f954c52e73d068316d76b6f4e36977e3fcebb13a2721e80237"
-dependencies = [
- "crunchy",
-]
-
-[[package]]
-name = "tinystr"
-version = "0.8.2"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "42d3e9c45c09de15d06dd8acf5f4e0e399e85927b7f00711024eb7ae10fa4869"
-dependencies = [
- "displaydoc",
- "zerovec",
-]
-
-[[package]]
-name = "tinyvec"
-version = "1.10.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "bfa5fdc3bce6191a1dbc8c02d5c8bffcf557bafa17c124c5264a458f1b0613fa"
-dependencies = [
- "tinyvec_macros",
-]
-
-[[package]]
-name = "tinyvec_macros"
-version = "0.1.1"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "1f3ccbac311fea05f86f61904b462b55fb3df8837a366dfc601a0161d0532f20"
-
-[[package]]
-name = "tokio"
-version = "1.49.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "72a2903cd7736441aac9df9d7688bd0ce48edccaadf181c3b90be801e81d3d86"
-dependencies = [
- "bytes",
- "libc",
- "mio",
- "pin-project-lite",
- "signal-hook-registry",
- "socket2 0.6.1",
- "tokio-macros",
- "windows-sys 0.61.2",
-]
-
-[[package]]
-name = "tokio-macros"
-version = "2.6.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "af407857209536a95c8e56f8231ef2c2e2aff839b22e07a1ffcbc617e9db9fa5"
-dependencies = [
- "proc-macro2",
- "quote",
- "syn 2.0.114",
-]
-
-[[package]]
-name = "tokio-rustls"
-version = "0.26.4"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "1729aa945f29d91ba541258c8df89027d5792d85a8841fb65e8bf0f4ede4ef61"
-dependencies = [
- "rustls",
- "tokio",
-]
-
-[[package]]
-name = "tokio-util"
-version = "0.7.18"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "9ae9cec805b01e8fc3fd2fe289f89149a9b66dd16786abd8b19cfa7b48cb0098"
-dependencies = [
- "bytes",
- "futures-core",
- "futures-sink",
- "pin-project-lite",
- "tokio",
-]
-
-[[package]]
-name = "tower"
-version = "0.5.3"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "ebe5ef63511595f1344e2d5cfa636d973292adc0eec1f0ad45fae9f0851ab1d4"
-dependencies = [
- "futures-core",
- "futures-util",
- "pin-project-lite",
- "sync_wrapper",
- "tokio",
- "tower-layer",
- "tower-service",
-]
-
-[[package]]
-name = "tower-http"
-version = "0.6.8"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "d4e6559d53cc268e5031cd8429d05415bc4cb4aefc4aa5d6cc35fbf5b924a1f8"
-dependencies = [
- "bitflags",
- "bytes",
- "futures-util",
- "http 1.4.0",
- "http-body 1.0.1",
- "iri-string",
- "pin-project-lite",
- "tower",
- "tower-layer",
- "tower-service",
-]
-
-[[package]]
-name = "tower-layer"
-version = "0.3.3"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "121c2a6cda46980bb0fcd1647ffaf6cd3fc79a013de288782836f6df9c48780e"
-
-[[package]]
-name = "tower-service"
-version = "0.3.3"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "8df9b6e13f2d32c91b9bd719c00d1958837bc7dec474d94952798cc8e69eeec3"
-
-[[package]]
-name = "tracing"
-version = "0.1.44"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "63e71662fa4b2a2c3a26f570f037eb95bb1f85397f3cd8076caed2f026a6d100"
-dependencies = [
- "pin-project-lite",
- "tracing-core",
-]
-
-[[package]]
-name = "tracing-core"
-version = "0.1.36"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "db97caf9d906fbde555dd62fa95ddba9eecfd14cb388e4f491a66d74cd5fb79a"
-dependencies = [
- "once_cell",
-]
-
-[[package]]
-name = "try-lock"
-version = "0.2.5"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "e421abadd41a4225275504ea4d6566923418b7f05506fbc9c0fe86ba7396114b"
-
-[[package]]
-name = "typenum"
-version = "1.19.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "562d481066bde0658276a35467c4af00bdc6ee726305698a55b86e61d7ad82bb"
-
-[[package]]
-name = "unicode-ident"
-version = "1.0.22"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "9312f7c4f6ff9069b165498234ce8be658059c6728633667c526e27dc2cf1df5"
-
-[[package]]
-name = "unicode-xid"
-version = "0.2.6"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "ebc1c04c71510c7f702b52b7c350734c9ff1295c464a03335b00bb84fc54f853"
-
-[[package]]
-name = "universal-hash"
-version = "0.5.1"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "fc1de2c688dc15305988b563c3854064043356019f97a4b46276fe734c4f07ea"
-dependencies = [
- "crypto-common",
- "subtle",
-]
-
-[[package]]
-name = "untrusted"
-version = "0.9.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "8ecb6da28b8a351d773b68d5825ac39017e680750f980f3a1a85cd8dd28a47c1"
-
-[[package]]
-name = "url"
-version = "2.5.8"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "ff67a8a4397373c3ef660812acab3268222035010ab8680ec4215f38ba3d0eed"
-dependencies = [
- "form_urlencoded",
- "idna",
- "percent-encoding",
- "serde",
-]
-
-[[package]]
-name = "utf8_iter"
-version = "1.0.4"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "b6c140620e7ffbb22c2dee59cafe6084a59b5ffc27a8859a5f0d494b5d52b6be"
-
-[[package]]
-name = "uuid"
-version = "1.19.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "e2e054861b4bd027cd373e18e8d8d8e6548085000e41290d95ce0c373a654b4a"
-dependencies = [
- "getrandom 0.3.4",
- "js-sys",
- "uuid-rng-internal",
- "wasm-bindgen",
-]
-
-[[package]]
-name = "uuid-rng-internal"
-version = "1.19.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "8d0021aebf9af0cbec73af2f884a2cd0a41d984c00e42f27baa11856ab480e2c"
-dependencies = [
- "getrandom 0.3.4",
-]
-
-[[package]]
-name = "value-bag"
-version = "1.12.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "7ba6f5989077681266825251a52748b8c1d8a4ad098cc37e440103d0ea717fc0"
-
-[[package]]
-name = "vcpkg"
-version = "0.2.15"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "accd4ea62f7bb7a82fe23066fb0957d48ef677f6eeb8215f372f52e48bb32426"
-
-[[package]]
-name = "version_check"
-version = "0.9.5"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "0b928f33d975fc6ad9f86c8f283853ad26bdd5b10b7f1542aa2fa15e2289105a"
-
-[[package]]
-name = "walkdir"
-version = "2.5.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "29790946404f91d9c5d06f9874efddea1dc06c5efe94541a7d6863108e3a5e4b"
-dependencies = [
- "same-file",
- "winapi-util",
-]
-
-[[package]]
-name = "want"
-version = "0.3.1"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "bfa7760aed19e106de2c7c0b581b509f2f25d3dacaf737cb82ac61bc6d760b0e"
-dependencies = [
- "try-lock",
-]
-
-[[package]]
-name = "wasi"
-version = "0.11.1+wasi-snapshot-preview1"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "ccf3ec651a847eb01de73ccad15eb7d99f80485de043efb2f370cd654f4ea44b"
-
-[[package]]
-name = "wasip2"
-version = "1.0.2+wasi-0.2.9"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "9517f9239f02c069db75e65f174b3da828fe5f5b945c4dd26bd25d89c03ebcf5"
-dependencies = [
- "wit-bindgen",
-]
-
-[[package]]
-name = "wasm-bindgen"
-version = "0.2.108"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "64024a30ec1e37399cf85a7ffefebdb72205ca1c972291c51512360d90bd8566"
-dependencies = [
- "cfg-if",
- "once_cell",
- "rustversion",
- "wasm-bindgen-macro",
- "wasm-bindgen-shared",
-]
-
-[[package]]
-name = "wasm-bindgen-futures"
-version = "0.4.58"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "70a6e77fd0ae8029c9ea0063f87c46fde723e7d887703d74ad2616d792e51e6f"
-dependencies = [
- "cfg-if",
- "futures-util",
- "js-sys",
- "once_cell",
- "wasm-bindgen",
- "web-sys",
-]
-
-[[package]]
-name = "wasm-bindgen-macro"
-version = "0.2.108"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "008b239d9c740232e71bd39e8ef6429d27097518b6b30bdf9086833bd5b6d608"
-dependencies = [
- "quote",
- "wasm-bindgen-macro-support",
-]
-
-[[package]]
-name = "wasm-bindgen-macro-support"
-version = "0.2.108"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "5256bae2d58f54820e6490f9839c49780dff84c65aeab9e772f15d5f0e913a55"
-dependencies = [
- "bumpalo",
- "proc-macro2",
- "quote",
- "syn 2.0.114",
- "wasm-bindgen-shared",
-]
-
-[[package]]
-name = "wasm-bindgen-shared"
-version = "0.2.108"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "1f01b580c9ac74c8d8f0c0e4afb04eeef2acf145458e52c03845ee9cd23e3d12"
-dependencies = [
- "unicode-ident",
-]
-
-[[package]]
-name = "web-sys"
-version = "0.3.85"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "312e32e551d92129218ea9a2452120f4aabc03529ef03e4d0d82fb2780608598"
-dependencies = [
- "js-sys",
- "wasm-bindgen",
-]
-
-[[package]]
-name = "web-time"
-version = "1.1.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "5a6580f308b1fad9207618087a65c04e7a10bc77e02c8e84e9b00dd4b12fa0bb"
-dependencies = [
- "js-sys",
- "wasm-bindgen",
-]
-
-[[package]]
-name = "winapi"
-version = "0.3.9"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "5c839a674fcd7a98952e593242ea400abe93992746761e38641405d28b00f419"
-dependencies = [
- "winapi-i686-pc-windows-gnu",
- "winapi-x86_64-pc-windows-gnu",
-]
-
-[[package]]
-name = "winapi-i686-pc-windows-gnu"
-version = "0.4.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "ac3b87c63620426dd9b991e5ce0329eff545bccbbb34f3be09ff6fb6ab51b7b6"
-
-[[package]]
-name = "winapi-util"
-version = "0.1.11"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "c2a7b1c03c876122aa43f3020e6c3c3ee5c05081c9a00739faf7503aeba10d22"
-dependencies = [
- "windows-sys 0.61.2",
-]
-
-[[package]]
-name = "winapi-x86_64-pc-windows-gnu"
-version = "0.4.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f"
-
-[[package]]
-name = "windows-link"
-version = "0.2.1"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "f0805222e57f7521d6a62e36fa9163bc891acd422f971defe97d64e70d0a4fe5"
-
-[[package]]
-name = "windows-registry"
-version = "0.6.1"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "02752bf7fbdcce7f2a27a742f798510f3e5ad88dbe84871e5168e2120c3d5720"
-dependencies = [
- "windows-link",
- "windows-result",
- "windows-strings",
-]
-
-[[package]]
-name = "windows-result"
-version = "0.4.1"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "7781fa89eaf60850ac3d2da7af8e5242a5ea78d1a11c49bf2910bb5a73853eb5"
-dependencies = [
- "windows-link",
-]
-
-[[package]]
-name = "windows-strings"
-version = "0.5.1"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "7837d08f69c77cf6b07689544538e017c1bfcf57e34b4c0ff58e6c2cd3b37091"
-dependencies = [
- "windows-link",
-]
-
-[[package]]
-name = "windows-sys"
-version = "0.52.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "282be5f36a8ce781fad8c8ae18fa3f9beff57ec1b52cb3de0789201425d9a33d"
-dependencies = [
- "windows-targets 0.52.6",
-]
-
-[[package]]
-name = "windows-sys"
-version = "0.60.2"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "f2f500e4d28234f72040990ec9d39e3a6b950f9f22d3dba18416c35882612bcb"
-dependencies = [
- "windows-targets 0.53.5",
-]
-
-[[package]]
-name = "windows-sys"
-version = "0.61.2"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "ae137229bcbd6cdf0f7b80a31df61766145077ddf49416a728b02cb3921ff3fc"
-dependencies = [
- "windows-link",
-]
-
-[[package]]
-name = "windows-targets"
-version = "0.52.6"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "9b724f72796e036ab90c1021d4780d4d3d648aca59e491e6b98e725b84e99973"
-dependencies = [
- "windows_aarch64_gnullvm 0.52.6",
- "windows_aarch64_msvc 0.52.6",
- "windows_i686_gnu 0.52.6",
- "windows_i686_gnullvm 0.52.6",
- "windows_i686_msvc 0.52.6",
- "windows_x86_64_gnu 0.52.6",
- "windows_x86_64_gnullvm 0.52.6",
- "windows_x86_64_msvc 0.52.6",
-]
-
-[[package]]
-name = "windows-targets"
-version = "0.53.5"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "4945f9f551b88e0d65f3db0bc25c33b8acea4d9e41163edf90dcd0b19f9069f3"
-dependencies = [
- "windows-link",
- "windows_aarch64_gnullvm 0.53.1",
- "windows_aarch64_msvc 0.53.1",
- "windows_i686_gnu 0.53.1",
- "windows_i686_gnullvm 0.53.1",
- "windows_i686_msvc 0.53.1",
- "windows_x86_64_gnu 0.53.1",
- "windows_x86_64_gnullvm 0.53.1",
- "windows_x86_64_msvc 0.53.1",
-]
-
-[[package]]
-name = "windows_aarch64_gnullvm"
-version = "0.52.6"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "32a4622180e7a0ec044bb555404c800bc9fd9ec262ec147edd5989ccd0c02cd3"
-
-[[package]]
-name = "windows_aarch64_gnullvm"
-version = "0.53.1"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "a9d8416fa8b42f5c947f8482c43e7d89e73a173cead56d044f6a56104a6d1b53"
-
-[[package]]
-name = "windows_aarch64_msvc"
-version = "0.52.6"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "09ec2a7bb152e2252b53fa7803150007879548bc709c039df7627cabbd05d469"
-
-[[package]]
-name = "windows_aarch64_msvc"
-version = "0.53.1"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "b9d782e804c2f632e395708e99a94275910eb9100b2114651e04744e9b125006"
-
-[[package]]
-name = "windows_i686_gnu"
-version = "0.52.6"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "8e9b5ad5ab802e97eb8e295ac6720e509ee4c243f69d781394014ebfe8bbfa0b"
-
-[[package]]
-name = "windows_i686_gnu"
-version = "0.53.1"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "960e6da069d81e09becb0ca57a65220ddff016ff2d6af6a223cf372a506593a3"
-
-[[package]]
-name = "windows_i686_gnullvm"
-version = "0.52.6"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "0eee52d38c090b3caa76c563b86c3a4bd71ef1a819287c19d586d7334ae8ed66"
-
-[[package]]
-name = "windows_i686_gnullvm"
-version = "0.53.1"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "fa7359d10048f68ab8b09fa71c3daccfb0e9b559aed648a8f95469c27057180c"
-
-[[package]]
-name = "windows_i686_msvc"
-version = "0.52.6"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "240948bc05c5e7c6dabba28bf89d89ffce3e303022809e73deaefe4f6ec56c66"
-
-[[package]]
-name = "windows_i686_msvc"
-version = "0.53.1"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "1e7ac75179f18232fe9c285163565a57ef8d3c89254a30685b57d83a38d326c2"
-
-[[package]]
-name = "windows_x86_64_gnu"
-version = "0.52.6"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "147a5c80aabfbf0c7d901cb5895d1de30ef2907eb21fbbab29ca94c5b08b1a78"
-
-[[package]]
-name = "windows_x86_64_gnu"
-version = "0.53.1"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "9c3842cdd74a865a8066ab39c8a7a473c0778a3f29370b5fd6b4b9aa7df4a499"
-
-[[package]]
-name = "windows_x86_64_gnullvm"
-version = "0.52.6"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "24d5b23dc417412679681396f2b49f3de8c1473deb516bd34410872eff51ed0d"
-
-[[package]]
-name = "windows_x86_64_gnullvm"
-version = "0.53.1"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "0ffa179e2d07eee8ad8f57493436566c7cc30ac536a3379fdf008f47f6bb7ae1"
-
-[[package]]
-name = "windows_x86_64_msvc"
-version = "0.52.6"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "589f6da84c646204747d1270a2a5661ea66ed1cced2631d546fdfb155959f9ec"
-
-[[package]]
-name = "windows_x86_64_msvc"
-version = "0.53.1"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "d6bbff5f0aada427a1e5a6da5f1f98158182f26556f345ac9e04d36d0ebed650"
-
-[[package]]
-name = "wit-bindgen"
-version = "0.51.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "d7249219f66ced02969388cf2bb044a09756a083d0fab1e566056b04d9fbcaa5"
-
-[[package]]
-name = "writeable"
-version = "0.6.2"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "9edde0db4769d2dc68579893f2306b26c6ecfbe0ef499b013d731b7b9247e0b9"
-
-[[package]]
-name = "x25519-dalek"
-version = "2.0.1"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "c7e468321c81fb07fa7f4c636c3972b9100f0346e5b6a9f2bd0603a52f7ed277"
-dependencies = [
- "curve25519-dalek",
- "rand_core 0.6.4",
- "serde",
- "zeroize",
-]
-
-[[package]]
-name = "xsalsa20poly1305"
-version = "0.9.1"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "02a6dad357567f81cd78ee75f7c61f1b30bb2fe4390be8fb7c69e2ac8dffb6c7"
-dependencies = [
- "aead",
- "poly1305",
- "salsa20",
- "subtle",
- "zeroize",
-]
-
-[[package]]
-name = "yoke"
-version = "0.8.1"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "72d6e5c6afb84d73944e5cedb052c4680d5657337201555f9f2a16b7406d4954"
-dependencies = [
- "stable_deref_trait",
- "yoke-derive",
- "zerofrom",
-]
-
-[[package]]
-name = "yoke-derive"
-version = "0.8.1"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "b659052874eb698efe5b9e8cf382204678a0086ebf46982b79d6ca3182927e5d"
-dependencies = [
- "proc-macro2",
- "quote",
- "syn 2.0.114",
- "synstructure",
-]
-
-[[package]]
-name = "zerocopy"
-version = "0.8.33"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "668f5168d10b9ee831de31933dc111a459c97ec93225beb307aed970d1372dfd"
-dependencies = [
- "zerocopy-derive",
-]
-
-[[package]]
-name = "zerocopy-derive"
-version = "0.8.33"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "2c7962b26b0a8685668b671ee4b54d007a67d4eaf05fda79ac0ecf41e32270f1"
-dependencies = [
- "proc-macro2",
- "quote",
- "syn 2.0.114",
-]
-
-[[package]]
-name = "zerofrom"
-version = "0.1.6"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "50cc42e0333e05660c3587f3bf9d0478688e15d870fab3346451ce7f8c9fbea5"
-dependencies = [
- "zerofrom-derive",
-]
-
-[[package]]
-name = "zerofrom-derive"
-version = "0.1.6"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "d71e5d6e06ab090c67b5e44993ec16b72dcbaabc526db883a360057678b48502"
-dependencies = [
- "proc-macro2",
- "quote",
- "syn 2.0.114",
- "synstructure",
-]
-
-[[package]]
-name = "zeroize"
-version = "1.8.2"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "b97154e67e32c85465826e8bcc1c59429aaaf107c1e4a9e53c8d8ccd5eff88d0"
-dependencies = [
- "zeroize_derive",
-]
-
-[[package]]
-name = "zeroize_derive"
-version = "1.4.3"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "85a5b4158499876c763cb03bc4e49185d3cccbabb15b33c627f7884f43db852e"
-dependencies = [
- "proc-macro2",
- "quote",
- "syn 2.0.114",
-]
-
-[[package]]
-name = "zerotrie"
-version = "0.2.3"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "2a59c17a5562d507e4b54960e8569ebee33bee890c70aa3fe7b97e85a9fd7851"
-dependencies = [
- "displaydoc",
- "yoke",
- "zerofrom",
-]
-
-[[package]]
-name = "zerovec"
-version = "0.11.5"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "6c28719294829477f525be0186d13efa9a3c602f7ec202ca9e353d310fb9a002"
-dependencies = [
- "yoke",
- "zerofrom",
- "zerovec-derive",
-]
-
-[[package]]
-name = "zerovec-derive"
-version = "0.11.2"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "eadce39539ca5cb3985590102671f2567e659fca9666581ad3411d59207951f3"
-dependencies = [
- "proc-macro2",
- "quote",
- "syn 2.0.114",
-]
-
-[[package]]
-name = "zmij"
-version = "1.0.16"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "dfcd145825aace48cff44a8844de64bf75feec3080e0aa5cdbde72961ae51a65"
diff --git a/rust/llmchat/sync/Cargo.toml b/rust/llmchat/sync/Cargo.toml
deleted file mode 100644
index aff7a8a8d8..0000000000
--- a/rust/llmchat/sync/Cargo.toml
+++ /dev/null
@@ -1,20 +0,0 @@
-[package]
-name = "llmchat-sync"
-version = "0.1.0"
-edition = "2024"
-
-[dependencies]
-llmchat-db = { path = "../db" }
-ente-core = { path = "../../core" }
-reqwest = { version = "0.12", default-features = false, features = ["json", "blocking", "http2", "charset", "system-proxy", "rustls-tls-native-roots"] }
-serde = { version = "1", features = ["derive"] }
-serde_json = "1"
-thiserror = "2"
-uuid = { version = "1", features = ["v4", "rng-getrandom"] }
-hkdf = "0.12"
-sha2 = "0.10"
-zeroize = "1"
-
-[dev-dependencies]
-httpmock = "0.7"
-tempfile = "3"
diff --git a/rust/llmchat/sync/src/conflict.rs b/rust/llmchat/sync/src/conflict.rs
deleted file mode 100644
index dc3a3e4240..0000000000
--- a/rust/llmchat/sync/src/conflict.rs
+++ /dev/null
@@ -1,239 +0,0 @@
-use std::collections::{HashMap, HashSet};
-
-use llmchat_db::{AttachmentMeta, Message, Sender};
-use uuid::Uuid;
-
-#[derive(Debug, Clone, Copy, PartialEq, Eq)]
-pub enum ConflictResolution {
- LocalWins,
- RemoteWins,
-}
-
-#[derive(Debug, Clone, Copy, PartialEq, Eq)]
-pub struct LocalSyncState {
- pub uuid: Uuid,
- pub needs_sync: bool,
- pub server_updated_at: Option<i64>,
-}
-
-pub fn resolve_session_conflict(
- local: LocalSyncState,
- remote_updated_at: i64,
- remote_uuid: Uuid,
-) -> ConflictResolution {
- if local.needs_sync && local.server_updated_at.is_none() {
- return ConflictResolution::LocalWins;
- }
-
- let local_ts = local.server_updated_at.unwrap_or(0);
- if local_ts > remote_updated_at {
- ConflictResolution::LocalWins
- } else if local_ts < remote_updated_at {
- ConflictResolution::RemoteWins
- } else if local.uuid > remote_uuid {
- ConflictResolution::LocalWins
- } else {
- ConflictResolution::RemoteWins
- }
-}
-
-pub fn should_accept_remote_session(
- local: LocalSyncState,
- remote_updated_at: i64,
- remote_uuid: Uuid,
-) -> bool {
- resolve_session_conflict(local, remote_updated_at, remote_uuid)
- == ConflictResolution::RemoteWins
-}
-
-pub fn resolve_message_conflict(
- local: LocalSyncState,
- remote_updated_at: i64,
- remote_uuid: Uuid,
-) -> ConflictResolution {
- if local.needs_sync && local.server_updated_at.is_none() {
- return ConflictResolution::LocalWins;
- }
-
- let local_ts = local.server_updated_at.unwrap_or(0);
- if local_ts > remote_updated_at {
- ConflictResolution::LocalWins
- } else if local_ts < remote_updated_at {
- ConflictResolution::RemoteWins
- } else if local.uuid > remote_uuid {
- ConflictResolution::LocalWins
- } else {
- ConflictResolution::RemoteWins
- }
-}
-
-pub fn should_accept_remote_message(
- local: LocalSyncState,
- remote_updated_at: i64,
- remote_uuid: Uuid,
-) -> bool {
- resolve_message_conflict(local, remote_updated_at, remote_uuid)
- == ConflictResolution::RemoteWins
-}
-
-pub fn find_duplicate_message(
- local_messages: &[Message],
- sender: &Sender,
- text: &str,
- attachments: &[AttachmentMeta],
- created_at: i64,
- parent: Option<Uuid>,
-) -> Option<Uuid> {
- let signature = attachments_signature(attachments);
- local_messages.iter().find_map(|message| {
- if &message.sender != sender {
- return None;
- }
- if message.text != text {
- return None;
- }
- if message.parent_message_uuid != parent {
- return None;
- }
- if attachments_signature(&message.attachments) != signature {
- return None;
- }
- if (message.created_at - created_at).abs() > 2_000_000 {
- return None;
- }
- Some(message.uuid)
- })
-}
-
-pub fn order_for_sync(messages: &[Message]) -> Vec<Message> {
- if messages.is_empty() {
- return Vec::new();
- }
-
- let by_id: HashMap<Uuid, &Message> = messages.iter().map(|m| (m.uuid, m)).collect();
- let mut children: HashMap<Option<Uuid>, Vec<&Message>> = HashMap::new();
-
- for message in messages {
- let parent = message
- .parent_message_uuid
- .filter(|parent| by_id.contains_key(parent));
- children.entry(parent).or_default().push(message);
- }
-
- for list in children.values_mut() {
- list.sort_by(|a, b| {
- a.created_at
- .cmp(&b.created_at)
- .then_with(|| a.uuid.cmp(&b.uuid))
- });
- }
-
- let mut ordered = Vec::with_capacity(messages.len());
- let mut visited = HashSet::new();
-
- if let Some(roots) = children.get(&None) {
- for root in roots {
- dfs_order(*root, &children, &mut visited, &mut ordered);
- }
- }
-
- ordered
-}
-
-fn dfs_order(
- node: &Message,
- children: &HashMap<Option<Uuid>, Vec<&Message>>,
- visited: &mut HashSet<Uuid>,
- output: &mut Vec<Message>,
-) {
- if !visited.insert(node.uuid) {
- return;
- }
- output.push(node.clone());
- if let Some(kids) = children.get(&Some(node.uuid)) {
- for child in kids {
- dfs_order(*child, children, visited, output);
- }
- }
-}
-
-fn attachments_signature(attachments: &[AttachmentMeta]) -> Vec<String> {
- attachments
- .iter()
- .map(|att| format!("{:?}:{}:{}", att.kind, att.name, att.size))
- .collect()
-}
-
-#[cfg(test)]
-mod tests {
- use super::*;
- use llmchat_db::{AttachmentKind, AttachmentMeta, Message, Sender};
- use uuid::Uuid;
-
- #[test]
- fn duplicate_message_respects_parent_and_attachment_size() {
- let session_uuid = Uuid::new_v4();
- let parent_uuid = Uuid::new_v4();
- let message_uuid = Uuid::new_v4();
- let attachment = AttachmentMeta {
- id: "att-1".to_string(),
- kind: AttachmentKind::Image,
- size: 512,
- name: "photo.png".to_string(),
- };
-
- let local = Message {
- uuid: message_uuid,
- session_uuid,
- parent_message_uuid: Some(parent_uuid),
- sender: Sender::SelfUser,
- text: "hello".to_string(),
- attachments: vec![attachment.clone()],
- created_at: 10_000,
- remote_id: None,
- server_updated_at: None,
- needs_sync: true,
- deleted_at: None,
- };
-
- let wrong_size = AttachmentMeta {
- size: 256,
- ..attachment.clone()
- };
- assert!(
- find_duplicate_message(
- &[local.clone()],
- &Sender::SelfUser,
- "hello",
- &[wrong_size],
- 10_000,
- Some(parent_uuid),
- )
- .is_none()
- );
-
- assert!(
- find_duplicate_message(
- &[local.clone()],
- &Sender::SelfUser,
- "hello",
- &[attachment.clone()],
- 10_000,
- None,
- )
- .is_none()
- );
-
- assert_eq!(
- find_duplicate_message(
- &[local],
- &Sender::SelfUser,
- "hello",
- &[attachment],
- 10_000,
- Some(parent_uuid),
- ),
- Some(message_uuid)
- );
- }
-}
diff --git a/rust/llmchat/sync/src/crypto.rs b/rust/llmchat/sync/src/crypto.rs
deleted file mode 100644
index 30b3c57e46..0000000000
--- a/rust/llmchat/sync/src/crypto.rs
+++ /dev/null
@@ -1,76 +0,0 @@
-use ente_core::crypto::{self, blob};
-use hkdf::Hkdf;
-use serde::{Serialize, de::DeserializeOwned};
-use sha2::Sha256;
-use uuid::Uuid;
-
-use crate::errors::SyncError;
-use crate::models::EncryptedPayload;
-
-pub fn encrypt_payload<T: Serialize>(
- payload: &T,
- key: &[u8],
-) -> Result<EncryptedPayload, SyncError> {
- let json = serde_json::to_vec(payload)?;
- let encrypted = blob::encrypt(&json, key)?;
- Ok(EncryptedPayload {
- encrypted_data: crypto::encode_b64(&encrypted.encrypted_data),
- header: crypto::encode_b64(&encrypted.decryption_header),
- })
-}
-
-pub fn decrypt_payload<T: DeserializeOwned>(
- encrypted_data: &str,
- header: &str,
- key: &[u8],
-) -> Result<T, SyncError> {
- let ciphertext = crypto::decode_b64(encrypted_data)?;
- let header = crypto::decode_b64(header)?;
- let plaintext = blob::decrypt(&ciphertext, &header, key)?;
- let payload = serde_json::from_slice(&plaintext)?;
- Ok(payload)
-}
-
-pub fn encrypt_chat_key(chat_key: &[u8], master_key: &[u8]) -> Result<EncryptedPayload, SyncError> {
- let encrypted = blob::encrypt(chat_key, master_key)?;
- Ok(EncryptedPayload {
- encrypted_data: crypto::encode_b64(&encrypted.encrypted_data),
- header: crypto::encode_b64(&encrypted.decryption_header),
- })
-}
-
-pub fn decrypt_chat_key(
- payload: &EncryptedPayload,
- master_key: &[u8],
-) -> Result<Vec<u8>, SyncError> {
- let ciphertext = crypto::decode_b64(&payload.encrypted_data)?;
- let header = crypto::decode_b64(&payload.header)?;
- let plaintext = blob::decrypt(&ciphertext, &header, master_key)?;
- Ok(plaintext)
-}
-
-pub fn derive_attachment_key(chat_key: &[u8], session_uuid: Uuid) -> Result<Vec<u8>, SyncError> {
- let hk = Hkdf::<Sha256>::new(Some(session_uuid.as_bytes()), chat_key);
- let mut out = vec![0u8; blob::KEY_BYTES];
- hk.expand(b"llmchat_attachment_v1", &mut out)
- .map_err(|_| SyncError::Crypto("hkdf expand failed".to_string()))?;
- Ok(out)
-}
-
-pub fn encrypt_attachment_bytes(
- plaintext: &[u8],
- chat_key: &[u8],
- session_uuid: Uuid,
-) -> Result<Vec<u8>, SyncError> {
- let key = derive_attachment_key(chat_key, session_uuid)?;
- Ok(llmchat_db::crypto::encrypt_blob(plaintext, &key)?)
-}
-
-pub fn decrypt_attachment_bytes(
- ciphertext: &[u8],
- chat_key: &[u8],
- session_uuid: Uuid,
-) -> Result<Vec<u8>, SyncError> {
- let key = derive_attachment_key(chat_key, session_uuid)?;
- Ok(llmchat_db::crypto::decrypt_blob(ciphertext, &key)?)
-}
diff --git a/rust/llmchat/sync/src/diff_cursor.rs b/rust/llmchat/sync/src/diff_cursor.rs
deleted file mode 100644
index 7085c604c7..0000000000
--- a/rust/llmchat/sync/src/diff_cursor.rs
+++ /dev/null
@@ -1,36 +0,0 @@
-use serde::{Deserialize, Serialize};
-
-#[derive(Debug, Clone, Serialize, Deserialize, PartialEq, Eq, Hash)]
-#[serde(rename_all = "camelCase")]
-pub struct SyncCursor {
- #[serde(alias = "base_since_time")]
- pub base_since_time: i64,
- #[serde(alias = "since_time")]
- pub since_time: i64,
- #[serde(alias = "max_time")]
- pub max_time: i64,
- #[serde(alias = "since_type")]
- pub since_type: String,
- #[serde(alias = "since_id")]
- pub since_id: String,
-}
-
-impl Default for SyncCursor {
- fn default() -> Self {
- Self {
- base_since_time: 0,
- since_time: 0,
- max_time: 0,
- since_type: "sessions".to_string(),
- since_id: "00000000-0000-0000-0000-000000000000".to_string(),
- }
- }
-}
-
-impl SyncCursor {
- pub fn is_complete_cycle(&self) -> bool {
- self.since_type == "sessions"
- && self.since_time == self.base_since_time
- && self.since_time == self.max_time
- }
-}
diff --git a/rust/llmchat/sync/src/errors.rs b/rust/llmchat/sync/src/errors.rs
deleted file mode 100644
index aa04f3248d..0000000000
--- a/rust/llmchat/sync/src/errors.rs
+++ /dev/null
@@ -1,54 +0,0 @@
-use thiserror::Error;
-
-#[derive(Debug, Error)]
-pub enum SyncError {
- #[error("not logged in")]
- NotLoggedIn,
- #[error("unauthorized")]
- Unauthorized,
- #[error("db error: {0}")]
- Db(#[from] llmchat_db::Error),
- #[error("crypto error: {0}")]
- Crypto(String),
- #[error("http {status}: {message}")]
- Http {
- status: u16,
- message: String,
- code: Option<String>,
- },
- #[error("limit reached: {code}")]
- LimitReached {
- code: String,
- message: Option<String>,
- },
- #[error("attachment API unavailable")]
- AttachmentApiUnavailable,
- #[error("attachment missing: {0}")]
- AttachmentMissing(String),
- #[error("invalid response: {0}")]
- InvalidResponse(String),
- #[error("sync already in progress")]
- SyncInProgress,
- #[error("serde error: {0}")]
- Serde(String),
- #[error("io error: {0}")]
- Io(String),
-}
-
-impl From<ente_core::crypto::CryptoError> for SyncError {
- fn from(err: ente_core::crypto::CryptoError) -> Self {
- SyncError::Crypto(err.to_string())
- }
-}
-
-impl From<serde_json::Error> for SyncError {
- fn from(err: serde_json::Error) -> Self {
- SyncError::Serde(err.to_string())
- }
-}
-
-impl From<std::io::Error> for SyncError {
- fn from(err: std::io::Error) -> Self {
- SyncError::Io(err.to_string())
- }
-}
diff --git a/rust/llmchat/sync/src/http.rs b/rust/llmchat/sync/src/http.rs
deleted file mode 100644
index 98bc93f025..0000000000
--- a/rust/llmchat/sync/src/http.rs
+++ /dev/null
@@ -1,386 +0,0 @@
-use std::time::Duration;
-
-use reqwest::Url;
-use reqwest::blocking::{Client, Response};
-use reqwest::header::{HeaderMap, HeaderName, HeaderValue, LOCATION};
-use reqwest::redirect::Policy;
-use serde::Serialize;
-use serde::de::DeserializeOwned;
-use uuid::Uuid;
-
-use crate::errors::SyncError;
-
-const DEFAULT_BASE_URL: &str = "https://api.ente.io";
-
-#[derive(Debug, Clone)]
-pub struct HttpConfig {
- pub base_url: String,
- pub auth_token: String,
- pub user_agent: Option<String>,
- pub client_package: Option<String>,
- pub client_version: Option<String>,
- pub timeout_secs: Option<u64>,
-}
-
-pub struct HttpClient {
- base_url: String,
- base_origin: Url,
- client: Client,
- auth_token: String,
- user_agent: Option<String>,
- client_package: Option<String>,
- client_version: Option<String>,
-}
-
-impl HttpClient {
- pub fn new(config: HttpConfig) -> Result<Self, SyncError> {
- let base_url = config.base_url.trim_end_matches('/').to_string();
- let base_origin = Url::parse(&base_url)
- .map_err(|_| SyncError::InvalidResponse("invalid base url".to_string()))?;
- let is_http = base_url.starts_with("http://");
- let is_default = base_url.starts_with(DEFAULT_BASE_URL);
- let allow_insecure = is_http || !is_default;
-
- let mut builder = Client::builder().redirect(Policy::none());
- if let Some(timeout) = config.timeout_secs {
- builder = builder.timeout(Duration::from_secs(timeout));
- }
- if allow_insecure {
- builder = builder.danger_accept_invalid_certs(true);
- }
- let client = builder.build().map_err(|e| SyncError::Http {
- status: 0,
- message: e.to_string(),
- code: None,
- })?;
- Ok(Self {
- base_url,
- base_origin,
- client,
- auth_token: config.auth_token,
- user_agent: config.user_agent,
- client_package: config.client_package,
- client_version: config.client_version,
- })
- }
-
- pub fn get_json<T: DeserializeOwned>(
- &self,
- path: &str,
- query: &[(&str, String)],
- ) -> Result<T, SyncError> {
- let url = format!("{}{}", self.base_url, path);
- let resp = self
- .client
- .get(&url)
- .headers(self.build_headers())
- .query(query)
- .send()
- .map_err(map_reqwest_error)?;
- parse_json_response(resp)
- }
-
- pub fn get_json_optional<T: DeserializeOwned>(
- &self,
- path: &str,
- query: &[(&str, String)],
- ) -> Result<Option<T>, SyncError> {
- let url = format!("{}{}", self.base_url, path);
- let resp = self
- .client
- .get(&url)
- .headers(self.build_headers())
- .query(query)
- .send()
- .map_err(map_reqwest_error)?;
- if resp.status().as_u16() == 404 {
- return Ok(None);
- }
- parse_json_response(resp).map(Some)
- }
-
- pub fn post_json<T: DeserializeOwned, B: Serialize>(
- &self,
- path: &str,
- body: &B,
- ) -> Result<T, SyncError> {
- let url = format!("{}{}", self.base_url, path);
- let resp = self
- .client
- .post(&url)
- .headers(self.build_headers())
- .json(body)
- .send()
- .map_err(map_reqwest_error)?;
- parse_json_response(resp)
- }
-
- pub fn post_empty<B: Serialize>(&self, path: &str, body: &B) -> Result<(), SyncError> {
- let url = format!("{}{}", self.base_url, path);
- let resp = self
- .client
- .post(&url)
- .headers(self.build_headers())
- .json(body)
- .send()
- .map_err(map_reqwest_error)?;
- parse_empty_response(resp)
- }
-
- pub fn delete(&self, path: &str, query: &[(&str, String)]) -> Result<(), SyncError> {
- let url = format!("{}{}", self.base_url, path);
- let resp = self
- .client
- .delete(&url)
- .headers(self.build_headers())
- .query(query)
- .send()
- .map_err(map_reqwest_error)?;
- parse_empty_response(resp)
- }
-
- pub fn get_bytes(&self, url: &str) -> Result<Vec<u8>, SyncError> {
- let mut current_url = self.parse_url(url)?;
- for _ in 0..5 {
- let headers = self.build_headers_for_url(&current_url);
- let resp = self
- .client
- .get(current_url.clone())
- .headers(headers)
- .send()
- .map_err(map_reqwest_error)?;
- if resp.status().is_redirection() {
- if let Some(location) = resp.headers().get(LOCATION) {
- current_url = self.resolve_redirect(&current_url, location)?;
- continue;
- }
- }
- return parse_bytes_response(resp);
- }
- Err(SyncError::InvalidResponse("too many redirects".to_string()))
- }
-
- pub fn head_status(&self, path: &str) -> Result<u16, SyncError> {
- let url = format!("{}{}", self.base_url, path);
- self.head_status_url(&url)
- }
-
- fn head_status_url(&self, url: &str) -> Result<u16, SyncError> {
- let mut current_url = self.parse_url(url)?;
- for _ in 0..5 {
- let headers = self.build_headers_for_url(&current_url);
- let resp = self
- .client
- .head(current_url.clone())
- .headers(headers)
- .send()
- .map_err(map_reqwest_error)?;
- let status = resp.status().as_u16();
- if status == 401 {
- return Err(SyncError::Unauthorized);
- }
- if resp.status().is_redirection() {
- if let Some(location) = resp.headers().get(LOCATION) {
- current_url = self.resolve_redirect(&current_url, location)?;
- continue;
- }
- }
- return Ok(status);
- }
- Err(SyncError::InvalidResponse("too many redirects".to_string()))
- }
-
- pub fn put_bytes(
- &self,
- url: &str,
- body: &[u8],
- headers: &[(&str, String)],
- ) -> Result<(), SyncError> {
- let mut header_map = HeaderMap::new();
- for (name, value) in headers {
- let header_name = HeaderName::from_bytes(name.as_bytes())
- .map_err(|_| SyncError::InvalidResponse("invalid header name".to_string()))?;
- let header_value = HeaderValue::from_str(value)
- .map_err(|_| SyncError::InvalidResponse("invalid header value".to_string()))?;
- header_map.insert(header_name, header_value);
- }
-
- let mut current_url = self.parse_url(url)?;
- for _ in 0..5 {
- let resp = self
- .client
- .put(current_url.clone())
- .headers(header_map.clone())
- .body(body.to_vec())
- .send()
- .map_err(map_reqwest_error)?;
-
- if resp.status().is_redirection() {
- if let Some(location) = resp.headers().get(LOCATION) {
- current_url = self.resolve_redirect(&current_url, location)?;
- continue;
- }
- }
-
- return parse_empty_response(resp);
- }
-
- Err(SyncError::InvalidResponse("too many redirects".to_string()))
- }
-
- fn parse_url(&self, url: &str) -> Result<Url, SyncError> {
- Url::parse(url).map_err(|_| SyncError::InvalidResponse("invalid url".to_string()))
- }
-
- fn resolve_redirect(
- &self,
- current_url: &Url,
- location: &HeaderValue,
- ) -> Result<Url, SyncError> {
- let next = location
- .to_str()
- .map_err(|_| SyncError::InvalidResponse("invalid redirect location".to_string()))?;
- Url::parse(next)
- .or_else(|_| current_url.join(next))
- .map_err(|_| SyncError::InvalidResponse("invalid redirect location".to_string()))
- }
-
- fn is_same_origin(&self, url: &Url) -> bool {
- self.base_origin.scheme() == url.scheme()
- && self.base_origin.host_str() == url.host_str()
- && self.base_origin.port_or_known_default() == url.port_or_known_default()
- }
-
- fn build_headers_for_url(&self, url: &Url) -> HeaderMap {
- if self.is_same_origin(url) {
- self.build_headers()
- } else {
- self.build_public_headers()
- }
- }
-
- fn build_public_headers(&self) -> HeaderMap {
- let mut headers = HeaderMap::new();
- if let Some(agent) = &self.user_agent {
- if let Ok(value) = HeaderValue::from_str(agent) {
- headers.insert("User-Agent", value);
- }
- }
- headers
- }
-
- fn build_headers(&self) -> HeaderMap {
- let mut headers = HeaderMap::new();
- if let Some(agent) = &self.user_agent {
- if let Ok(value) = HeaderValue::from_str(agent) {
- headers.insert("User-Agent", value);
- }
- }
- if let Some(pkg) = &self.client_package {
- if let Ok(value) = HeaderValue::from_str(pkg) {
- headers.insert("X-Client-Package", value);
- }
- }
- if let Some(version) = &self.client_version {
- if let Ok(value) = HeaderValue::from_str(version) {
- headers.insert("X-Client-Version", value);
- }
- }
- headers.insert(
- "x-request-id",
- HeaderValue::from_str(&Uuid::new_v4().to_string()).unwrap(),
- );
- if let Ok(value) = HeaderValue::from_str(&self.auth_token) {
- headers.insert("X-Auth-Token", value);
- }
- headers
- }
-}
-
-#[derive(Debug, serde::Deserialize)]
-struct ErrorResponse {
- code: Option<String>,
- message: Option<String>,
-}
-
-fn parse_json_response<T: DeserializeOwned>(resp: Response) -> Result<T, SyncError> {
- let status = resp.status().as_u16();
- if status == 401 {
- return Err(SyncError::Unauthorized);
- }
- if status >= 300 {
- let body = resp.text().unwrap_or_default();
- return Err(map_error_response(status, &body));
- }
- resp.json::<T>().map_err(map_reqwest_error)
-}
-
-fn parse_empty_response(resp: Response) -> Result<(), SyncError> {
- let status = resp.status().as_u16();
- if status == 401 {
- return Err(SyncError::Unauthorized);
- }
- if status >= 300 {
- let body = resp.text().unwrap_or_default();
- return Err(map_error_response(status, &body));
- }
- Ok(())
-}
-
-fn parse_bytes_response(resp: Response) -> Result<Vec<u8>, SyncError> {
- let status = resp.status().as_u16();
- if status == 401 {
- return Err(SyncError::Unauthorized);
- }
- if status >= 300 {
- let body = resp.text().unwrap_or_default();
- return Err(map_error_response(status, &body));
- }
- resp.bytes()
- .map(|bytes| bytes.to_vec())
- .map_err(map_reqwest_error)
-}
-
-fn map_error_response(status: u16, body: &str) -> SyncError {
- if let Ok(err) = serde_json::from_str::<ErrorResponse>(body) {
- if let Some(code) = err.code.clone() {
- if matches!(
- code.as_str(),
- "LLMCHAT_MESSAGE_LIMIT_REACHED"
- | "LLMCHAT_ATTACHMENT_LIMIT_REACHED"
- | "LLMCHAT_PAYLOAD_TOO_LARGE"
- ) {
- return SyncError::LimitReached {
- code,
- message: err.message,
- };
- }
- }
- return SyncError::Http {
- status,
- message: err.message.unwrap_or_else(|| body.to_string()),
- code: err.code,
- };
- }
- SyncError::Http {
- status,
- message: body.to_string(),
- code: None,
- }
-}
-
-fn map_reqwest_error(err: reqwest::Error) -> SyncError {
- if let Some(status) = err.status() {
- SyncError::Http {
- status: status.as_u16(),
- message: err.to_string(),
- code: None,
- }
- } else {
- SyncError::Http {
- status: 0,
- message: err.to_string(),
- code: None,
- }
- }
-}
diff --git a/rust/llmchat/sync/src/lib.rs b/rust/llmchat/sync/src/lib.rs
deleted file mode 100644
index ef465fd53c..0000000000
--- a/rust/llmchat/sync/src/lib.rs
+++ /dev/null
@@ -1,13 +0,0 @@
-pub mod conflict;
-pub mod crypto;
-pub mod diff_cursor;
-pub mod errors;
-pub mod http;
-pub mod models;
-pub mod sync;
-
-pub use errors::SyncError;
-pub use sync::{
- MigrationConfig, MigrationPriority, MigrationProgress, MigrationProgressCallback,
- MigrationState, SyncAuth, SyncEngine, SyncResult, SyncStats, fetch_chat_key,
-};
diff --git a/rust/llmchat/sync/src/models.rs b/rust/llmchat/sync/src/models.rs
deleted file mode 100644
index 34c36e0dee..0000000000
--- a/rust/llmchat/sync/src/models.rs
+++ /dev/null
@@ -1,197 +0,0 @@
-use serde::{Deserialize, Serialize};
-
-use crate::diff_cursor::SyncCursor;
-use llmchat_db::AttachmentKind;
-
-#[derive(Debug, Clone, Serialize, Deserialize)]
-#[serde(rename_all = "camelCase")]
-pub struct EncryptedPayload {
- #[serde(
- alias = "encrypted_key",
- alias = "encryptedKey",
- alias = "encrypted_data",
- alias = "encryptedData"
- )]
- pub encrypted_data: String,
- pub header: String,
-}
-
-#[derive(Debug, Clone, Serialize, Deserialize)]
-pub struct ChatKeyPayload {
- #[serde(
- rename = "encryptedKey",
- default,
- skip_serializing_if = "Option::is_none",
- alias = "encrypted_key"
- )]
- pub encrypted_key: Option<String>,
- #[serde(
- rename = "encryptedData",
- default,
- skip_serializing_if = "Option::is_none",
- alias = "encrypted_data"
- )]
- pub encrypted_data: Option<String>,
- pub header: String,
-}
-
-impl ChatKeyPayload {
- pub fn from_encrypted(encrypted: &EncryptedPayload) -> Self {
- Self {
- encrypted_key: Some(encrypted.encrypted_data.clone()),
- encrypted_data: Some(encrypted.encrypted_data.clone()),
- header: encrypted.header.clone(),
- }
- }
-
- pub fn encrypted_value(&self) -> Option<&str> {
- self.encrypted_data
- .as_deref()
- .or(self.encrypted_key.as_deref())
- }
-}
-
-#[derive(Debug, Clone, Serialize, Deserialize)]
-#[serde(rename_all = "camelCase")]
-pub struct RemoteSession {
- #[serde(rename = "sessionUUID", alias = "session_uuid")]
- pub session_uuid: String,
- #[serde(rename = "encryptedData", alias = "encrypted_data")]
- pub encrypted_data: String,
- pub header: String,
- #[serde(
- rename = "clientMetadata",
- alias = "client_metadata",
- skip_serializing_if = "Option::is_none"
- )]
- pub client_metadata: Option<String>,
- #[serde(alias = "created_at")]
- pub created_at: i64,
- #[serde(alias = "updated_at")]
- pub updated_at: i64,
- #[serde(alias = "is_deleted")]
- pub is_deleted: Option<bool>,
-}
-
-#[derive(Debug, Clone, Serialize, Deserialize)]
-#[serde(rename_all = "camelCase")]
-pub struct RemoteMessage {
- #[serde(rename = "messageUUID", alias = "message_uuid")]
- pub message_uuid: String,
- #[serde(rename = "sessionUUID", alias = "session_uuid")]
- pub session_uuid: String,
- #[serde(rename = "parentMessageUUID", alias = "parent_message_uuid")]
- pub parent_message_uuid: Option<String>,
- pub sender: String,
- pub attachments: Vec<RemoteAttachment>,
- #[serde(rename = "encryptedData", alias = "encrypted_data")]
- pub encrypted_data: String,
- pub header: String,
- #[serde(
- rename = "clientMetadata",
- alias = "client_metadata",
- skip_serializing_if = "Option::is_none"
- )]
- pub client_metadata: Option<String>,
- #[serde(alias = "created_at")]
- pub created_at: i64,
- #[serde(alias = "updated_at")]
- pub updated_at: Option<i64>,
- #[serde(alias = "is_deleted")]
- pub is_deleted: Option<bool>,
-}
-
-#[derive(Debug, Clone, Serialize, Deserialize)]
-#[serde(rename_all = "camelCase")]
-pub struct RemoteAttachment {
- pub id: String,
- pub size: i64,
- #[serde(
- rename = "clientMetadata",
- alias = "client_metadata",
- skip_serializing_if = "Option::is_none"
- )]
- pub client_metadata: Option<String>,
- #[serde(
- rename = "encryptedName",
- alias = "encrypted_name",
- skip_serializing_if = "Option::is_none"
- )]
- pub encrypted_name: Option<String>,
- #[serde(skip_serializing_if = "Option::is_none")]
- pub kind: Option<AttachmentKind>,
-}
-
-#[derive(Debug, Clone, Serialize, Deserialize)]
-#[serde(rename_all = "camelCase")]
-pub struct SessionTombstone {
- #[serde(rename = "sessionUUID", alias = "session_uuid")]
- pub session_uuid: String,
- #[serde(alias = "deleted_at")]
- pub deleted_at: Option<i64>,
-}
-
-#[derive(Debug, Clone, Serialize, Deserialize)]
-#[serde(rename_all = "camelCase")]
-pub struct MessageTombstone {
- #[serde(rename = "messageUUID", alias = "message_uuid")]
- pub message_uuid: String,
- #[serde(alias = "deleted_at")]
- pub deleted_at: Option<i64>,
-}
-
-#[derive(Debug, Clone, Serialize, Deserialize, Default)]
-#[serde(rename_all = "camelCase")]
-pub struct DiffTombstones {
- #[serde(default)]
- pub sessions: Vec<SessionTombstone>,
- #[serde(default)]
- pub messages: Vec<MessageTombstone>,
-}
-
-#[derive(Debug, Clone, Serialize, Deserialize)]
-#[serde(rename_all = "camelCase")]
-pub struct DiffResponse {
- #[serde(default)]
- pub sessions: Vec<RemoteSession>,
- #[serde(default)]
- pub messages: Vec<RemoteMessage>,
- #[serde(default)]
- pub tombstones: DiffTombstones,
- pub cursor: Option<SyncCursor>,
- pub timestamp: Option<i64>,
-}
-
-#[derive(Debug, Clone, Serialize, Deserialize)]
-#[serde(rename_all = "camelCase")]
-pub struct UploadUrlRequest {
- pub content_length: i64,
- #[serde(
- rename = "contentMD5",
- alias = "content_md5",
- skip_serializing_if = "Option::is_none"
- )]
- pub content_md5: Option<String>,
-}
-
-#[derive(Debug, Clone, Serialize, Deserialize)]
-#[serde(rename_all = "camelCase")]
-pub struct UploadUrlResponse {
- #[serde(rename = "attachmentId", alias = "attachment_id")]
- pub attachment_id: String,
- #[serde(rename = "objectKey", alias = "object_key")]
- pub object_key: String,
- pub url: String,
-}
-
-#[derive(Debug, Clone, Serialize, Deserialize)]
-#[serde(rename_all = "camelCase")]
-pub struct SessionPayload {
- pub title: String,
-}
-
-#[derive(Debug, Clone, Serialize, Deserialize)]
-#[serde(rename_all = "camelCase")]
-pub struct MessagePayload {
- pub text: String,
-}
diff --git a/rust/llmchat/sync/src/sync.rs b/rust/llmchat/sync/src/sync.rs
deleted file mode 100644
index 754d3fb73a..0000000000
--- a/rust/llmchat/sync/src/sync.rs
+++ /dev/null
@@ -1,1961 +0,0 @@
-use std::collections::{HashMap, HashSet};
-use std::path::PathBuf;
-use std::sync::Arc;
-use std::sync::atomic::{AtomicBool, Ordering};
-
-use zeroize::Zeroizing;
-
-use ente_core::crypto::keys;
-use llmchat_db::{
- AttachmentKind, AttachmentMeta, AttachmentStore, Clock, EntityType, FsAttachmentStore,
- LlmChatDb, Message, Sender, Session, SqliteBackend, SyncEntityState, SyncStateDb, SystemClock,
- UploadState,
-};
-use uuid::Uuid;
-
-use crate::conflict::{
- LocalSyncState, find_duplicate_message, order_for_sync, should_accept_remote_message,
- should_accept_remote_session,
-};
-use crate::crypto::{
- decrypt_chat_key, decrypt_payload, encrypt_attachment_bytes, encrypt_chat_key, encrypt_payload,
-};
-use crate::diff_cursor::SyncCursor;
-use crate::errors::SyncError;
-use crate::http::{HttpClient, HttpConfig};
-use crate::models::{
- ChatKeyPayload, DiffResponse, MessagePayload, RemoteAttachment, SessionPayload,
- UploadUrlRequest, UploadUrlResponse,
-};
-
-const CURSOR_META_KEY: &str = "llmchat.sync.cursor";
-const CHAT_KEY_META_KEY: &str = "llmchat.chat.key";
-const OFFLINE_SEED_META_KEY: &str = "llmchat.offline.seeded.v1";
-const ZERO_UUID: &str = "00000000-0000-0000-0000-000000000000";
-
-static SYNC_LOCK: AtomicBool = AtomicBool::new(false);
-
-#[derive(Debug, Clone)]
-pub struct MigrationConfig {
- pub batch_size: i64,
- pub priority: MigrationPriority,
-}
-
-#[derive(Debug, Clone, Copy, PartialEq, Eq)]
-pub enum MigrationPriority {
- RecentFirst,
- OldestFirst,
-}
-
-#[derive(Debug, Clone, Copy, PartialEq, Eq)]
-pub enum MigrationState {
- NotNeeded,
- InProgress,
- Complete,
- Failed,
-}
-
-#[derive(Debug, Clone)]
-pub struct MigrationProgress {
- pub state: MigrationState,
- pub processed: i64,
- pub remaining: i64,
- pub total: i64,
-}
-
-pub trait MigrationProgressCallback: Send + Sync {
- fn on_progress(&self, progress: MigrationProgress);
-}
-
-struct SyncLockGuard;
-
-impl Drop for SyncLockGuard {
- fn drop(&mut self) {
- SYNC_LOCK.store(false, Ordering::SeqCst);
- }
-}
-
-#[derive(Debug, Clone)]
-pub struct SyncAuth {
- pub base_url: String,
- pub auth_token: String,
- pub master_key: Zeroizing<Vec<u8>>,
- pub user_agent: Option<String>,
- pub client_package: Option<String>,
- pub client_version: Option<String>,
-}
-
-#[derive(Debug, Default, Clone)]
-pub struct SyncStats {
- pub sessions: i64,
- pub messages: i64,
-}
-
-#[derive(Debug, Default, Clone)]
-pub struct SyncResult {
- pub pulled: SyncStats,
- pub pushed: SyncStats,
- pub uploaded_attachments: i64,
- pub downloaded_attachments: i64,
-}
-
-#[derive(Debug, Clone, Copy, PartialEq, Eq)]
-enum ChatKeyStatus {
- Cached,
- Remote,
- Created,
-}
-
-pub struct SyncEngine {
- db: LlmChatDb<SqliteBackend>,
- sync_state: SyncStateDb<SqliteBackend>,
- attachment_store: FsAttachmentStore,
- plaintext_dir: Option<PathBuf>,
- diff_limit: i64,
- offline_db: std::sync::Mutex<Option<OfflineDbConfig>>,
-}
-
-#[derive(Clone)]
-struct OfflineDbConfig {
- path: String,
- key: Vec<u8>,
-}
-
-impl SyncEngine {
- pub fn new(
- main_db_path: String,
- sync_db_path: String,
- db_key: Vec<u8>,
- attachments_dir: String,
- _meta_dir: String,
- plaintext_dir: Option<String>,
- ) -> Result<Self, SyncError> {
- llmchat_db::traits::ensure_directory(&attachments_dir)?;
- if let Some(ref dir) = plaintext_dir {
- let _ = llmchat_db::traits::ensure_directory(dir);
- }
-
- let db = LlmChatDb::open_sqlite_with_defaults(main_db_path, sync_db_path.clone(), db_key)?;
- let sync_state = SyncStateDb::open_sqlite_with_defaults(sync_db_path)?;
- let attachment_store = FsAttachmentStore::new(attachments_dir);
- Ok(Self {
- db,
- sync_state,
- attachment_store,
- plaintext_dir: plaintext_dir.map(PathBuf::from),
- diff_limit: 500,
- offline_db: std::sync::Mutex::new(None),
- })
- }
-
- pub fn sync(&self, auth: SyncAuth) -> Result<SyncResult, SyncError> {
- if SYNC_LOCK
- .compare_exchange(false, true, Ordering::SeqCst, Ordering::SeqCst)
- .is_err()
- {
- return Err(SyncError::SyncInProgress);
- }
- let _guard = SyncLockGuard;
-
- if auth.auth_token.trim().is_empty() {
- return Err(SyncError::NotLoggedIn);
- }
- if auth.master_key.len() != llmchat_db::crypto::KEY_BYTES {
- return Err(SyncError::Crypto("invalid master key length".to_string()));
- }
-
- let SyncAuth {
- base_url,
- auth_token,
- master_key,
- user_agent,
- client_package,
- client_version,
- } = auth;
-
- let http = HttpClient::new(HttpConfig {
- base_url,
- auth_token,
- user_agent,
- client_package,
- client_version,
- timeout_secs: None,
- })?;
-
- let (chat_key, key_status) = self.get_or_create_chat_key(&http, &master_key)?;
- let mut result = SyncResult::default();
-
- if key_status == ChatKeyStatus::Created {
- self.prepare_for_new_chat_key()?;
- } else {
- self.pull(&http, &chat_key, &mut result)?;
- }
- self.push(&http, &chat_key, &mut result)?;
-
- Ok(result)
- }
-
- pub fn sync_with_progress(
- &self,
- auth: SyncAuth,
- config: MigrationConfig,
- callback: &dyn MigrationProgressCallback,
- ) -> Result<SyncResult, SyncError> {
- if SYNC_LOCK
- .compare_exchange(false, true, Ordering::SeqCst, Ordering::SeqCst)
- .is_err()
- {
- return Err(SyncError::SyncInProgress);
- }
- let _guard = SyncLockGuard;
-
- if auth.auth_token.trim().is_empty() {
- return Err(SyncError::NotLoggedIn);
- }
- if auth.master_key.len() != llmchat_db::crypto::KEY_BYTES {
- return Err(SyncError::Crypto("invalid master key length".to_string()));
- }
-
- let SyncAuth {
- base_url,
- auth_token,
- master_key,
- user_agent,
- client_package,
- client_version,
- } = auth;
-
- let http = HttpClient::new(HttpConfig {
- base_url,
- auth_token,
- user_agent,
- client_package,
- client_version,
- timeout_secs: None,
- })?;
-
- let (chat_key, key_status) = self.get_or_create_chat_key(&http, &master_key)?;
- let mut result = SyncResult::default();
-
- if key_status == ChatKeyStatus::Created {
- self.prepare_for_new_chat_key()?;
- } else {
- self.pull(&http, &chat_key, &mut result)?;
- }
-
- let total = self.db.count_needing_sync()?;
- let mut processed = 0;
- callback.on_progress(MigrationProgress {
- state: MigrationState::InProgress,
- processed,
- remaining: total,
- total,
- });
-
- let batch_size = if config.batch_size <= 0 {
- 1
- } else {
- config.batch_size
- };
- let order_desc = matches!(config.priority, MigrationPriority::RecentFirst);
-
- let sync_result = (|| -> Result<(), SyncError> {
- loop {
- let batch = self
- .db
- .get_sessions_needing_sync_batch(batch_size, order_desc)?;
- if batch.is_empty() {
- break;
- }
-
- for session in batch {
- self.push_session_with_messages(&http, &chat_key, &session, &mut result)?;
- processed += 1;
- let remaining = total.saturating_sub(processed);
- callback.on_progress(MigrationProgress {
- state: MigrationState::InProgress,
- processed,
- remaining,
- total,
- });
- }
- }
- Ok(())
- })();
-
- if let Err(err) = sync_result {
- let remaining = total.saturating_sub(processed);
- callback.on_progress(MigrationProgress {
- state: MigrationState::Failed,
- processed,
- remaining,
- total,
- });
- return Err(err);
- }
-
- callback.on_progress(MigrationProgress {
- state: MigrationState::Complete,
- processed,
- remaining: 0,
- total,
- });
-
- Ok(result)
- }
-
- pub fn sync_in_background(
- self: Arc<Self>,
- auth: SyncAuth,
- ) -> std::thread::JoinHandle<Result<SyncResult, SyncError>> {
- std::thread::spawn(move || self.sync(auth))
- }
-
- pub fn check_migration_status_local(&self) -> Result<Option<MigrationState>, SyncError> {
- let pending = self.db.count_needing_sync()?;
- if pending > 0 {
- return Ok(Some(MigrationState::InProgress));
- }
- Ok(None)
- }
-
- pub fn reset_sync_state(&self) -> Result<(), SyncError> {
- let _ = self.sync_state.delete_meta(CURSOR_META_KEY);
- let _ = self.sync_state.delete_meta(CHAT_KEY_META_KEY);
- let _ = self.sync_state.delete_meta(OFFLINE_SEED_META_KEY);
- let _ = self.sync_state.clear_state();
- let _ = self.sync_state.clear_meta();
- self.db.reset_attachment_sync_state()?;
- let _ = self.attachment_store.clear_all();
- if let Ok(mut offline) = self.offline_db.lock() {
- *offline = None;
- }
- Ok(())
- }
-
- pub fn seed_from_offline(
- &self,
- offline_db_path: String,
- offline_db_key: Vec<u8>,
- ) -> Result<(), SyncError> {
- if let Ok(mut offline) = self.offline_db.lock() {
- *offline = Some(OfflineDbConfig {
- path: offline_db_path.clone(),
- key: offline_db_key.clone(),
- });
- }
- if self.sync_state.get_meta(OFFLINE_SEED_META_KEY)?.is_some() {
- return Ok(());
- }
-
- let offline_db = llmchat_db::ChatDb::open_sqlite_with_defaults(
- offline_db_path.clone(),
- offline_db_key.clone(),
- )?;
- let sessions = offline_db.list_sessions()?;
-
- for session in sessions {
- let _ = self.db.upsert_session(
- session.uuid,
- &session.title,
- session.created_at,
- session.updated_at,
- None,
- true,
- session.deleted_at,
- )?;
- let messages = offline_db.get_messages(session.uuid)?;
- for message in messages {
- let _ = self.db.insert_message_with_uuid_and_state(
- message.uuid,
- session.uuid,
- message.sender.as_str(),
- &message.text,
- message.parent_message_uuid,
- message.attachments.clone(),
- message.created_at,
- message.deleted_at,
- true,
- )?;
- }
- }
-
- self.sync_state.set_meta(OFFLINE_SEED_META_KEY, b"1")?;
- Ok(())
- }
-
- pub fn check_migration_status(&self, auth: SyncAuth) -> Result<MigrationState, SyncError> {
- if let Some(local) = self.check_migration_status_local()? {
- return Ok(local);
- }
- if auth.auth_token.trim().is_empty() {
- return Err(SyncError::NotLoggedIn);
- }
- if auth.master_key.len() != llmchat_db::crypto::KEY_BYTES {
- return Err(SyncError::Crypto("invalid master key length".to_string()));
- }
-
- let SyncAuth {
- base_url,
- auth_token,
- master_key,
- user_agent,
- client_package,
- client_version,
- } = auth;
-
- let http = HttpClient::new(HttpConfig {
- base_url,
- auth_token,
- user_agent,
- client_package,
- client_version,
- timeout_secs: None,
- })?;
-
- if self.load_chat_key_from_meta(&master_key)?.is_some() {
- return Ok(MigrationState::NotNeeded);
- }
-
- let remote = http.get_json_optional::<ChatKeyPayload>("/llmchat/chat/key", &[]);
- match remote {
- Ok(Some(_)) => Ok(MigrationState::InProgress),
- Ok(None) => Ok(MigrationState::InProgress),
- Err(SyncError::Http {
- status: 404,
- code: Some(code),
- ..
- }) if code == "NOT_FOUND" || code == "AuthKeyNotCreated" => {
- Ok(MigrationState::InProgress)
- }
- Err(err) => Err(err),
- }
- }
-
- fn prepare_for_new_chat_key(&self) -> Result<(), SyncError> {
- self.reset_cursor_to_now()?;
- let _ = self.sync_state.clear_state();
- self.db.mark_all_needs_sync()?;
- self.db.clear_all_server_timestamps()?;
- self.db.reset_attachment_sync_state()?;
- self.attachment_store.clear_all()?;
- Ok(())
- }
-
- fn reset_cursor_to_now(&self) -> Result<(), SyncError> {
- let clock = SystemClock;
- let now = clock.now_us();
- let cursor = SyncCursor {
- base_since_time: now,
- since_time: now,
- max_time: now,
- since_type: "sessions".to_string(),
- since_id: "00000000-0000-0000-0000-000000000000".to_string(),
- };
- self.save_cursor(&cursor)?;
- Ok(())
- }
-
- pub fn download_attachment(
- &self,
- auth: SyncAuth,
- attachment_id: String,
- session_uuid: String,
- ) -> Result<bool, SyncError> {
- if auth.auth_token.trim().is_empty() {
- return Err(SyncError::NotLoggedIn);
- }
- if auth.master_key.len() != llmchat_db::crypto::KEY_BYTES {
- return Err(SyncError::Crypto("invalid master key length".to_string()));
- }
-
- let session_uuid = Uuid::parse_str(&session_uuid)
- .map_err(|_| SyncError::InvalidResponse("invalid session uuid".to_string()))?;
-
- let plaintext_dir = self
- .plaintext_dir
- .as_ref()
- .ok_or_else(|| SyncError::AttachmentMissing(attachment_id.clone()))?;
- let plaintext_path = plaintext_dir.join(&attachment_id);
- if plaintext_path.exists() {
- return Ok(false);
- }
-
- let SyncAuth {
- base_url,
- auth_token,
- master_key,
- user_agent,
- client_package,
- client_version,
- } = auth;
-
- let base_url = base_url.trim_end_matches('/').to_string();
- let http = HttpClient::new(HttpConfig {
- base_url: base_url.clone(),
- auth_token,
- user_agent,
- client_package,
- client_version,
- timeout_secs: None,
- })?;
-
- let (chat_key, _) = self.get_or_create_chat_key(&http, &master_key)?;
- let encrypted = if self.attachment_store.exists(&attachment_id)? {
- self.attachment_store.read(&attachment_id)?
- } else {
- let mut remote_id = match self.db.get_attachment_remote_id(&attachment_id)? {
- Some(remote_id) => remote_id,
- None => {
- let fallback = attachment_id.clone();
- self.db
- .set_attachment_remote_id(&attachment_id, Some(&fallback))?;
- fallback
- }
- };
- let mut url = format!("{}/llmchat/chat/attachment/{}", base_url, remote_id);
- let bytes = match http.get_bytes(&url) {
- Ok(bytes) => bytes,
- Err(SyncError::Http { status: 404, .. }) => {
- if let Err(err) =
- self.force_upload_attachment(&http, &chat_key, session_uuid, &attachment_id)
- {
- return Err(err);
- }
- if let Some(updated) = self.db.get_attachment_remote_id(&attachment_id)? {
- remote_id = updated;
- url = format!("{}/llmchat/chat/attachment/{}", base_url, remote_id);
- }
- http.get_bytes(&url)?
- }
- Err(err) => return Err(err),
- };
- self.attachment_store.write(&attachment_id, &bytes)?;
- bytes
- };
-
- let plaintext =
- crate::crypto::decrypt_attachment_bytes(&encrypted, &chat_key, session_uuid)?;
- std::fs::write(plaintext_path, plaintext)?;
- Ok(true)
- }
-
- pub fn download_attachment_in_background(
- self: Arc<Self>,
- auth: SyncAuth,
- attachment_id: String,
- session_uuid: String,
- ) -> std::thread::JoinHandle<Result<bool, SyncError>> {
- std::thread::spawn(move || self.download_attachment(auth, attachment_id, session_uuid))
- }
-
- fn pull(
- &self,
- http: &HttpClient,
- chat_key: &[u8],
- result: &mut SyncResult,
- ) -> Result<(), SyncError> {
- let mut cursor = self.load_cursor()?;
- let mut seen_cursors: HashSet<SyncCursor> = HashSet::new();
-
- loop {
- let query = vec![
- ("sinceTime", cursor.since_time.to_string()),
- ("sinceType", cursor.since_type.clone()),
- ("sinceId", cursor.since_id.clone()),
- ("limit", self.diff_limit.to_string()),
- ];
- let response: DiffResponse = http.get_json("/llmchat/chat/diff", &query)?;
-
- self.apply_diff(&response, chat_key, result)?;
-
- let next_cursor = match response.cursor.clone() {
- Some(cursor) => cursor,
- None => {
- if let Some(timestamp) = response.timestamp {
- SyncCursor {
- base_since_time: timestamp,
- since_time: timestamp,
- max_time: timestamp,
- since_type: "sessions".to_string(),
- since_id: "00000000-0000-0000-0000-000000000000".to_string(),
- }
- } else {
- cursor.clone()
- }
- }
- };
-
- if !seen_cursors.insert(next_cursor.clone()) {
- break;
- }
-
- cursor = next_cursor;
- self.save_cursor(&cursor)?;
-
- if cursor.is_complete_cycle() {
- break;
- }
- }
-
- Ok(())
- }
-
- fn apply_diff(
- &self,
- response: &DiffResponse,
- chat_key: &[u8],
- result: &mut SyncResult,
- ) -> Result<(), SyncError> {
- let mut local_messages_cache: HashMap<Uuid, Vec<Message>> = HashMap::new();
- let mut duplicate_map: HashMap<Uuid, Uuid> = HashMap::new();
- let mut remote_message_updates: HashMap<Uuid, i64> = HashMap::new();
- let mut remote_session_map: HashMap<Uuid, Uuid> = HashMap::new();
- let mut remote_message_map: HashMap<Uuid, Uuid> = HashMap::new();
-
- for message in &response.messages {
- if message.is_deleted == Some(true) {
- continue;
- }
- let session_uuid = Uuid::parse_str(&message.session_uuid)
- .map_err(|e| SyncError::InvalidResponse(e.to_string()))?;
- let timestamp = message.updated_at.unwrap_or(message.created_at);
- remote_message_updates
- .entry(session_uuid)
- .and_modify(|current| {
- if *current < timestamp {
- *current = timestamp;
- }
- })
- .or_insert(timestamp);
- }
-
- for session in &response.sessions {
- if session.is_deleted == Some(true) {
- continue;
- }
- let payload: SessionPayload =
- decrypt_payload(&session.encrypted_data, &session.header, chat_key)?;
- let remote_uuid = Uuid::parse_str(&session.session_uuid)
- .map_err(|e| SyncError::InvalidResponse(e.to_string()))?;
- let mut local_uuid = session
- .client_metadata
- .as_deref()
- .and_then(decode_client_id)
- .and_then(|value| Uuid::parse_str(&value).ok())
- .unwrap_or(remote_uuid);
- let remote_uuid_str = remote_uuid.to_string();
- let mut local = self.db.get_session(local_uuid).ok().flatten();
- let mut local_state = self.sync_state.get_session_state(local_uuid).ok().flatten();
- if let Some(state) = local_state.as_ref() {
- if let Some(existing_remote) = state.remote_id.as_deref() {
- if existing_remote != remote_uuid_str.as_str() {
- local_uuid = remote_uuid;
- local = self.db.get_session(local_uuid).ok().flatten();
- local_state = self.sync_state.get_session_state(local_uuid).ok().flatten();
- }
- }
- }
- remote_session_map.insert(remote_uuid, local_uuid);
- if let Some(local_session) = local.as_ref() {
- let local_sync = LocalSyncState {
- uuid: local_session.uuid,
- needs_sync: local_session.needs_sync,
- server_updated_at: local_state
- .as_ref()
- .and_then(|state| state.server_updated_at),
- };
- if !should_accept_remote_session(local_sync, session.updated_at, remote_uuid) {
- if local_state
- .as_ref()
- .and_then(|state| state.remote_id.as_deref())
- .is_none()
- {
- let _ = self
- .sync_state
- .set_session_remote_id(local_uuid, Some(&remote_uuid_str));
- }
- continue;
- }
- }
- let title_changed = local
- .as_ref()
- .map(|existing| existing.title != payload.title)
- .unwrap_or(true);
- let mut effective_updated_at = local
- .as_ref()
- .map(|existing| existing.updated_at)
- .unwrap_or(session.updated_at);
- if let Some(remote_updated) = remote_message_updates.get(&remote_uuid) {
- if effective_updated_at < *remote_updated {
- effective_updated_at = *remote_updated;
- }
- }
- if title_changed && effective_updated_at < session.updated_at {
- effective_updated_at = session.updated_at;
- }
-
- let created_at = session
- .client_metadata
- .as_deref()
- .and_then(|metadata| decode_client_created_at(metadata, chat_key))
- .unwrap_or(session.created_at);
-
- let _ = self.db.upsert_session_from_remote(
- local_uuid,
- &remote_uuid.to_string(),
- &payload.title,
- created_at,
- effective_updated_at,
- )?;
- self.sync_state.set_session_state(
- local_uuid,
- Some(&remote_uuid_str),
- Some(session.updated_at),
- )?;
- result.pulled.sessions += 1;
- }
-
- for message in &response.messages {
- if message.is_deleted == Some(true) {
- continue;
- }
- let payload: MessagePayload =
- decrypt_payload(&message.encrypted_data, &message.header, chat_key)?;
- let remote_message_uuid = Uuid::parse_str(&message.message_uuid)
- .map_err(|e| SyncError::InvalidResponse(e.to_string()))?;
- let remote_session_uuid = Uuid::parse_str(&message.session_uuid)
- .map_err(|e| SyncError::InvalidResponse(e.to_string()))?;
- let session_uuid = remote_session_map
- .get(&remote_session_uuid)
- .cloned()
- .or_else(|| {
- self.sync_state
- .get_session_uuid_by_remote_id(&remote_session_uuid.to_string())
- .ok()
- .flatten()
- })
- .unwrap_or(remote_session_uuid);
- let remote_message_uuid_str = remote_message_uuid.to_string();
- let mut message_uuid = message
- .client_metadata
- .as_deref()
- .and_then(decode_client_id)
- .and_then(|value| Uuid::parse_str(&value).ok())
- .unwrap_or(remote_message_uuid);
- let remote_updated_at = message.updated_at.unwrap_or(message.created_at);
-
- let sender: Sender = message
- .sender
- .parse::<Sender>()
- .map_err(|e| SyncError::InvalidResponse(e.to_string()))?;
- let (attachments, attachment_remote_ids) =
- self.decrypt_remote_attachments(&message.attachments, chat_key)?;
-
- let local_messages = local_messages_cache
- .entry(session_uuid)
- .or_insert_with(|| self.db.get_messages(session_uuid).unwrap_or_default());
- let mut local_message = local_messages
- .iter()
- .find(|local| local.uuid == message_uuid);
- let mut local_state = self
- .sync_state
- .get_message_state(message_uuid)
- .ok()
- .flatten();
- if let Some(state) = local_state.as_ref() {
- if let Some(existing_remote) = state.remote_id.as_deref() {
- if existing_remote != remote_message_uuid_str.as_str() {
- message_uuid = remote_message_uuid;
- local_message = local_messages
- .iter()
- .find(|local| local.uuid == message_uuid);
- local_state = self
- .sync_state
- .get_message_state(message_uuid)
- .ok()
- .flatten();
- }
- }
- }
- remote_message_map.insert(remote_message_uuid, message_uuid);
- if let Some(local_message) = local_message {
- let local_sync = LocalSyncState {
- uuid: local_message.uuid,
- needs_sync: local_message.needs_sync,
- server_updated_at: local_state
- .as_ref()
- .and_then(|state| state.server_updated_at),
- };
- if !should_accept_remote_message(local_sync, remote_updated_at, remote_message_uuid)
- {
- if local_state
- .as_ref()
- .and_then(|state| state.remote_id.as_deref())
- .is_none()
- {
- let _ = self
- .sync_state
- .set_message_remote_id(message_uuid, Some(&remote_message_uuid_str));
- }
- continue;
- }
- }
-
- let parent_uuid = message
- .parent_message_uuid
- .as_ref()
- .and_then(|parent| Uuid::parse_str(parent).ok())
- .and_then(|parent| {
- duplicate_map
- .get(&parent)
- .cloned()
- .or_else(|| remote_message_map.get(&parent).cloned())
- .or_else(|| {
- self.sync_state
- .get_message_uuid_by_remote_id(&parent.to_string())
- .ok()
- .flatten()
- })
- });
-
- let created_at = message
- .client_metadata
- .as_deref()
- .and_then(|metadata| decode_client_created_at(metadata, chat_key))
- .unwrap_or(message.created_at);
-
- if let Some(dup_uuid) = find_duplicate_message(
- local_messages,
- &sender,
- &payload.text,
- &attachments,
- created_at,
- parent_uuid,
- ) {
- duplicate_map.insert(remote_message_uuid, dup_uuid);
- remote_message_map.insert(remote_message_uuid, dup_uuid);
- continue;
- }
-
- let inserted = self.db.upsert_message_from_remote(
- message_uuid,
- session_uuid,
- &remote_message_uuid.to_string(),
- sender.as_str(),
- &payload.text,
- parent_uuid,
- attachments.clone(),
- created_at,
- )?;
- self.sync_state.set_message_state(
- message_uuid,
- Some(&remote_message_uuid_str),
- Some(remote_updated_at),
- )?;
-
- for attachment in &attachments {
- let remote_id = attachment_remote_ids
- .get(&attachment.id)
- .map(String::as_str);
- let _ = self.db.upsert_attachment_with_state(
- &attachment.id,
- session_uuid,
- message_uuid,
- attachment.size,
- remote_id,
- UploadState::Uploaded,
- );
- }
-
- local_messages.push(inserted);
- result.pulled.messages += 1;
- }
-
- let clock = SystemClock;
- let now = clock.now_us();
- let offline_db = self.open_offline_db()?;
- for tombstone in &response.tombstones.sessions {
- let remote_uuid = Uuid::parse_str(&tombstone.session_uuid)
- .map_err(|e| SyncError::InvalidResponse(e.to_string()))?;
- let local_uuid = remote_session_map.get(&remote_uuid).cloned().or_else(|| {
- self.sync_state
- .get_session_uuid_by_remote_id(&remote_uuid.to_string())
- .ok()
- .flatten()
- });
- let Some(local_uuid) = local_uuid else {
- continue;
- };
- let deleted_at = tombstone.deleted_at.or(response.timestamp).unwrap_or(now);
- let local = self.db.get_session(local_uuid).ok().flatten();
- let local_state = self.sync_state.get_session_state(local_uuid).ok().flatten();
- self.apply_session_tombstone(local, local_state, local_uuid, deleted_at)?;
- if let Some(offline_db) = offline_db.as_ref() {
- if offline_db.get_session(local_uuid).ok().flatten().is_some() {
- let _ = offline_db.apply_session_tombstone(local_uuid, deleted_at);
- }
- }
- }
-
- for tombstone in &response.tombstones.messages {
- let remote_uuid = Uuid::parse_str(&tombstone.message_uuid)
- .map_err(|e| SyncError::InvalidResponse(e.to_string()))?;
- let local_uuid = remote_message_map.get(&remote_uuid).cloned().or_else(|| {
- self.sync_state
- .get_message_uuid_by_remote_id(&remote_uuid.to_string())
- .ok()
- .flatten()
- });
- let Some(local_uuid) = local_uuid else {
- continue;
- };
- let deleted_at = tombstone.deleted_at.or(response.timestamp).unwrap_or(now);
- let _ = self.db.apply_message_tombstone(local_uuid, deleted_at);
- let _ = self.sync_state.delete_message_state(local_uuid);
- if let Some(offline_db) = offline_db.as_ref() {
- let _ = offline_db.apply_message_tombstone(local_uuid, deleted_at);
- }
- }
-
- Ok(())
- }
-
- fn open_offline_db(&self) -> Result<Option<llmchat_db::ChatDb<SqliteBackend>>, SyncError> {
- let config = match self.offline_db.lock() {
- Ok(guard) => guard.clone(),
- Err(_) => None,
- };
- let Some(config) = config else {
- return Ok(None);
- };
- if config.path.trim().is_empty() {
- return Ok(None);
- }
- let db = llmchat_db::ChatDb::open_sqlite_with_defaults(config.path, config.key)?;
- Ok(Some(db))
- }
-
- fn apply_session_tombstone(
- &self,
- local: Option<Session>,
- local_state: Option<SyncEntityState>,
- session_uuid: Uuid,
- deleted_at: i64,
- ) -> Result<(), SyncError> {
- let Some(local) = local else {
- return Ok(());
- };
-
- let server_updated_at = local_state.and_then(|state| state.server_updated_at);
-
- if local.needs_sync && server_updated_at.is_none() {
- self.db.apply_session_tombstone(session_uuid, deleted_at)?;
- let _ = self.sync_state.delete_session_state(session_uuid);
- return Ok(());
- }
-
- if local.needs_sync && server_updated_at.is_some() {
- if local.updated_at > deleted_at {
- return Ok(());
- }
- }
-
- self.db.apply_session_tombstone(session_uuid, deleted_at)?;
- let _ = self.sync_state.delete_session_state(session_uuid);
- Ok(())
- }
-
- fn push(
- &self,
- http: &HttpClient,
- chat_key: &[u8],
- result: &mut SyncResult,
- ) -> Result<(), SyncError> {
- let deleted_sessions = self.db.get_deleted_sessions()?;
- for (uuid, _deleted_at) in deleted_sessions {
- if let Some(remote_id) = self.sync_state.get_session_remote_id(uuid)? {
- http.delete("/llmchat/chat/session", &[("id", remote_id)])?;
- let _ = self.sync_state.delete_session_state(uuid);
- }
- let _ = self.db.delete_attachment_tracking_for_session(uuid);
- let _ = self.db.hard_delete(EntityType::Session, uuid);
- }
-
- let deleted_messages = self.db.get_deleted_messages()?;
- for (uuid, _deleted_at) in deleted_messages {
- if let Some(remote_id) = self.sync_state.get_message_remote_id(uuid)? {
- http.delete("/llmchat/chat/message", &[("id", remote_id)])?;
- let _ = self.sync_state.delete_message_state(uuid);
- }
- let _ = self.db.delete_attachment_tracking_for_message(uuid);
- let _ = self.db.hard_delete(EntityType::Message, uuid);
- }
-
- let sessions = self.db.list_sessions()?;
- for session in sessions {
- self.push_session_with_messages(http, chat_key, &session, result)?;
- }
-
- Ok(())
- }
-
- fn push_session_with_messages(
- &self,
- http: &HttpClient,
- chat_key: &[u8],
- session: &Session,
- result: &mut SyncResult,
- ) -> Result<(), SyncError> {
- let session_uuid = session.uuid;
- let messages = self.collect_messages_for_sync(session_uuid)?;
- let session_state = self.sync_state.get_session_state(session_uuid)?;
- let should_upsert_session = session.needs_sync
- || session_state
- .as_ref()
- .and_then(|state| state.remote_id.as_deref())
- .is_none();
- let mut session_remote_id = session_state.and_then(|state| state.remote_id);
-
- if !messages.is_empty() {
- self.reconcile_attachments(session_uuid, &messages)?;
-
- let force_uploads =
- self.revalidate_uploaded_attachments(http, session_uuid, &messages)?;
- let uploaded =
- self.upload_pending_attachments(http, chat_key, session_uuid, &force_uploads)?;
- result.uploaded_attachments += uploaded;
-
- let upload_states = self.collect_attachment_states(&messages)?;
- let blocked = blocked_messages(&messages, &upload_states);
-
- let ordered = order_for_sync(&messages);
- let filtered: Vec<Message> = ordered
- .into_iter()
- .filter(|message| !blocked.contains(&message.uuid))
- .collect();
-
- if should_upsert_session {
- session_remote_id = Some(self.push_session(http, chat_key, session)?);
- result.pushed.sessions += 1;
- }
-
- for message in filtered.iter() {
- self.push_message_with_retry(http, chat_key, message, result)?;
- let _ = self.db.mark_message_synced(message.uuid);
- }
-
- if blocked.is_empty() && filtered.len() == messages.len() {
- if let Some(remote_id) = session_remote_id.clone().or_else(|| {
- self.sync_state
- .get_session_remote_id(session_uuid)
- .ok()
- .flatten()
- }) {
- let _ = self.db.mark_session_synced(session_uuid, &remote_id);
- }
- }
- } else if should_upsert_session {
- session_remote_id = Some(self.push_session(http, chat_key, session)?);
- result.pushed.sessions += 1;
- if let Some(remote_id) = session_remote_id.clone().or_else(|| {
- self.sync_state
- .get_session_remote_id(session_uuid)
- .ok()
- .flatten()
- }) {
- let _ = self.db.mark_session_synced(session_uuid, &remote_id);
- }
- }
-
- Ok(())
- }
-
- fn push_session(
- &self,
- http: &HttpClient,
- chat_key: &[u8],
- session: &Session,
- ) -> Result<String, SyncError> {
- let session_payload = SessionPayload {
- title: session.title.clone(),
- };
- let encrypted = encrypt_payload(&session_payload, chat_key)?;
- let client_metadata =
- encode_client_metadata(&session.uuid.to_string(), session.created_at, chat_key)?;
- let session_uuid =
- normalize_remote_uuid(self.sync_state.get_session_remote_id(session.uuid)?);
- let session_request = UpsertSessionRequest {
- session_uuid: session_uuid.clone(),
- encrypted_data: encrypted.encrypted_data,
- header: encrypted.header,
- client_metadata: Some(client_metadata),
- };
- let response: UpsertSessionResponse =
- http.post_json("/llmchat/chat/session", &session_request)?;
- let remote_id = response.session_uuid;
- self.sync_state
- .set_session_state(session.uuid, Some(&remote_id), response.updated_at)?;
- Ok(remote_id)
- }
-
- fn push_message_with_retry(
- &self,
- http: &HttpClient,
- chat_key: &[u8],
- message: &Message,
- result: &mut SyncResult,
- ) -> Result<(), SyncError> {
- match self.push_message(http, chat_key, message) {
- Ok(()) => {
- result.pushed.messages += 1;
- Ok(())
- }
- Err(err) => {
- if !self.is_attachment_size_mismatch(&err) {
- return Err(err);
- }
- self.reset_attachments_for_message(message)?;
- let empty_force = HashSet::new();
- let uploaded = self.upload_pending_attachments(
- http,
- chat_key,
- message.session_uuid,
- &empty_force,
- )?;
- result.uploaded_attachments += uploaded;
- self.push_message(http, chat_key, message)?;
- result.pushed.messages += 1;
- Ok(())
- }
- }
- }
-
- fn push_message(
- &self,
- http: &HttpClient,
- chat_key: &[u8],
- message: &Message,
- ) -> Result<(), SyncError> {
- let message_payload = MessagePayload {
- text: message.text.clone(),
- };
- let encrypted = encrypt_payload(&message_payload, chat_key)?;
- let attachments = self.encrypt_attachments(
- message.session_uuid,
- message.uuid,
- &message.attachments,
- chat_key,
- )?;
-
- let session_remote_id = normalize_remote_uuid(
- self.sync_state
- .get_session_remote_id(message.session_uuid)?,
- )
- .ok_or_else(|| SyncError::InvalidResponse("missing session remote id".to_string()))?;
- let message_uuid =
- normalize_remote_uuid(self.sync_state.get_message_remote_id(message.uuid)?);
- let parent_message_uuid = message.parent_message_uuid.and_then(|parent| {
- normalize_remote_uuid(self.sync_state.get_message_remote_id(parent).ok().flatten())
- });
- let client_metadata =
- encode_client_metadata(&message.uuid.to_string(), message.created_at, chat_key)?;
- let message_request = UpsertMessageRequest {
- message_uuid,
- session_uuid: session_remote_id,
- parent_message_uuid,
- sender: message.sender.as_str().to_string(),
- attachments,
- encrypted_data: encrypted.encrypted_data,
- header: encrypted.header,
- client_metadata: Some(client_metadata),
- };
- let response: UpsertMessageResponse =
- http.post_json("/llmchat/chat/message", &message_request)?;
- self.sync_state.set_message_state(
- message.uuid,
- Some(&response.message_uuid),
- response.updated_at,
- )?;
- Ok(())
- }
-
- fn reset_attachments_for_message(&self, message: &Message) -> Result<(), SyncError> {
- for attachment in &message.attachments {
- let _ = self.attachment_store.delete(&attachment.id);
- let _ = self.db.upsert_pending_attachment(
- &attachment.id,
- message.session_uuid,
- message.uuid,
- attachment.size,
- );
- let _ = self
- .db
- .set_attachment_upload_state(&attachment.id, UploadState::Pending);
- let _ = self.db.set_attachment_remote_id(&attachment.id, None);
- }
- Ok(())
- }
-
- fn is_attachment_size_mismatch(&self, error: &SyncError) -> bool {
- match error {
- SyncError::Http {
- status: 400,
- message,
- ..
- } => message
- .to_ascii_lowercase()
- .contains("attachment size mismatch"),
- _ => false,
- }
- }
-
- fn encrypt_attachments(
- &self,
- session_uuid: Uuid,
- message_uuid: Uuid,
- attachments: &[AttachmentMeta],
- chat_key: &[u8],
- ) -> Result<Vec<RemoteAttachment>, SyncError> {
- attachments
- .iter()
- .map(|attachment| {
- let encrypted_size =
- self.encrypted_attachment_size(&attachment.id, session_uuid, chat_key)?;
- let remote_id = match self.db.get_attachment_remote_id(&attachment.id)? {
- Some(remote_id) => remote_id,
- None => {
- let fallback = attachment.id.clone();
- self.db
- .set_attachment_remote_id(&attachment.id, Some(&fallback))?;
- fallback
- }
- };
- let client_metadata =
- encode_attachment_metadata(attachment, message_uuid, chat_key)?;
- Ok(RemoteAttachment {
- id: remote_id,
- size: encrypted_size,
- client_metadata: Some(client_metadata),
- encrypted_name: None,
- kind: None,
- })
- })
- .collect()
- }
-
- fn decrypt_remote_attachments(
- &self,
- attachments: &[RemoteAttachment],
- chat_key: &[u8],
- ) -> Result<(Vec<AttachmentMeta>, HashMap<String, String>), SyncError> {
- let mut metas = Vec::with_capacity(attachments.len());
- let mut remote_ids = HashMap::new();
- for attachment in attachments {
- let (meta, client_id) = decode_attachment_metadata(attachment, chat_key)?;
- remote_ids.insert(client_id.clone(), attachment.id.clone());
- metas.push(meta);
- }
- Ok((metas, remote_ids))
- }
-
- fn collect_messages_for_sync(&self, session_uuid: Uuid) -> Result<Vec<Message>, SyncError> {
- let messages = self.db.get_messages(session_uuid)?;
- let mut pending = Vec::new();
-
- for message in messages {
- let state = self.sync_state.get_message_state(message.uuid)?;
- let missing_remote = state
- .as_ref()
- .and_then(|entry| entry.remote_id.as_deref())
- .is_none();
- let missing_server_ts = state
- .as_ref()
- .and_then(|entry| entry.server_updated_at)
- .is_none();
- if message.needs_sync || missing_remote || missing_server_ts {
- pending.push(message);
- }
- }
-
- Ok(pending)
- }
-
- fn reconcile_attachments(
- &self,
- session_uuid: Uuid,
- messages: &[Message],
- ) -> Result<(), SyncError> {
- for message in messages {
- for attachment in &message.attachments {
- if self
- .db
- .get_attachment_upload_state(&attachment.id)?
- .is_none()
- {
- let _ = self.db.upsert_pending_attachment(
- &attachment.id,
- session_uuid,
- message.uuid,
- attachment.size,
- );
- }
- }
- }
- Ok(())
- }
-
- fn collect_attachment_states(
- &self,
- messages: &[Message],
- ) -> Result<HashMap<String, UploadState>, SyncError> {
- let mut states = HashMap::new();
- for message in messages {
- for attachment in &message.attachments {
- let state = self
- .db
- .get_attachment_upload_state(&attachment.id)?
- .unwrap_or(UploadState::Pending);
- states.insert(attachment.id.clone(), state);
- }
- }
- Ok(states)
- }
-
- fn revalidate_uploaded_attachments(
- &self,
- http: &HttpClient,
- session_uuid: Uuid,
- messages: &[Message],
- ) -> Result<HashSet<String>, SyncError> {
- let states = self.collect_attachment_states(messages)?;
- let plaintext_dir = self.plaintext_dir.as_ref();
- let mut force_uploads = HashSet::new();
- let mut checked = HashSet::new();
-
- for message in messages {
- for attachment in &message.attachments {
- if !checked.insert(attachment.id.clone()) {
- continue;
- }
- let state = states
- .get(&attachment.id)
- .copied()
- .unwrap_or(UploadState::Pending);
- if state != UploadState::Uploaded {
- continue;
- }
-
- let has_encrypted = self.attachment_store.exists(&attachment.id)?;
- let has_plaintext = plaintext_dir
- .map(|dir| dir.join(&attachment.id).exists())
- .unwrap_or(false);
- if !has_encrypted && !has_plaintext {
- continue;
- }
-
- let remote_id = match self.db.get_attachment_remote_id(&attachment.id)? {
- Some(remote_id) => remote_id,
- None => {
- let fallback = attachment.id.clone();
- self.db
- .set_attachment_remote_id(&attachment.id, Some(&fallback))?;
- fallback
- }
- };
-
- let status =
- match http.head_status(&format!("/llmchat/chat/attachment/{}", remote_id)) {
- Ok(status) => status,
- Err(SyncError::Unauthorized) => return Err(SyncError::Unauthorized),
- Err(_) => continue,
- };
-
- if status == 404 {
- let _ = self.db.upsert_pending_attachment(
- &attachment.id,
- session_uuid,
- message.uuid,
- attachment.size,
- );
- let _ = self
- .db
- .set_attachment_upload_state(&attachment.id, UploadState::Pending);
- force_uploads.insert(attachment.id.clone());
- }
- }
- }
-
- Ok(force_uploads)
- }
-
- fn force_upload_attachment(
- &self,
- http: &HttpClient,
- chat_key: &[u8],
- session_uuid: Uuid,
- attachment_id: &str,
- ) -> Result<(), SyncError> {
- let (encrypted, content_length) =
- self.encrypted_attachment_bytes(attachment_id, session_uuid, chat_key)?;
- let request = UploadUrlRequest {
- content_length,
- content_md5: None,
- };
- let upload_url = http.post_json::<UploadUrlResponse, _>(
- "/llmchat/chat/attachment/upload-url?force=true",
- &request,
- )?;
- self.db
- .set_attachment_remote_id(attachment_id, Some(&upload_url.attachment_id))?;
- http.put_bytes(&upload_url.url, &encrypted, &[])?;
- if self
- .db
- .get_attachment_upload_state(attachment_id)?
- .is_some()
- {
- let _ = self.db.mark_attachment_uploaded(attachment_id);
- }
- Ok(())
- }
-
- fn upload_pending_attachments(
- &self,
- http: &HttpClient,
- chat_key: &[u8],
- session_uuid: Uuid,
- force_uploads: &HashSet<String>,
- ) -> Result<i64, SyncError> {
- let pending = self.db.get_pending_uploads_for_session(session_uuid)?;
- let mut uploaded = 0;
-
- for row in pending {
- self.db
- .set_attachment_upload_state(&row.attachment_id, UploadState::Uploading)?;
-
- let (encrypted, content_length) =
- match self.encrypted_attachment_bytes(&row.attachment_id, session_uuid, chat_key) {
- Ok(data) => data,
- Err(err) => {
- let _ = self
- .db
- .set_attachment_upload_state(&row.attachment_id, UploadState::Failed);
- return Err(err);
- }
- };
-
- let request = UploadUrlRequest {
- content_length,
- content_md5: None,
- };
-
- let upload_path = if force_uploads.contains(&row.attachment_id) {
- "/llmchat/chat/attachment/upload-url?force=true".to_string()
- } else {
- "/llmchat/chat/attachment/upload-url".to_string()
- };
-
- let upload_url = match http.post_json::<UploadUrlResponse, _>(&upload_path, &request) {
- Ok(resp) => Some(resp),
- Err(SyncError::Http { status: 409, .. }) => {
- let _ = self.db.mark_attachment_uploaded(&row.attachment_id);
- uploaded += 1;
- None
- }
- Err(SyncError::Http {
- status: 404 | 501, ..
- }) => {
- let _ = self
- .db
- .set_attachment_upload_state(&row.attachment_id, UploadState::Failed);
- return Err(SyncError::AttachmentApiUnavailable);
- }
- Err(err) => {
- let _ = self
- .db
- .set_attachment_upload_state(&row.attachment_id, UploadState::Failed);
- return Err(err);
- }
- };
-
- if let Some(upload_url) = upload_url {
- self.db.set_attachment_remote_id(
- &row.attachment_id,
- Some(&upload_url.attachment_id),
- )?;
- if let Err(err) = http.put_bytes(&upload_url.url, &encrypted, &[]) {
- let _ = self
- .db
- .set_attachment_upload_state(&row.attachment_id, UploadState::Failed);
- return Err(err);
- }
- let _ = self.db.mark_attachment_uploaded(&row.attachment_id);
- uploaded += 1;
- }
- }
-
- Ok(uploaded)
- }
-
- fn encrypted_attachment_bytes(
- &self,
- attachment_id: &str,
- session_uuid: Uuid,
- chat_key: &[u8],
- ) -> Result<(Vec<u8>, i64), SyncError> {
- let bytes = self.ensure_encrypted_bytes(attachment_id, session_uuid, chat_key)?;
- let size = bytes.len() as i64;
- Ok((bytes, size))
- }
-
- fn encrypted_attachment_size(
- &self,
- attachment_id: &str,
- session_uuid: Uuid,
- chat_key: &[u8],
- ) -> Result<i64, SyncError> {
- if self.attachment_store.exists(attachment_id)? {
- let size = self.attachment_store.size(attachment_id)?;
- return Ok(size as i64);
- }
-
- let (_bytes, size) =
- self.encrypted_attachment_bytes(attachment_id, session_uuid, chat_key)?;
- Ok(size)
- }
-
- fn ensure_encrypted_bytes(
- &self,
- attachment_id: &str,
- session_uuid: Uuid,
- chat_key: &[u8],
- ) -> Result<Vec<u8>, SyncError> {
- if self.attachment_store.exists(attachment_id)? {
- return Ok(self.attachment_store.read(attachment_id)?);
- }
-
- let plaintext_dir = self
- .plaintext_dir
- .as_ref()
- .ok_or_else(|| SyncError::AttachmentMissing(attachment_id.to_string()))?;
- let path = plaintext_dir.join(attachment_id);
- if !path.exists() {
- return Err(SyncError::AttachmentMissing(attachment_id.to_string()));
- }
- let plaintext = std::fs::read(path)?;
- let encrypted = encrypt_attachment_bytes(&plaintext, chat_key, session_uuid)?;
- self.attachment_store.write(attachment_id, &encrypted)?;
- Ok(encrypted)
- }
-
- fn load_cursor(&self) -> Result<SyncCursor, SyncError> {
- match self.sync_state.get_meta(CURSOR_META_KEY)? {
- Some(data) => Ok(serde_json::from_slice(&data)?),
- None => Ok(SyncCursor::default()),
- }
- }
-
- fn save_cursor(&self, cursor: &SyncCursor) -> Result<(), SyncError> {
- let data = serde_json::to_vec(cursor)?;
- self.sync_state.set_meta(CURSOR_META_KEY, &data)?;
- Ok(())
- }
-
- fn load_chat_key_from_meta(&self, master_key: &[u8]) -> Result<Option<Vec<u8>>, SyncError> {
- load_chat_key_from_meta(&self.sync_state, master_key)
- }
-
- fn save_chat_key_to_meta(&self, payload: &ChatKeyPayload) -> Result<(), SyncError> {
- save_chat_key_to_meta(&self.sync_state, payload)
- }
-
- fn get_or_create_chat_key(
- &self,
- http: &HttpClient,
- master_key: &[u8],
- ) -> Result<(Vec<u8>, ChatKeyStatus), SyncError> {
- get_or_create_chat_key_with_state(&self.sync_state, http, master_key)
- }
-}
-
-pub fn fetch_chat_key(auth: SyncAuth, sync_db_path: String) -> Result<Vec<u8>, SyncError> {
- if auth.auth_token.trim().is_empty() {
- return Err(SyncError::NotLoggedIn);
- }
- if auth.master_key.len() != llmchat_db::crypto::KEY_BYTES {
- return Err(SyncError::Crypto("invalid master key length".to_string()));
- }
-
- let SyncAuth {
- base_url,
- auth_token,
- master_key,
- user_agent,
- client_package,
- client_version,
- } = auth;
-
- let http = HttpClient::new(HttpConfig {
- base_url,
- auth_token,
- user_agent,
- client_package,
- client_version,
- timeout_secs: None,
- })?;
-
- let sync_state = SyncStateDb::open_sqlite_with_defaults(sync_db_path)?;
- let (chat_key, _) = get_or_create_chat_key_with_state(&sync_state, &http, &master_key)?;
- Ok(chat_key)
-}
-
-fn load_chat_key_from_meta(
- sync_state: &SyncStateDb<SqliteBackend>,
- master_key: &[u8],
-) -> Result<Option<Vec<u8>>, SyncError> {
- let data = match sync_state.get_meta(CHAT_KEY_META_KEY)? {
- Some(data) => data,
- None => return Ok(None),
- };
- let payload: ChatKeyPayload = serde_json::from_slice(&data)?;
- let encrypted = payload
- .encrypted_value()
- .ok_or_else(|| SyncError::InvalidResponse("missing encrypted chat key".to_string()))?;
- let encrypted_payload = crate::models::EncryptedPayload {
- encrypted_data: encrypted.to_string(),
- header: payload.header,
- };
- Ok(Some(decrypt_chat_key(&encrypted_payload, master_key)?))
-}
-
-fn save_chat_key_to_meta(
- sync_state: &SyncStateDb<SqliteBackend>,
- payload: &ChatKeyPayload,
-) -> Result<(), SyncError> {
- let data = serde_json::to_vec(payload)?;
- sync_state.set_meta(CHAT_KEY_META_KEY, &data)?;
- Ok(())
-}
-
-fn get_or_create_chat_key_with_state(
- sync_state: &SyncStateDb<SqliteBackend>,
- http: &HttpClient,
- master_key: &[u8],
-) -> Result<(Vec<u8>, ChatKeyStatus), SyncError> {
- if let Some(key) = load_chat_key_from_meta(sync_state, master_key)? {
- return Ok((key, ChatKeyStatus::Cached));
- }
-
- let remote = http.get_json_optional::<ChatKeyPayload>("/llmchat/chat/key", &[]);
- let remote = match remote {
- Ok(value) => value,
- Err(SyncError::Http {
- status: 400,
- code: Some(code),
- ..
- }) if code == "AuthKeyNotCreated" => None,
- Err(err) => return Err(err),
- };
-
- if let Some(payload) = remote {
- let encrypted = payload
- .encrypted_value()
- .ok_or_else(|| SyncError::InvalidResponse("missing encrypted chat key".to_string()))?;
- let encrypted_payload = crate::models::EncryptedPayload {
- encrypted_data: encrypted.to_string(),
- header: payload.header.clone(),
- };
- let key = decrypt_chat_key(&encrypted_payload, master_key)?;
- save_chat_key_to_meta(sync_state, &payload)?;
- return Ok((key, ChatKeyStatus::Remote));
- }
-
- let chat_key = keys::generate_stream_key();
- let encrypted = encrypt_chat_key(&chat_key, master_key)?;
- let payload = ChatKeyPayload::from_encrypted(&encrypted);
-
- match http.post_empty("/llmchat/chat/key", &payload) {
- Ok(()) => {
- save_chat_key_to_meta(sync_state, &payload)?;
- Ok((chat_key, ChatKeyStatus::Created))
- }
- Err(SyncError::Http { status: 409, .. }) => {
- let existing = http.get_json_optional::<ChatKeyPayload>("/llmchat/chat/key", &[])?;
- let payload = existing
- .ok_or_else(|| SyncError::InvalidResponse("chat key already exists".to_string()))?;
- let encrypted = payload.encrypted_value().ok_or_else(|| {
- SyncError::InvalidResponse("missing encrypted chat key".to_string())
- })?;
- let encrypted_payload = crate::models::EncryptedPayload {
- encrypted_data: encrypted.to_string(),
- header: payload.header.clone(),
- };
- let key = decrypt_chat_key(&encrypted_payload, master_key)?;
- save_chat_key_to_meta(sync_state, &payload)?;
- Ok((key, ChatKeyStatus::Remote))
- }
- Err(err) => Err(err),
- }
-}
-
-#[derive(Debug, serde::Serialize, serde::Deserialize)]
-#[serde(rename_all = "camelCase")]
-struct ClientMetadataPayload {
- #[serde(rename = "clientId")]
- client_id: String,
- #[serde(default)]
- created_at: Option<serde_json::Value>,
-}
-
-fn encode_client_metadata(
- client_id: &str,
- created_at: i64,
- chat_key: &[u8],
-) -> Result<String, SyncError> {
- let created_at_value = if created_at > 0 {
- let encrypted = llmchat_db::crypto::encrypt_json_field(&created_at.to_string(), chat_key)
- .map_err(|err| SyncError::Crypto(err.to_string()))?;
- Some(serde_json::Value::String(encrypted))
- } else {
- None
- };
-
- let payload = ClientMetadataPayload {
- client_id: client_id.to_string(),
- created_at: created_at_value,
- };
- Ok(serde_json::to_string(&payload)?)
-}
-
-fn decode_client_id(value: &str) -> Option<String> {
- serde_json::from_str::<ClientMetadataPayload>(value)
- .ok()
- .map(|payload| payload.client_id)
- .filter(|client_id| !client_id.trim().is_empty())
-}
-
-fn decode_client_created_at(value: &str, chat_key: &[u8]) -> Option<i64> {
- if let Ok(payload) = serde_json::from_str::<ClientMetadataPayload>(value) {
- let created_at_value = payload.created_at?;
- let parsed = match created_at_value {
- serde_json::Value::Number(number) => number.as_i64(),
- serde_json::Value::String(raw) => {
- let decrypted =
- llmchat_db::crypto::decrypt_json_field(&raw, chat_key).unwrap_or(raw);
- decrypted.parse::<i64>().ok()
- }
- _ => None,
- };
- return parsed.filter(|created_at| *created_at > 0);
- }
-
- let decrypted = llmchat_db::crypto::decrypt_json_field(value, chat_key)
- .unwrap_or_else(|_| value.to_string());
- decrypted
- .parse::<i64>()
- .ok()
- .filter(|created_at| *created_at > 0)
-}
-
-#[derive(Debug, serde::Serialize, serde::Deserialize)]
-#[serde(rename_all = "camelCase")]
-struct AttachmentClientMetadata {
- #[serde(rename = "clientId")]
- client_id: String,
- #[serde(rename = "localId", default)]
- local_id: Option<String>,
- #[serde(default)]
- encrypted_name: Option<String>,
- #[serde(default)]
- kind: Option<AttachmentKind>,
-}
-
-fn encode_attachment_metadata(
- attachment: &AttachmentMeta,
- message_uuid: Uuid,
- chat_key: &[u8],
-) -> Result<String, SyncError> {
- let encrypted_name = llmchat_db::crypto::encrypt_json_field(&attachment.name, chat_key)
- .map_err(|err| SyncError::Crypto(err.to_string()))?;
- let payload = AttachmentClientMetadata {
- client_id: format!("{}:{}", message_uuid, attachment.id),
- local_id: Some(attachment.id.clone()),
- encrypted_name: Some(encrypted_name),
- kind: Some(attachment.kind),
- };
- Ok(serde_json::to_string(&payload)?)
-}
-
-fn decode_attachment_metadata(
- attachment: &RemoteAttachment,
- chat_key: &[u8],
-) -> Result<(AttachmentMeta, String), SyncError> {
- if let Some(metadata) = &attachment.client_metadata {
- let payload = serde_json::from_str::<AttachmentClientMetadata>(metadata).map_err(|_| {
- SyncError::InvalidResponse("invalid attachment clientMetadata".to_string())
- })?;
- let encrypted_name = payload.encrypted_name.ok_or_else(|| {
- SyncError::InvalidResponse("missing attachment encryptedName".to_string())
- })?;
- let name = llmchat_db::crypto::decrypt_json_field(&encrypted_name, chat_key)
- .map_err(|err| SyncError::Crypto(err.to_string()))?;
- let kind = payload.kind.unwrap_or_else(|| infer_kind(&name));
- let local_id = payload
- .local_id
- .clone()
- .filter(|value| !value.trim().is_empty())
- .unwrap_or(payload.client_id.clone());
- return Ok((
- AttachmentMeta {
- id: local_id.clone(),
- kind,
- size: attachment.size,
- name,
- },
- local_id,
- ));
- }
-
- let encrypted_name = attachment
- .encrypted_name
- .as_ref()
- .ok_or_else(|| SyncError::InvalidResponse("missing attachment metadata".to_string()))?;
- let name = llmchat_db::crypto::decrypt_json_field(encrypted_name, chat_key)
- .map_err(|err| SyncError::Crypto(err.to_string()))?;
- let kind = attachment.kind.unwrap_or_else(|| infer_kind(&name));
- let client_id = attachment.id.clone();
- Ok((
- AttachmentMeta {
- id: client_id.clone(),
- kind,
- size: attachment.size,
- name,
- },
- client_id,
- ))
-}
-
-#[derive(Debug, serde::Serialize)]
-#[serde(rename_all = "camelCase")]
-struct UpsertSessionRequest {
- #[serde(
- rename = "sessionUUID",
- alias = "session_uuid",
- skip_serializing_if = "Option::is_none"
- )]
- session_uuid: Option<String>,
- #[serde(rename = "encryptedData", alias = "encrypted_data")]
- encrypted_data: String,
- header: String,
- #[serde(
- rename = "clientMetadata",
- alias = "client_metadata",
- skip_serializing_if = "Option::is_none"
- )]
- client_metadata: Option<String>,
-}
-
-#[derive(Debug, serde::Deserialize)]
-#[serde(rename_all = "camelCase")]
-struct UpsertSessionResponse {
- #[serde(rename = "sessionUUID", alias = "session_uuid")]
- session_uuid: String,
- #[serde(alias = "updated_at")]
- updated_at: Option<i64>,
-}
-
-#[derive(Debug, serde::Deserialize)]
-#[serde(rename_all = "camelCase")]
-struct UpsertMessageResponse {
- #[serde(rename = "messageUUID", alias = "message_uuid")]
- message_uuid: String,
- #[serde(alias = "updated_at")]
- updated_at: Option<i64>,
-}
-
-#[derive(Debug, serde::Serialize)]
-#[serde(rename_all = "camelCase")]
-struct UpsertMessageRequest {
- #[serde(
- rename = "messageUUID",
- alias = "message_uuid",
- skip_serializing_if = "Option::is_none"
- )]
- message_uuid: Option<String>,
- #[serde(rename = "sessionUUID", alias = "session_uuid")]
- session_uuid: String,
- #[serde(rename = "parentMessageUUID", alias = "parent_message_uuid")]
- parent_message_uuid: Option<String>,
- sender: String,
- attachments: Vec<RemoteAttachment>,
- #[serde(rename = "encryptedData", alias = "encrypted_data")]
- encrypted_data: String,
- header: String,
- #[serde(
- rename = "clientMetadata",
- alias = "client_metadata",
- skip_serializing_if = "Option::is_none"
- )]
- client_metadata: Option<String>,
-}
-
-fn normalize_remote_uuid(value: Option<String>) -> Option<String> {
- value.and_then(|value| {
- let trimmed = value.trim();
- if trimmed.is_empty() || trimmed == ZERO_UUID {
- None
- } else {
- Some(trimmed.to_string())
- }
- })
-}
-
-fn blocked_messages(messages: &[Message], states: &HashMap<String, UploadState>) -> HashSet<Uuid> {
- let mut blocked: HashSet<Uuid> = HashSet::new();
- let mut children: HashMap<Uuid, Vec<Uuid>> = HashMap::new();
-
- for message in messages {
- let parent = message.parent_message_uuid;
- if let Some(parent) = parent {
- children.entry(parent).or_default().push(message.uuid);
- }
- let is_blocked = message.attachments.iter().any(|att| {
- states
- .get(&att.id)
- .map(|state| *state != UploadState::Uploaded)
- .unwrap_or(true)
- });
- if is_blocked {
- blocked.insert(message.uuid);
- }
- }
-
- let mut queue: Vec<Uuid> = blocked.iter().cloned().collect();
- while let Some(current) = queue.pop() {
- if let Some(kids) = children.get(&current) {
- for child in kids {
- if blocked.insert(*child) {
- queue.push(*child);
- }
- }
- }
- }
-
- blocked
-}
-
-fn infer_kind(name: &str) -> AttachmentKind {
- let lower = name.to_ascii_lowercase();
- if lower.ends_with(".png")
- || lower.ends_with(".jpg")
- || lower.ends_with(".jpeg")
- || lower.ends_with(".gif")
- || lower.ends_with(".webp")
- || lower.ends_with(".heic")
- || lower.ends_with(".bmp")
- {
- AttachmentKind::Image
- } else {
- AttachmentKind::Document
- }
-}
diff --git a/rust/llmchat/sync/tests/sync_integration.rs b/rust/llmchat/sync/tests/sync_integration.rs
deleted file mode 100644
index b619197323..0000000000
--- a/rust/llmchat/sync/tests/sync_integration.rs
+++ /dev/null
@@ -1,311 +0,0 @@
-use httpmock::Method::{DELETE, GET, POST};
-use httpmock::MockServer;
-use llmchat_db::LlmChatDb;
-use llmchat_db::crypto::KEY_BYTES;
-use llmchat_sync::SyncAuth;
-use llmchat_sync::SyncEngine;
-use llmchat_sync::crypto::{encrypt_chat_key, encrypt_payload};
-use llmchat_sync::models::{
- ChatKeyPayload, DiffResponse, DiffTombstones, MessagePayload, MessageTombstone, RemoteMessage,
- RemoteSession, SessionPayload,
-};
-use tempfile::TempDir;
-use uuid::Uuid;
-use zeroize::Zeroizing;
-
-struct TestEnv {
- _dir: TempDir,
- main_db_path: String,
- attachments_db_path: String,
- attachments_dir: String,
- meta_dir: String,
- plaintext_dir: Option<String>,
-}
-
-impl TestEnv {
- fn new() -> Self {
- let dir = TempDir::new().expect("temp dir");
- let main_db_path = dir.path().join("main.db");
- let attachments_db_path = dir.path().join("attachments.db");
- let attachments_dir = dir.path().join("attachments");
- let meta_dir = dir.path().join("meta");
- Self {
- _dir: dir,
- main_db_path: main_db_path.to_string_lossy().to_string(),
- attachments_db_path: attachments_db_path.to_string_lossy().to_string(),
- attachments_dir: attachments_dir.to_string_lossy().to_string(),
- meta_dir: meta_dir.to_string_lossy().to_string(),
- plaintext_dir: None,
- }
- }
-}
-
-fn make_auth(server: &MockServer, master_key: Vec<u8>) -> SyncAuth {
- SyncAuth {
- base_url: server.base_url(),
- auth_token: "token".to_string(),
- master_key: Zeroizing::new(master_key),
- user_agent: None,
- client_package: None,
- client_version: None,
- }
-}
-
-fn mock_chat_key(server: &MockServer, master_key: &[u8], chat_key: &[u8]) {
- let encrypted = encrypt_chat_key(chat_key, master_key).expect("encrypt chat key");
- let payload = ChatKeyPayload::from_encrypted(&encrypted);
- server.mock(|when, then| {
- when.method(GET).path("/llmchat/chat/key");
- then.status(200).json_body_obj(&payload);
- });
-}
-
-fn mock_empty_diff(server: &MockServer, timestamp: i64) {
- let diff = DiffResponse {
- sessions: Vec::new(),
- messages: Vec::new(),
- tombstones: DiffTombstones::default(),
- cursor: None,
- timestamp: Some(timestamp),
- };
- server.mock(|when, then| {
- when.method(GET).path("/llmchat/chat/diff");
- then.status(200).json_body_obj(&diff);
- });
-}
-
-#[test]
-fn pull_applies_remote_sessions_and_messages() {
- let env = TestEnv::new();
- let db_key = vec![42u8; KEY_BYTES];
- let engine = SyncEngine::new(
- env.main_db_path.clone(),
- env.attachments_db_path.clone(),
- db_key.clone(),
- env.attachments_dir.clone(),
- env.meta_dir.clone(),
- env.plaintext_dir.clone(),
- )
- .expect("sync engine");
-
- let master_key = vec![9u8; KEY_BYTES];
- let chat_key = ente_core::crypto::keys::generate_stream_key();
-
- let server = MockServer::start();
- mock_chat_key(&server, &master_key, &chat_key);
-
- let session_uuid = Uuid::new_v4();
- let message_uuid = Uuid::new_v4();
-
- let session_payload = SessionPayload {
- title: "Remote Session".to_string(),
- };
- let encrypted_session = encrypt_payload(&session_payload, &chat_key).expect("encrypt session");
-
- let message_payload = MessagePayload {
- text: "hello".to_string(),
- };
- let encrypted_message = encrypt_payload(&message_payload, &chat_key).expect("encrypt message");
-
- let diff = DiffResponse {
- sessions: vec![RemoteSession {
- session_uuid: session_uuid.to_string(),
- encrypted_data: encrypted_session.encrypted_data,
- header: encrypted_session.header,
- client_metadata: None,
- created_at: 10,
- updated_at: 11,
- is_deleted: None,
- }],
- messages: vec![RemoteMessage {
- message_uuid: message_uuid.to_string(),
- session_uuid: session_uuid.to_string(),
- parent_message_uuid: None,
- sender: "self".to_string(),
- attachments: Vec::new(),
- encrypted_data: encrypted_message.encrypted_data,
- header: encrypted_message.header,
- client_metadata: None,
- created_at: 12,
- updated_at: None,
- is_deleted: None,
- }],
- tombstones: DiffTombstones::default(),
- cursor: None,
- timestamp: Some(12),
- };
-
- server.mock(|when, then| {
- when.method(GET).path("/llmchat/chat/diff");
- then.status(200).json_body_obj(&diff);
- });
-
- let auth = make_auth(&server, master_key);
- engine.sync(auth).expect("sync");
-
- let db = LlmChatDb::open_sqlite_with_defaults(
- env.main_db_path.clone(),
- env.attachments_db_path.clone(),
- db_key,
- )
- .expect("db");
-
- let sessions = db.list_sessions().expect("sessions");
- assert_eq!(sessions.len(), 1);
- assert_eq!(sessions[0].uuid, session_uuid);
- assert_eq!(sessions[0].title, "Remote Session");
-
- let messages = db.get_messages(session_uuid).expect("messages");
- assert_eq!(messages.len(), 1);
- assert_eq!(messages[0].uuid, message_uuid);
- assert_eq!(messages[0].text, "hello");
- assert!(!messages[0].needs_sync);
-}
-
-#[test]
-fn push_only_needs_sync_messages() {
- let env = TestEnv::new();
- let db_key = vec![11u8; KEY_BYTES];
- let engine = SyncEngine::new(
- env.main_db_path.clone(),
- env.attachments_db_path.clone(),
- db_key.clone(),
- env.attachments_dir.clone(),
- env.meta_dir.clone(),
- env.plaintext_dir.clone(),
- )
- .expect("sync engine");
-
- let db = LlmChatDb::open_sqlite_with_defaults(
- env.main_db_path.clone(),
- env.attachments_db_path.clone(),
- db_key.clone(),
- )
- .expect("db");
-
- let session = db.create_session("Local Session").expect("session");
- let message_one = db
- .insert_message(session.uuid, "self", "one", None, Vec::new())
- .expect("message one");
- let _message_two = db
- .insert_message(session.uuid, "self", "two", None, Vec::new())
- .expect("message two");
- db.mark_message_synced(message_one.uuid)
- .expect("mark synced");
-
- let master_key = vec![7u8; KEY_BYTES];
- let chat_key = ente_core::crypto::keys::generate_stream_key();
- let server = MockServer::start();
- mock_chat_key(&server, &master_key, &chat_key);
- mock_empty_diff(&server, 10);
-
- let session_mock = server.mock(|when, then| {
- when.method(POST).path("/llmchat/chat/session");
- then.status(200).json_body_obj(&serde_json::json!({}));
- });
-
- let message_mock = server.mock(|when, then| {
- when.method(POST).path("/llmchat/chat/message");
- then.status(200).json_body_obj(&serde_json::json!({}));
- });
-
- let auth = make_auth(&server, master_key);
- engine.sync(auth).expect("sync");
-
- assert_eq!(session_mock.hits(), 1);
- assert_eq!(message_mock.hits(), 1);
-
- let messages = db.get_messages(session.uuid).expect("messages");
- assert!(messages.iter().all(|message| !message.needs_sync));
-}
-
-#[test]
-fn tombstone_removes_messages() {
- let env = TestEnv::new();
- let db_key = vec![3u8; KEY_BYTES];
- let engine = SyncEngine::new(
- env.main_db_path.clone(),
- env.attachments_db_path.clone(),
- db_key.clone(),
- env.attachments_dir.clone(),
- env.meta_dir.clone(),
- env.plaintext_dir.clone(),
- )
- .expect("sync engine");
-
- let master_key = vec![12u8; KEY_BYTES];
- let chat_key = ente_core::crypto::keys::generate_stream_key();
-
- let server = MockServer::start();
- mock_chat_key(&server, &master_key, &chat_key);
-
- let session_uuid = Uuid::new_v4();
- let message_uuid = Uuid::new_v4();
-
- let session_payload = SessionPayload {
- title: "Remote Session".to_string(),
- };
- let encrypted_session = encrypt_payload(&session_payload, &chat_key).expect("encrypt session");
-
- let message_payload = MessagePayload {
- text: "to delete".to_string(),
- };
- let encrypted_message = encrypt_payload(&message_payload, &chat_key).expect("encrypt message");
-
- let diff = DiffResponse {
- sessions: vec![RemoteSession {
- session_uuid: session_uuid.to_string(),
- encrypted_data: encrypted_session.encrypted_data,
- header: encrypted_session.header,
- client_metadata: None,
- created_at: 10,
- updated_at: 11,
- is_deleted: None,
- }],
- messages: vec![RemoteMessage {
- message_uuid: message_uuid.to_string(),
- session_uuid: session_uuid.to_string(),
- parent_message_uuid: None,
- sender: "self".to_string(),
- attachments: Vec::new(),
- encrypted_data: encrypted_message.encrypted_data,
- header: encrypted_message.header,
- client_metadata: None,
- created_at: 12,
- updated_at: None,
- is_deleted: None,
- }],
- tombstones: DiffTombstones {
- sessions: Vec::new(),
- messages: vec![MessageTombstone {
- message_uuid: message_uuid.to_string(),
- deleted_at: Some(15),
- }],
- },
- cursor: None,
- timestamp: Some(15),
- };
-
- server.mock(|when, then| {
- when.method(GET).path("/llmchat/chat/diff");
- then.status(200).json_body_obj(&diff);
- });
-
- server.mock(|when, then| {
- when.method(DELETE).path("/llmchat/chat/message");
- then.status(200).json_body_obj(&serde_json::json!({}));
- });
-
- let auth = make_auth(&server, master_key);
- engine.sync(auth).expect("sync");
-
- let db = LlmChatDb::open_sqlite_with_defaults(
- env.main_db_path.clone(),
- env.attachments_db_path.clone(),
- db_key,
- )
- .expect("db");
-
- let messages = db.get_messages(session_uuid).expect("messages");
- assert!(messages.is_empty());
-}
diff --git a/rust/llmchat/uniffi/inference_rs_uniffi/Cargo.lock b/rust/llmchat/uniffi/inference_rs_uniffi/Cargo.lock
deleted file mode 100644
index c755d50a3c..0000000000
--- a/rust/llmchat/uniffi/inference_rs_uniffi/Cargo.lock
+++ /dev/null
@@ -1,1074 +0,0 @@
-# This file is automatically @generated by Cargo.
-# It is not intended for manual editing.
-version = 4
-
-[[package]]
-name = "aho-corasick"
-version = "1.1.4"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "ddd31a130427c27518df266943a5308ed92d4b226cc639f5a8f1002816174301"
-dependencies = [
- "memchr",
-]
-
-[[package]]
-name = "anyhow"
-version = "1.0.100"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "a23eb6b1614318a8071c9b2521f36b424b2c83db5eb3a0fead4a6c0809af6e61"
-
-[[package]]
-name = "askama"
-version = "0.14.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "f75363874b771be265f4ffe307ca705ef6f3baa19011c149da8674a87f1b75c4"
-dependencies = [
- "askama_derive",
- "itoa",
- "percent-encoding",
- "serde",
- "serde_json",
-]
-
-[[package]]
-name = "askama_derive"
-version = "0.14.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "129397200fe83088e8a68407a8e2b1f826cf0086b21ccdb866a722c8bcd3a94f"
-dependencies = [
- "askama_parser",
- "basic-toml",
- "memchr",
- "proc-macro2",
- "quote",
- "rustc-hash",
- "serde",
- "serde_derive",
- "syn",
-]
-
-[[package]]
-name = "askama_parser"
-version = "0.14.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "d6ab5630b3d5eaf232620167977f95eb51f3432fc76852328774afbd242d4358"
-dependencies = [
- "memchr",
- "serde",
- "serde_derive",
- "winnow",
-]
-
-[[package]]
-name = "autocfg"
-version = "1.5.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "c08606f8c3cbf4ce6ec8e28fb0014a2c086708fe954eaa885384a6165172e7e8"
-
-[[package]]
-name = "basic-toml"
-version = "0.1.10"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "ba62675e8242a4c4e806d12f11d136e626e6c8361d6b829310732241652a178a"
-dependencies = [
- "serde",
-]
-
-[[package]]
-name = "bindgen"
-version = "0.72.1"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "993776b509cfb49c750f11b8f07a46fa23e0a1386ffc01fb1e7d343efc387895"
-dependencies = [
- "bitflags",
- "cexpr",
- "clang-sys",
- "itertools",
- "log",
- "prettyplease",
- "proc-macro2",
- "quote",
- "regex",
- "rustc-hash",
- "shlex",
- "syn",
-]
-
-[[package]]
-name = "bitflags"
-version = "2.10.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "812e12b5285cc515a9c72a5c1d3b6d46a19dac5acfef5265968c166106e31dd3"
-
-[[package]]
-name = "bytes"
-version = "1.11.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "b35204fbdc0b3f4446b89fc1ac2cf84a8a68971995d0bf2e925ec7cd960f9cb3"
-
-[[package]]
-name = "camino"
-version = "1.2.2"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "e629a66d692cb9ff1a1c664e41771b3dcaf961985a9774c0eb0bd1b51cf60a48"
-dependencies = [
- "serde_core",
-]
-
-[[package]]
-name = "cargo-platform"
-version = "0.1.9"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "e35af189006b9c0f00a064685c727031e3ed2d8020f7ba284d78cc2671bd36ea"
-dependencies = [
- "serde",
-]
-
-[[package]]
-name = "cargo_metadata"
-version = "0.19.2"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "dd5eb614ed4c27c5d706420e4320fbe3216ab31fa1c33cd8246ac36dae4479ba"
-dependencies = [
- "camino",
- "cargo-platform",
- "semver",
- "serde",
- "serde_json",
- "thiserror 2.0.17",
-]
-
-[[package]]
-name = "cc"
-version = "1.2.56"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "aebf35691d1bfb0ac386a69bac2fde4dd276fb618cf8bf4f5318fe285e821bb2"
-dependencies = [
- "find-msvc-tools",
- "jobserver",
- "libc",
- "shlex",
-]
-
-[[package]]
-name = "cexpr"
-version = "0.6.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "6fac387a98bb7c37292057cffc56d62ecb629900026402633ae9160df93a8766"
-dependencies = [
- "nom",
-]
-
-[[package]]
-name = "cfg-if"
-version = "1.0.4"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "9330f8b2ff13f34540b44e946ef35111825727b38d33286ef986142615121801"
-
-[[package]]
-name = "clang-sys"
-version = "1.8.1"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "0b023947811758c97c59bf9d1c188fd619ad4718dcaa767947df1cadb14f39f4"
-dependencies = [
- "glob",
- "libc",
- "libloading",
-]
-
-[[package]]
-name = "cmake"
-version = "0.1.57"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "75443c44cd6b379beb8c5b45d85d0773baf31cce901fe7bb252f4eff3008ef7d"
-dependencies = [
- "cc",
-]
-
-[[package]]
-name = "either"
-version = "1.15.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "48c757948c5ede0e46177b7add2e67155f70e33c07fea8284df6576da70b3719"
-
-[[package]]
-name = "encoding_rs"
-version = "0.8.35"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "75030f3c4f45dafd7586dd6780965a8c7e8e285a5ecb86713e63a79c5b2766f3"
-dependencies = [
- "cfg-if",
-]
-
-[[package]]
-name = "enumflags2"
-version = "0.7.12"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "1027f7680c853e056ebcec683615fb6fbbc07dbaa13b4d5d9442b146ded4ecef"
-dependencies = [
- "enumflags2_derive",
-]
-
-[[package]]
-name = "enumflags2_derive"
-version = "0.7.12"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "67c78a4d8fdf9953a5c9d458f9efe940fd97a0cab0941c075a813ac594733827"
-dependencies = [
- "proc-macro2",
- "quote",
- "syn",
-]
-
-[[package]]
-name = "equivalent"
-version = "1.0.2"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "877a4ace8713b0bcf2a4e7eec82529c029f1d0619886d18145fea96c3ffe5c0f"
-
-[[package]]
-name = "errno"
-version = "0.3.14"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "39cab71617ae0d63f51a36d69f866391735b51691dbda63cf6f96d042b63efeb"
-dependencies = [
- "libc",
- "windows-sys",
-]
-
-[[package]]
-name = "fastrand"
-version = "2.3.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "37909eebbb50d72f9059c3b6d82c0463f2ff062c9e95845c43a6c9c0355411be"
-
-[[package]]
-name = "find-msvc-tools"
-version = "0.1.9"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "5baebc0774151f905a1a2cc41989300b1e6fbb29aff0ceffa1064fdd3088d582"
-
-[[package]]
-name = "find_cuda_helper"
-version = "0.2.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "f9f9e65c593dd01ac77daad909ea4ad17f0d6d1776193fc8ea766356177abdad"
-dependencies = [
- "glob",
-]
-
-[[package]]
-name = "fs-err"
-version = "2.11.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "88a41f105fe1d5b6b34b2055e3dc59bb79b46b48b2040b9e6c7b4b5de097aa41"
-dependencies = [
- "autocfg",
-]
-
-[[package]]
-name = "getrandom"
-version = "0.3.4"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "899def5c37c4fd7b2664648c28120ecec138e4d395b459e5ca34f9cce2dd77fd"
-dependencies = [
- "cfg-if",
- "libc",
- "r-efi",
- "wasip2",
-]
-
-[[package]]
-name = "glob"
-version = "0.3.3"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "0cc23270f6e1808e30a928bdc84dea0b9b4136a8bc82338574f23baf47bbd280"
-
-[[package]]
-name = "goblin"
-version = "0.8.2"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "1b363a30c165f666402fe6a3024d3bec7ebc898f96a4a23bd1c99f8dbf3f4f47"
-dependencies = [
- "log",
- "plain",
- "scroll",
-]
-
-[[package]]
-name = "hashbrown"
-version = "0.16.1"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "841d1cc9bed7f9236f321df977030373f4a4163ae1a7dbfe1a51a2c1a51d9100"
-
-[[package]]
-name = "heck"
-version = "0.5.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "2304e00983f87ffb38b55b444b5e3b60a884b5d30c0fca7d82fe33449bbe55ea"
-
-[[package]]
-name = "indexmap"
-version = "2.13.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "7714e70437a7dc3ac8eb7e6f8df75fd8eb422675fc7678aff7364301092b1017"
-dependencies = [
- "equivalent",
- "hashbrown",
- "serde",
- "serde_core",
-]
-
-[[package]]
-name = "inference_rs"
-version = "0.1.0"
-dependencies = [
- "llama-cpp-2",
- "llama-cpp-sys-2",
- "parking_lot",
- "self_cell",
- "serde",
- "serde_json",
- "thiserror 1.0.69",
-]
-
-[[package]]
-name = "inference_rs_uniffi"
-version = "0.1.0"
-dependencies = [
- "inference_rs",
- "serde",
- "thiserror 1.0.69",
- "uniffi",
-]
-
-[[package]]
-name = "itertools"
-version = "0.13.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "413ee7dfc52ee1a4949ceeb7dbc8a33f2d6c088194d9f922fb8318faf1f01186"
-dependencies = [
- "either",
-]
-
-[[package]]
-name = "itoa"
-version = "1.0.17"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "92ecc6618181def0457392ccd0ee51198e065e016d1d527a7ac1b6dc7c1f09d2"
-
-[[package]]
-name = "jobserver"
-version = "0.1.34"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "9afb3de4395d6b3e67a780b6de64b51c978ecf11cb9a462c66be7d4ca9039d33"
-dependencies = [
- "getrandom",
- "libc",
-]
-
-[[package]]
-name = "libc"
-version = "0.2.180"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "bcc35a38544a891a5f7c865aca548a982ccb3b8650a5b06d0fd33a10283c56fc"
-
-[[package]]
-name = "libloading"
-version = "0.8.9"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "d7c4b02199fee7c5d21a5ae7d8cfa79a6ef5bb2fc834d6e9058e89c825efdc55"
-dependencies = [
- "cfg-if",
- "windows-link",
-]
-
-[[package]]
-name = "linux-raw-sys"
-version = "0.11.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "df1d3c3b53da64cf5760482273a98e575c651a67eec7f77df96b5b642de8f039"
-
-[[package]]
-name = "llama-cpp-2"
-version = "0.1.138"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "2947ab625c59d1fdf42e61f538c3fa66f43de2f78316971920873f359483d1d8"
-dependencies = [
- "encoding_rs",
- "enumflags2",
- "llama-cpp-sys-2",
- "thiserror 2.0.17",
- "tracing",
- "tracing-core",
-]
-
-[[package]]
-name = "llama-cpp-sys-2"
-version = "0.1.138"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "84a529006bf16af70c7485ba957820dc2bc9467d75697e97970c81d2da73c76f"
-dependencies = [
- "bindgen",
- "cc",
- "cmake",
- "find_cuda_helper",
- "glob",
- "walkdir",
-]
-
-[[package]]
-name = "lock_api"
-version = "0.4.14"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "224399e74b87b5f3557511d98dff8b14089b3dadafcab6bb93eab67d3aace965"
-dependencies = [
- "scopeguard",
-]
-
-[[package]]
-name = "log"
-version = "0.4.29"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "5e5032e24019045c762d3c0f28f5b6b8bbf38563a65908389bf7978758920897"
-
-[[package]]
-name = "memchr"
-version = "2.7.6"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "f52b00d39961fc5b2736ea853c9cc86238e165017a493d1d5c8eac6bdc4cc273"
-
-[[package]]
-name = "minimal-lexical"
-version = "0.2.1"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "68354c5c6bd36d73ff3feceb05efa59b6acb7626617f4962be322a825e61f79a"
-
-[[package]]
-name = "nom"
-version = "7.1.3"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "d273983c5a657a70a3e8f2a01329822f3b8c8172b73826411a55751e404a0a4a"
-dependencies = [
- "memchr",
- "minimal-lexical",
-]
-
-[[package]]
-name = "once_cell"
-version = "1.21.3"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "42f5e15c9953c5e4ccceeb2e7382a716482c34515315f7b03532b8b4e8393d2d"
-
-[[package]]
-name = "parking_lot"
-version = "0.12.5"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "93857453250e3077bd71ff98b6a65ea6621a19bb0f559a85248955ac12c45a1a"
-dependencies = [
- "lock_api",
- "parking_lot_core",
-]
-
-[[package]]
-name = "parking_lot_core"
-version = "0.9.12"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "2621685985a2ebf1c516881c026032ac7deafcda1a2c9b7850dc81e3dfcb64c1"
-dependencies = [
- "cfg-if",
- "libc",
- "redox_syscall",
- "smallvec",
- "windows-link",
-]
-
-[[package]]
-name = "percent-encoding"
-version = "2.3.2"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "9b4f627cb1b25917193a259e49bdad08f671f8d9708acfd5fe0a8c1455d87220"
-
-[[package]]
-name = "pin-project-lite"
-version = "0.2.16"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "3b3cff922bd51709b605d9ead9aa71031d81447142d828eb4a6eba76fe619f9b"
-
-[[package]]
-name = "plain"
-version = "0.2.3"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "b4596b6d070b27117e987119b4dac604f3c58cfb0b191112e24771b2faeac1a6"
-
-[[package]]
-name = "prettyplease"
-version = "0.2.37"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "479ca8adacdd7ce8f1fb39ce9ecccbfe93a3f1344b3d0d97f20bc0196208f62b"
-dependencies = [
- "proc-macro2",
- "syn",
-]
-
-[[package]]
-name = "proc-macro2"
-version = "1.0.105"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "535d180e0ecab6268a3e718bb9fd44db66bbbc256257165fc699dadf70d16fe7"
-dependencies = [
- "unicode-ident",
-]
-
-[[package]]
-name = "quote"
-version = "1.0.43"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "dc74d9a594b72ae6656596548f56f667211f8a97b3d4c3d467150794690dc40a"
-dependencies = [
- "proc-macro2",
-]
-
-[[package]]
-name = "r-efi"
-version = "5.3.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "69cdb34c158ceb288df11e18b4bd39de994f6657d83847bdffdbd7f346754b0f"
-
-[[package]]
-name = "redox_syscall"
-version = "0.5.18"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "ed2bf2547551a7053d6fdfafda3f938979645c44812fbfcda098faae3f1a362d"
-dependencies = [
- "bitflags",
-]
-
-[[package]]
-name = "regex"
-version = "1.12.2"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "843bc0191f75f3e22651ae5f1e72939ab2f72a4bc30fa80a066bd66edefc24d4"
-dependencies = [
- "aho-corasick",
- "memchr",
- "regex-automata",
- "regex-syntax",
-]
-
-[[package]]
-name = "regex-automata"
-version = "0.4.13"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "5276caf25ac86c8d810222b3dbb938e512c55c6831a10f3e6ed1c93b84041f1c"
-dependencies = [
- "aho-corasick",
- "memchr",
- "regex-syntax",
-]
-
-[[package]]
-name = "regex-syntax"
-version = "0.8.8"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "7a2d987857b319362043e95f5353c0535c1f58eec5336fdfcf626430af7def58"
-
-[[package]]
-name = "rustc-hash"
-version = "2.1.1"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "357703d41365b4b27c590e3ed91eabb1b663f07c4c084095e60cbed4362dff0d"
-
-[[package]]
-name = "rustix"
-version = "1.1.3"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "146c9e247ccc180c1f61615433868c99f3de3ae256a30a43b49f67c2d9171f34"
-dependencies = [
- "bitflags",
- "errno",
- "libc",
- "linux-raw-sys",
- "windows-sys",
-]
-
-[[package]]
-name = "same-file"
-version = "1.0.6"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "93fc1dc3aaa9bfed95e02e6eadabb4baf7e3078b0bd1b4d7b6b0b68378900502"
-dependencies = [
- "winapi-util",
-]
-
-[[package]]
-name = "scopeguard"
-version = "1.2.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "94143f37725109f92c262ed2cf5e59bce7498c01bcc1502d7b9afe439a4e9f49"
-
-[[package]]
-name = "scroll"
-version = "0.12.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "6ab8598aa408498679922eff7fa985c25d58a90771bd6be794434c5277eab1a6"
-dependencies = [
- "scroll_derive",
-]
-
-[[package]]
-name = "scroll_derive"
-version = "0.12.1"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "1783eabc414609e28a5ba76aee5ddd52199f7107a0b24c2e9746a1ecc34a683d"
-dependencies = [
- "proc-macro2",
- "quote",
- "syn",
-]
-
-[[package]]
-name = "self_cell"
-version = "1.2.2"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "b12e76d157a900eb52e81bc6e9f3069344290341720e9178cde2407113ac8d89"
-
-[[package]]
-name = "semver"
-version = "1.0.27"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "d767eb0aabc880b29956c35734170f26ed551a859dbd361d140cdbeca61ab1e2"
-dependencies = [
- "serde",
- "serde_core",
-]
-
-[[package]]
-name = "serde"
-version = "1.0.228"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "9a8e94ea7f378bd32cbbd37198a4a91436180c5bb472411e48b5ec2e2124ae9e"
-dependencies = [
- "serde_core",
- "serde_derive",
-]
-
-[[package]]
-name = "serde_core"
-version = "1.0.228"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "41d385c7d4ca58e59fc732af25c3983b67ac852c1a25000afe1175de458b67ad"
-dependencies = [
- "serde_derive",
-]
-
-[[package]]
-name = "serde_derive"
-version = "1.0.228"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "d540f220d3187173da220f885ab66608367b6574e925011a9353e4badda91d79"
-dependencies = [
- "proc-macro2",
- "quote",
- "syn",
-]
-
-[[package]]
-name = "serde_json"
-version = "1.0.149"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "83fc039473c5595ace860d8c4fafa220ff474b3fc6bfdb4293327f1a37e94d86"
-dependencies = [
- "itoa",
- "memchr",
- "serde",
- "serde_core",
- "zmij",
-]
-
-[[package]]
-name = "serde_spanned"
-version = "1.0.4"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "f8bbf91e5a4d6315eee45e704372590b30e260ee83af6639d64557f51b067776"
-dependencies = [
- "serde_core",
-]
-
-[[package]]
-name = "shlex"
-version = "1.3.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "0fda2ff0d084019ba4d7c6f371c95d8fd75ce3524c3cb8fb653a3023f6323e64"
-
-[[package]]
-name = "siphasher"
-version = "1.0.1"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "56199f7ddabf13fe5074ce809e7d3f42b42ae711800501b5b16ea82ad029c39d"
-
-[[package]]
-name = "smallvec"
-version = "1.15.1"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "67b1b7a3b5fe4f1376887184045fcf45c69e92af734b7aaddc05fb777b6fbd03"
-
-[[package]]
-name = "smawk"
-version = "0.3.2"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "b7c388c1b5e93756d0c740965c41e8822f866621d41acbdf6336a6a168f8840c"
-
-[[package]]
-name = "static_assertions"
-version = "1.1.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "a2eb9349b6444b326872e140eb1cf5e7c522154d69e7a0ffb0fb81c06b37543f"
-
-[[package]]
-name = "syn"
-version = "2.0.114"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "d4d107df263a3013ef9b1879b0df87d706ff80f65a86ea879bd9c31f9b307c2a"
-dependencies = [
- "proc-macro2",
- "quote",
- "unicode-ident",
-]
-
-[[package]]
-name = "tempfile"
-version = "3.24.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "655da9c7eb6305c55742045d5a8d2037996d61d8de95806335c7c86ce0f82e9c"
-dependencies = [
- "fastrand",
- "getrandom",
- "once_cell",
- "rustix",
- "windows-sys",
-]
-
-[[package]]
-name = "textwrap"
-version = "0.16.2"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "c13547615a44dc9c452a8a534638acdf07120d4b6847c8178705da06306a3057"
-dependencies = [
- "smawk",
-]
-
-[[package]]
-name = "thiserror"
-version = "1.0.69"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "b6aaf5339b578ea85b50e080feb250a3e8ae8cfcdff9a461c9ec2904bc923f52"
-dependencies = [
- "thiserror-impl 1.0.69",
-]
-
-[[package]]
-name = "thiserror"
-version = "2.0.17"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "f63587ca0f12b72a0600bcba1d40081f830876000bb46dd2337a3051618f4fc8"
-dependencies = [
- "thiserror-impl 2.0.17",
-]
-
-[[package]]
-name = "thiserror-impl"
-version = "1.0.69"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "4fee6c4efc90059e10f81e6d42c60a18f76588c3d74cb83a0b242a2b6c7504c1"
-dependencies = [
- "proc-macro2",
- "quote",
- "syn",
-]
-
-[[package]]
-name = "thiserror-impl"
-version = "2.0.17"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "3ff15c8ecd7de3849db632e14d18d2571fa09dfc5ed93479bc4485c7a517c913"
-dependencies = [
- "proc-macro2",
- "quote",
- "syn",
-]
-
-[[package]]
-name = "toml"
-version = "0.9.11+spec-1.1.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "f3afc9a848309fe1aaffaed6e1546a7a14de1f935dc9d89d32afd9a44bab7c46"
-dependencies = [
- "indexmap",
- "serde_core",
- "serde_spanned",
- "toml_datetime",
- "toml_parser",
- "toml_writer",
- "winnow",
-]
-
-[[package]]
-name = "toml_datetime"
-version = "0.7.5+spec-1.1.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "92e1cfed4a3038bc5a127e35a2d360f145e1f4b971b551a2ba5fd7aedf7e1347"
-dependencies = [
- "serde_core",
-]
-
-[[package]]
-name = "toml_parser"
-version = "1.0.6+spec-1.1.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "a3198b4b0a8e11f09dd03e133c0280504d0801269e9afa46362ffde1cbeebf44"
-dependencies = [
- "winnow",
-]
-
-[[package]]
-name = "toml_writer"
-version = "1.0.6+spec-1.1.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "ab16f14aed21ee8bfd8ec22513f7287cd4a91aa92e44edfe2c17ddd004e92607"
-
-[[package]]
-name = "tracing"
-version = "0.1.44"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "63e71662fa4b2a2c3a26f570f037eb95bb1f85397f3cd8076caed2f026a6d100"
-dependencies = [
- "pin-project-lite",
- "tracing-attributes",
- "tracing-core",
-]
-
-[[package]]
-name = "tracing-attributes"
-version = "0.1.31"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "7490cfa5ec963746568740651ac6781f701c9c5ea257c58e057f3ba8cf69e8da"
-dependencies = [
- "proc-macro2",
- "quote",
- "syn",
-]
-
-[[package]]
-name = "tracing-core"
-version = "0.1.36"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "db97caf9d906fbde555dd62fa95ddba9eecfd14cb388e4f491a66d74cd5fb79a"
-dependencies = [
- "once_cell",
- "valuable",
-]
-
-[[package]]
-name = "unicode-ident"
-version = "1.0.22"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "9312f7c4f6ff9069b165498234ce8be658059c6728633667c526e27dc2cf1df5"
-
-[[package]]
-name = "uniffi"
-version = "0.31.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "b8c6dec3fc6645f71a16a3fa9ff57991028153bd194ca97f4b55e610c73ce66a"
-dependencies = [
- "anyhow",
- "cargo_metadata",
- "uniffi_bindgen",
- "uniffi_core",
- "uniffi_macros",
- "uniffi_pipeline",
-]
-
-[[package]]
-name = "uniffi_bindgen"
-version = "0.31.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "4ed0150801958d4825da56a41c71f000a457ac3a4613fa9647df78ac4b6b6881"
-dependencies = [
- "anyhow",
- "askama",
- "camino",
- "cargo_metadata",
- "fs-err",
- "glob",
- "goblin",
- "heck",
- "indexmap",
- "once_cell",
- "serde",
- "tempfile",
- "textwrap",
- "toml",
- "uniffi_internal_macros",
- "uniffi_meta",
- "uniffi_pipeline",
- "uniffi_udl",
-]
-
-[[package]]
-name = "uniffi_core"
-version = "0.31.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "b0ef62e69762fbb9386dcb6c87cd3dd05d525fa8a3a579a290892e60ddbda47e"
-dependencies = [
- "anyhow",
- "bytes",
- "once_cell",
- "static_assertions",
-]
-
-[[package]]
-name = "uniffi_internal_macros"
-version = "0.31.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "98f51ebca0d9a4b2aa6c644d5ede45c56f73906b96403c08a1985e75ccb64a01"
-dependencies = [
- "anyhow",
- "indexmap",
- "proc-macro2",
- "quote",
- "syn",
-]
-
-[[package]]
-name = "uniffi_macros"
-version = "0.31.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "db9d12529f1223d014fd501e5f29ca0884d15d6ed5ddddd9f506e55350327dc3"
-dependencies = [
- "camino",
- "fs-err",
- "once_cell",
- "proc-macro2",
- "quote",
- "serde",
- "syn",
- "toml",
- "uniffi_meta",
-]
-
-[[package]]
-name = "uniffi_meta"
-version = "0.31.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "9df6d413db2827c68588f8149d30d49b71d540d46539e435b23a7f7dbd4d4f86"
-dependencies = [
- "anyhow",
- "siphasher",
- "uniffi_internal_macros",
- "uniffi_pipeline",
-]
-
-[[package]]
-name = "uniffi_pipeline"
-version = "0.31.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "a806dddc8208f22efd7e95a5cdf88ed43d0f3271e8f63b47e757a8bbdb43b63a"
-dependencies = [
- "anyhow",
- "heck",
- "indexmap",
- "tempfile",
- "uniffi_internal_macros",
-]
-
-[[package]]
-name = "uniffi_udl"
-version = "0.31.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "0d1a7339539bf6f6fa3e9b534dece13f778bda2d54b1a6d4e40b4d6090ac26e7"
-dependencies = [
- "anyhow",
- "textwrap",
- "uniffi_meta",
- "weedle2",
-]
-
-[[package]]
-name = "valuable"
-version = "0.1.1"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "ba73ea9cf16a25df0c8caa16c51acb937d5712a8429db78a3ee29d5dcacd3a65"
-
-[[package]]
-name = "walkdir"
-version = "2.5.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "29790946404f91d9c5d06f9874efddea1dc06c5efe94541a7d6863108e3a5e4b"
-dependencies = [
- "same-file",
- "winapi-util",
-]
-
-[[package]]
-name = "wasip2"
-version = "1.0.2+wasi-0.2.9"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "9517f9239f02c069db75e65f174b3da828fe5f5b945c4dd26bd25d89c03ebcf5"
-dependencies = [
- "wit-bindgen",
-]
-
-[[package]]
-name = "weedle2"
-version = "5.0.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "998d2c24ec099a87daf9467808859f9d82b61f1d9c9701251aea037f514eae0e"
-dependencies = [
- "nom",
-]
-
-[[package]]
-name = "winapi-util"
-version = "0.1.11"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "c2a7b1c03c876122aa43f3020e6c3c3ee5c05081c9a00739faf7503aeba10d22"
-dependencies = [
- "windows-sys",
-]
-
-[[package]]
-name = "windows-link"
-version = "0.2.1"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "f0805222e57f7521d6a62e36fa9163bc891acd422f971defe97d64e70d0a4fe5"
-
-[[package]]
-name = "windows-sys"
-version = "0.61.2"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "ae137229bcbd6cdf0f7b80a31df61766145077ddf49416a728b02cb3921ff3fc"
-dependencies = [
- "windows-link",
-]
-
-[[package]]
-name = "winnow"
-version = "0.7.14"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "5a5364e9d77fcdeeaa6062ced926ee3381faa2ee02d3eb83a5c27a8825540829"
-dependencies = [
- "memchr",
-]
-
-[[package]]
-name = "wit-bindgen"
-version = "0.51.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "d7249219f66ced02969388cf2bb044a09756a083d0fab1e566056b04d9fbcaa5"
-
-[[package]]
-name = "zmij"
-version = "1.0.14"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "bd8f3f50b848df28f887acb68e41201b5aea6bc8a8dacc00fb40635ff9a72fea"
diff --git a/rust/llmchat/uniffi/inference_rs_uniffi/Cargo.toml b/rust/llmchat/uniffi/inference_rs_uniffi/Cargo.toml
deleted file mode 100644
index ee3ec2eab1..0000000000
--- a/rust/llmchat/uniffi/inference_rs_uniffi/Cargo.toml
+++ /dev/null
@@ -1,14 +0,0 @@
-[package]
-name = "inference_rs_uniffi"
-version = "0.1.0"
-edition = "2024"
-
-[lib]
-name = "inference_rs_uniffi"
-crate-type = ["staticlib", "cdylib"]
-
-[dependencies]
-inference_rs = { path = "../../inference" }
-serde = { version = "1", features = ["derive"] }
-thiserror = "1"
-uniffi = { version = "0.31.0" }
diff --git a/rust/llmchat/uniffi/inference_rs_uniffi/src/api.rs b/rust/llmchat/uniffi/inference_rs_uniffi/src/api.rs
deleted file mode 100644
index 0e6dd77fca..0000000000
--- a/rust/llmchat/uniffi/inference_rs_uniffi/src/api.rs
+++ /dev/null
@@ -1,325 +0,0 @@
-use inference_rs as core;
-use serde::{Deserialize, Serialize};
-use std::sync::Arc;
-use thiserror::Error;
-
-#[derive(Debug, Error, uniffi::Error)]
-pub enum InferenceError {
- #[error("{0}")]
- Message(String),
-}
-
-impl From<String> for InferenceError {
- fn from(value: String) -> Self {
- Self::Message(value)
- }
-}
-
-#[derive(Debug, Clone, Serialize, Deserialize, uniffi::Record)]
-pub struct ModelLoadParams {
- pub model_path: String,
- pub n_gpu_layers: Option<i32>,
- pub use_mmap: Option<bool>,
- pub use_mlock: Option<bool>,
-}
-
-#[derive(Debug, Clone, Serialize, Deserialize, uniffi::Record)]
-pub struct ContextParams {
- pub context_size: Option<i32>,
- pub n_threads: Option<i32>,
- pub n_batch: Option<i32>,
-}
-
-#[derive(Debug, Clone, Serialize, Deserialize, uniffi::Record)]
-pub struct ModelInfo {
- pub bos_token_id: Option<i32>,
- pub eos_token_id: Option<i32>,
- pub bos_token: Option<String>,
- pub eos_token: Option<String>,
- pub chat_template: Option<String>,
- pub metadata_json: Option<String>,
-}
-
-#[derive(Debug, Clone, Serialize, Deserialize, uniffi::Record)]
-pub struct ChatMessage {
- pub role: String,
- pub content: String,
-}
-
-#[derive(Debug, Clone, Serialize, Deserialize, uniffi::Record)]
-pub struct GenerateRequest {
- pub prompt: String,
- pub max_tokens: Option<i32>,
- pub temperature: Option<f32>,
- pub top_p: Option<f32>,
- pub top_k: Option<i32>,
- pub repeat_penalty: Option<f32>,
- pub frequency_penalty: Option<f32>,
- pub presence_penalty: Option<f32>,
- pub seed: Option<i64>,
- pub stop_sequences: Option<Vec<String>>,
- pub grammar: Option<String>,
-}
-
-#[derive(Debug, Clone, Serialize, Deserialize, uniffi::Record)]
-pub struct GenerateChatRequest {
- pub messages: Vec<ChatMessage>,
- pub template_override: Option<String>,
- pub add_assistant: Option<bool>,
- pub image_paths: Option<Vec<String>>,
- pub mmproj_path: Option<String>,
- pub media_marker: Option<String>,
- pub max_tokens: Option<i32>,
- pub temperature: Option<f32>,
- pub top_p: Option<f32>,
- pub top_k: Option<i32>,
- pub repeat_penalty: Option<f32>,
- pub frequency_penalty: Option<f32>,
- pub presence_penalty: Option<f32>,
- pub seed: Option<i64>,
- pub stop_sequences: Option<Vec<String>>,
- pub grammar: Option<String>,
-}
-
-#[derive(Debug, Clone, Serialize, Deserialize, uniffi::Record)]
-pub struct GenerateSummary {
- pub job_id: i64,
- pub prompt_tokens: Option<i32>,
- pub generated_tokens: Option<i32>,
- pub total_time_ms: Option<i64>,
-}
-
-#[derive(Debug, Clone, Serialize, Deserialize, uniffi::Enum)]
-pub enum GenerateEvent {
- Text {
- job_id: i64,
- text: String,
- token_id: Option<i32>,
- },
- Done { summary: GenerateSummary },
- Error { job_id: i64, message: String },
-}
-
-#[derive(uniffi::Object)]
-pub struct ModelHandle {
- handle: core::ModelHandleRef,
-}
-
-#[derive(uniffi::Object)]
-pub struct ContextHandle {
- handle: core::ContextHandleRef,
-}
-
-#[uniffi::export(callback_interface)]
-pub trait GenerateEventCallback: Send + Sync {
- fn on_event(&self, event: GenerateEvent);
-}
-
-impl From<ModelLoadParams> for core::ModelLoadParams {
- fn from(value: ModelLoadParams) -> Self {
- Self {
- model_path: value.model_path,
- n_gpu_layers: value.n_gpu_layers,
- use_mmap: value.use_mmap,
- use_mlock: value.use_mlock,
- }
- }
-}
-
-impl From<ContextParams> for core::ContextParams {
- fn from(value: ContextParams) -> Self {
- Self {
- context_size: value.context_size,
- n_threads: value.n_threads,
- n_batch: value.n_batch,
- }
- }
-}
-
-impl From<core::ModelInfo> for ModelInfo {
- fn from(value: core::ModelInfo) -> Self {
- Self {
- bos_token_id: value.bos_token_id,
- eos_token_id: value.eos_token_id,
- bos_token: value.bos_token,
- eos_token: value.eos_token,
- chat_template: value.chat_template,
- metadata_json: value.metadata_json,
- }
- }
-}
-
-impl From<ChatMessage> for core::ChatMessage {
- fn from(value: ChatMessage) -> Self {
- Self {
- role: value.role,
- content: value.content,
- }
- }
-}
-
-impl From<GenerateRequest> for core::GenerateRequest {
- fn from(value: GenerateRequest) -> Self {
- Self {
- prompt: value.prompt,
- max_tokens: value.max_tokens,
- temperature: value.temperature,
- top_p: value.top_p,
- top_k: value.top_k,
- repeat_penalty: value.repeat_penalty,
- frequency_penalty: value.frequency_penalty,
- presence_penalty: value.presence_penalty,
- seed: value.seed,
- stop_sequences: value.stop_sequences,
- grammar: value.grammar,
- }
- }
-}
-
-impl From<GenerateChatRequest> for core::GenerateChatRequest {
- fn from(value: GenerateChatRequest) -> Self {
- Self {
- messages: value.messages.into_iter().map(Into::into).collect(),
- template_override: value.template_override,
- add_assistant: value.add_assistant,
- image_paths: value.image_paths,
- mmproj_path: value.mmproj_path,
- media_marker: value.media_marker,
- max_tokens: value.max_tokens,
- temperature: value.temperature,
- top_p: value.top_p,
- top_k: value.top_k,
- repeat_penalty: value.repeat_penalty,
- frequency_penalty: value.frequency_penalty,
- presence_penalty: value.presence_penalty,
- seed: value.seed,
- stop_sequences: value.stop_sequences,
- grammar: value.grammar,
- }
- }
-}
-
-impl From<core::GenerateSummary> for GenerateSummary {
- fn from(value: core::GenerateSummary) -> Self {
- Self {
- job_id: value.job_id,
- prompt_tokens: value.prompt_tokens,
- generated_tokens: value.generated_tokens,
- total_time_ms: value.total_time_ms,
- }
- }
-}
-
-impl From<core::GenerateEvent> for GenerateEvent {
- fn from(value: core::GenerateEvent) -> Self {
- match value {
- core::GenerateEvent::Text {
- job_id,
- text,
- token_id,
- } => Self::Text {
- job_id,
- text,
- token_id,
- },
- core::GenerateEvent::Done { summary } => Self::Done {
- summary: summary.into(),
- },
- core::GenerateEvent::Error { job_id, message } => Self::Error { job_id, message },
- }
- }
-}
-
-struct CallbackSink {
- callback: Box<dyn GenerateEventCallback>,
-}
-
-impl core::EventSink for CallbackSink {
- fn add(&mut self, event: core::GenerateEvent) {
- self.callback.on_event(event.into());
- }
-}
-
-#[uniffi::export]
-pub fn init_backend() -> Result<(), InferenceError> {
- core::init_backend().map_err(InferenceError::from)
-}
-
-#[uniffi::export]
-pub fn load_model(params: ModelLoadParams) -> Result<Arc<ModelHandle>, InferenceError> {
- let model = core::load_model(params.into()).map_err(InferenceError::from)?;
- Ok(Arc::new(ModelHandle { handle: model }))
-}
-
-#[uniffi::export]
-pub fn create_context(
- model: Arc<ModelHandle>,
- params: ContextParams,
-) -> Result<Arc<ContextHandle>, InferenceError> {
- let context = core::create_context(model.handle.clone(), params.into()).map_err(InferenceError::from)?;
- Ok(Arc::new(ContextHandle { handle: context }))
-}
-
-#[uniffi::export]
-pub fn tokenize(
- model: Arc<ModelHandle>,
- text: String,
- add_bos: bool,
- special: bool,
-) -> Result<Vec<i32>, InferenceError> {
- core::tokenize(model.handle.as_ref(), text, add_bos, special)
- .map_err(InferenceError::from)
-}
-
-#[uniffi::export]
-pub fn detokenize(model: Arc<ModelHandle>, tokens: Vec<i32>) -> Result<String, InferenceError> {
- core::detokenize(model.handle.as_ref(), tokens).map_err(InferenceError::from)
-}
-
-#[uniffi::export]
-pub fn get_model_info(model: Arc<ModelHandle>) -> Result<ModelInfo, InferenceError> {
- core::get_model_info(model.handle.as_ref())
- .map(Into::into)
- .map_err(InferenceError::from)
-}
-
-#[uniffi::export]
-pub fn apply_chat_template(
- model: Arc<ModelHandle>,
- messages: Vec<ChatMessage>,
- template_override: Option<String>,
- add_assistant: bool,
-) -> Result<String, InferenceError> {
- let messages = messages.into_iter().map(Into::into).collect();
- core::apply_chat_template(model.handle.as_ref(), messages, template_override, add_assistant)
- .map_err(InferenceError::from)
-}
-
-#[uniffi::export]
-pub fn generate_chat_stream(
- context: Arc<ContextHandle>,
- request: GenerateChatRequest,
- callback: Box<dyn GenerateEventCallback>,
-) -> Result<GenerateSummary, InferenceError> {
- let mut sink = CallbackSink { callback };
- core::generate_chat_stream(context.handle.as_ref(), request.into(), &mut sink)
- .map(Into::into)
- .map_err(InferenceError::from)
-}
-
-#[uniffi::export]
-pub fn generate_stream(
- context: Arc<ContextHandle>,
- request: GenerateRequest,
- callback: Box<dyn GenerateEventCallback>,
-) -> Result<GenerateSummary, InferenceError> {
- let mut sink = CallbackSink { callback };
- core::generate_stream(context.handle.as_ref(), request.into(), &mut sink)
- .map(Into::into)
- .map_err(InferenceError::from)
-}
-
-#[uniffi::export]
-pub fn cancel(job_id: i64) {
- let _ = core::cancel(job_id);
-}
diff --git a/rust/llmchat/uniffi/inference_rs_uniffi/src/lib.rs b/rust/llmchat/uniffi/inference_rs_uniffi/src/lib.rs
deleted file mode 100644
index dce5d9a1da..0000000000
--- a/rust/llmchat/uniffi/inference_rs_uniffi/src/lib.rs
+++ /dev/null
@@ -1,7 +0,0 @@
-#![allow(unexpected_cfgs)]
-
-mod api;
-
-uniffi::setup_scaffolding!("inference_rs_uniffi");
-
-pub use api::*;
diff --git a/rust/llmchat/uniffi/inference_rs_uniffi/uniffi.toml b/rust/llmchat/uniffi/inference_rs_uniffi/uniffi.toml
deleted file mode 100644
index f3de948c2b..0000000000
--- a/rust/llmchat/uniffi/inference_rs_uniffi/uniffi.toml
+++ /dev/null
@@ -1,8 +0,0 @@
-[bindings.swift]
-link_frameworks = ["Accelerate", "Metal", "MetalKit", "Foundation"]
-
-[bindings.kotlin]
-package_name = "io.ente.labs.inference_rs"
-cdylib_name = "inference_rs_uniffi"
-android = true
-kotlin_target_version = "1.9.0"
diff --git a/rust/llmchat/uniffi/llmchat_db_uniffi/Cargo.lock b/rust/llmchat/uniffi/llmchat_db_uniffi/Cargo.lock
deleted file mode 100644
index f4321a513a..0000000000
--- a/rust/llmchat/uniffi/llmchat_db_uniffi/Cargo.lock
+++ /dev/null
@@ -1,2501 +0,0 @@
-# This file is automatically @generated by Cargo.
-# It is not intended for manual editing.
-version = 4
-
-[[package]]
-name = "aead"
-version = "0.5.2"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "d122413f284cf2d62fb1b7db97e02edb8cda96d769b16e443a4f6195e35662b0"
-dependencies = [
- "crypto-common",
- "generic-array",
-]
-
-[[package]]
-name = "anyhow"
-version = "1.0.100"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "a23eb6b1614318a8071c9b2521f36b424b2c83db5eb3a0fead4a6c0809af6e61"
-
-[[package]]
-name = "argon2"
-version = "0.5.3"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "3c3610892ee6e0cbce8ae2700349fcf8f98adb0dbfbee85aec3c9179d29cc072"
-dependencies = [
- "base64ct",
- "blake2",
- "cpufeatures",
- "password-hash",
-]
-
-[[package]]
-name = "arrayref"
-version = "0.3.9"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "76a2e8124351fda1ef8aaaa3bbd7ebbcb486bbcd4225aca0aa0d84bb2db8fecb"
-
-[[package]]
-name = "arrayvec"
-version = "0.7.6"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "7c02d123df017efcdfbd739ef81735b36c5ba83ec3c59c80a9d7ecc718f92e50"
-
-[[package]]
-name = "askama"
-version = "0.14.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "f75363874b771be265f4ffe307ca705ef6f3baa19011c149da8674a87f1b75c4"
-dependencies = [
- "askama_derive",
- "itoa",
- "percent-encoding",
- "serde",
- "serde_json",
-]
-
-[[package]]
-name = "askama_derive"
-version = "0.14.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "129397200fe83088e8a68407a8e2b1f826cf0086b21ccdb866a722c8bcd3a94f"
-dependencies = [
- "askama_parser",
- "basic-toml",
- "memchr",
- "proc-macro2",
- "quote",
- "rustc-hash",
- "serde",
- "serde_derive",
- "syn",
-]
-
-[[package]]
-name = "askama_parser"
-version = "0.14.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "d6ab5630b3d5eaf232620167977f95eb51f3432fc76852328774afbd242d4358"
-dependencies = [
- "memchr",
- "serde",
- "serde_derive",
- "winnow",
-]
-
-[[package]]
-name = "atomic-waker"
-version = "1.1.2"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "1505bd5d3d116872e7271a6d4e16d81d0c8570876c8de68093a09ac269d8aac0"
-
-[[package]]
-name = "autocfg"
-version = "1.5.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "c08606f8c3cbf4ce6ec8e28fb0014a2c086708fe954eaa885384a6165172e7e8"
-
-[[package]]
-name = "base64"
-version = "0.22.1"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "72b3254f16251a8381aa12e40e3c4d2f0199f8c6508fbecb9d91f575e0fbb8c6"
-
-[[package]]
-name = "base64ct"
-version = "1.8.3"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "2af50177e190e07a26ab74f8b1efbfe2ef87da2116221318cb1c2e82baf7de06"
-
-[[package]]
-name = "basic-toml"
-version = "0.1.10"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "ba62675e8242a4c4e806d12f11d136e626e6c8361d6b829310732241652a178a"
-dependencies = [
- "serde",
-]
-
-[[package]]
-name = "bitflags"
-version = "2.10.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "812e12b5285cc515a9c72a5c1d3b6d46a19dac5acfef5265968c166106e31dd3"
-
-[[package]]
-name = "blake2"
-version = "0.10.6"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "46502ad458c9a52b69d4d4d32775c788b7a1b85e8bc9d482d92250fc0e3f8efe"
-dependencies = [
- "digest",
-]
-
-[[package]]
-name = "blake2b_simd"
-version = "1.0.4"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "b79834656f71332577234b50bfc009996f7449e0c056884e6a02492ded0ca2f3"
-dependencies = [
- "arrayref",
- "arrayvec",
- "constant_time_eq",
-]
-
-[[package]]
-name = "block-buffer"
-version = "0.10.4"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "3078c7629b62d3f0439517fa394996acacc5cbc91c5a20d8c658e77abd503a71"
-dependencies = [
- "generic-array",
-]
-
-[[package]]
-name = "block-padding"
-version = "0.3.3"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "a8894febbff9f758034a5b8e12d87918f56dfc64a8e1fe757d65e29041538d93"
-dependencies = [
- "generic-array",
-]
-
-[[package]]
-name = "bumpalo"
-version = "3.19.1"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "5dd9dc738b7a8311c7ade152424974d8115f2cdad61e8dab8dac9f2362298510"
-
-[[package]]
-name = "bytes"
-version = "1.11.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "b35204fbdc0b3f4446b89fc1ac2cf84a8a68971995d0bf2e925ec7cd960f9cb3"
-
-[[package]]
-name = "camino"
-version = "1.2.2"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "e629a66d692cb9ff1a1c664e41771b3dcaf961985a9774c0eb0bd1b51cf60a48"
-dependencies = [
- "serde_core",
-]
-
-[[package]]
-name = "cargo-platform"
-version = "0.1.9"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "e35af189006b9c0f00a064685c727031e3ed2d8020f7ba284d78cc2671bd36ea"
-dependencies = [
- "serde",
-]
-
-[[package]]
-name = "cargo_metadata"
-version = "0.19.2"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "dd5eb614ed4c27c5d706420e4320fbe3216ab31fa1c33cd8246ac36dae4479ba"
-dependencies = [
- "camino",
- "cargo-platform",
- "semver",
- "serde",
- "serde_json",
- "thiserror",
-]
-
-[[package]]
-name = "cc"
-version = "1.2.53"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "755d2fce177175ffca841e9a06afdb2c4ab0f593d53b4dee48147dfaade85932"
-dependencies = [
- "find-msvc-tools",
- "shlex",
-]
-
-[[package]]
-name = "cfg-if"
-version = "1.0.4"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "9330f8b2ff13f34540b44e946ef35111825727b38d33286ef986142615121801"
-
-[[package]]
-name = "cfg_aliases"
-version = "0.2.1"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "613afe47fcd5fac7ccf1db93babcb082c5994d996f20b8b159f2ad1658eb5724"
-
-[[package]]
-name = "chacha20"
-version = "0.9.1"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "c3613f74bd2eac03dad61bd53dbe620703d4371614fe0bc3b9f04dd36fe4e818"
-dependencies = [
- "cfg-if",
- "cipher",
- "cpufeatures",
-]
-
-[[package]]
-name = "cipher"
-version = "0.4.4"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "773f3b9af64447d2ce9850330c473515014aa235e6a783b02db81ff39e4a3dad"
-dependencies = [
- "crypto-common",
- "inout",
- "zeroize",
-]
-
-[[package]]
-name = "constant_time_eq"
-version = "0.4.2"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "3d52eff69cd5e647efe296129160853a42795992097e8af39800e1060caeea9b"
-
-[[package]]
-name = "core-foundation"
-version = "0.9.4"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "91e195e091a93c46f7102ec7818a2aa394e1e1771c3ab4825963fa03e45afb8f"
-dependencies = [
- "core-foundation-sys",
- "libc",
-]
-
-[[package]]
-name = "core-foundation"
-version = "0.10.1"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "b2a6cd9ae233e7f62ba4e9353e81a88df7fc8a5987b8d445b4d90c879bd156f6"
-dependencies = [
- "core-foundation-sys",
- "libc",
-]
-
-[[package]]
-name = "core-foundation-sys"
-version = "0.8.7"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "773648b94d0e5d620f64f280777445740e61fe701025087ec8b57f45c791888b"
-
-[[package]]
-name = "cpufeatures"
-version = "0.2.17"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "59ed5838eebb26a2bb2e58f6d5b5316989ae9d08bab10e0e6d103e656d1b0280"
-dependencies = [
- "libc",
-]
-
-[[package]]
-name = "crypto-common"
-version = "0.1.7"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "78c8292055d1c1df0cce5d180393dc8cce0abec0a7102adb6c7b1eef6016d60a"
-dependencies = [
- "generic-array",
- "rand_core 0.6.4",
- "typenum",
-]
-
-[[package]]
-name = "crypto_secretstream"
-version = "0.2.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "9a6419214057ad50a13efccb3ad7714b86b848e3a5aa7b6cf5a3ff07edf387eb"
-dependencies = [
- "aead",
- "chacha20",
- "getrandom 0.2.17",
- "poly1305",
- "rand_core 0.6.4",
- "subtle",
-]
-
-[[package]]
-name = "curve25519-dalek"
-version = "4.1.3"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "97fb8b7c4503de7d6ae7b42ab72a5a59857b4c937ec27a3d4539dba95b5ab2be"
-dependencies = [
- "cfg-if",
- "cpufeatures",
- "curve25519-dalek-derive",
- "fiat-crypto",
- "rustc_version",
- "subtle",
- "zeroize",
-]
-
-[[package]]
-name = "curve25519-dalek-derive"
-version = "0.1.1"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "f46882e17999c6cc590af592290432be3bce0428cb0d5f8b6715e4dc7b383eb3"
-dependencies = [
- "proc-macro2",
- "quote",
- "syn",
-]
-
-[[package]]
-name = "digest"
-version = "0.10.7"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "9ed9a281f7bc9b7576e61468ba615a66a5c8cfdff42420a70aa82701a3b1e292"
-dependencies = [
- "block-buffer",
- "crypto-common",
- "subtle",
-]
-
-[[package]]
-name = "displaydoc"
-version = "0.2.5"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "97369cbbc041bc366949bc74d34658d6cda5621039731c6310521892a3a20ae0"
-dependencies = [
- "proc-macro2",
- "quote",
- "syn",
-]
-
-[[package]]
-name = "encoding_rs"
-version = "0.8.35"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "75030f3c4f45dafd7586dd6780965a8c7e8e285a5ecb86713e63a79c5b2766f3"
-dependencies = [
- "cfg-if",
-]
-
-[[package]]
-name = "ente-core"
-version = "0.0.1"
-dependencies = [
- "argon2",
- "base64",
- "blake2b_simd",
- "crypto_secretstream",
- "getrandom 0.2.17",
- "hex",
- "md-5",
- "rand_core 0.6.4",
- "reqwest",
- "salsa20",
- "serde",
- "serde_json",
- "subtle",
- "thiserror",
- "x25519-dalek",
- "xsalsa20poly1305",
- "zeroize",
-]
-
-[[package]]
-name = "equivalent"
-version = "1.0.2"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "877a4ace8713b0bcf2a4e7eec82529c029f1d0619886d18145fea96c3ffe5c0f"
-
-[[package]]
-name = "errno"
-version = "0.3.14"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "39cab71617ae0d63f51a36d69f866391735b51691dbda63cf6f96d042b63efeb"
-dependencies = [
- "libc",
- "windows-sys 0.61.2",
-]
-
-[[package]]
-name = "fallible-iterator"
-version = "0.3.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "2acce4a10f12dc2fb14a218589d4f1f62ef011b2d0cc4b3cb1bba8e94da14649"
-
-[[package]]
-name = "fallible-streaming-iterator"
-version = "0.1.9"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "7360491ce676a36bf9bb3c56c1aa791658183a54d2744120f27285738d90465a"
-
-[[package]]
-name = "fastrand"
-version = "2.3.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "37909eebbb50d72f9059c3b6d82c0463f2ff062c9e95845c43a6c9c0355411be"
-
-[[package]]
-name = "fiat-crypto"
-version = "0.2.9"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "28dea519a9695b9977216879a3ebfddf92f1c08c05d984f8996aecd6ecdc811d"
-
-[[package]]
-name = "find-msvc-tools"
-version = "0.1.8"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "8591b0bcc8a98a64310a2fae1bb3e9b8564dd10e381e6e28010fde8e8e8568db"
-
-[[package]]
-name = "fnv"
-version = "1.0.7"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "3f9eec918d3f24069decb9af1554cad7c880e2da24a9afd88aca000531ab82c1"
-
-[[package]]
-name = "foldhash"
-version = "0.2.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "77ce24cb58228fbb8aa041425bb1050850ac19177686ea6e0f41a70416f56fdb"
-
-[[package]]
-name = "form_urlencoded"
-version = "1.2.2"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "cb4cb245038516f5f85277875cdaa4f7d2c9a0fa0468de06ed190163b1581fcf"
-dependencies = [
- "percent-encoding",
-]
-
-[[package]]
-name = "fs-err"
-version = "2.11.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "88a41f105fe1d5b6b34b2055e3dc59bb79b46b48b2040b9e6c7b4b5de097aa41"
-dependencies = [
- "autocfg",
-]
-
-[[package]]
-name = "futures-channel"
-version = "0.3.31"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "2dff15bf788c671c1934e366d07e30c1814a8ef514e1af724a602e8a2fbe1b10"
-dependencies = [
- "futures-core",
-]
-
-[[package]]
-name = "futures-core"
-version = "0.3.31"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "05f29059c0c2090612e8d742178b0580d2dc940c837851ad723096f87af6663e"
-
-[[package]]
-name = "futures-sink"
-version = "0.3.31"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "e575fab7d1e0dcb8d0c7bcf9a63ee213816ab51902e6d244a95819acacf1d4f7"
-
-[[package]]
-name = "futures-task"
-version = "0.3.31"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "f90f7dce0722e95104fcb095585910c0977252f286e354b5e3bd38902cd99988"
-
-[[package]]
-name = "futures-util"
-version = "0.3.31"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "9fa08315bb612088cc391249efdc3bc77536f16c91f6cf495e6fbe85b20a4a81"
-dependencies = [
- "futures-core",
- "futures-task",
- "pin-project-lite",
- "pin-utils",
- "slab",
-]
-
-[[package]]
-name = "generic-array"
-version = "0.14.7"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "85649ca51fd72272d7821adaf274ad91c288277713d9c18820d8499a7ff69e9a"
-dependencies = [
- "typenum",
- "version_check",
-]
-
-[[package]]
-name = "getrandom"
-version = "0.2.17"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "ff2abc00be7fca6ebc474524697ae276ad847ad0a6b3faa4bcb027e9a4614ad0"
-dependencies = [
- "cfg-if",
- "js-sys",
- "libc",
- "wasi",
- "wasm-bindgen",
-]
-
-[[package]]
-name = "getrandom"
-version = "0.3.4"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "899def5c37c4fd7b2664648c28120ecec138e4d395b459e5ca34f9cce2dd77fd"
-dependencies = [
- "cfg-if",
- "js-sys",
- "libc",
- "r-efi",
- "wasip2",
- "wasm-bindgen",
-]
-
-[[package]]
-name = "glob"
-version = "0.3.3"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "0cc23270f6e1808e30a928bdc84dea0b9b4136a8bc82338574f23baf47bbd280"
-
-[[package]]
-name = "goblin"
-version = "0.8.2"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "1b363a30c165f666402fe6a3024d3bec7ebc898f96a4a23bd1c99f8dbf3f4f47"
-dependencies = [
- "log",
- "plain",
- "scroll",
-]
-
-[[package]]
-name = "h2"
-version = "0.4.13"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "2f44da3a8150a6703ed5d34e164b875fd14c2cdab9af1252a9a1020bde2bdc54"
-dependencies = [
- "atomic-waker",
- "bytes",
- "fnv",
- "futures-core",
- "futures-sink",
- "http",
- "indexmap",
- "slab",
- "tokio",
- "tokio-util",
- "tracing",
-]
-
-[[package]]
-name = "hashbrown"
-version = "0.16.1"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "841d1cc9bed7f9236f321df977030373f4a4163ae1a7dbfe1a51a2c1a51d9100"
-dependencies = [
- "foldhash",
-]
-
-[[package]]
-name = "hashlink"
-version = "0.11.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "ea0b22561a9c04a7cb1a302c013e0259cd3b4bb619f145b32f72b8b4bcbed230"
-dependencies = [
- "hashbrown",
-]
-
-[[package]]
-name = "heck"
-version = "0.5.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "2304e00983f87ffb38b55b444b5e3b60a884b5d30c0fca7d82fe33449bbe55ea"
-
-[[package]]
-name = "hex"
-version = "0.4.3"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "7f24254aa9a54b5c858eaee2f5bccdb46aaf0e486a595ed5fd8f86ba55232a70"
-
-[[package]]
-name = "http"
-version = "1.4.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "e3ba2a386d7f85a81f119ad7498ebe444d2e22c2af0b86b069416ace48b3311a"
-dependencies = [
- "bytes",
- "itoa",
-]
-
-[[package]]
-name = "http-body"
-version = "1.0.1"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "1efedce1fb8e6913f23e0c92de8e62cd5b772a67e7b3946df930a62566c93184"
-dependencies = [
- "bytes",
- "http",
-]
-
-[[package]]
-name = "http-body-util"
-version = "0.1.3"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "b021d93e26becf5dc7e1b75b1bed1fd93124b374ceb73f43d4d4eafec896a64a"
-dependencies = [
- "bytes",
- "futures-core",
- "http",
- "http-body",
- "pin-project-lite",
-]
-
-[[package]]
-name = "httparse"
-version = "1.10.1"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "6dbf3de79e51f3d586ab4cb9d5c3e2c14aa28ed23d180cf89b4df0454a69cc87"
-
-[[package]]
-name = "hyper"
-version = "1.8.1"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "2ab2d4f250c3d7b1c9fcdff1cece94ea4e2dfbec68614f7b87cb205f24ca9d11"
-dependencies = [
- "atomic-waker",
- "bytes",
- "futures-channel",
- "futures-core",
- "h2",
- "http",
- "http-body",
- "httparse",
- "itoa",
- "pin-project-lite",
- "pin-utils",
- "smallvec",
- "tokio",
- "want",
-]
-
-[[package]]
-name = "hyper-rustls"
-version = "0.27.7"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "e3c93eb611681b207e1fe55d5a71ecf91572ec8a6705cdb6857f7d8d5242cf58"
-dependencies = [
- "http",
- "hyper",
- "hyper-util",
- "rustls",
- "rustls-native-certs",
- "rustls-pki-types",
- "tokio",
- "tokio-rustls",
- "tower-service",
-]
-
-[[package]]
-name = "hyper-util"
-version = "0.1.19"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "727805d60e7938b76b826a6ef209eb70eaa1812794f9424d4a4e2d740662df5f"
-dependencies = [
- "base64",
- "bytes",
- "futures-channel",
- "futures-core",
- "futures-util",
- "http",
- "http-body",
- "hyper",
- "ipnet",
- "libc",
- "percent-encoding",
- "pin-project-lite",
- "socket2",
- "system-configuration",
- "tokio",
- "tower-service",
- "tracing",
- "windows-registry",
-]
-
-[[package]]
-name = "icu_collections"
-version = "2.1.1"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "4c6b649701667bbe825c3b7e6388cb521c23d88644678e83c0c4d0a621a34b43"
-dependencies = [
- "displaydoc",
- "potential_utf",
- "yoke",
- "zerofrom",
- "zerovec",
-]
-
-[[package]]
-name = "icu_locale_core"
-version = "2.1.1"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "edba7861004dd3714265b4db54a3c390e880ab658fec5f7db895fae2046b5bb6"
-dependencies = [
- "displaydoc",
- "litemap",
- "tinystr",
- "writeable",
- "zerovec",
-]
-
-[[package]]
-name = "icu_normalizer"
-version = "2.1.1"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "5f6c8828b67bf8908d82127b2054ea1b4427ff0230ee9141c54251934ab1b599"
-dependencies = [
- "icu_collections",
- "icu_normalizer_data",
- "icu_properties",
- "icu_provider",
- "smallvec",
- "zerovec",
-]
-
-[[package]]
-name = "icu_normalizer_data"
-version = "2.1.1"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "7aedcccd01fc5fe81e6b489c15b247b8b0690feb23304303a9e560f37efc560a"
-
-[[package]]
-name = "icu_properties"
-version = "2.1.2"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "020bfc02fe870ec3a66d93e677ccca0562506e5872c650f893269e08615d74ec"
-dependencies = [
- "icu_collections",
- "icu_locale_core",
- "icu_properties_data",
- "icu_provider",
- "zerotrie",
- "zerovec",
-]
-
-[[package]]
-name = "icu_properties_data"
-version = "2.1.2"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "616c294cf8d725c6afcd8f55abc17c56464ef6211f9ed59cccffe534129c77af"
-
-[[package]]
-name = "icu_provider"
-version = "2.1.1"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "85962cf0ce02e1e0a629cc34e7ca3e373ce20dda4c4d7294bbd0bf1fdb59e614"
-dependencies = [
- "displaydoc",
- "icu_locale_core",
- "writeable",
- "yoke",
- "zerofrom",
- "zerotrie",
- "zerovec",
-]
-
-[[package]]
-name = "idna"
-version = "1.1.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "3b0875f23caa03898994f6ddc501886a45c7d3d62d04d2d90788d47be1b1e4de"
-dependencies = [
- "idna_adapter",
- "smallvec",
- "utf8_iter",
-]
-
-[[package]]
-name = "idna_adapter"
-version = "1.2.1"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "3acae9609540aa318d1bc588455225fb2085b9ed0c4f6bd0d9d5bcd86f1a0344"
-dependencies = [
- "icu_normalizer",
- "icu_properties",
-]
-
-[[package]]
-name = "indexmap"
-version = "2.13.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "7714e70437a7dc3ac8eb7e6f8df75fd8eb422675fc7678aff7364301092b1017"
-dependencies = [
- "equivalent",
- "hashbrown",
- "serde",
- "serde_core",
-]
-
-[[package]]
-name = "inout"
-version = "0.1.4"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "879f10e63c20629ecabbb64a8010319738c66a5cd0c29b02d63d272b03751d01"
-dependencies = [
- "block-padding",
- "generic-array",
-]
-
-[[package]]
-name = "ipnet"
-version = "2.11.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "469fb0b9cefa57e3ef31275ee7cacb78f2fdca44e4765491884a2b119d4eb130"
-
-[[package]]
-name = "iri-string"
-version = "0.7.10"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "c91338f0783edbd6195decb37bae672fd3b165faffb89bf7b9e6942f8b1a731a"
-dependencies = [
- "memchr",
- "serde",
-]
-
-[[package]]
-name = "itoa"
-version = "1.0.17"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "92ecc6618181def0457392ccd0ee51198e065e016d1d527a7ac1b6dc7c1f09d2"
-
-[[package]]
-name = "js-sys"
-version = "0.3.85"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "8c942ebf8e95485ca0d52d97da7c5a2c387d0e7f0ba4c35e93bfcaee045955b3"
-dependencies = [
- "once_cell",
- "wasm-bindgen",
-]
-
-[[package]]
-name = "libc"
-version = "0.2.180"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "bcc35a38544a891a5f7c865aca548a982ccb3b8650a5b06d0fd33a10283c56fc"
-
-[[package]]
-name = "libsqlite3-sys"
-version = "0.36.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "95b4103cffefa72eb8428cb6b47d6627161e51c2739fc5e3b734584157bc642a"
-dependencies = [
- "cc",
- "pkg-config",
- "vcpkg",
-]
-
-[[package]]
-name = "linux-raw-sys"
-version = "0.11.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "df1d3c3b53da64cf5760482273a98e575c651a67eec7f77df96b5b642de8f039"
-
-[[package]]
-name = "litemap"
-version = "0.8.1"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "6373607a59f0be73a39b6fe456b8192fcc3585f602af20751600e974dd455e77"
-
-[[package]]
-name = "llmchat-db"
-version = "0.1.0"
-dependencies = [
- "ente-core",
- "rusqlite",
- "serde",
- "serde_json",
- "thiserror",
- "uuid",
- "zeroize",
-]
-
-[[package]]
-name = "llmchat_db_uniffi"
-version = "0.1.0"
-dependencies = [
- "llmchat-db",
- "serde",
- "thiserror",
- "uniffi",
- "uuid",
-]
-
-[[package]]
-name = "log"
-version = "0.4.29"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "5e5032e24019045c762d3c0f28f5b6b8bbf38563a65908389bf7978758920897"
-
-[[package]]
-name = "lru-slab"
-version = "0.1.2"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "112b39cec0b298b6c1999fee3e31427f74f676e4cb9879ed1a121b43661a4154"
-
-[[package]]
-name = "md-5"
-version = "0.10.6"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "d89e7ee0cfbedfc4da3340218492196241d89eefb6dab27de5df917a6d2e78cf"
-dependencies = [
- "cfg-if",
- "digest",
-]
-
-[[package]]
-name = "memchr"
-version = "2.7.6"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "f52b00d39961fc5b2736ea853c9cc86238e165017a493d1d5c8eac6bdc4cc273"
-
-[[package]]
-name = "mime"
-version = "0.3.17"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "6877bb514081ee2a7ff5ef9de3281f14a4dd4bceac4c09388074a6b5df8a139a"
-
-[[package]]
-name = "minimal-lexical"
-version = "0.2.1"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "68354c5c6bd36d73ff3feceb05efa59b6acb7626617f4962be322a825e61f79a"
-
-[[package]]
-name = "mio"
-version = "1.1.1"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "a69bcab0ad47271a0234d9422b131806bf3968021e5dc9328caf2d4cd58557fc"
-dependencies = [
- "libc",
- "wasi",
- "windows-sys 0.61.2",
-]
-
-[[package]]
-name = "nom"
-version = "7.1.3"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "d273983c5a657a70a3e8f2a01329822f3b8c8172b73826411a55751e404a0a4a"
-dependencies = [
- "memchr",
- "minimal-lexical",
-]
-
-[[package]]
-name = "once_cell"
-version = "1.21.3"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "42f5e15c9953c5e4ccceeb2e7382a716482c34515315f7b03532b8b4e8393d2d"
-
-[[package]]
-name = "opaque-debug"
-version = "0.3.1"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "c08d65885ee38876c4f86fa503fb49d7b507c2b62552df7c70b2fce627e06381"
-
-[[package]]
-name = "openssl-probe"
-version = "0.2.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "9f50d9b3dabb09ecd771ad0aa242ca6894994c130308ca3d7684634df8037391"
-
-[[package]]
-name = "password-hash"
-version = "0.5.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "346f04948ba92c43e8469c1ee6736c7563d71012b17d40745260fe106aac2166"
-dependencies = [
- "base64ct",
- "rand_core 0.6.4",
- "subtle",
-]
-
-[[package]]
-name = "percent-encoding"
-version = "2.3.2"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "9b4f627cb1b25917193a259e49bdad08f671f8d9708acfd5fe0a8c1455d87220"
-
-[[package]]
-name = "pin-project-lite"
-version = "0.2.16"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "3b3cff922bd51709b605d9ead9aa71031d81447142d828eb4a6eba76fe619f9b"
-
-[[package]]
-name = "pin-utils"
-version = "0.1.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "8b870d8c151b6f2fb93e84a13146138f05d02ed11c7e7c54f8826aaaf7c9f184"
-
-[[package]]
-name = "pkg-config"
-version = "0.3.32"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "7edddbd0b52d732b21ad9a5fab5c704c14cd949e5e9a1ec5929a24fded1b904c"
-
-[[package]]
-name = "plain"
-version = "0.2.3"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "b4596b6d070b27117e987119b4dac604f3c58cfb0b191112e24771b2faeac1a6"
-
-[[package]]
-name = "poly1305"
-version = "0.8.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "8159bd90725d2df49889a078b54f4f79e87f1f8a8444194cdca81d38f5393abf"
-dependencies = [
- "cpufeatures",
- "opaque-debug",
- "universal-hash",
-]
-
-[[package]]
-name = "potential_utf"
-version = "0.1.4"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "b73949432f5e2a09657003c25bca5e19a0e9c84f8058ca374f49e0ebe605af77"
-dependencies = [
- "zerovec",
-]
-
-[[package]]
-name = "ppv-lite86"
-version = "0.2.21"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "85eae3c4ed2f50dcfe72643da4befc30deadb458a9b590d720cde2f2b1e97da9"
-dependencies = [
- "zerocopy",
-]
-
-[[package]]
-name = "proc-macro2"
-version = "1.0.105"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "535d180e0ecab6268a3e718bb9fd44db66bbbc256257165fc699dadf70d16fe7"
-dependencies = [
- "unicode-ident",
-]
-
-[[package]]
-name = "quinn"
-version = "0.11.9"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "b9e20a958963c291dc322d98411f541009df2ced7b5a4f2bd52337638cfccf20"
-dependencies = [
- "bytes",
- "cfg_aliases",
- "pin-project-lite",
- "quinn-proto",
- "quinn-udp",
- "rustc-hash",
- "rustls",
- "socket2",
- "thiserror",
- "tokio",
- "tracing",
- "web-time",
-]
-
-[[package]]
-name = "quinn-proto"
-version = "0.11.13"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "f1906b49b0c3bc04b5fe5d86a77925ae6524a19b816ae38ce1e426255f1d8a31"
-dependencies = [
- "bytes",
- "getrandom 0.3.4",
- "lru-slab",
- "rand",
- "ring",
- "rustc-hash",
- "rustls",
- "rustls-pki-types",
- "slab",
- "thiserror",
- "tinyvec",
- "tracing",
- "web-time",
-]
-
-[[package]]
-name = "quinn-udp"
-version = "0.5.14"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "addec6a0dcad8a8d96a771f815f0eaf55f9d1805756410b39f5fa81332574cbd"
-dependencies = [
- "cfg_aliases",
- "libc",
- "once_cell",
- "socket2",
- "tracing",
- "windows-sys 0.60.2",
-]
-
-[[package]]
-name = "quote"
-version = "1.0.43"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "dc74d9a594b72ae6656596548f56f667211f8a97b3d4c3d467150794690dc40a"
-dependencies = [
- "proc-macro2",
-]
-
-[[package]]
-name = "r-efi"
-version = "5.3.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "69cdb34c158ceb288df11e18b4bd39de994f6657d83847bdffdbd7f346754b0f"
-
-[[package]]
-name = "rand"
-version = "0.9.2"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "6db2770f06117d490610c7488547d543617b21bfa07796d7a12f6f1bd53850d1"
-dependencies = [
- "rand_chacha",
- "rand_core 0.9.5",
-]
-
-[[package]]
-name = "rand_chacha"
-version = "0.9.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "d3022b5f1df60f26e1ffddd6c66e8aa15de382ae63b3a0c1bfc0e4d3e3f325cb"
-dependencies = [
- "ppv-lite86",
- "rand_core 0.9.5",
-]
-
-[[package]]
-name = "rand_core"
-version = "0.6.4"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "ec0be4795e2f6a28069bec0b5ff3e2ac9bafc99e6a9a7dc3547996c5c816922c"
-dependencies = [
- "getrandom 0.2.17",
-]
-
-[[package]]
-name = "rand_core"
-version = "0.9.5"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "76afc826de14238e6e8c374ddcc1fa19e374fd8dd986b0d2af0d02377261d83c"
-dependencies = [
- "getrandom 0.3.4",
-]
-
-[[package]]
-name = "reqwest"
-version = "0.12.28"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "eddd3ca559203180a307f12d114c268abf583f59b03cb906fd0b3ff8646c1147"
-dependencies = [
- "base64",
- "bytes",
- "encoding_rs",
- "futures-core",
- "h2",
- "http",
- "http-body",
- "http-body-util",
- "hyper",
- "hyper-rustls",
- "hyper-util",
- "js-sys",
- "log",
- "mime",
- "percent-encoding",
- "pin-project-lite",
- "quinn",
- "rustls",
- "rustls-native-certs",
- "rustls-pki-types",
- "serde",
- "serde_json",
- "serde_urlencoded",
- "sync_wrapper",
- "tokio",
- "tokio-rustls",
- "tower",
- "tower-http",
- "tower-service",
- "url",
- "wasm-bindgen",
- "wasm-bindgen-futures",
- "web-sys",
-]
-
-[[package]]
-name = "ring"
-version = "0.17.14"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "a4689e6c2294d81e88dc6261c768b63bc4fcdb852be6d1352498b114f61383b7"
-dependencies = [
- "cc",
- "cfg-if",
- "getrandom 0.2.17",
- "libc",
- "untrusted",
- "windows-sys 0.52.0",
-]
-
-[[package]]
-name = "rsqlite-vfs"
-version = "0.1.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "a8a1f2315036ef6b1fbacd1972e8ee7688030b0a2121edfc2a6550febd41574d"
-dependencies = [
- "hashbrown",
- "thiserror",
-]
-
-[[package]]
-name = "rusqlite"
-version = "0.38.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "f1c93dd1c9683b438c392c492109cb702b8090b2bfc8fed6f6e4eb4523f17af3"
-dependencies = [
- "bitflags",
- "fallible-iterator",
- "fallible-streaming-iterator",
- "hashlink",
- "libsqlite3-sys",
- "smallvec",
- "sqlite-wasm-rs",
-]
-
-[[package]]
-name = "rustc-hash"
-version = "2.1.1"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "357703d41365b4b27c590e3ed91eabb1b663f07c4c084095e60cbed4362dff0d"
-
-[[package]]
-name = "rustc_version"
-version = "0.4.1"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "cfcb3a22ef46e85b45de6ee7e79d063319ebb6594faafcf1c225ea92ab6e9b92"
-dependencies = [
- "semver",
-]
-
-[[package]]
-name = "rustix"
-version = "1.1.3"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "146c9e247ccc180c1f61615433868c99f3de3ae256a30a43b49f67c2d9171f34"
-dependencies = [
- "bitflags",
- "errno",
- "libc",
- "linux-raw-sys",
- "windows-sys 0.61.2",
-]
-
-[[package]]
-name = "rustls"
-version = "0.23.36"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "c665f33d38cea657d9614f766881e4d510e0eda4239891eea56b4cadcf01801b"
-dependencies = [
- "once_cell",
- "ring",
- "rustls-pki-types",
- "rustls-webpki",
- "subtle",
- "zeroize",
-]
-
-[[package]]
-name = "rustls-native-certs"
-version = "0.8.3"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "612460d5f7bea540c490b2b6395d8e34a953e52b491accd6c86c8164c5932a63"
-dependencies = [
- "openssl-probe",
- "rustls-pki-types",
- "schannel",
- "security-framework",
-]
-
-[[package]]
-name = "rustls-pki-types"
-version = "1.14.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "be040f8b0a225e40375822a563fa9524378b9d63112f53e19ffff34df5d33fdd"
-dependencies = [
- "web-time",
- "zeroize",
-]
-
-[[package]]
-name = "rustls-webpki"
-version = "0.103.9"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "d7df23109aa6c1567d1c575b9952556388da57401e4ace1d15f79eedad0d8f53"
-dependencies = [
- "ring",
- "rustls-pki-types",
- "untrusted",
-]
-
-[[package]]
-name = "rustversion"
-version = "1.0.22"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "b39cdef0fa800fc44525c84ccb54a029961a8215f9619753635a9c0d2538d46d"
-
-[[package]]
-name = "ryu"
-version = "1.0.22"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "a50f4cf475b65d88e057964e0e9bb1f0aa9bbb2036dc65c64596b42932536984"
-
-[[package]]
-name = "salsa20"
-version = "0.10.2"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "97a22f5af31f73a954c10289c93e8a50cc23d971e80ee446f1f6f7137a088213"
-dependencies = [
- "cipher",
-]
-
-[[package]]
-name = "schannel"
-version = "0.1.28"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "891d81b926048e76efe18581bf793546b4c0eaf8448d72be8de2bbee5fd166e1"
-dependencies = [
- "windows-sys 0.61.2",
-]
-
-[[package]]
-name = "scroll"
-version = "0.12.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "6ab8598aa408498679922eff7fa985c25d58a90771bd6be794434c5277eab1a6"
-dependencies = [
- "scroll_derive",
-]
-
-[[package]]
-name = "scroll_derive"
-version = "0.12.1"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "1783eabc414609e28a5ba76aee5ddd52199f7107a0b24c2e9746a1ecc34a683d"
-dependencies = [
- "proc-macro2",
- "quote",
- "syn",
-]
-
-[[package]]
-name = "security-framework"
-version = "3.5.1"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "b3297343eaf830f66ede390ea39da1d462b6b0c1b000f420d0a83f898bbbe6ef"
-dependencies = [
- "bitflags",
- "core-foundation 0.10.1",
- "core-foundation-sys",
- "libc",
- "security-framework-sys",
-]
-
-[[package]]
-name = "security-framework-sys"
-version = "2.15.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "cc1f0cbffaac4852523ce30d8bd3c5cdc873501d96ff467ca09b6767bb8cd5c0"
-dependencies = [
- "core-foundation-sys",
- "libc",
-]
-
-[[package]]
-name = "semver"
-version = "1.0.27"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "d767eb0aabc880b29956c35734170f26ed551a859dbd361d140cdbeca61ab1e2"
-dependencies = [
- "serde",
- "serde_core",
-]
-
-[[package]]
-name = "serde"
-version = "1.0.228"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "9a8e94ea7f378bd32cbbd37198a4a91436180c5bb472411e48b5ec2e2124ae9e"
-dependencies = [
- "serde_core",
- "serde_derive",
-]
-
-[[package]]
-name = "serde_core"
-version = "1.0.228"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "41d385c7d4ca58e59fc732af25c3983b67ac852c1a25000afe1175de458b67ad"
-dependencies = [
- "serde_derive",
-]
-
-[[package]]
-name = "serde_derive"
-version = "1.0.228"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "d540f220d3187173da220f885ab66608367b6574e925011a9353e4badda91d79"
-dependencies = [
- "proc-macro2",
- "quote",
- "syn",
-]
-
-[[package]]
-name = "serde_json"
-version = "1.0.149"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "83fc039473c5595ace860d8c4fafa220ff474b3fc6bfdb4293327f1a37e94d86"
-dependencies = [
- "itoa",
- "memchr",
- "serde",
- "serde_core",
- "zmij",
-]
-
-[[package]]
-name = "serde_spanned"
-version = "1.0.4"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "f8bbf91e5a4d6315eee45e704372590b30e260ee83af6639d64557f51b067776"
-dependencies = [
- "serde_core",
-]
-
-[[package]]
-name = "serde_urlencoded"
-version = "0.7.1"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "d3491c14715ca2294c4d6a88f15e84739788c1d030eed8c110436aafdaa2f3fd"
-dependencies = [
- "form_urlencoded",
- "itoa",
- "ryu",
- "serde",
-]
-
-[[package]]
-name = "shlex"
-version = "1.3.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "0fda2ff0d084019ba4d7c6f371c95d8fd75ce3524c3cb8fb653a3023f6323e64"
-
-[[package]]
-name = "siphasher"
-version = "1.0.1"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "56199f7ddabf13fe5074ce809e7d3f42b42ae711800501b5b16ea82ad029c39d"
-
-[[package]]
-name = "slab"
-version = "0.4.11"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "7a2ae44ef20feb57a68b23d846850f861394c2e02dc425a50098ae8c90267589"
-
-[[package]]
-name = "smallvec"
-version = "1.15.1"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "67b1b7a3b5fe4f1376887184045fcf45c69e92af734b7aaddc05fb777b6fbd03"
-
-[[package]]
-name = "smawk"
-version = "0.3.2"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "b7c388c1b5e93756d0c740965c41e8822f866621d41acbdf6336a6a168f8840c"
-
-[[package]]
-name = "socket2"
-version = "0.6.1"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "17129e116933cf371d018bb80ae557e889637989d8638274fb25622827b03881"
-dependencies = [
- "libc",
- "windows-sys 0.60.2",
-]
-
-[[package]]
-name = "sqlite-wasm-rs"
-version = "0.5.2"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "2f4206ed3a67690b9c29b77d728f6acc3ce78f16bf846d83c94f76400320181b"
-dependencies = [
- "cc",
- "js-sys",
- "rsqlite-vfs",
- "wasm-bindgen",
-]
-
-[[package]]
-name = "stable_deref_trait"
-version = "1.2.1"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "6ce2be8dc25455e1f91df71bfa12ad37d7af1092ae736f3a6cd0e37bc7810596"
-
-[[package]]
-name = "static_assertions"
-version = "1.1.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "a2eb9349b6444b326872e140eb1cf5e7c522154d69e7a0ffb0fb81c06b37543f"
-
-[[package]]
-name = "subtle"
-version = "2.6.1"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "13c2bddecc57b384dee18652358fb23172facb8a2c51ccc10d74c157bdea3292"
-
-[[package]]
-name = "syn"
-version = "2.0.114"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "d4d107df263a3013ef9b1879b0df87d706ff80f65a86ea879bd9c31f9b307c2a"
-dependencies = [
- "proc-macro2",
- "quote",
- "unicode-ident",
-]
-
-[[package]]
-name = "sync_wrapper"
-version = "1.0.2"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "0bf256ce5efdfa370213c1dabab5935a12e49f2c58d15e9eac2870d3b4f27263"
-dependencies = [
- "futures-core",
-]
-
-[[package]]
-name = "synstructure"
-version = "0.13.2"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "728a70f3dbaf5bab7f0c4b1ac8d7ae5ea60a4b5549c8a5914361c99147a709d2"
-dependencies = [
- "proc-macro2",
- "quote",
- "syn",
-]
-
-[[package]]
-name = "system-configuration"
-version = "0.6.1"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "3c879d448e9d986b661742763247d3693ed13609438cf3d006f51f5368a5ba6b"
-dependencies = [
- "bitflags",
- "core-foundation 0.9.4",
- "system-configuration-sys",
-]
-
-[[package]]
-name = "system-configuration-sys"
-version = "0.6.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "8e1d1b10ced5ca923a1fcb8d03e96b8d3268065d724548c0211415ff6ac6bac4"
-dependencies = [
- "core-foundation-sys",
- "libc",
-]
-
-[[package]]
-name = "tempfile"
-version = "3.24.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "655da9c7eb6305c55742045d5a8d2037996d61d8de95806335c7c86ce0f82e9c"
-dependencies = [
- "fastrand",
- "getrandom 0.3.4",
- "once_cell",
- "rustix",
- "windows-sys 0.61.2",
-]
-
-[[package]]
-name = "textwrap"
-version = "0.16.2"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "c13547615a44dc9c452a8a534638acdf07120d4b6847c8178705da06306a3057"
-dependencies = [
- "smawk",
-]
-
-[[package]]
-name = "thiserror"
-version = "2.0.18"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "4288b5bcbc7920c07a1149a35cf9590a2aa808e0bc1eafaade0b80947865fbc4"
-dependencies = [
- "thiserror-impl",
-]
-
-[[package]]
-name = "thiserror-impl"
-version = "2.0.18"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "ebc4ee7f67670e9b64d05fa4253e753e016c6c95ff35b89b7941d6b856dec1d5"
-dependencies = [
- "proc-macro2",
- "quote",
- "syn",
-]
-
-[[package]]
-name = "tinystr"
-version = "0.8.2"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "42d3e9c45c09de15d06dd8acf5f4e0e399e85927b7f00711024eb7ae10fa4869"
-dependencies = [
- "displaydoc",
- "zerovec",
-]
-
-[[package]]
-name = "tinyvec"
-version = "1.10.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "bfa5fdc3bce6191a1dbc8c02d5c8bffcf557bafa17c124c5264a458f1b0613fa"
-dependencies = [
- "tinyvec_macros",
-]
-
-[[package]]
-name = "tinyvec_macros"
-version = "0.1.1"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "1f3ccbac311fea05f86f61904b462b55fb3df8837a366dfc601a0161d0532f20"
-
-[[package]]
-name = "tokio"
-version = "1.49.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "72a2903cd7736441aac9df9d7688bd0ce48edccaadf181c3b90be801e81d3d86"
-dependencies = [
- "bytes",
- "libc",
- "mio",
- "pin-project-lite",
- "socket2",
- "windows-sys 0.61.2",
-]
-
-[[package]]
-name = "tokio-rustls"
-version = "0.26.4"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "1729aa945f29d91ba541258c8df89027d5792d85a8841fb65e8bf0f4ede4ef61"
-dependencies = [
- "rustls",
- "tokio",
-]
-
-[[package]]
-name = "tokio-util"
-version = "0.7.18"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "9ae9cec805b01e8fc3fd2fe289f89149a9b66dd16786abd8b19cfa7b48cb0098"
-dependencies = [
- "bytes",
- "futures-core",
- "futures-sink",
- "pin-project-lite",
- "tokio",
-]
-
-[[package]]
-name = "toml"
-version = "0.9.11+spec-1.1.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "f3afc9a848309fe1aaffaed6e1546a7a14de1f935dc9d89d32afd9a44bab7c46"
-dependencies = [
- "indexmap",
- "serde_core",
- "serde_spanned",
- "toml_datetime",
- "toml_parser",
- "toml_writer",
- "winnow",
-]
-
-[[package]]
-name = "toml_datetime"
-version = "0.7.5+spec-1.1.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "92e1cfed4a3038bc5a127e35a2d360f145e1f4b971b551a2ba5fd7aedf7e1347"
-dependencies = [
- "serde_core",
-]
-
-[[package]]
-name = "toml_parser"
-version = "1.0.6+spec-1.1.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "a3198b4b0a8e11f09dd03e133c0280504d0801269e9afa46362ffde1cbeebf44"
-dependencies = [
- "winnow",
-]
-
-[[package]]
-name = "toml_writer"
-version = "1.0.6+spec-1.1.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "ab16f14aed21ee8bfd8ec22513f7287cd4a91aa92e44edfe2c17ddd004e92607"
-
-[[package]]
-name = "tower"
-version = "0.5.3"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "ebe5ef63511595f1344e2d5cfa636d973292adc0eec1f0ad45fae9f0851ab1d4"
-dependencies = [
- "futures-core",
- "futures-util",
- "pin-project-lite",
- "sync_wrapper",
- "tokio",
- "tower-layer",
- "tower-service",
-]
-
-[[package]]
-name = "tower-http"
-version = "0.6.8"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "d4e6559d53cc268e5031cd8429d05415bc4cb4aefc4aa5d6cc35fbf5b924a1f8"
-dependencies = [
- "bitflags",
- "bytes",
- "futures-util",
- "http",
- "http-body",
- "iri-string",
- "pin-project-lite",
- "tower",
- "tower-layer",
- "tower-service",
-]
-
-[[package]]
-name = "tower-layer"
-version = "0.3.3"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "121c2a6cda46980bb0fcd1647ffaf6cd3fc79a013de288782836f6df9c48780e"
-
-[[package]]
-name = "tower-service"
-version = "0.3.3"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "8df9b6e13f2d32c91b9bd719c00d1958837bc7dec474d94952798cc8e69eeec3"
-
-[[package]]
-name = "tracing"
-version = "0.1.44"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "63e71662fa4b2a2c3a26f570f037eb95bb1f85397f3cd8076caed2f026a6d100"
-dependencies = [
- "pin-project-lite",
- "tracing-core",
-]
-
-[[package]]
-name = "tracing-core"
-version = "0.1.36"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "db97caf9d906fbde555dd62fa95ddba9eecfd14cb388e4f491a66d74cd5fb79a"
-dependencies = [
- "once_cell",
-]
-
-[[package]]
-name = "try-lock"
-version = "0.2.5"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "e421abadd41a4225275504ea4d6566923418b7f05506fbc9c0fe86ba7396114b"
-
-[[package]]
-name = "typenum"
-version = "1.19.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "562d481066bde0658276a35467c4af00bdc6ee726305698a55b86e61d7ad82bb"
-
-[[package]]
-name = "unicode-ident"
-version = "1.0.22"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "9312f7c4f6ff9069b165498234ce8be658059c6728633667c526e27dc2cf1df5"
-
-[[package]]
-name = "uniffi"
-version = "0.31.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "b8c6dec3fc6645f71a16a3fa9ff57991028153bd194ca97f4b55e610c73ce66a"
-dependencies = [
- "anyhow",
- "cargo_metadata",
- "uniffi_bindgen",
- "uniffi_core",
- "uniffi_macros",
- "uniffi_pipeline",
-]
-
-[[package]]
-name = "uniffi_bindgen"
-version = "0.31.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "4ed0150801958d4825da56a41c71f000a457ac3a4613fa9647df78ac4b6b6881"
-dependencies = [
- "anyhow",
- "askama",
- "camino",
- "cargo_metadata",
- "fs-err",
- "glob",
- "goblin",
- "heck",
- "indexmap",
- "once_cell",
- "serde",
- "tempfile",
- "textwrap",
- "toml",
- "uniffi_internal_macros",
- "uniffi_meta",
- "uniffi_pipeline",
- "uniffi_udl",
-]
-
-[[package]]
-name = "uniffi_core"
-version = "0.31.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "b0ef62e69762fbb9386dcb6c87cd3dd05d525fa8a3a579a290892e60ddbda47e"
-dependencies = [
- "anyhow",
- "bytes",
- "once_cell",
- "static_assertions",
-]
-
-[[package]]
-name = "uniffi_internal_macros"
-version = "0.31.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "98f51ebca0d9a4b2aa6c644d5ede45c56f73906b96403c08a1985e75ccb64a01"
-dependencies = [
- "anyhow",
- "indexmap",
- "proc-macro2",
- "quote",
- "syn",
-]
-
-[[package]]
-name = "uniffi_macros"
-version = "0.31.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "db9d12529f1223d014fd501e5f29ca0884d15d6ed5ddddd9f506e55350327dc3"
-dependencies = [
- "camino",
- "fs-err",
- "once_cell",
- "proc-macro2",
- "quote",
- "serde",
- "syn",
- "toml",
- "uniffi_meta",
-]
-
-[[package]]
-name = "uniffi_meta"
-version = "0.31.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "9df6d413db2827c68588f8149d30d49b71d540d46539e435b23a7f7dbd4d4f86"
-dependencies = [
- "anyhow",
- "siphasher",
- "uniffi_internal_macros",
- "uniffi_pipeline",
-]
-
-[[package]]
-name = "uniffi_pipeline"
-version = "0.31.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "a806dddc8208f22efd7e95a5cdf88ed43d0f3271e8f63b47e757a8bbdb43b63a"
-dependencies = [
- "anyhow",
- "heck",
- "indexmap",
- "tempfile",
- "uniffi_internal_macros",
-]
-
-[[package]]
-name = "uniffi_udl"
-version = "0.31.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "0d1a7339539bf6f6fa3e9b534dece13f778bda2d54b1a6d4e40b4d6090ac26e7"
-dependencies = [
- "anyhow",
- "textwrap",
- "uniffi_meta",
- "weedle2",
-]
-
-[[package]]
-name = "universal-hash"
-version = "0.5.1"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "fc1de2c688dc15305988b563c3854064043356019f97a4b46276fe734c4f07ea"
-dependencies = [
- "crypto-common",
- "subtle",
-]
-
-[[package]]
-name = "untrusted"
-version = "0.9.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "8ecb6da28b8a351d773b68d5825ac39017e680750f980f3a1a85cd8dd28a47c1"
-
-[[package]]
-name = "url"
-version = "2.5.8"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "ff67a8a4397373c3ef660812acab3268222035010ab8680ec4215f38ba3d0eed"
-dependencies = [
- "form_urlencoded",
- "idna",
- "percent-encoding",
- "serde",
-]
-
-[[package]]
-name = "utf8_iter"
-version = "1.0.4"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "b6c140620e7ffbb22c2dee59cafe6084a59b5ffc27a8859a5f0d494b5d52b6be"
-
-[[package]]
-name = "uuid"
-version = "1.19.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "e2e054861b4bd027cd373e18e8d8d8e6548085000e41290d95ce0c373a654b4a"
-dependencies = [
- "getrandom 0.3.4",
- "js-sys",
- "uuid-rng-internal",
- "wasm-bindgen",
-]
-
-[[package]]
-name = "uuid-rng-internal"
-version = "1.19.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "8d0021aebf9af0cbec73af2f884a2cd0a41d984c00e42f27baa11856ab480e2c"
-dependencies = [
- "getrandom 0.3.4",
-]
-
-[[package]]
-name = "vcpkg"
-version = "0.2.15"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "accd4ea62f7bb7a82fe23066fb0957d48ef677f6eeb8215f372f52e48bb32426"
-
-[[package]]
-name = "version_check"
-version = "0.9.5"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "0b928f33d975fc6ad9f86c8f283853ad26bdd5b10b7f1542aa2fa15e2289105a"
-
-[[package]]
-name = "want"
-version = "0.3.1"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "bfa7760aed19e106de2c7c0b581b509f2f25d3dacaf737cb82ac61bc6d760b0e"
-dependencies = [
- "try-lock",
-]
-
-[[package]]
-name = "wasi"
-version = "0.11.1+wasi-snapshot-preview1"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "ccf3ec651a847eb01de73ccad15eb7d99f80485de043efb2f370cd654f4ea44b"
-
-[[package]]
-name = "wasip2"
-version = "1.0.2+wasi-0.2.9"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "9517f9239f02c069db75e65f174b3da828fe5f5b945c4dd26bd25d89c03ebcf5"
-dependencies = [
- "wit-bindgen",
-]
-
-[[package]]
-name = "wasm-bindgen"
-version = "0.2.108"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "64024a30ec1e37399cf85a7ffefebdb72205ca1c972291c51512360d90bd8566"
-dependencies = [
- "cfg-if",
- "once_cell",
- "rustversion",
- "wasm-bindgen-macro",
- "wasm-bindgen-shared",
-]
-
-[[package]]
-name = "wasm-bindgen-futures"
-version = "0.4.58"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "70a6e77fd0ae8029c9ea0063f87c46fde723e7d887703d74ad2616d792e51e6f"
-dependencies = [
- "cfg-if",
- "futures-util",
- "js-sys",
- "once_cell",
- "wasm-bindgen",
- "web-sys",
-]
-
-[[package]]
-name = "wasm-bindgen-macro"
-version = "0.2.108"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "008b239d9c740232e71bd39e8ef6429d27097518b6b30bdf9086833bd5b6d608"
-dependencies = [
- "quote",
- "wasm-bindgen-macro-support",
-]
-
-[[package]]
-name = "wasm-bindgen-macro-support"
-version = "0.2.108"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "5256bae2d58f54820e6490f9839c49780dff84c65aeab9e772f15d5f0e913a55"
-dependencies = [
- "bumpalo",
- "proc-macro2",
- "quote",
- "syn",
- "wasm-bindgen-shared",
-]
-
-[[package]]
-name = "wasm-bindgen-shared"
-version = "0.2.108"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "1f01b580c9ac74c8d8f0c0e4afb04eeef2acf145458e52c03845ee9cd23e3d12"
-dependencies = [
- "unicode-ident",
-]
-
-[[package]]
-name = "web-sys"
-version = "0.3.85"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "312e32e551d92129218ea9a2452120f4aabc03529ef03e4d0d82fb2780608598"
-dependencies = [
- "js-sys",
- "wasm-bindgen",
-]
-
-[[package]]
-name = "web-time"
-version = "1.1.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "5a6580f308b1fad9207618087a65c04e7a10bc77e02c8e84e9b00dd4b12fa0bb"
-dependencies = [
- "js-sys",
- "wasm-bindgen",
-]
-
-[[package]]
-name = "weedle2"
-version = "5.0.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "998d2c24ec099a87daf9467808859f9d82b61f1d9c9701251aea037f514eae0e"
-dependencies = [
- "nom",
-]
-
-[[package]]
-name = "windows-link"
-version = "0.2.1"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "f0805222e57f7521d6a62e36fa9163bc891acd422f971defe97d64e70d0a4fe5"
-
-[[package]]
-name = "windows-registry"
-version = "0.6.1"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "02752bf7fbdcce7f2a27a742f798510f3e5ad88dbe84871e5168e2120c3d5720"
-dependencies = [
- "windows-link",
- "windows-result",
- "windows-strings",
-]
-
-[[package]]
-name = "windows-result"
-version = "0.4.1"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "7781fa89eaf60850ac3d2da7af8e5242a5ea78d1a11c49bf2910bb5a73853eb5"
-dependencies = [
- "windows-link",
-]
-
-[[package]]
-name = "windows-strings"
-version = "0.5.1"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "7837d08f69c77cf6b07689544538e017c1bfcf57e34b4c0ff58e6c2cd3b37091"
-dependencies = [
- "windows-link",
-]
-
-[[package]]
-name = "windows-sys"
-version = "0.52.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "282be5f36a8ce781fad8c8ae18fa3f9beff57ec1b52cb3de0789201425d9a33d"
-dependencies = [
- "windows-targets 0.52.6",
-]
-
-[[package]]
-name = "windows-sys"
-version = "0.60.2"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "f2f500e4d28234f72040990ec9d39e3a6b950f9f22d3dba18416c35882612bcb"
-dependencies = [
- "windows-targets 0.53.5",
-]
-
-[[package]]
-name = "windows-sys"
-version = "0.61.2"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "ae137229bcbd6cdf0f7b80a31df61766145077ddf49416a728b02cb3921ff3fc"
-dependencies = [
- "windows-link",
-]
-
-[[package]]
-name = "windows-targets"
-version = "0.52.6"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "9b724f72796e036ab90c1021d4780d4d3d648aca59e491e6b98e725b84e99973"
-dependencies = [
- "windows_aarch64_gnullvm 0.52.6",
- "windows_aarch64_msvc 0.52.6",
- "windows_i686_gnu 0.52.6",
- "windows_i686_gnullvm 0.52.6",
- "windows_i686_msvc 0.52.6",
- "windows_x86_64_gnu 0.52.6",
- "windows_x86_64_gnullvm 0.52.6",
- "windows_x86_64_msvc 0.52.6",
-]
-
-[[package]]
-name = "windows-targets"
-version = "0.53.5"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "4945f9f551b88e0d65f3db0bc25c33b8acea4d9e41163edf90dcd0b19f9069f3"
-dependencies = [
- "windows-link",
- "windows_aarch64_gnullvm 0.53.1",
- "windows_aarch64_msvc 0.53.1",
- "windows_i686_gnu 0.53.1",
- "windows_i686_gnullvm 0.53.1",
- "windows_i686_msvc 0.53.1",
- "windows_x86_64_gnu 0.53.1",
- "windows_x86_64_gnullvm 0.53.1",
- "windows_x86_64_msvc 0.53.1",
-]
-
-[[package]]
-name = "windows_aarch64_gnullvm"
-version = "0.52.6"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "32a4622180e7a0ec044bb555404c800bc9fd9ec262ec147edd5989ccd0c02cd3"
-
-[[package]]
-name = "windows_aarch64_gnullvm"
-version = "0.53.1"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "a9d8416fa8b42f5c947f8482c43e7d89e73a173cead56d044f6a56104a6d1b53"
-
-[[package]]
-name = "windows_aarch64_msvc"
-version = "0.52.6"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "09ec2a7bb152e2252b53fa7803150007879548bc709c039df7627cabbd05d469"
-
-[[package]]
-name = "windows_aarch64_msvc"
-version = "0.53.1"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "b9d782e804c2f632e395708e99a94275910eb9100b2114651e04744e9b125006"
-
-[[package]]
-name = "windows_i686_gnu"
-version = "0.52.6"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "8e9b5ad5ab802e97eb8e295ac6720e509ee4c243f69d781394014ebfe8bbfa0b"
-
-[[package]]
-name = "windows_i686_gnu"
-version = "0.53.1"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "960e6da069d81e09becb0ca57a65220ddff016ff2d6af6a223cf372a506593a3"
-
-[[package]]
-name = "windows_i686_gnullvm"
-version = "0.52.6"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "0eee52d38c090b3caa76c563b86c3a4bd71ef1a819287c19d586d7334ae8ed66"
-
-[[package]]
-name = "windows_i686_gnullvm"
-version = "0.53.1"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "fa7359d10048f68ab8b09fa71c3daccfb0e9b559aed648a8f95469c27057180c"
-
-[[package]]
-name = "windows_i686_msvc"
-version = "0.52.6"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "240948bc05c5e7c6dabba28bf89d89ffce3e303022809e73deaefe4f6ec56c66"
-
-[[package]]
-name = "windows_i686_msvc"
-version = "0.53.1"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "1e7ac75179f18232fe9c285163565a57ef8d3c89254a30685b57d83a38d326c2"
-
-[[package]]
-name = "windows_x86_64_gnu"
-version = "0.52.6"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "147a5c80aabfbf0c7d901cb5895d1de30ef2907eb21fbbab29ca94c5b08b1a78"
-
-[[package]]
-name = "windows_x86_64_gnu"
-version = "0.53.1"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "9c3842cdd74a865a8066ab39c8a7a473c0778a3f29370b5fd6b4b9aa7df4a499"
-
-[[package]]
-name = "windows_x86_64_gnullvm"
-version = "0.52.6"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "24d5b23dc417412679681396f2b49f3de8c1473deb516bd34410872eff51ed0d"
-
-[[package]]
-name = "windows_x86_64_gnullvm"
-version = "0.53.1"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "0ffa179e2d07eee8ad8f57493436566c7cc30ac536a3379fdf008f47f6bb7ae1"
-
-[[package]]
-name = "windows_x86_64_msvc"
-version = "0.52.6"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "589f6da84c646204747d1270a2a5661ea66ed1cced2631d546fdfb155959f9ec"
-
-[[package]]
-name = "windows_x86_64_msvc"
-version = "0.53.1"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "d6bbff5f0aada427a1e5a6da5f1f98158182f26556f345ac9e04d36d0ebed650"
-
-[[package]]
-name = "winnow"
-version = "0.7.14"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "5a5364e9d77fcdeeaa6062ced926ee3381faa2ee02d3eb83a5c27a8825540829"
-dependencies = [
- "memchr",
-]
-
-[[package]]
-name = "wit-bindgen"
-version = "0.51.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "d7249219f66ced02969388cf2bb044a09756a083d0fab1e566056b04d9fbcaa5"
-
-[[package]]
-name = "writeable"
-version = "0.6.2"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "9edde0db4769d2dc68579893f2306b26c6ecfbe0ef499b013d731b7b9247e0b9"
-
-[[package]]
-name = "x25519-dalek"
-version = "2.0.1"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "c7e468321c81fb07fa7f4c636c3972b9100f0346e5b6a9f2bd0603a52f7ed277"
-dependencies = [
- "curve25519-dalek",
- "rand_core 0.6.4",
- "serde",
- "zeroize",
-]
-
-[[package]]
-name = "xsalsa20poly1305"
-version = "0.9.1"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "02a6dad357567f81cd78ee75f7c61f1b30bb2fe4390be8fb7c69e2ac8dffb6c7"
-dependencies = [
- "aead",
- "poly1305",
- "salsa20",
- "subtle",
- "zeroize",
-]
-
-[[package]]
-name = "yoke"
-version = "0.8.1"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "72d6e5c6afb84d73944e5cedb052c4680d5657337201555f9f2a16b7406d4954"
-dependencies = [
- "stable_deref_trait",
- "yoke-derive",
- "zerofrom",
-]
-
-[[package]]
-name = "yoke-derive"
-version = "0.8.1"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "b659052874eb698efe5b9e8cf382204678a0086ebf46982b79d6ca3182927e5d"
-dependencies = [
- "proc-macro2",
- "quote",
- "syn",
- "synstructure",
-]
-
-[[package]]
-name = "zerocopy"
-version = "0.8.33"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "668f5168d10b9ee831de31933dc111a459c97ec93225beb307aed970d1372dfd"
-dependencies = [
- "zerocopy-derive",
-]
-
-[[package]]
-name = "zerocopy-derive"
-version = "0.8.33"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "2c7962b26b0a8685668b671ee4b54d007a67d4eaf05fda79ac0ecf41e32270f1"
-dependencies = [
- "proc-macro2",
- "quote",
- "syn",
-]
-
-[[package]]
-name = "zerofrom"
-version = "0.1.6"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "50cc42e0333e05660c3587f3bf9d0478688e15d870fab3346451ce7f8c9fbea5"
-dependencies = [
- "zerofrom-derive",
-]
-
-[[package]]
-name = "zerofrom-derive"
-version = "0.1.6"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "d71e5d6e06ab090c67b5e44993ec16b72dcbaabc526db883a360057678b48502"
-dependencies = [
- "proc-macro2",
- "quote",
- "syn",
- "synstructure",
-]
-
-[[package]]
-name = "zeroize"
-version = "1.8.2"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "b97154e67e32c85465826e8bcc1c59429aaaf107c1e4a9e53c8d8ccd5eff88d0"
-dependencies = [
- "zeroize_derive",
-]
-
-[[package]]
-name = "zeroize_derive"
-version = "1.4.3"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "85a5b4158499876c763cb03bc4e49185d3cccbabb15b33c627f7884f43db852e"
-dependencies = [
- "proc-macro2",
- "quote",
- "syn",
-]
-
-[[package]]
-name = "zerotrie"
-version = "0.2.3"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "2a59c17a5562d507e4b54960e8569ebee33bee890c70aa3fe7b97e85a9fd7851"
-dependencies = [
- "displaydoc",
- "yoke",
- "zerofrom",
-]
-
-[[package]]
-name = "zerovec"
-version = "0.11.5"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "6c28719294829477f525be0186d13efa9a3c602f7ec202ca9e353d310fb9a002"
-dependencies = [
- "yoke",
- "zerofrom",
- "zerovec-derive",
-]
-
-[[package]]
-name = "zerovec-derive"
-version = "0.11.2"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "eadce39539ca5cb3985590102671f2567e659fca9666581ad3411d59207951f3"
-dependencies = [
- "proc-macro2",
- "quote",
- "syn",
-]
-
-[[package]]
-name = "zmij"
-version = "1.0.16"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "dfcd145825aace48cff44a8844de64bf75feec3080e0aa5cdbde72961ae51a65"
diff --git a/rust/llmchat/uniffi/llmchat_db_uniffi/Cargo.toml b/rust/llmchat/uniffi/llmchat_db_uniffi/Cargo.toml
deleted file mode 100644
index bd2ffcc380..0000000000
--- a/rust/llmchat/uniffi/llmchat_db_uniffi/Cargo.toml
+++ /dev/null
@@ -1,16 +0,0 @@
-[package]
-name = "llmchat_db_uniffi"
-version = "0.1.0"
-edition = "2024"
-
-[lib]
-name = "llmchat_db_uniffi"
-crate-type = ["staticlib", "cdylib"]
-
-[dependencies]
-llmchat-db = { path = "../../db" }
-serde = { version = "1", features = ["derive"] }
-thiserror = "2"
-uniffi = { version = "0.31.0" }
-uuid = { version = "1" }
-
diff --git a/rust/llmchat/uniffi/llmchat_db_uniffi/build.rs b/rust/llmchat/uniffi/llmchat_db_uniffi/build.rs
deleted file mode 100644
index f328e4d9d0..0000000000
--- a/rust/llmchat/uniffi/llmchat_db_uniffi/build.rs
+++ /dev/null
@@ -1 +0,0 @@
-fn main() {}
diff --git a/rust/llmchat/uniffi/llmchat_db_uniffi/src/api.rs b/rust/llmchat/uniffi/llmchat_db_uniffi/src/api.rs
deleted file mode 100644
index d2b8a9fef7..0000000000
--- a/rust/llmchat/uniffi/llmchat_db_uniffi/src/api.rs
+++ /dev/null
@@ -1,206 +0,0 @@
-use llmchat_db as core;
-use thiserror::Error;
-use uuid::Uuid;
-
-#[derive(Debug, Error, uniffi::Error)]
-pub enum DbError {
- #[error("{0}")]
- Message(String),
-}
-
-impl From<core::Error> for DbError {
- fn from(err: core::Error) -> Self {
- DbError::Message(err.to_string())
- }
-}
-
-#[derive(Debug, Clone, uniffi::Record)]
-pub struct Session {
- pub uuid: String,
- pub title: String,
- pub created_at_us: i64,
- pub updated_at_us: i64,
- pub remote_id: Option<String>,
- pub needs_sync: bool,
- pub deleted_at_us: Option<i64>,
-}
-
-#[derive(Debug, Clone, uniffi::Enum)]
-pub enum Sender {
- SelfUser,
- Other,
-}
-
-impl Sender {
- fn as_str(&self) -> &'static str {
- match self {
- Sender::SelfUser => "self",
- Sender::Other => "other",
- }
- }
-}
-
-#[derive(Debug, Clone, uniffi::Enum)]
-pub enum AttachmentKind {
- Image,
- Document,
-}
-
-impl From<AttachmentKind> for core::AttachmentKind {
- fn from(value: AttachmentKind) -> Self {
- match value {
- AttachmentKind::Image => core::AttachmentKind::Image,
- AttachmentKind::Document => core::AttachmentKind::Document,
- }
- }
-}
-
-impl From<core::AttachmentKind> for AttachmentKind {
- fn from(value: core::AttachmentKind) -> Self {
- match value {
- core::AttachmentKind::Image => AttachmentKind::Image,
- core::AttachmentKind::Document => AttachmentKind::Document,
- }
- }
-}
-
-#[derive(Debug, Clone, uniffi::Record)]
-pub struct AttachmentMeta {
- pub id: String,
- pub kind: AttachmentKind,
- pub size: i64,
- pub name: String,
-}
-
-impl From<AttachmentMeta> for core::AttachmentMeta {
- fn from(value: AttachmentMeta) -> Self {
- core::AttachmentMeta {
- id: value.id,
- kind: value.kind.into(),
- size: value.size,
- name: value.name,
- }
- }
-}
-
-impl From<core::AttachmentMeta> for AttachmentMeta {
- fn from(value: core::AttachmentMeta) -> Self {
- AttachmentMeta {
- id: value.id,
- kind: value.kind.into(),
- size: value.size,
- name: value.name,
- }
- }
-}
-
-#[derive(Debug, Clone, uniffi::Record)]
-pub struct Message {
- pub uuid: String,
- pub session_uuid: String,
- pub parent_message_uuid: Option<String>,
- pub sender: Sender,
- pub text: String,
- pub attachments: Vec<AttachmentMeta>,
- pub created_at_us: i64,
- pub deleted_at_us: Option<i64>,
-}
-
-#[derive(uniffi::Object)]
-pub struct LlmChatDb {
- inner: core::LlmChatDb<core::SqliteBackend>,
-}
-
-fn to_session(session: core::Session) -> Session {
- Session {
- uuid: session.uuid.to_string(),
- title: session.title,
- created_at_us: session.created_at,
- updated_at_us: session.updated_at,
- remote_id: session.remote_id,
- needs_sync: session.needs_sync,
- deleted_at_us: session.deleted_at,
- }
-}
-
-fn to_message(message: core::Message) -> Message {
- Message {
- uuid: message.uuid.to_string(),
- session_uuid: message.session_uuid.to_string(),
- parent_message_uuid: message.parent_message_uuid.map(|v| v.to_string()),
- sender: match message.sender {
- core::Sender::SelfUser => Sender::SelfUser,
- core::Sender::Other => Sender::Other,
- },
- text: message.text,
- attachments: message.attachments.into_iter().map(Into::into).collect(),
- created_at_us: message.created_at,
- deleted_at_us: message.deleted_at,
- }
-}
-
-#[uniffi::export]
-impl LlmChatDb {
- #[uniffi::constructor]
- pub fn open(main_db_path: String, attachments_db_path: String, key: Vec<u8>) -> Result<Self, DbError> {
- let inner = core::LlmChatDb::open_sqlite_with_defaults(main_db_path, attachments_db_path, key)?;
- Ok(Self { inner })
- }
-
- pub fn create_session(&self, title: String) -> Result<Session, DbError> {
- Ok(to_session(self.inner.create_session(&title)?))
- }
-
- pub fn list_sessions(&self) -> Result<Vec<Session>, DbError> {
- Ok(self.inner.list_sessions()?.into_iter().map(to_session).collect())
- }
-
- pub fn get_session(&self, uuid: String) -> Result<Option<Session>, DbError> {
- let uuid = Uuid::parse_str(&uuid).map_err(|e| DbError::Message(e.to_string()))?;
- Ok(self.inner.get_session(uuid)?.map(to_session))
- }
-
- pub fn delete_session(&self, uuid: String) -> Result<(), DbError> {
- let uuid = Uuid::parse_str(&uuid).map_err(|e| DbError::Message(e.to_string()))?;
- Ok(self.inner.delete_session(uuid)?)
- }
-
- pub fn update_session_title(&self, uuid: String, title: String) -> Result<(), DbError> {
- let uuid = Uuid::parse_str(&uuid).map_err(|e| DbError::Message(e.to_string()))?;
- Ok(self.inner.update_session_title(uuid, &title)?)
- }
-
- pub fn insert_message(
- &self,
- session_uuid: String,
- sender: Sender,
- text: String,
- parent_message_uuid: Option<String>,
- attachments: Vec<AttachmentMeta>,
- ) -> Result<Message, DbError> {
- let session_uuid = Uuid::parse_str(&session_uuid).map_err(|e| DbError::Message(e.to_string()))?;
- let parent = parent_message_uuid
- .map(|v| Uuid::parse_str(&v))
- .transpose()
- .map_err(|e| DbError::Message(e.to_string()))?;
-
- let message = self.inner.insert_message(
- session_uuid,
- sender.as_str(),
- &text,
- parent,
- attachments.into_iter().map(Into::into).collect(),
- )?;
- Ok(to_message(message))
- }
-
- pub fn get_messages(&self, session_uuid: String) -> Result<Vec<Message>, DbError> {
- let session_uuid = Uuid::parse_str(&session_uuid).map_err(|e| DbError::Message(e.to_string()))?;
- Ok(self.inner.get_messages(session_uuid)?.into_iter().map(to_message).collect())
- }
-
- pub fn update_message_text(&self, uuid: String, text: String) -> Result<(), DbError> {
- let uuid = Uuid::parse_str(&uuid).map_err(|e| DbError::Message(e.to_string()))?;
- Ok(self.inner.update_message_text(uuid, &text)?)
- }
-}
diff --git a/rust/llmchat/uniffi/llmchat_db_uniffi/src/api.udl b/rust/llmchat/uniffi/llmchat_db_uniffi/src/api.udl
deleted file mode 100644
index a905f63b51..0000000000
--- a/rust/llmchat/uniffi/llmchat_db_uniffi/src/api.udl
+++ /dev/null
@@ -1,70 +0,0 @@
-[Error]
-interface DbError {
- Message(string message);
-};
-
-enum Sender {
- "SelfUser",
- "Other"
-};
-
-enum AttachmentKind {
- "Image",
- "Document"
-};
-
-dictionary AttachmentMeta {
- string id;
- AttachmentKind kind;
- i64 size;
- string name;
-};
-
-dictionary Session {
- string uuid;
- string title;
- i64 created_at_us;
- i64 updated_at_us;
- string? remote_id;
- boolean needs_sync;
- i64? deleted_at_us;
-};
-
-dictionary Message {
- string uuid;
- string session_uuid;
- string? parent_message_uuid;
- Sender sender;
- string text;
- sequence<AttachmentMeta> attachments;
- i64 created_at_us;
- i64? deleted_at_us;
-};
-
-namespace llmchat_db_uniffi {
- interface LlmChatDb {
- [Constructor, Throws=DbError]
- LlmChatDb(string main_db_path, string attachments_db_path, sequence<u8> key);
-
- [Throws=DbError]
- Session create_session(string title);
-
- [Throws=DbError]
- sequence<Session> list_sessions();
-
- [Throws=DbError]
- Session? get_session(string uuid);
-
- [Throws=DbError]
- void delete_session(string uuid);
-
- [Throws=DbError]
- Message insert_message(string session_uuid, Sender sender, string text, string? parent_message_uuid, sequence<AttachmentMeta> attachments);
-
- [Throws=DbError]
- sequence<Message> get_messages(string session_uuid);
-
- [Throws=DbError]
- void update_message_text(string uuid, string text);
- };
-};
diff --git a/rust/llmchat/uniffi/llmchat_db_uniffi/src/lib.rs b/rust/llmchat/uniffi/llmchat_db_uniffi/src/lib.rs
deleted file mode 100644
index 11e4194664..0000000000
--- a/rust/llmchat/uniffi/llmchat_db_uniffi/src/lib.rs
+++ /dev/null
@@ -1,7 +0,0 @@
-#![allow(unexpected_cfgs)]
-
-mod api;
-
-uniffi::setup_scaffolding!("llmchat_db_uniffi");
-
-pub use api::*;
diff --git a/rust/llmchat/uniffi/llmchat_db_uniffi/uniffi.toml b/rust/llmchat/uniffi/llmchat_db_uniffi/uniffi.toml
deleted file mode 100644
index 728f5e9c61..0000000000
--- a/rust/llmchat/uniffi/llmchat_db_uniffi/uniffi.toml
+++ /dev/null
@@ -1,8 +0,0 @@
-[bindings.swift]
-link_frameworks = ["Foundation"]
-
-[bindings.kotlin]
-package_name = "io.ente.labs.llmchat_db"
-cdylib_name = "llmchat_db_uniffi"
-android = true
-kotlin_target_version = "1.9.0"
diff --git a/rust/llmchat/uniffi/llmchat_sync_uniffi/Cargo.lock b/rust/llmchat/uniffi/llmchat_sync_uniffi/Cargo.lock
deleted file mode 100644
index e92288dabf..0000000000
--- a/rust/llmchat/uniffi/llmchat_sync_uniffi/Cargo.lock
+++ /dev/null
@@ -1,2557 +0,0 @@
-# This file is automatically @generated by Cargo.
-# It is not intended for manual editing.
-version = 4
-
-[[package]]
-name = "aead"
-version = "0.5.2"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "d122413f284cf2d62fb1b7db97e02edb8cda96d769b16e443a4f6195e35662b0"
-dependencies = [
- "crypto-common",
- "generic-array",
-]
-
-[[package]]
-name = "anyhow"
-version = "1.0.100"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "a23eb6b1614318a8071c9b2521f36b424b2c83db5eb3a0fead4a6c0809af6e61"
-
-[[package]]
-name = "argon2"
-version = "0.5.3"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "3c3610892ee6e0cbce8ae2700349fcf8f98adb0dbfbee85aec3c9179d29cc072"
-dependencies = [
- "base64ct",
- "blake2",
- "cpufeatures",
- "password-hash",
-]
-
-[[package]]
-name = "arrayref"
-version = "0.3.9"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "76a2e8124351fda1ef8aaaa3bbd7ebbcb486bbcd4225aca0aa0d84bb2db8fecb"
-
-[[package]]
-name = "arrayvec"
-version = "0.7.6"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "7c02d123df017efcdfbd739ef81735b36c5ba83ec3c59c80a9d7ecc718f92e50"
-
-[[package]]
-name = "askama"
-version = "0.14.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "f75363874b771be265f4ffe307ca705ef6f3baa19011c149da8674a87f1b75c4"
-dependencies = [
- "askama_derive",
- "itoa",
- "percent-encoding",
- "serde",
- "serde_json",
-]
-
-[[package]]
-name = "askama_derive"
-version = "0.14.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "129397200fe83088e8a68407a8e2b1f826cf0086b21ccdb866a722c8bcd3a94f"
-dependencies = [
- "askama_parser",
- "basic-toml",
- "memchr",
- "proc-macro2",
- "quote",
- "rustc-hash",
- "serde",
- "serde_derive",
- "syn",
-]
-
-[[package]]
-name = "askama_parser"
-version = "0.14.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "d6ab5630b3d5eaf232620167977f95eb51f3432fc76852328774afbd242d4358"
-dependencies = [
- "memchr",
- "serde",
- "serde_derive",
- "winnow",
-]
-
-[[package]]
-name = "atomic-waker"
-version = "1.1.2"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "1505bd5d3d116872e7271a6d4e16d81d0c8570876c8de68093a09ac269d8aac0"
-
-[[package]]
-name = "autocfg"
-version = "1.5.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "c08606f8c3cbf4ce6ec8e28fb0014a2c086708fe954eaa885384a6165172e7e8"
-
-[[package]]
-name = "base64"
-version = "0.22.1"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "72b3254f16251a8381aa12e40e3c4d2f0199f8c6508fbecb9d91f575e0fbb8c6"
-
-[[package]]
-name = "base64ct"
-version = "1.8.3"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "2af50177e190e07a26ab74f8b1efbfe2ef87da2116221318cb1c2e82baf7de06"
-
-[[package]]
-name = "basic-toml"
-version = "0.1.10"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "ba62675e8242a4c4e806d12f11d136e626e6c8361d6b829310732241652a178a"
-dependencies = [
- "serde",
-]
-
-[[package]]
-name = "bitflags"
-version = "2.10.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "812e12b5285cc515a9c72a5c1d3b6d46a19dac5acfef5265968c166106e31dd3"
-
-[[package]]
-name = "blake2"
-version = "0.10.6"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "46502ad458c9a52b69d4d4d32775c788b7a1b85e8bc9d482d92250fc0e3f8efe"
-dependencies = [
- "digest",
-]
-
-[[package]]
-name = "blake2b_simd"
-version = "1.0.4"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "b79834656f71332577234b50bfc009996f7449e0c056884e6a02492ded0ca2f3"
-dependencies = [
- "arrayref",
- "arrayvec",
- "constant_time_eq",
-]
-
-[[package]]
-name = "block-buffer"
-version = "0.10.4"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "3078c7629b62d3f0439517fa394996acacc5cbc91c5a20d8c658e77abd503a71"
-dependencies = [
- "generic-array",
-]
-
-[[package]]
-name = "block-padding"
-version = "0.3.3"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "a8894febbff9f758034a5b8e12d87918f56dfc64a8e1fe757d65e29041538d93"
-dependencies = [
- "generic-array",
-]
-
-[[package]]
-name = "bumpalo"
-version = "3.19.1"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "5dd9dc738b7a8311c7ade152424974d8115f2cdad61e8dab8dac9f2362298510"
-
-[[package]]
-name = "bytes"
-version = "1.11.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "b35204fbdc0b3f4446b89fc1ac2cf84a8a68971995d0bf2e925ec7cd960f9cb3"
-
-[[package]]
-name = "camino"
-version = "1.2.2"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "e629a66d692cb9ff1a1c664e41771b3dcaf961985a9774c0eb0bd1b51cf60a48"
-dependencies = [
- "serde_core",
-]
-
-[[package]]
-name = "cargo-platform"
-version = "0.1.9"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "e35af189006b9c0f00a064685c727031e3ed2d8020f7ba284d78cc2671bd36ea"
-dependencies = [
- "serde",
-]
-
-[[package]]
-name = "cargo_metadata"
-version = "0.19.2"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "dd5eb614ed4c27c5d706420e4320fbe3216ab31fa1c33cd8246ac36dae4479ba"
-dependencies = [
- "camino",
- "cargo-platform",
- "semver",
- "serde",
- "serde_json",
- "thiserror",
-]
-
-[[package]]
-name = "cc"
-version = "1.2.53"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "755d2fce177175ffca841e9a06afdb2c4ab0f593d53b4dee48147dfaade85932"
-dependencies = [
- "find-msvc-tools",
- "shlex",
-]
-
-[[package]]
-name = "cfg-if"
-version = "1.0.4"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "9330f8b2ff13f34540b44e946ef35111825727b38d33286ef986142615121801"
-
-[[package]]
-name = "cfg_aliases"
-version = "0.2.1"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "613afe47fcd5fac7ccf1db93babcb082c5994d996f20b8b159f2ad1658eb5724"
-
-[[package]]
-name = "chacha20"
-version = "0.9.1"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "c3613f74bd2eac03dad61bd53dbe620703d4371614fe0bc3b9f04dd36fe4e818"
-dependencies = [
- "cfg-if",
- "cipher",
- "cpufeatures",
-]
-
-[[package]]
-name = "cipher"
-version = "0.4.4"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "773f3b9af64447d2ce9850330c473515014aa235e6a783b02db81ff39e4a3dad"
-dependencies = [
- "crypto-common",
- "inout",
- "zeroize",
-]
-
-[[package]]
-name = "constant_time_eq"
-version = "0.4.2"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "3d52eff69cd5e647efe296129160853a42795992097e8af39800e1060caeea9b"
-
-[[package]]
-name = "core-foundation"
-version = "0.9.4"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "91e195e091a93c46f7102ec7818a2aa394e1e1771c3ab4825963fa03e45afb8f"
-dependencies = [
- "core-foundation-sys",
- "libc",
-]
-
-[[package]]
-name = "core-foundation"
-version = "0.10.1"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "b2a6cd9ae233e7f62ba4e9353e81a88df7fc8a5987b8d445b4d90c879bd156f6"
-dependencies = [
- "core-foundation-sys",
- "libc",
-]
-
-[[package]]
-name = "core-foundation-sys"
-version = "0.8.7"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "773648b94d0e5d620f64f280777445740e61fe701025087ec8b57f45c791888b"
-
-[[package]]
-name = "cpufeatures"
-version = "0.2.17"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "59ed5838eebb26a2bb2e58f6d5b5316989ae9d08bab10e0e6d103e656d1b0280"
-dependencies = [
- "libc",
-]
-
-[[package]]
-name = "crypto-common"
-version = "0.1.7"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "78c8292055d1c1df0cce5d180393dc8cce0abec0a7102adb6c7b1eef6016d60a"
-dependencies = [
- "generic-array",
- "rand_core 0.6.4",
- "typenum",
-]
-
-[[package]]
-name = "crypto_secretstream"
-version = "0.2.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "9a6419214057ad50a13efccb3ad7714b86b848e3a5aa7b6cf5a3ff07edf387eb"
-dependencies = [
- "aead",
- "chacha20",
- "getrandom 0.2.17",
- "poly1305",
- "rand_core 0.6.4",
- "subtle",
-]
-
-[[package]]
-name = "curve25519-dalek"
-version = "4.1.3"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "97fb8b7c4503de7d6ae7b42ab72a5a59857b4c937ec27a3d4539dba95b5ab2be"
-dependencies = [
- "cfg-if",
- "cpufeatures",
- "curve25519-dalek-derive",
- "fiat-crypto",
- "rustc_version",
- "subtle",
- "zeroize",
-]
-
-[[package]]
-name = "curve25519-dalek-derive"
-version = "0.1.1"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "f46882e17999c6cc590af592290432be3bce0428cb0d5f8b6715e4dc7b383eb3"
-dependencies = [
- "proc-macro2",
- "quote",
- "syn",
-]
-
-[[package]]
-name = "digest"
-version = "0.10.7"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "9ed9a281f7bc9b7576e61468ba615a66a5c8cfdff42420a70aa82701a3b1e292"
-dependencies = [
- "block-buffer",
- "crypto-common",
- "subtle",
-]
-
-[[package]]
-name = "displaydoc"
-version = "0.2.5"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "97369cbbc041bc366949bc74d34658d6cda5621039731c6310521892a3a20ae0"
-dependencies = [
- "proc-macro2",
- "quote",
- "syn",
-]
-
-[[package]]
-name = "encoding_rs"
-version = "0.8.35"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "75030f3c4f45dafd7586dd6780965a8c7e8e285a5ecb86713e63a79c5b2766f3"
-dependencies = [
- "cfg-if",
-]
-
-[[package]]
-name = "ente-core"
-version = "0.0.1"
-dependencies = [
- "argon2",
- "base64",
- "blake2b_simd",
- "crypto_secretstream",
- "getrandom 0.2.17",
- "hex",
- "md-5",
- "rand_core 0.6.4",
- "reqwest",
- "salsa20",
- "serde",
- "serde_json",
- "subtle",
- "thiserror",
- "x25519-dalek",
- "xsalsa20poly1305",
- "zeroize",
-]
-
-[[package]]
-name = "equivalent"
-version = "1.0.2"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "877a4ace8713b0bcf2a4e7eec82529c029f1d0619886d18145fea96c3ffe5c0f"
-
-[[package]]
-name = "errno"
-version = "0.3.14"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "39cab71617ae0d63f51a36d69f866391735b51691dbda63cf6f96d042b63efeb"
-dependencies = [
- "libc",
- "windows-sys 0.61.2",
-]
-
-[[package]]
-name = "fallible-iterator"
-version = "0.3.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "2acce4a10f12dc2fb14a218589d4f1f62ef011b2d0cc4b3cb1bba8e94da14649"
-
-[[package]]
-name = "fallible-streaming-iterator"
-version = "0.1.9"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "7360491ce676a36bf9bb3c56c1aa791658183a54d2744120f27285738d90465a"
-
-[[package]]
-name = "fastrand"
-version = "2.3.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "37909eebbb50d72f9059c3b6d82c0463f2ff062c9e95845c43a6c9c0355411be"
-
-[[package]]
-name = "fiat-crypto"
-version = "0.2.9"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "28dea519a9695b9977216879a3ebfddf92f1c08c05d984f8996aecd6ecdc811d"
-
-[[package]]
-name = "find-msvc-tools"
-version = "0.1.8"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "8591b0bcc8a98a64310a2fae1bb3e9b8564dd10e381e6e28010fde8e8e8568db"
-
-[[package]]
-name = "fnv"
-version = "1.0.7"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "3f9eec918d3f24069decb9af1554cad7c880e2da24a9afd88aca000531ab82c1"
-
-[[package]]
-name = "foldhash"
-version = "0.2.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "77ce24cb58228fbb8aa041425bb1050850ac19177686ea6e0f41a70416f56fdb"
-
-[[package]]
-name = "form_urlencoded"
-version = "1.2.2"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "cb4cb245038516f5f85277875cdaa4f7d2c9a0fa0468de06ed190163b1581fcf"
-dependencies = [
- "percent-encoding",
-]
-
-[[package]]
-name = "fs-err"
-version = "2.11.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "88a41f105fe1d5b6b34b2055e3dc59bb79b46b48b2040b9e6c7b4b5de097aa41"
-dependencies = [
- "autocfg",
-]
-
-[[package]]
-name = "futures-channel"
-version = "0.3.31"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "2dff15bf788c671c1934e366d07e30c1814a8ef514e1af724a602e8a2fbe1b10"
-dependencies = [
- "futures-core",
- "futures-sink",
-]
-
-[[package]]
-name = "futures-core"
-version = "0.3.31"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "05f29059c0c2090612e8d742178b0580d2dc940c837851ad723096f87af6663e"
-
-[[package]]
-name = "futures-io"
-version = "0.3.31"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "9e5c1b78ca4aae1ac06c48a526a655760685149f0d465d21f37abfe57ce075c6"
-
-[[package]]
-name = "futures-sink"
-version = "0.3.31"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "e575fab7d1e0dcb8d0c7bcf9a63ee213816ab51902e6d244a95819acacf1d4f7"
-
-[[package]]
-name = "futures-task"
-version = "0.3.31"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "f90f7dce0722e95104fcb095585910c0977252f286e354b5e3bd38902cd99988"
-
-[[package]]
-name = "futures-util"
-version = "0.3.31"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "9fa08315bb612088cc391249efdc3bc77536f16c91f6cf495e6fbe85b20a4a81"
-dependencies = [
- "futures-core",
- "futures-io",
- "futures-sink",
- "futures-task",
- "memchr",
- "pin-project-lite",
- "pin-utils",
- "slab",
-]
-
-[[package]]
-name = "generic-array"
-version = "0.14.7"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "85649ca51fd72272d7821adaf274ad91c288277713d9c18820d8499a7ff69e9a"
-dependencies = [
- "typenum",
- "version_check",
-]
-
-[[package]]
-name = "getrandom"
-version = "0.2.17"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "ff2abc00be7fca6ebc474524697ae276ad847ad0a6b3faa4bcb027e9a4614ad0"
-dependencies = [
- "cfg-if",
- "js-sys",
- "libc",
- "wasi",
- "wasm-bindgen",
-]
-
-[[package]]
-name = "getrandom"
-version = "0.3.4"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "899def5c37c4fd7b2664648c28120ecec138e4d395b459e5ca34f9cce2dd77fd"
-dependencies = [
- "cfg-if",
- "js-sys",
- "libc",
- "r-efi",
- "wasip2",
- "wasm-bindgen",
-]
-
-[[package]]
-name = "glob"
-version = "0.3.3"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "0cc23270f6e1808e30a928bdc84dea0b9b4136a8bc82338574f23baf47bbd280"
-
-[[package]]
-name = "goblin"
-version = "0.8.2"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "1b363a30c165f666402fe6a3024d3bec7ebc898f96a4a23bd1c99f8dbf3f4f47"
-dependencies = [
- "log",
- "plain",
- "scroll",
-]
-
-[[package]]
-name = "h2"
-version = "0.4.13"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "2f44da3a8150a6703ed5d34e164b875fd14c2cdab9af1252a9a1020bde2bdc54"
-dependencies = [
- "atomic-waker",
- "bytes",
- "fnv",
- "futures-core",
- "futures-sink",
- "http",
- "indexmap",
- "slab",
- "tokio",
- "tokio-util",
- "tracing",
-]
-
-[[package]]
-name = "hashbrown"
-version = "0.16.1"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "841d1cc9bed7f9236f321df977030373f4a4163ae1a7dbfe1a51a2c1a51d9100"
-dependencies = [
- "foldhash",
-]
-
-[[package]]
-name = "hashlink"
-version = "0.11.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "ea0b22561a9c04a7cb1a302c013e0259cd3b4bb619f145b32f72b8b4bcbed230"
-dependencies = [
- "hashbrown",
-]
-
-[[package]]
-name = "heck"
-version = "0.5.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "2304e00983f87ffb38b55b444b5e3b60a884b5d30c0fca7d82fe33449bbe55ea"
-
-[[package]]
-name = "hex"
-version = "0.4.3"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "7f24254aa9a54b5c858eaee2f5bccdb46aaf0e486a595ed5fd8f86ba55232a70"
-
-[[package]]
-name = "hkdf"
-version = "0.12.4"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "7b5f8eb2ad728638ea2c7d47a21db23b7b58a72ed6a38256b8a1849f15fbbdf7"
-dependencies = [
- "hmac",
-]
-
-[[package]]
-name = "hmac"
-version = "0.12.1"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "6c49c37c09c17a53d937dfbb742eb3a961d65a994e6bcdcf37e7399d0cc8ab5e"
-dependencies = [
- "digest",
-]
-
-[[package]]
-name = "http"
-version = "1.4.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "e3ba2a386d7f85a81f119ad7498ebe444d2e22c2af0b86b069416ace48b3311a"
-dependencies = [
- "bytes",
- "itoa",
-]
-
-[[package]]
-name = "http-body"
-version = "1.0.1"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "1efedce1fb8e6913f23e0c92de8e62cd5b772a67e7b3946df930a62566c93184"
-dependencies = [
- "bytes",
- "http",
-]
-
-[[package]]
-name = "http-body-util"
-version = "0.1.3"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "b021d93e26becf5dc7e1b75b1bed1fd93124b374ceb73f43d4d4eafec896a64a"
-dependencies = [
- "bytes",
- "futures-core",
- "http",
- "http-body",
- "pin-project-lite",
-]
-
-[[package]]
-name = "httparse"
-version = "1.10.1"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "6dbf3de79e51f3d586ab4cb9d5c3e2c14aa28ed23d180cf89b4df0454a69cc87"
-
-[[package]]
-name = "hyper"
-version = "1.8.1"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "2ab2d4f250c3d7b1c9fcdff1cece94ea4e2dfbec68614f7b87cb205f24ca9d11"
-dependencies = [
- "atomic-waker",
- "bytes",
- "futures-channel",
- "futures-core",
- "h2",
- "http",
- "http-body",
- "httparse",
- "itoa",
- "pin-project-lite",
- "pin-utils",
- "smallvec",
- "tokio",
- "want",
-]
-
-[[package]]
-name = "hyper-rustls"
-version = "0.27.7"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "e3c93eb611681b207e1fe55d5a71ecf91572ec8a6705cdb6857f7d8d5242cf58"
-dependencies = [
- "http",
- "hyper",
- "hyper-util",
- "rustls",
- "rustls-native-certs",
- "rustls-pki-types",
- "tokio",
- "tokio-rustls",
- "tower-service",
-]
-
-[[package]]
-name = "hyper-util"
-version = "0.1.19"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "727805d60e7938b76b826a6ef209eb70eaa1812794f9424d4a4e2d740662df5f"
-dependencies = [
- "base64",
- "bytes",
- "futures-channel",
- "futures-core",
- "futures-util",
- "http",
- "http-body",
- "hyper",
- "ipnet",
- "libc",
- "percent-encoding",
- "pin-project-lite",
- "socket2",
- "system-configuration",
- "tokio",
- "tower-service",
- "tracing",
- "windows-registry",
-]
-
-[[package]]
-name = "icu_collections"
-version = "2.1.1"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "4c6b649701667bbe825c3b7e6388cb521c23d88644678e83c0c4d0a621a34b43"
-dependencies = [
- "displaydoc",
- "potential_utf",
- "yoke",
- "zerofrom",
- "zerovec",
-]
-
-[[package]]
-name = "icu_locale_core"
-version = "2.1.1"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "edba7861004dd3714265b4db54a3c390e880ab658fec5f7db895fae2046b5bb6"
-dependencies = [
- "displaydoc",
- "litemap",
- "tinystr",
- "writeable",
- "zerovec",
-]
-
-[[package]]
-name = "icu_normalizer"
-version = "2.1.1"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "5f6c8828b67bf8908d82127b2054ea1b4427ff0230ee9141c54251934ab1b599"
-dependencies = [
- "icu_collections",
- "icu_normalizer_data",
- "icu_properties",
- "icu_provider",
- "smallvec",
- "zerovec",
-]
-
-[[package]]
-name = "icu_normalizer_data"
-version = "2.1.1"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "7aedcccd01fc5fe81e6b489c15b247b8b0690feb23304303a9e560f37efc560a"
-
-[[package]]
-name = "icu_properties"
-version = "2.1.2"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "020bfc02fe870ec3a66d93e677ccca0562506e5872c650f893269e08615d74ec"
-dependencies = [
- "icu_collections",
- "icu_locale_core",
- "icu_properties_data",
- "icu_provider",
- "zerotrie",
- "zerovec",
-]
-
-[[package]]
-name = "icu_properties_data"
-version = "2.1.2"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "616c294cf8d725c6afcd8f55abc17c56464ef6211f9ed59cccffe534129c77af"
-
-[[package]]
-name = "icu_provider"
-version = "2.1.1"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "85962cf0ce02e1e0a629cc34e7ca3e373ce20dda4c4d7294bbd0bf1fdb59e614"
-dependencies = [
- "displaydoc",
- "icu_locale_core",
- "writeable",
- "yoke",
- "zerofrom",
- "zerotrie",
- "zerovec",
-]
-
-[[package]]
-name = "idna"
-version = "1.1.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "3b0875f23caa03898994f6ddc501886a45c7d3d62d04d2d90788d47be1b1e4de"
-dependencies = [
- "idna_adapter",
- "smallvec",
- "utf8_iter",
-]
-
-[[package]]
-name = "idna_adapter"
-version = "1.2.1"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "3acae9609540aa318d1bc588455225fb2085b9ed0c4f6bd0d9d5bcd86f1a0344"
-dependencies = [
- "icu_normalizer",
- "icu_properties",
-]
-
-[[package]]
-name = "indexmap"
-version = "2.13.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "7714e70437a7dc3ac8eb7e6f8df75fd8eb422675fc7678aff7364301092b1017"
-dependencies = [
- "equivalent",
- "hashbrown",
- "serde",
- "serde_core",
-]
-
-[[package]]
-name = "inout"
-version = "0.1.4"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "879f10e63c20629ecabbb64a8010319738c66a5cd0c29b02d63d272b03751d01"
-dependencies = [
- "block-padding",
- "generic-array",
-]
-
-[[package]]
-name = "ipnet"
-version = "2.11.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "469fb0b9cefa57e3ef31275ee7cacb78f2fdca44e4765491884a2b119d4eb130"
-
-[[package]]
-name = "iri-string"
-version = "0.7.10"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "c91338f0783edbd6195decb37bae672fd3b165faffb89bf7b9e6942f8b1a731a"
-dependencies = [
- "memchr",
- "serde",
-]
-
-[[package]]
-name = "itoa"
-version = "1.0.17"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "92ecc6618181def0457392ccd0ee51198e065e016d1d527a7ac1b6dc7c1f09d2"
-
-[[package]]
-name = "js-sys"
-version = "0.3.85"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "8c942ebf8e95485ca0d52d97da7c5a2c387d0e7f0ba4c35e93bfcaee045955b3"
-dependencies = [
- "once_cell",
- "wasm-bindgen",
-]
-
-[[package]]
-name = "libc"
-version = "0.2.180"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "bcc35a38544a891a5f7c865aca548a982ccb3b8650a5b06d0fd33a10283c56fc"
-
-[[package]]
-name = "libsqlite3-sys"
-version = "0.36.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "95b4103cffefa72eb8428cb6b47d6627161e51c2739fc5e3b734584157bc642a"
-dependencies = [
- "cc",
- "pkg-config",
- "vcpkg",
-]
-
-[[package]]
-name = "linux-raw-sys"
-version = "0.11.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "df1d3c3b53da64cf5760482273a98e575c651a67eec7f77df96b5b642de8f039"
-
-[[package]]
-name = "litemap"
-version = "0.8.1"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "6373607a59f0be73a39b6fe456b8192fcc3585f602af20751600e974dd455e77"
-
-[[package]]
-name = "llmchat-db"
-version = "0.1.0"
-dependencies = [
- "ente-core",
- "rusqlite",
- "serde",
- "serde_json",
- "thiserror",
- "uuid",
- "zeroize",
-]
-
-[[package]]
-name = "llmchat-sync"
-version = "0.1.0"
-dependencies = [
- "ente-core",
- "hkdf",
- "llmchat-db",
- "reqwest",
- "serde",
- "serde_json",
- "sha2",
- "thiserror",
- "uuid",
- "zeroize",
-]
-
-[[package]]
-name = "llmchat_sync_uniffi"
-version = "0.1.0"
-dependencies = [
- "llmchat-sync",
- "serde",
- "thiserror",
- "uniffi",
-]
-
-[[package]]
-name = "log"
-version = "0.4.29"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "5e5032e24019045c762d3c0f28f5b6b8bbf38563a65908389bf7978758920897"
-
-[[package]]
-name = "lru-slab"
-version = "0.1.2"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "112b39cec0b298b6c1999fee3e31427f74f676e4cb9879ed1a121b43661a4154"
-
-[[package]]
-name = "md-5"
-version = "0.10.6"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "d89e7ee0cfbedfc4da3340218492196241d89eefb6dab27de5df917a6d2e78cf"
-dependencies = [
- "cfg-if",
- "digest",
-]
-
-[[package]]
-name = "memchr"
-version = "2.7.6"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "f52b00d39961fc5b2736ea853c9cc86238e165017a493d1d5c8eac6bdc4cc273"
-
-[[package]]
-name = "mime"
-version = "0.3.17"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "6877bb514081ee2a7ff5ef9de3281f14a4dd4bceac4c09388074a6b5df8a139a"
-
-[[package]]
-name = "minimal-lexical"
-version = "0.2.1"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "68354c5c6bd36d73ff3feceb05efa59b6acb7626617f4962be322a825e61f79a"
-
-[[package]]
-name = "mio"
-version = "1.1.1"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "a69bcab0ad47271a0234d9422b131806bf3968021e5dc9328caf2d4cd58557fc"
-dependencies = [
- "libc",
- "wasi",
- "windows-sys 0.61.2",
-]
-
-[[package]]
-name = "nom"
-version = "7.1.3"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "d273983c5a657a70a3e8f2a01329822f3b8c8172b73826411a55751e404a0a4a"
-dependencies = [
- "memchr",
- "minimal-lexical",
-]
-
-[[package]]
-name = "once_cell"
-version = "1.21.3"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "42f5e15c9953c5e4ccceeb2e7382a716482c34515315f7b03532b8b4e8393d2d"
-
-[[package]]
-name = "opaque-debug"
-version = "0.3.1"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "c08d65885ee38876c4f86fa503fb49d7b507c2b62552df7c70b2fce627e06381"
-
-[[package]]
-name = "openssl-probe"
-version = "0.2.1"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "7c87def4c32ab89d880effc9e097653c8da5d6ef28e6b539d313baaacfbafcbe"
-
-[[package]]
-name = "password-hash"
-version = "0.5.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "346f04948ba92c43e8469c1ee6736c7563d71012b17d40745260fe106aac2166"
-dependencies = [
- "base64ct",
- "rand_core 0.6.4",
- "subtle",
-]
-
-[[package]]
-name = "percent-encoding"
-version = "2.3.2"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "9b4f627cb1b25917193a259e49bdad08f671f8d9708acfd5fe0a8c1455d87220"
-
-[[package]]
-name = "pin-project-lite"
-version = "0.2.16"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "3b3cff922bd51709b605d9ead9aa71031d81447142d828eb4a6eba76fe619f9b"
-
-[[package]]
-name = "pin-utils"
-version = "0.1.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "8b870d8c151b6f2fb93e84a13146138f05d02ed11c7e7c54f8826aaaf7c9f184"
-
-[[package]]
-name = "pkg-config"
-version = "0.3.32"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "7edddbd0b52d732b21ad9a5fab5c704c14cd949e5e9a1ec5929a24fded1b904c"
-
-[[package]]
-name = "plain"
-version = "0.2.3"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "b4596b6d070b27117e987119b4dac604f3c58cfb0b191112e24771b2faeac1a6"
-
-[[package]]
-name = "poly1305"
-version = "0.8.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "8159bd90725d2df49889a078b54f4f79e87f1f8a8444194cdca81d38f5393abf"
-dependencies = [
- "cpufeatures",
- "opaque-debug",
- "universal-hash",
-]
-
-[[package]]
-name = "potential_utf"
-version = "0.1.4"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "b73949432f5e2a09657003c25bca5e19a0e9c84f8058ca374f49e0ebe605af77"
-dependencies = [
- "zerovec",
-]
-
-[[package]]
-name = "ppv-lite86"
-version = "0.2.21"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "85eae3c4ed2f50dcfe72643da4befc30deadb458a9b590d720cde2f2b1e97da9"
-dependencies = [
- "zerocopy",
-]
-
-[[package]]
-name = "proc-macro2"
-version = "1.0.105"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "535d180e0ecab6268a3e718bb9fd44db66bbbc256257165fc699dadf70d16fe7"
-dependencies = [
- "unicode-ident",
-]
-
-[[package]]
-name = "quinn"
-version = "0.11.9"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "b9e20a958963c291dc322d98411f541009df2ced7b5a4f2bd52337638cfccf20"
-dependencies = [
- "bytes",
- "cfg_aliases",
- "pin-project-lite",
- "quinn-proto",
- "quinn-udp",
- "rustc-hash",
- "rustls",
- "socket2",
- "thiserror",
- "tokio",
- "tracing",
- "web-time",
-]
-
-[[package]]
-name = "quinn-proto"
-version = "0.11.13"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "f1906b49b0c3bc04b5fe5d86a77925ae6524a19b816ae38ce1e426255f1d8a31"
-dependencies = [
- "bytes",
- "getrandom 0.3.4",
- "lru-slab",
- "rand",
- "ring",
- "rustc-hash",
- "rustls",
- "rustls-pki-types",
- "slab",
- "thiserror",
- "tinyvec",
- "tracing",
- "web-time",
-]
-
-[[package]]
-name = "quinn-udp"
-version = "0.5.14"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "addec6a0dcad8a8d96a771f815f0eaf55f9d1805756410b39f5fa81332574cbd"
-dependencies = [
- "cfg_aliases",
- "libc",
- "once_cell",
- "socket2",
- "tracing",
- "windows-sys 0.60.2",
-]
-
-[[package]]
-name = "quote"
-version = "1.0.43"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "dc74d9a594b72ae6656596548f56f667211f8a97b3d4c3d467150794690dc40a"
-dependencies = [
- "proc-macro2",
-]
-
-[[package]]
-name = "r-efi"
-version = "5.3.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "69cdb34c158ceb288df11e18b4bd39de994f6657d83847bdffdbd7f346754b0f"
-
-[[package]]
-name = "rand"
-version = "0.9.2"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "6db2770f06117d490610c7488547d543617b21bfa07796d7a12f6f1bd53850d1"
-dependencies = [
- "rand_chacha",
- "rand_core 0.9.5",
-]
-
-[[package]]
-name = "rand_chacha"
-version = "0.9.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "d3022b5f1df60f26e1ffddd6c66e8aa15de382ae63b3a0c1bfc0e4d3e3f325cb"
-dependencies = [
- "ppv-lite86",
- "rand_core 0.9.5",
-]
-
-[[package]]
-name = "rand_core"
-version = "0.6.4"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "ec0be4795e2f6a28069bec0b5ff3e2ac9bafc99e6a9a7dc3547996c5c816922c"
-dependencies = [
- "getrandom 0.2.17",
-]
-
-[[package]]
-name = "rand_core"
-version = "0.9.5"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "76afc826de14238e6e8c374ddcc1fa19e374fd8dd986b0d2af0d02377261d83c"
-dependencies = [
- "getrandom 0.3.4",
-]
-
-[[package]]
-name = "reqwest"
-version = "0.12.28"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "eddd3ca559203180a307f12d114c268abf583f59b03cb906fd0b3ff8646c1147"
-dependencies = [
- "base64",
- "bytes",
- "encoding_rs",
- "futures-channel",
- "futures-core",
- "futures-util",
- "h2",
- "http",
- "http-body",
- "http-body-util",
- "hyper",
- "hyper-rustls",
- "hyper-util",
- "js-sys",
- "log",
- "mime",
- "percent-encoding",
- "pin-project-lite",
- "quinn",
- "rustls",
- "rustls-native-certs",
- "rustls-pki-types",
- "serde",
- "serde_json",
- "serde_urlencoded",
- "sync_wrapper",
- "tokio",
- "tokio-rustls",
- "tower",
- "tower-http",
- "tower-service",
- "url",
- "wasm-bindgen",
- "wasm-bindgen-futures",
- "web-sys",
-]
-
-[[package]]
-name = "ring"
-version = "0.17.14"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "a4689e6c2294d81e88dc6261c768b63bc4fcdb852be6d1352498b114f61383b7"
-dependencies = [
- "cc",
- "cfg-if",
- "getrandom 0.2.17",
- "libc",
- "untrusted",
- "windows-sys 0.52.0",
-]
-
-[[package]]
-name = "rsqlite-vfs"
-version = "0.1.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "a8a1f2315036ef6b1fbacd1972e8ee7688030b0a2121edfc2a6550febd41574d"
-dependencies = [
- "hashbrown",
- "thiserror",
-]
-
-[[package]]
-name = "rusqlite"
-version = "0.38.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "f1c93dd1c9683b438c392c492109cb702b8090b2bfc8fed6f6e4eb4523f17af3"
-dependencies = [
- "bitflags",
- "fallible-iterator",
- "fallible-streaming-iterator",
- "hashlink",
- "libsqlite3-sys",
- "smallvec",
- "sqlite-wasm-rs",
-]
-
-[[package]]
-name = "rustc-hash"
-version = "2.1.1"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "357703d41365b4b27c590e3ed91eabb1b663f07c4c084095e60cbed4362dff0d"
-
-[[package]]
-name = "rustc_version"
-version = "0.4.1"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "cfcb3a22ef46e85b45de6ee7e79d063319ebb6594faafcf1c225ea92ab6e9b92"
-dependencies = [
- "semver",
-]
-
-[[package]]
-name = "rustix"
-version = "1.1.3"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "146c9e247ccc180c1f61615433868c99f3de3ae256a30a43b49f67c2d9171f34"
-dependencies = [
- "bitflags",
- "errno",
- "libc",
- "linux-raw-sys",
- "windows-sys 0.61.2",
-]
-
-[[package]]
-name = "rustls"
-version = "0.23.36"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "c665f33d38cea657d9614f766881e4d510e0eda4239891eea56b4cadcf01801b"
-dependencies = [
- "once_cell",
- "ring",
- "rustls-pki-types",
- "rustls-webpki",
- "subtle",
- "zeroize",
-]
-
-[[package]]
-name = "rustls-native-certs"
-version = "0.8.3"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "612460d5f7bea540c490b2b6395d8e34a953e52b491accd6c86c8164c5932a63"
-dependencies = [
- "openssl-probe",
- "rustls-pki-types",
- "schannel",
- "security-framework",
-]
-
-[[package]]
-name = "rustls-pki-types"
-version = "1.14.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "be040f8b0a225e40375822a563fa9524378b9d63112f53e19ffff34df5d33fdd"
-dependencies = [
- "web-time",
- "zeroize",
-]
-
-[[package]]
-name = "rustls-webpki"
-version = "0.103.9"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "d7df23109aa6c1567d1c575b9952556388da57401e4ace1d15f79eedad0d8f53"
-dependencies = [
- "ring",
- "rustls-pki-types",
- "untrusted",
-]
-
-[[package]]
-name = "rustversion"
-version = "1.0.22"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "b39cdef0fa800fc44525c84ccb54a029961a8215f9619753635a9c0d2538d46d"
-
-[[package]]
-name = "ryu"
-version = "1.0.22"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "a50f4cf475b65d88e057964e0e9bb1f0aa9bbb2036dc65c64596b42932536984"
-
-[[package]]
-name = "salsa20"
-version = "0.10.2"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "97a22f5af31f73a954c10289c93e8a50cc23d971e80ee446f1f6f7137a088213"
-dependencies = [
- "cipher",
-]
-
-[[package]]
-name = "schannel"
-version = "0.1.28"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "891d81b926048e76efe18581bf793546b4c0eaf8448d72be8de2bbee5fd166e1"
-dependencies = [
- "windows-sys 0.61.2",
-]
-
-[[package]]
-name = "scroll"
-version = "0.12.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "6ab8598aa408498679922eff7fa985c25d58a90771bd6be794434c5277eab1a6"
-dependencies = [
- "scroll_derive",
-]
-
-[[package]]
-name = "scroll_derive"
-version = "0.12.1"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "1783eabc414609e28a5ba76aee5ddd52199f7107a0b24c2e9746a1ecc34a683d"
-dependencies = [
- "proc-macro2",
- "quote",
- "syn",
-]
-
-[[package]]
-name = "security-framework"
-version = "3.5.1"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "b3297343eaf830f66ede390ea39da1d462b6b0c1b000f420d0a83f898bbbe6ef"
-dependencies = [
- "bitflags",
- "core-foundation 0.10.1",
- "core-foundation-sys",
- "libc",
- "security-framework-sys",
-]
-
-[[package]]
-name = "security-framework-sys"
-version = "2.15.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "cc1f0cbffaac4852523ce30d8bd3c5cdc873501d96ff467ca09b6767bb8cd5c0"
-dependencies = [
- "core-foundation-sys",
- "libc",
-]
-
-[[package]]
-name = "semver"
-version = "1.0.27"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "d767eb0aabc880b29956c35734170f26ed551a859dbd361d140cdbeca61ab1e2"
-dependencies = [
- "serde",
- "serde_core",
-]
-
-[[package]]
-name = "serde"
-version = "1.0.228"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "9a8e94ea7f378bd32cbbd37198a4a91436180c5bb472411e48b5ec2e2124ae9e"
-dependencies = [
- "serde_core",
- "serde_derive",
-]
-
-[[package]]
-name = "serde_core"
-version = "1.0.228"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "41d385c7d4ca58e59fc732af25c3983b67ac852c1a25000afe1175de458b67ad"
-dependencies = [
- "serde_derive",
-]
-
-[[package]]
-name = "serde_derive"
-version = "1.0.228"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "d540f220d3187173da220f885ab66608367b6574e925011a9353e4badda91d79"
-dependencies = [
- "proc-macro2",
- "quote",
- "syn",
-]
-
-[[package]]
-name = "serde_json"
-version = "1.0.149"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "83fc039473c5595ace860d8c4fafa220ff474b3fc6bfdb4293327f1a37e94d86"
-dependencies = [
- "itoa",
- "memchr",
- "serde",
- "serde_core",
- "zmij",
-]
-
-[[package]]
-name = "serde_spanned"
-version = "1.0.4"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "f8bbf91e5a4d6315eee45e704372590b30e260ee83af6639d64557f51b067776"
-dependencies = [
- "serde_core",
-]
-
-[[package]]
-name = "serde_urlencoded"
-version = "0.7.1"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "d3491c14715ca2294c4d6a88f15e84739788c1d030eed8c110436aafdaa2f3fd"
-dependencies = [
- "form_urlencoded",
- "itoa",
- "ryu",
- "serde",
-]
-
-[[package]]
-name = "sha2"
-version = "0.10.9"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "a7507d819769d01a365ab707794a4084392c824f54a7a6a7862f8c3d0892b283"
-dependencies = [
- "cfg-if",
- "cpufeatures",
- "digest",
-]
-
-[[package]]
-name = "shlex"
-version = "1.3.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "0fda2ff0d084019ba4d7c6f371c95d8fd75ce3524c3cb8fb653a3023f6323e64"
-
-[[package]]
-name = "siphasher"
-version = "1.0.1"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "56199f7ddabf13fe5074ce809e7d3f42b42ae711800501b5b16ea82ad029c39d"
-
-[[package]]
-name = "slab"
-version = "0.4.11"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "7a2ae44ef20feb57a68b23d846850f861394c2e02dc425a50098ae8c90267589"
-
-[[package]]
-name = "smallvec"
-version = "1.15.1"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "67b1b7a3b5fe4f1376887184045fcf45c69e92af734b7aaddc05fb777b6fbd03"
-
-[[package]]
-name = "smawk"
-version = "0.3.2"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "b7c388c1b5e93756d0c740965c41e8822f866621d41acbdf6336a6a168f8840c"
-
-[[package]]
-name = "socket2"
-version = "0.6.1"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "17129e116933cf371d018bb80ae557e889637989d8638274fb25622827b03881"
-dependencies = [
- "libc",
- "windows-sys 0.60.2",
-]
-
-[[package]]
-name = "sqlite-wasm-rs"
-version = "0.5.2"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "2f4206ed3a67690b9c29b77d728f6acc3ce78f16bf846d83c94f76400320181b"
-dependencies = [
- "cc",
- "js-sys",
- "rsqlite-vfs",
- "wasm-bindgen",
-]
-
-[[package]]
-name = "stable_deref_trait"
-version = "1.2.1"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "6ce2be8dc25455e1f91df71bfa12ad37d7af1092ae736f3a6cd0e37bc7810596"
-
-[[package]]
-name = "static_assertions"
-version = "1.1.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "a2eb9349b6444b326872e140eb1cf5e7c522154d69e7a0ffb0fb81c06b37543f"
-
-[[package]]
-name = "subtle"
-version = "2.6.1"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "13c2bddecc57b384dee18652358fb23172facb8a2c51ccc10d74c157bdea3292"
-
-[[package]]
-name = "syn"
-version = "2.0.114"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "d4d107df263a3013ef9b1879b0df87d706ff80f65a86ea879bd9c31f9b307c2a"
-dependencies = [
- "proc-macro2",
- "quote",
- "unicode-ident",
-]
-
-[[package]]
-name = "sync_wrapper"
-version = "1.0.2"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "0bf256ce5efdfa370213c1dabab5935a12e49f2c58d15e9eac2870d3b4f27263"
-dependencies = [
- "futures-core",
-]
-
-[[package]]
-name = "synstructure"
-version = "0.13.2"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "728a70f3dbaf5bab7f0c4b1ac8d7ae5ea60a4b5549c8a5914361c99147a709d2"
-dependencies = [
- "proc-macro2",
- "quote",
- "syn",
-]
-
-[[package]]
-name = "system-configuration"
-version = "0.6.1"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "3c879d448e9d986b661742763247d3693ed13609438cf3d006f51f5368a5ba6b"
-dependencies = [
- "bitflags",
- "core-foundation 0.9.4",
- "system-configuration-sys",
-]
-
-[[package]]
-name = "system-configuration-sys"
-version = "0.6.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "8e1d1b10ced5ca923a1fcb8d03e96b8d3268065d724548c0211415ff6ac6bac4"
-dependencies = [
- "core-foundation-sys",
- "libc",
-]
-
-[[package]]
-name = "tempfile"
-version = "3.24.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "655da9c7eb6305c55742045d5a8d2037996d61d8de95806335c7c86ce0f82e9c"
-dependencies = [
- "fastrand",
- "getrandom 0.3.4",
- "once_cell",
- "rustix",
- "windows-sys 0.61.2",
-]
-
-[[package]]
-name = "textwrap"
-version = "0.16.2"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "c13547615a44dc9c452a8a534638acdf07120d4b6847c8178705da06306a3057"
-dependencies = [
- "smawk",
-]
-
-[[package]]
-name = "thiserror"
-version = "2.0.18"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "4288b5bcbc7920c07a1149a35cf9590a2aa808e0bc1eafaade0b80947865fbc4"
-dependencies = [
- "thiserror-impl",
-]
-
-[[package]]
-name = "thiserror-impl"
-version = "2.0.18"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "ebc4ee7f67670e9b64d05fa4253e753e016c6c95ff35b89b7941d6b856dec1d5"
-dependencies = [
- "proc-macro2",
- "quote",
- "syn",
-]
-
-[[package]]
-name = "tinystr"
-version = "0.8.2"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "42d3e9c45c09de15d06dd8acf5f4e0e399e85927b7f00711024eb7ae10fa4869"
-dependencies = [
- "displaydoc",
- "zerovec",
-]
-
-[[package]]
-name = "tinyvec"
-version = "1.10.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "bfa5fdc3bce6191a1dbc8c02d5c8bffcf557bafa17c124c5264a458f1b0613fa"
-dependencies = [
- "tinyvec_macros",
-]
-
-[[package]]
-name = "tinyvec_macros"
-version = "0.1.1"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "1f3ccbac311fea05f86f61904b462b55fb3df8837a366dfc601a0161d0532f20"
-
-[[package]]
-name = "tokio"
-version = "1.49.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "72a2903cd7736441aac9df9d7688bd0ce48edccaadf181c3b90be801e81d3d86"
-dependencies = [
- "bytes",
- "libc",
- "mio",
- "pin-project-lite",
- "socket2",
- "windows-sys 0.61.2",
-]
-
-[[package]]
-name = "tokio-rustls"
-version = "0.26.4"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "1729aa945f29d91ba541258c8df89027d5792d85a8841fb65e8bf0f4ede4ef61"
-dependencies = [
- "rustls",
- "tokio",
-]
-
-[[package]]
-name = "tokio-util"
-version = "0.7.18"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "9ae9cec805b01e8fc3fd2fe289f89149a9b66dd16786abd8b19cfa7b48cb0098"
-dependencies = [
- "bytes",
- "futures-core",
- "futures-sink",
- "pin-project-lite",
- "tokio",
-]
-
-[[package]]
-name = "toml"
-version = "0.9.11+spec-1.1.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "f3afc9a848309fe1aaffaed6e1546a7a14de1f935dc9d89d32afd9a44bab7c46"
-dependencies = [
- "indexmap",
- "serde_core",
- "serde_spanned",
- "toml_datetime",
- "toml_parser",
- "toml_writer",
- "winnow",
-]
-
-[[package]]
-name = "toml_datetime"
-version = "0.7.5+spec-1.1.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "92e1cfed4a3038bc5a127e35a2d360f145e1f4b971b551a2ba5fd7aedf7e1347"
-dependencies = [
- "serde_core",
-]
-
-[[package]]
-name = "toml_parser"
-version = "1.0.6+spec-1.1.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "a3198b4b0a8e11f09dd03e133c0280504d0801269e9afa46362ffde1cbeebf44"
-dependencies = [
- "winnow",
-]
-
-[[package]]
-name = "toml_writer"
-version = "1.0.6+spec-1.1.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "ab16f14aed21ee8bfd8ec22513f7287cd4a91aa92e44edfe2c17ddd004e92607"
-
-[[package]]
-name = "tower"
-version = "0.5.3"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "ebe5ef63511595f1344e2d5cfa636d973292adc0eec1f0ad45fae9f0851ab1d4"
-dependencies = [
- "futures-core",
- "futures-util",
- "pin-project-lite",
- "sync_wrapper",
- "tokio",
- "tower-layer",
- "tower-service",
-]
-
-[[package]]
-name = "tower-http"
-version = "0.6.8"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "d4e6559d53cc268e5031cd8429d05415bc4cb4aefc4aa5d6cc35fbf5b924a1f8"
-dependencies = [
- "bitflags",
- "bytes",
- "futures-util",
- "http",
- "http-body",
- "iri-string",
- "pin-project-lite",
- "tower",
- "tower-layer",
- "tower-service",
-]
-
-[[package]]
-name = "tower-layer"
-version = "0.3.3"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "121c2a6cda46980bb0fcd1647ffaf6cd3fc79a013de288782836f6df9c48780e"
-
-[[package]]
-name = "tower-service"
-version = "0.3.3"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "8df9b6e13f2d32c91b9bd719c00d1958837bc7dec474d94952798cc8e69eeec3"
-
-[[package]]
-name = "tracing"
-version = "0.1.44"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "63e71662fa4b2a2c3a26f570f037eb95bb1f85397f3cd8076caed2f026a6d100"
-dependencies = [
- "pin-project-lite",
- "tracing-core",
-]
-
-[[package]]
-name = "tracing-core"
-version = "0.1.36"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "db97caf9d906fbde555dd62fa95ddba9eecfd14cb388e4f491a66d74cd5fb79a"
-dependencies = [
- "once_cell",
-]
-
-[[package]]
-name = "try-lock"
-version = "0.2.5"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "e421abadd41a4225275504ea4d6566923418b7f05506fbc9c0fe86ba7396114b"
-
-[[package]]
-name = "typenum"
-version = "1.19.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "562d481066bde0658276a35467c4af00bdc6ee726305698a55b86e61d7ad82bb"
-
-[[package]]
-name = "unicode-ident"
-version = "1.0.22"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "9312f7c4f6ff9069b165498234ce8be658059c6728633667c526e27dc2cf1df5"
-
-[[package]]
-name = "uniffi"
-version = "0.31.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "b8c6dec3fc6645f71a16a3fa9ff57991028153bd194ca97f4b55e610c73ce66a"
-dependencies = [
- "anyhow",
- "cargo_metadata",
- "uniffi_bindgen",
- "uniffi_core",
- "uniffi_macros",
- "uniffi_pipeline",
-]
-
-[[package]]
-name = "uniffi_bindgen"
-version = "0.31.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "4ed0150801958d4825da56a41c71f000a457ac3a4613fa9647df78ac4b6b6881"
-dependencies = [
- "anyhow",
- "askama",
- "camino",
- "cargo_metadata",
- "fs-err",
- "glob",
- "goblin",
- "heck",
- "indexmap",
- "once_cell",
- "serde",
- "tempfile",
- "textwrap",
- "toml",
- "uniffi_internal_macros",
- "uniffi_meta",
- "uniffi_pipeline",
- "uniffi_udl",
-]
-
-[[package]]
-name = "uniffi_core"
-version = "0.31.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "b0ef62e69762fbb9386dcb6c87cd3dd05d525fa8a3a579a290892e60ddbda47e"
-dependencies = [
- "anyhow",
- "bytes",
- "once_cell",
- "static_assertions",
-]
-
-[[package]]
-name = "uniffi_internal_macros"
-version = "0.31.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "98f51ebca0d9a4b2aa6c644d5ede45c56f73906b96403c08a1985e75ccb64a01"
-dependencies = [
- "anyhow",
- "indexmap",
- "proc-macro2",
- "quote",
- "syn",
-]
-
-[[package]]
-name = "uniffi_macros"
-version = "0.31.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "db9d12529f1223d014fd501e5f29ca0884d15d6ed5ddddd9f506e55350327dc3"
-dependencies = [
- "camino",
- "fs-err",
- "once_cell",
- "proc-macro2",
- "quote",
- "serde",
- "syn",
- "toml",
- "uniffi_meta",
-]
-
-[[package]]
-name = "uniffi_meta"
-version = "0.31.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "9df6d413db2827c68588f8149d30d49b71d540d46539e435b23a7f7dbd4d4f86"
-dependencies = [
- "anyhow",
- "siphasher",
- "uniffi_internal_macros",
- "uniffi_pipeline",
-]
-
-[[package]]
-name = "uniffi_pipeline"
-version = "0.31.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "a806dddc8208f22efd7e95a5cdf88ed43d0f3271e8f63b47e757a8bbdb43b63a"
-dependencies = [
- "anyhow",
- "heck",
- "indexmap",
- "tempfile",
- "uniffi_internal_macros",
-]
-
-[[package]]
-name = "uniffi_udl"
-version = "0.31.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "0d1a7339539bf6f6fa3e9b534dece13f778bda2d54b1a6d4e40b4d6090ac26e7"
-dependencies = [
- "anyhow",
- "textwrap",
- "uniffi_meta",
- "weedle2",
-]
-
-[[package]]
-name = "universal-hash"
-version = "0.5.1"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "fc1de2c688dc15305988b563c3854064043356019f97a4b46276fe734c4f07ea"
-dependencies = [
- "crypto-common",
- "subtle",
-]
-
-[[package]]
-name = "untrusted"
-version = "0.9.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "8ecb6da28b8a351d773b68d5825ac39017e680750f980f3a1a85cd8dd28a47c1"
-
-[[package]]
-name = "url"
-version = "2.5.8"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "ff67a8a4397373c3ef660812acab3268222035010ab8680ec4215f38ba3d0eed"
-dependencies = [
- "form_urlencoded",
- "idna",
- "percent-encoding",
- "serde",
-]
-
-[[package]]
-name = "utf8_iter"
-version = "1.0.4"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "b6c140620e7ffbb22c2dee59cafe6084a59b5ffc27a8859a5f0d494b5d52b6be"
-
-[[package]]
-name = "uuid"
-version = "1.19.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "e2e054861b4bd027cd373e18e8d8d8e6548085000e41290d95ce0c373a654b4a"
-dependencies = [
- "getrandom 0.3.4",
- "js-sys",
- "uuid-rng-internal",
- "wasm-bindgen",
-]
-
-[[package]]
-name = "uuid-rng-internal"
-version = "1.19.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "8d0021aebf9af0cbec73af2f884a2cd0a41d984c00e42f27baa11856ab480e2c"
-dependencies = [
- "getrandom 0.3.4",
-]
-
-[[package]]
-name = "vcpkg"
-version = "0.2.15"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "accd4ea62f7bb7a82fe23066fb0957d48ef677f6eeb8215f372f52e48bb32426"
-
-[[package]]
-name = "version_check"
-version = "0.9.5"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "0b928f33d975fc6ad9f86c8f283853ad26bdd5b10b7f1542aa2fa15e2289105a"
-
-[[package]]
-name = "want"
-version = "0.3.1"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "bfa7760aed19e106de2c7c0b581b509f2f25d3dacaf737cb82ac61bc6d760b0e"
-dependencies = [
- "try-lock",
-]
-
-[[package]]
-name = "wasi"
-version = "0.11.1+wasi-snapshot-preview1"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "ccf3ec651a847eb01de73ccad15eb7d99f80485de043efb2f370cd654f4ea44b"
-
-[[package]]
-name = "wasip2"
-version = "1.0.2+wasi-0.2.9"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "9517f9239f02c069db75e65f174b3da828fe5f5b945c4dd26bd25d89c03ebcf5"
-dependencies = [
- "wit-bindgen",
-]
-
-[[package]]
-name = "wasm-bindgen"
-version = "0.2.108"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "64024a30ec1e37399cf85a7ffefebdb72205ca1c972291c51512360d90bd8566"
-dependencies = [
- "cfg-if",
- "once_cell",
- "rustversion",
- "wasm-bindgen-macro",
- "wasm-bindgen-shared",
-]
-
-[[package]]
-name = "wasm-bindgen-futures"
-version = "0.4.58"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "70a6e77fd0ae8029c9ea0063f87c46fde723e7d887703d74ad2616d792e51e6f"
-dependencies = [
- "cfg-if",
- "futures-util",
- "js-sys",
- "once_cell",
- "wasm-bindgen",
- "web-sys",
-]
-
-[[package]]
-name = "wasm-bindgen-macro"
-version = "0.2.108"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "008b239d9c740232e71bd39e8ef6429d27097518b6b30bdf9086833bd5b6d608"
-dependencies = [
- "quote",
- "wasm-bindgen-macro-support",
-]
-
-[[package]]
-name = "wasm-bindgen-macro-support"
-version = "0.2.108"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "5256bae2d58f54820e6490f9839c49780dff84c65aeab9e772f15d5f0e913a55"
-dependencies = [
- "bumpalo",
- "proc-macro2",
- "quote",
- "syn",
- "wasm-bindgen-shared",
-]
-
-[[package]]
-name = "wasm-bindgen-shared"
-version = "0.2.108"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "1f01b580c9ac74c8d8f0c0e4afb04eeef2acf145458e52c03845ee9cd23e3d12"
-dependencies = [
- "unicode-ident",
-]
-
-[[package]]
-name = "web-sys"
-version = "0.3.85"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "312e32e551d92129218ea9a2452120f4aabc03529ef03e4d0d82fb2780608598"
-dependencies = [
- "js-sys",
- "wasm-bindgen",
-]
-
-[[package]]
-name = "web-time"
-version = "1.1.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "5a6580f308b1fad9207618087a65c04e7a10bc77e02c8e84e9b00dd4b12fa0bb"
-dependencies = [
- "js-sys",
- "wasm-bindgen",
-]
-
-[[package]]
-name = "weedle2"
-version = "5.0.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "998d2c24ec099a87daf9467808859f9d82b61f1d9c9701251aea037f514eae0e"
-dependencies = [
- "nom",
-]
-
-[[package]]
-name = "windows-link"
-version = "0.2.1"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "f0805222e57f7521d6a62e36fa9163bc891acd422f971defe97d64e70d0a4fe5"
-
-[[package]]
-name = "windows-registry"
-version = "0.6.1"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "02752bf7fbdcce7f2a27a742f798510f3e5ad88dbe84871e5168e2120c3d5720"
-dependencies = [
- "windows-link",
- "windows-result",
- "windows-strings",
-]
-
-[[package]]
-name = "windows-result"
-version = "0.4.1"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "7781fa89eaf60850ac3d2da7af8e5242a5ea78d1a11c49bf2910bb5a73853eb5"
-dependencies = [
- "windows-link",
-]
-
-[[package]]
-name = "windows-strings"
-version = "0.5.1"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "7837d08f69c77cf6b07689544538e017c1bfcf57e34b4c0ff58e6c2cd3b37091"
-dependencies = [
- "windows-link",
-]
-
-[[package]]
-name = "windows-sys"
-version = "0.52.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "282be5f36a8ce781fad8c8ae18fa3f9beff57ec1b52cb3de0789201425d9a33d"
-dependencies = [
- "windows-targets 0.52.6",
-]
-
-[[package]]
-name = "windows-sys"
-version = "0.60.2"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "f2f500e4d28234f72040990ec9d39e3a6b950f9f22d3dba18416c35882612bcb"
-dependencies = [
- "windows-targets 0.53.5",
-]
-
-[[package]]
-name = "windows-sys"
-version = "0.61.2"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "ae137229bcbd6cdf0f7b80a31df61766145077ddf49416a728b02cb3921ff3fc"
-dependencies = [
- "windows-link",
-]
-
-[[package]]
-name = "windows-targets"
-version = "0.52.6"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "9b724f72796e036ab90c1021d4780d4d3d648aca59e491e6b98e725b84e99973"
-dependencies = [
- "windows_aarch64_gnullvm 0.52.6",
- "windows_aarch64_msvc 0.52.6",
- "windows_i686_gnu 0.52.6",
- "windows_i686_gnullvm 0.52.6",
- "windows_i686_msvc 0.52.6",
- "windows_x86_64_gnu 0.52.6",
- "windows_x86_64_gnullvm 0.52.6",
- "windows_x86_64_msvc 0.52.6",
-]
-
-[[package]]
-name = "windows-targets"
-version = "0.53.5"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "4945f9f551b88e0d65f3db0bc25c33b8acea4d9e41163edf90dcd0b19f9069f3"
-dependencies = [
- "windows-link",
- "windows_aarch64_gnullvm 0.53.1",
- "windows_aarch64_msvc 0.53.1",
- "windows_i686_gnu 0.53.1",
- "windows_i686_gnullvm 0.53.1",
- "windows_i686_msvc 0.53.1",
- "windows_x86_64_gnu 0.53.1",
- "windows_x86_64_gnullvm 0.53.1",
- "windows_x86_64_msvc 0.53.1",
-]
-
-[[package]]
-name = "windows_aarch64_gnullvm"
-version = "0.52.6"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "32a4622180e7a0ec044bb555404c800bc9fd9ec262ec147edd5989ccd0c02cd3"
-
-[[package]]
-name = "windows_aarch64_gnullvm"
-version = "0.53.1"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "a9d8416fa8b42f5c947f8482c43e7d89e73a173cead56d044f6a56104a6d1b53"
-
-[[package]]
-name = "windows_aarch64_msvc"
-version = "0.52.6"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "09ec2a7bb152e2252b53fa7803150007879548bc709c039df7627cabbd05d469"
-
-[[package]]
-name = "windows_aarch64_msvc"
-version = "0.53.1"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "b9d782e804c2f632e395708e99a94275910eb9100b2114651e04744e9b125006"
-
-[[package]]
-name = "windows_i686_gnu"
-version = "0.52.6"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "8e9b5ad5ab802e97eb8e295ac6720e509ee4c243f69d781394014ebfe8bbfa0b"
-
-[[package]]
-name = "windows_i686_gnu"
-version = "0.53.1"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "960e6da069d81e09becb0ca57a65220ddff016ff2d6af6a223cf372a506593a3"
-
-[[package]]
-name = "windows_i686_gnullvm"
-version = "0.52.6"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "0eee52d38c090b3caa76c563b86c3a4bd71ef1a819287c19d586d7334ae8ed66"
-
-[[package]]
-name = "windows_i686_gnullvm"
-version = "0.53.1"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "fa7359d10048f68ab8b09fa71c3daccfb0e9b559aed648a8f95469c27057180c"
-
-[[package]]
-name = "windows_i686_msvc"
-version = "0.52.6"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "240948bc05c5e7c6dabba28bf89d89ffce3e303022809e73deaefe4f6ec56c66"
-
-[[package]]
-name = "windows_i686_msvc"
-version = "0.53.1"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "1e7ac75179f18232fe9c285163565a57ef8d3c89254a30685b57d83a38d326c2"
-
-[[package]]
-name = "windows_x86_64_gnu"
-version = "0.52.6"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "147a5c80aabfbf0c7d901cb5895d1de30ef2907eb21fbbab29ca94c5b08b1a78"
-
-[[package]]
-name = "windows_x86_64_gnu"
-version = "0.53.1"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "9c3842cdd74a865a8066ab39c8a7a473c0778a3f29370b5fd6b4b9aa7df4a499"
-
-[[package]]
-name = "windows_x86_64_gnullvm"
-version = "0.52.6"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "24d5b23dc417412679681396f2b49f3de8c1473deb516bd34410872eff51ed0d"
-
-[[package]]
-name = "windows_x86_64_gnullvm"
-version = "0.53.1"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "0ffa179e2d07eee8ad8f57493436566c7cc30ac536a3379fdf008f47f6bb7ae1"
-
-[[package]]
-name = "windows_x86_64_msvc"
-version = "0.52.6"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "589f6da84c646204747d1270a2a5661ea66ed1cced2631d546fdfb155959f9ec"
-
-[[package]]
-name = "windows_x86_64_msvc"
-version = "0.53.1"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "d6bbff5f0aada427a1e5a6da5f1f98158182f26556f345ac9e04d36d0ebed650"
-
-[[package]]
-name = "winnow"
-version = "0.7.14"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "5a5364e9d77fcdeeaa6062ced926ee3381faa2ee02d3eb83a5c27a8825540829"
-dependencies = [
- "memchr",
-]
-
-[[package]]
-name = "wit-bindgen"
-version = "0.51.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "d7249219f66ced02969388cf2bb044a09756a083d0fab1e566056b04d9fbcaa5"
-
-[[package]]
-name = "writeable"
-version = "0.6.2"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "9edde0db4769d2dc68579893f2306b26c6ecfbe0ef499b013d731b7b9247e0b9"
-
-[[package]]
-name = "x25519-dalek"
-version = "2.0.1"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "c7e468321c81fb07fa7f4c636c3972b9100f0346e5b6a9f2bd0603a52f7ed277"
-dependencies = [
- "curve25519-dalek",
- "rand_core 0.6.4",
- "serde",
- "zeroize",
-]
-
-[[package]]
-name = "xsalsa20poly1305"
-version = "0.9.1"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "02a6dad357567f81cd78ee75f7c61f1b30bb2fe4390be8fb7c69e2ac8dffb6c7"
-dependencies = [
- "aead",
- "poly1305",
- "salsa20",
- "subtle",
- "zeroize",
-]
-
-[[package]]
-name = "yoke"
-version = "0.8.1"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "72d6e5c6afb84d73944e5cedb052c4680d5657337201555f9f2a16b7406d4954"
-dependencies = [
- "stable_deref_trait",
- "yoke-derive",
- "zerofrom",
-]
-
-[[package]]
-name = "yoke-derive"
-version = "0.8.1"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "b659052874eb698efe5b9e8cf382204678a0086ebf46982b79d6ca3182927e5d"
-dependencies = [
- "proc-macro2",
- "quote",
- "syn",
- "synstructure",
-]
-
-[[package]]
-name = "zerocopy"
-version = "0.8.33"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "668f5168d10b9ee831de31933dc111a459c97ec93225beb307aed970d1372dfd"
-dependencies = [
- "zerocopy-derive",
-]
-
-[[package]]
-name = "zerocopy-derive"
-version = "0.8.33"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "2c7962b26b0a8685668b671ee4b54d007a67d4eaf05fda79ac0ecf41e32270f1"
-dependencies = [
- "proc-macro2",
- "quote",
- "syn",
-]
-
-[[package]]
-name = "zerofrom"
-version = "0.1.6"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "50cc42e0333e05660c3587f3bf9d0478688e15d870fab3346451ce7f8c9fbea5"
-dependencies = [
- "zerofrom-derive",
-]
-
-[[package]]
-name = "zerofrom-derive"
-version = "0.1.6"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "d71e5d6e06ab090c67b5e44993ec16b72dcbaabc526db883a360057678b48502"
-dependencies = [
- "proc-macro2",
- "quote",
- "syn",
- "synstructure",
-]
-
-[[package]]
-name = "zeroize"
-version = "1.8.2"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "b97154e67e32c85465826e8bcc1c59429aaaf107c1e4a9e53c8d8ccd5eff88d0"
-dependencies = [
- "zeroize_derive",
-]
-
-[[package]]
-name = "zeroize_derive"
-version = "1.4.3"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "85a5b4158499876c763cb03bc4e49185d3cccbabb15b33c627f7884f43db852e"
-dependencies = [
- "proc-macro2",
- "quote",
- "syn",
-]
-
-[[package]]
-name = "zerotrie"
-version = "0.2.3"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "2a59c17a5562d507e4b54960e8569ebee33bee890c70aa3fe7b97e85a9fd7851"
-dependencies = [
- "displaydoc",
- "yoke",
- "zerofrom",
-]
-
-[[package]]
-name = "zerovec"
-version = "0.11.5"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "6c28719294829477f525be0186d13efa9a3c602f7ec202ca9e353d310fb9a002"
-dependencies = [
- "yoke",
- "zerofrom",
- "zerovec-derive",
-]
-
-[[package]]
-name = "zerovec-derive"
-version = "0.11.2"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "eadce39539ca5cb3985590102671f2567e659fca9666581ad3411d59207951f3"
-dependencies = [
- "proc-macro2",
- "quote",
- "syn",
-]
-
-[[package]]
-name = "zmij"
-version = "1.0.16"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "dfcd145825aace48cff44a8844de64bf75feec3080e0aa5cdbde72961ae51a65"
diff --git a/rust/llmchat/uniffi/llmchat_sync_uniffi/Cargo.toml b/rust/llmchat/uniffi/llmchat_sync_uniffi/Cargo.toml
deleted file mode 100644
index 145636a2bf..0000000000
--- a/rust/llmchat/uniffi/llmchat_sync_uniffi/Cargo.toml
+++ /dev/null
@@ -1,16 +0,0 @@
-[package]
-name = "llmchat_sync_uniffi"
-version = "0.1.0"
-edition = "2024"
-
-[lib]
-name = "llmchat_sync_uniffi"
-crate-type = ["staticlib", "cdylib"]
-
-[dependencies]
-llmchat-sync = { path = "../../sync" }
-serde = { version = "1", features = ["derive"] }
-thiserror = "2"
-uniffi = { version = "0.31.0" }
-
-[build-dependencies]
diff --git a/rust/llmchat/uniffi/llmchat_sync_uniffi/build.rs b/rust/llmchat/uniffi/llmchat_sync_uniffi/build.rs
deleted file mode 100644
index f328e4d9d0..0000000000
--- a/rust/llmchat/uniffi/llmchat_sync_uniffi/build.rs
+++ /dev/null
@@ -1 +0,0 @@
-fn main() {}
diff --git a/rust/llmchat/uniffi/llmchat_sync_uniffi/src/api.rs b/rust/llmchat/uniffi/llmchat_sync_uniffi/src/api.rs
deleted file mode 100644
index 1c08ae015f..0000000000
--- a/rust/llmchat/uniffi/llmchat_sync_uniffi/src/api.rs
+++ /dev/null
@@ -1,258 +0,0 @@
-use llmchat_sync as core;
-use thiserror::Error;
-
-#[derive(Debug, Error, uniffi::Error)]
-pub enum SyncError {
- #[error("{0}")]
- Message(String),
- #[error("sync already in progress")]
- SyncInProgress,
-}
-
-impl From<core::SyncError> for SyncError {
- fn from(err: core::SyncError) -> Self {
- match err {
- core::SyncError::SyncInProgress => SyncError::SyncInProgress,
- other => SyncError::Message(other.to_string()),
- }
- }
-}
-
-#[derive(Debug, Clone, uniffi::Record)]
-pub struct SyncAuth {
- pub base_url: String,
- pub auth_token: String,
- pub master_key: Vec<u8>,
- pub user_agent: Option<String>,
- pub client_package: Option<String>,
- pub client_version: Option<String>,
-}
-
-impl From<SyncAuth> for core::SyncAuth {
- fn from(value: SyncAuth) -> Self {
- core::SyncAuth {
- base_url: value.base_url,
- auth_token: value.auth_token,
- master_key: value.master_key.into(),
- user_agent: value.user_agent,
- client_package: value.client_package,
- client_version: value.client_version,
- }
- }
-}
-
-#[derive(Debug, Clone, uniffi::Record)]
-pub struct MigrationConfig {
- pub batch_size: i64,
- pub priority: MigrationPriority,
-}
-
-#[derive(Debug, Clone, uniffi::Enum)]
-pub enum MigrationPriority {
- RecentFirst,
- OldestFirst,
-}
-
-impl From<MigrationPriority> for core::MigrationPriority {
- fn from(value: MigrationPriority) -> Self {
- match value {
- MigrationPriority::RecentFirst => core::MigrationPriority::RecentFirst,
- MigrationPriority::OldestFirst => core::MigrationPriority::OldestFirst,
- }
- }
-}
-
-impl From<core::MigrationPriority> for MigrationPriority {
- fn from(value: core::MigrationPriority) -> Self {
- match value {
- core::MigrationPriority::RecentFirst => MigrationPriority::RecentFirst,
- core::MigrationPriority::OldestFirst => MigrationPriority::OldestFirst,
- }
- }
-}
-
-impl From<MigrationConfig> for core::MigrationConfig {
- fn from(value: MigrationConfig) -> Self {
- core::MigrationConfig {
- batch_size: value.batch_size,
- priority: value.priority.into(),
- }
- }
-}
-
-#[derive(Debug, Clone, uniffi::Enum)]
-pub enum MigrationState {
- NotNeeded,
- InProgress,
- Complete,
- Failed,
-}
-
-impl From<core::MigrationState> for MigrationState {
- fn from(value: core::MigrationState) -> Self {
- match value {
- core::MigrationState::NotNeeded => MigrationState::NotNeeded,
- core::MigrationState::InProgress => MigrationState::InProgress,
- core::MigrationState::Complete => MigrationState::Complete,
- core::MigrationState::Failed => MigrationState::Failed,
- }
- }
-}
-
-#[derive(Debug, Clone, uniffi::Record)]
-pub struct MigrationProgress {
- pub state: MigrationState,
- pub processed: i64,
- pub remaining: i64,
- pub total: i64,
-}
-
-impl From<core::MigrationProgress> for MigrationProgress {
- fn from(value: core::MigrationProgress) -> Self {
- MigrationProgress {
- state: value.state.into(),
- processed: value.processed,
- remaining: value.remaining,
- total: value.total,
- }
- }
-}
-
-#[uniffi::export(callback_interface)]
-pub trait MigrationProgressCallback: Send + Sync {
- fn on_progress(&self, progress: MigrationProgress);
-}
-
-struct MigrationCallbackAdapter {
- inner: Box<dyn MigrationProgressCallback>,
-}
-
-impl core::MigrationProgressCallback for MigrationCallbackAdapter {
- fn on_progress(&self, progress: core::MigrationProgress) {
- self.inner.on_progress(progress.into());
- }
-}
-
-#[derive(Debug, Clone, uniffi::Record)]
-pub struct SyncStats {
- pub sessions: i64,
- pub messages: i64,
-}
-
-impl From<core::SyncStats> for SyncStats {
- fn from(value: core::SyncStats) -> Self {
- SyncStats {
- sessions: value.sessions,
- messages: value.messages,
- }
- }
-}
-
-#[derive(Debug, Clone, uniffi::Record)]
-pub struct SyncResult {
- pub pulled: SyncStats,
- pub pushed: SyncStats,
- pub uploaded_attachments: i64,
- pub downloaded_attachments: i64,
-}
-
-impl From<core::SyncResult> for SyncResult {
- fn from(value: core::SyncResult) -> Self {
- SyncResult {
- pulled: value.pulled.into(),
- pushed: value.pushed.into(),
- uploaded_attachments: value.uploaded_attachments,
- downloaded_attachments: value.downloaded_attachments,
- }
- }
-}
-
-#[uniffi::export]
-pub fn fetch_chat_key(auth: SyncAuth, sync_db_path: String) -> Result<Vec<u8>, SyncError> {
- let key = core::fetch_chat_key(auth.into(), sync_db_path)?;
- Ok(key)
-}
-
-#[derive(uniffi::Object)]
-pub struct LlmChatSync {
- inner: core::SyncEngine,
-}
-
-#[uniffi::export]
-impl LlmChatSync {
- #[uniffi::constructor]
- pub fn open(
- main_db_path: String,
- attachments_db_path: String,
- db_key: Vec<u8>,
- attachments_dir: String,
- meta_dir: String,
- plaintext_dir: Option<String>,
- ) -> Result<Self, SyncError> {
- let inner = core::SyncEngine::new(
- main_db_path,
- attachments_db_path,
- db_key,
- attachments_dir,
- meta_dir,
- plaintext_dir,
- )?;
- Ok(Self { inner })
- }
-
- pub fn sync(&self, auth: SyncAuth) -> Result<SyncResult, SyncError> {
- let result = self.inner.sync(auth.into())?;
- Ok(result.into())
- }
-
- pub fn check_migration_status_local(&self) -> Option<MigrationState> {
- self.inner
- .check_migration_status_local()
- .ok()
- .flatten()
- .map(Into::into)
- }
-
- pub fn check_migration_status(&self, auth: SyncAuth) -> Result<MigrationState, SyncError> {
- let state = self.inner.check_migration_status(auth.into())?;
- Ok(state.into())
- }
-
- pub fn reset_sync_state(&self) -> Result<(), SyncError> {
- self.inner.reset_sync_state()?;
- Ok(())
- }
-
- pub fn seed_from_offline(
- &self,
- offline_db_path: String,
- offline_db_key: Vec<u8>,
- ) -> Result<(), SyncError> {
- self.inner.seed_from_offline(offline_db_path, offline_db_key)?;
- Ok(())
- }
-
- pub fn sync_with_progress(
- &self,
- auth: SyncAuth,
- config: MigrationConfig,
- callback: Box<dyn MigrationProgressCallback>,
- ) -> Result<SyncResult, SyncError> {
- let adapter = MigrationCallbackAdapter { inner: callback };
- let result = self
- .inner
- .sync_with_progress(auth.into(), config.into(), &adapter)?;
- Ok(result.into())
- }
-
- pub fn download_attachment(
- &self,
- attachment_id: String,
- session_uuid: String,
- auth: SyncAuth,
- ) -> Result<bool, SyncError> {
- self.inner
- .download_attachment(auth.into(), attachment_id, session_uuid)
- .map_err(Into::into)
- }
-}
diff --git a/rust/llmchat/uniffi/llmchat_sync_uniffi/src/api.udl b/rust/llmchat/uniffi/llmchat_sync_uniffi/src/api.udl
deleted file mode 100644
index 794b21eae6..0000000000
--- a/rust/llmchat/uniffi/llmchat_sync_uniffi/src/api.udl
+++ /dev/null
@@ -1,38 +0,0 @@
-[Error]
-interface SyncError {
- Message(string message);
-};
-
-dictionary SyncAuth {
- string base_url;
- string auth_token;
- sequence<u8> master_key;
- string? user_agent;
- string? client_package;
- string? client_version;
-};
-
-dictionary SyncStats {
- i64 sessions;
- i64 messages;
-};
-
-dictionary SyncResult {
- SyncStats pulled;
- SyncStats pushed;
- i64 uploaded_attachments;
- i64 downloaded_attachments;
-};
-
-namespace llmchat_sync_uniffi {
- interface LlmChatSync {
- [Constructor, Throws=SyncError]
- LlmChatSync(string main_db_path, string attachments_db_path, sequence<u8> db_key, string attachments_dir, string meta_dir, string? plaintext_dir);
-
- [Throws=SyncError]
- SyncResult sync(SyncAuth auth);
-
- [Throws=SyncError]
- boolean download_attachment(string attachment_id, string session_uuid, SyncAuth auth);
- };
-};
diff --git a/rust/llmchat/uniffi/llmchat_sync_uniffi/src/lib.rs b/rust/llmchat/uniffi/llmchat_sync_uniffi/src/lib.rs
deleted file mode 100644
index e7504e14c7..0000000000
--- a/rust/llmchat/uniffi/llmchat_sync_uniffi/src/lib.rs
+++ /dev/null
@@ -1,7 +0,0 @@
-#![allow(unexpected_cfgs)]
-
-mod api;
-
-uniffi::setup_scaffolding!("llmchat_sync_uniffi");
-
-pub use api::*;
diff --git a/rust/llmchat/uniffi/llmchat_sync_uniffi/uniffi.toml b/rust/llmchat/uniffi/llmchat_sync_uniffi/uniffi.toml
deleted file mode 100644
index 86d02c56ab..0000000000
--- a/rust/llmchat/uniffi/llmchat_sync_uniffi/uniffi.toml
+++ /dev/null
@@ -1,8 +0,0 @@
-[bindings.swift]
-link_frameworks = ["Foundation"]
-
-[bindings.kotlin]
-package_name = "io.ente.labs.llmchat_sync"
-cdylib_name = "llmchat_sync_uniffi"
-android = true
-kotlin_target_version = "1.9.0"
diff --git a/rust/uniffi/core_uniffi/.gitignore b/rust/uniffi/core_uniffi/.gitignore
deleted file mode 100644
index 34c78b3bde..0000000000
--- a/rust/uniffi/core_uniffi/.gitignore
+++ /dev/null
@@ -1,5 +0,0 @@
-# Rust build artifacts
-/target/
-
-# OS
-.DS_Store
diff --git a/rust/uniffi/core_uniffi/Cargo.lock b/rust/uniffi/core_uniffi/Cargo.lock
deleted file mode 100644
index 134eef3972..0000000000
--- a/rust/uniffi/core_uniffi/Cargo.lock
+++ /dev/null
@@ -1,2469 +0,0 @@
-# This file is automatically @generated by Cargo.
-# It is not intended for manual editing.
-version = 4
-
-[[package]]
-name = "aead"
-version = "0.5.2"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "d122413f284cf2d62fb1b7db97e02edb8cda96d769b16e443a4f6195e35662b0"
-dependencies = [
- "crypto-common",
- "generic-array",
-]
-
-[[package]]
-name = "anyhow"
-version = "1.0.100"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "a23eb6b1614318a8071c9b2521f36b424b2c83db5eb3a0fead4a6c0809af6e61"
-
-[[package]]
-name = "argon2"
-version = "0.5.3"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "3c3610892ee6e0cbce8ae2700349fcf8f98adb0dbfbee85aec3c9179d29cc072"
-dependencies = [
- "base64ct",
- "blake2",
- "cpufeatures",
- "password-hash",
-]
-
-[[package]]
-name = "arrayref"
-version = "0.3.9"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "76a2e8124351fda1ef8aaaa3bbd7ebbcb486bbcd4225aca0aa0d84bb2db8fecb"
-
-[[package]]
-name = "arrayvec"
-version = "0.7.6"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "7c02d123df017efcdfbd739ef81735b36c5ba83ec3c59c80a9d7ecc718f92e50"
-
-[[package]]
-name = "askama"
-version = "0.14.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "f75363874b771be265f4ffe307ca705ef6f3baa19011c149da8674a87f1b75c4"
-dependencies = [
- "askama_derive",
- "itoa",
- "percent-encoding",
- "serde",
- "serde_json",
-]
-
-[[package]]
-name = "askama_derive"
-version = "0.14.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "129397200fe83088e8a68407a8e2b1f826cf0086b21ccdb866a722c8bcd3a94f"
-dependencies = [
- "askama_parser",
- "basic-toml",
- "memchr",
- "proc-macro2",
- "quote",
- "rustc-hash",
- "serde",
- "serde_derive",
- "syn",
-]
-
-[[package]]
-name = "askama_parser"
-version = "0.14.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "d6ab5630b3d5eaf232620167977f95eb51f3432fc76852328774afbd242d4358"
-dependencies = [
- "memchr",
- "serde",
- "serde_derive",
- "winnow",
-]
-
-[[package]]
-name = "atomic-waker"
-version = "1.1.2"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "1505bd5d3d116872e7271a6d4e16d81d0c8570876c8de68093a09ac269d8aac0"
-
-[[package]]
-name = "autocfg"
-version = "1.5.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "c08606f8c3cbf4ce6ec8e28fb0014a2c086708fe954eaa885384a6165172e7e8"
-
-[[package]]
-name = "base64"
-version = "0.22.1"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "72b3254f16251a8381aa12e40e3c4d2f0199f8c6508fbecb9d91f575e0fbb8c6"
-
-[[package]]
-name = "base64ct"
-version = "1.8.3"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "2af50177e190e07a26ab74f8b1efbfe2ef87da2116221318cb1c2e82baf7de06"
-
-[[package]]
-name = "basic-toml"
-version = "0.1.10"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "ba62675e8242a4c4e806d12f11d136e626e6c8361d6b829310732241652a178a"
-dependencies = [
- "serde",
-]
-
-[[package]]
-name = "bitflags"
-version = "2.10.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "812e12b5285cc515a9c72a5c1d3b6d46a19dac5acfef5265968c166106e31dd3"
-
-[[package]]
-name = "blake2"
-version = "0.10.6"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "46502ad458c9a52b69d4d4d32775c788b7a1b85e8bc9d482d92250fc0e3f8efe"
-dependencies = [
- "digest",
-]
-
-[[package]]
-name = "blake2b_simd"
-version = "1.0.4"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "b79834656f71332577234b50bfc009996f7449e0c056884e6a02492ded0ca2f3"
-dependencies = [
- "arrayref",
- "arrayvec",
- "constant_time_eq",
-]
-
-[[package]]
-name = "block-buffer"
-version = "0.10.4"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "3078c7629b62d3f0439517fa394996acacc5cbc91c5a20d8c658e77abd503a71"
-dependencies = [
- "generic-array",
-]
-
-[[package]]
-name = "block-padding"
-version = "0.3.3"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "a8894febbff9f758034a5b8e12d87918f56dfc64a8e1fe757d65e29041538d93"
-dependencies = [
- "generic-array",
-]
-
-[[package]]
-name = "bumpalo"
-version = "3.19.1"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "5dd9dc738b7a8311c7ade152424974d8115f2cdad61e8dab8dac9f2362298510"
-
-[[package]]
-name = "bytes"
-version = "1.11.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "b35204fbdc0b3f4446b89fc1ac2cf84a8a68971995d0bf2e925ec7cd960f9cb3"
-
-[[package]]
-name = "camino"
-version = "1.2.2"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "e629a66d692cb9ff1a1c664e41771b3dcaf961985a9774c0eb0bd1b51cf60a48"
-dependencies = [
- "serde_core",
-]
-
-[[package]]
-name = "cargo-platform"
-version = "0.1.9"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "e35af189006b9c0f00a064685c727031e3ed2d8020f7ba284d78cc2671bd36ea"
-dependencies = [
- "serde",
-]
-
-[[package]]
-name = "cargo_metadata"
-version = "0.19.2"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "dd5eb614ed4c27c5d706420e4320fbe3216ab31fa1c33cd8246ac36dae4479ba"
-dependencies = [
- "camino",
- "cargo-platform",
- "semver",
- "serde",
- "serde_json",
- "thiserror 2.0.17",
-]
-
-[[package]]
-name = "cc"
-version = "1.2.53"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "755d2fce177175ffca841e9a06afdb2c4ab0f593d53b4dee48147dfaade85932"
-dependencies = [
- "find-msvc-tools",
- "shlex",
-]
-
-[[package]]
-name = "cfg-if"
-version = "1.0.4"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "9330f8b2ff13f34540b44e946ef35111825727b38d33286ef986142615121801"
-
-[[package]]
-name = "cfg_aliases"
-version = "0.2.1"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "613afe47fcd5fac7ccf1db93babcb082c5994d996f20b8b159f2ad1658eb5724"
-
-[[package]]
-name = "chacha20"
-version = "0.9.1"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "c3613f74bd2eac03dad61bd53dbe620703d4371614fe0bc3b9f04dd36fe4e818"
-dependencies = [
- "cfg-if",
- "cipher",
- "cpufeatures",
-]
-
-[[package]]
-name = "cipher"
-version = "0.4.4"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "773f3b9af64447d2ce9850330c473515014aa235e6a783b02db81ff39e4a3dad"
-dependencies = [
- "crypto-common",
- "inout",
- "zeroize",
-]
-
-[[package]]
-name = "constant_time_eq"
-version = "0.4.2"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "3d52eff69cd5e647efe296129160853a42795992097e8af39800e1060caeea9b"
-
-[[package]]
-name = "core-foundation"
-version = "0.9.4"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "91e195e091a93c46f7102ec7818a2aa394e1e1771c3ab4825963fa03e45afb8f"
-dependencies = [
- "core-foundation-sys",
- "libc",
-]
-
-[[package]]
-name = "core-foundation"
-version = "0.10.1"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "b2a6cd9ae233e7f62ba4e9353e81a88df7fc8a5987b8d445b4d90c879bd156f6"
-dependencies = [
- "core-foundation-sys",
- "libc",
-]
-
-[[package]]
-name = "core-foundation-sys"
-version = "0.8.7"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "773648b94d0e5d620f64f280777445740e61fe701025087ec8b57f45c791888b"
-
-[[package]]
-name = "core_uniffi"
-version = "0.1.0"
-dependencies = [
- "base64",
- "ente-core",
- "once_cell",
- "thiserror 1.0.69",
- "uniffi",
-]
-
-[[package]]
-name = "cpufeatures"
-version = "0.2.17"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "59ed5838eebb26a2bb2e58f6d5b5316989ae9d08bab10e0e6d103e656d1b0280"
-dependencies = [
- "libc",
-]
-
-[[package]]
-name = "crypto-common"
-version = "0.1.7"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "78c8292055d1c1df0cce5d180393dc8cce0abec0a7102adb6c7b1eef6016d60a"
-dependencies = [
- "generic-array",
- "rand_core 0.6.4",
- "typenum",
-]
-
-[[package]]
-name = "crypto_secretstream"
-version = "0.2.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "9a6419214057ad50a13efccb3ad7714b86b848e3a5aa7b6cf5a3ff07edf387eb"
-dependencies = [
- "aead",
- "chacha20",
- "getrandom 0.2.17",
- "poly1305",
- "rand_core 0.6.4",
- "subtle",
-]
-
-[[package]]
-name = "curve25519-dalek"
-version = "4.1.3"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "97fb8b7c4503de7d6ae7b42ab72a5a59857b4c937ec27a3d4539dba95b5ab2be"
-dependencies = [
- "cfg-if",
- "cpufeatures",
- "curve25519-dalek-derive",
- "fiat-crypto",
- "rustc_version",
- "subtle",
- "zeroize",
-]
-
-[[package]]
-name = "curve25519-dalek-derive"
-version = "0.1.1"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "f46882e17999c6cc590af592290432be3bce0428cb0d5f8b6715e4dc7b383eb3"
-dependencies = [
- "proc-macro2",
- "quote",
- "syn",
-]
-
-[[package]]
-name = "digest"
-version = "0.10.7"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "9ed9a281f7bc9b7576e61468ba615a66a5c8cfdff42420a70aa82701a3b1e292"
-dependencies = [
- "block-buffer",
- "crypto-common",
- "subtle",
-]
-
-[[package]]
-name = "displaydoc"
-version = "0.2.5"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "97369cbbc041bc366949bc74d34658d6cda5621039731c6310521892a3a20ae0"
-dependencies = [
- "proc-macro2",
- "quote",
- "syn",
-]
-
-[[package]]
-name = "encoding_rs"
-version = "0.8.35"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "75030f3c4f45dafd7586dd6780965a8c7e8e285a5ecb86713e63a79c5b2766f3"
-dependencies = [
- "cfg-if",
-]
-
-[[package]]
-name = "ente-core"
-version = "0.0.1"
-dependencies = [
- "argon2",
- "base64",
- "blake2b_simd",
- "crypto_secretstream",
- "getrandom 0.2.17",
- "hex",
- "md-5",
- "rand_core 0.6.4",
- "reqwest",
- "salsa20",
- "serde",
- "serde_json",
- "sha2",
- "srp",
- "subtle",
- "thiserror 2.0.17",
- "x25519-dalek",
- "xsalsa20poly1305",
- "zeroize",
-]
-
-[[package]]
-name = "equivalent"
-version = "1.0.2"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "877a4ace8713b0bcf2a4e7eec82529c029f1d0619886d18145fea96c3ffe5c0f"
-
-[[package]]
-name = "errno"
-version = "0.3.14"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "39cab71617ae0d63f51a36d69f866391735b51691dbda63cf6f96d042b63efeb"
-dependencies = [
- "libc",
- "windows-sys 0.61.2",
-]
-
-[[package]]
-name = "fastrand"
-version = "2.3.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "37909eebbb50d72f9059c3b6d82c0463f2ff062c9e95845c43a6c9c0355411be"
-
-[[package]]
-name = "fiat-crypto"
-version = "0.2.9"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "28dea519a9695b9977216879a3ebfddf92f1c08c05d984f8996aecd6ecdc811d"
-
-[[package]]
-name = "find-msvc-tools"
-version = "0.1.8"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "8591b0bcc8a98a64310a2fae1bb3e9b8564dd10e381e6e28010fde8e8e8568db"
-
-[[package]]
-name = "fnv"
-version = "1.0.7"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "3f9eec918d3f24069decb9af1554cad7c880e2da24a9afd88aca000531ab82c1"
-
-[[package]]
-name = "form_urlencoded"
-version = "1.2.2"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "cb4cb245038516f5f85277875cdaa4f7d2c9a0fa0468de06ed190163b1581fcf"
-dependencies = [
- "percent-encoding",
-]
-
-[[package]]
-name = "fs-err"
-version = "2.11.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "88a41f105fe1d5b6b34b2055e3dc59bb79b46b48b2040b9e6c7b4b5de097aa41"
-dependencies = [
- "autocfg",
-]
-
-[[package]]
-name = "futures-channel"
-version = "0.3.31"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "2dff15bf788c671c1934e366d07e30c1814a8ef514e1af724a602e8a2fbe1b10"
-dependencies = [
- "futures-core",
-]
-
-[[package]]
-name = "futures-core"
-version = "0.3.31"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "05f29059c0c2090612e8d742178b0580d2dc940c837851ad723096f87af6663e"
-
-[[package]]
-name = "futures-sink"
-version = "0.3.31"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "e575fab7d1e0dcb8d0c7bcf9a63ee213816ab51902e6d244a95819acacf1d4f7"
-
-[[package]]
-name = "futures-task"
-version = "0.3.31"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "f90f7dce0722e95104fcb095585910c0977252f286e354b5e3bd38902cd99988"
-
-[[package]]
-name = "futures-util"
-version = "0.3.31"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "9fa08315bb612088cc391249efdc3bc77536f16c91f6cf495e6fbe85b20a4a81"
-dependencies = [
- "futures-core",
- "futures-task",
- "pin-project-lite",
- "pin-utils",
- "slab",
-]
-
-[[package]]
-name = "generic-array"
-version = "0.14.7"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "85649ca51fd72272d7821adaf274ad91c288277713d9c18820d8499a7ff69e9a"
-dependencies = [
- "typenum",
- "version_check",
-]
-
-[[package]]
-name = "getrandom"
-version = "0.2.17"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "ff2abc00be7fca6ebc474524697ae276ad847ad0a6b3faa4bcb027e9a4614ad0"
-dependencies = [
- "cfg-if",
- "js-sys",
- "libc",
- "wasi",
- "wasm-bindgen",
-]
-
-[[package]]
-name = "getrandom"
-version = "0.3.4"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "899def5c37c4fd7b2664648c28120ecec138e4d395b459e5ca34f9cce2dd77fd"
-dependencies = [
- "cfg-if",
- "js-sys",
- "libc",
- "r-efi",
- "wasip2",
- "wasm-bindgen",
-]
-
-[[package]]
-name = "glob"
-version = "0.3.3"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "0cc23270f6e1808e30a928bdc84dea0b9b4136a8bc82338574f23baf47bbd280"
-
-[[package]]
-name = "goblin"
-version = "0.8.2"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "1b363a30c165f666402fe6a3024d3bec7ebc898f96a4a23bd1c99f8dbf3f4f47"
-dependencies = [
- "log",
- "plain",
- "scroll",
-]
-
-[[package]]
-name = "h2"
-version = "0.4.13"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "2f44da3a8150a6703ed5d34e164b875fd14c2cdab9af1252a9a1020bde2bdc54"
-dependencies = [
- "atomic-waker",
- "bytes",
- "fnv",
- "futures-core",
- "futures-sink",
- "http",
- "indexmap",
- "slab",
- "tokio",
- "tokio-util",
- "tracing",
-]
-
-[[package]]
-name = "hashbrown"
-version = "0.16.1"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "841d1cc9bed7f9236f321df977030373f4a4163ae1a7dbfe1a51a2c1a51d9100"
-
-[[package]]
-name = "heck"
-version = "0.5.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "2304e00983f87ffb38b55b444b5e3b60a884b5d30c0fca7d82fe33449bbe55ea"
-
-[[package]]
-name = "hex"
-version = "0.4.3"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "7f24254aa9a54b5c858eaee2f5bccdb46aaf0e486a595ed5fd8f86ba55232a70"
-
-[[package]]
-name = "http"
-version = "1.4.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "e3ba2a386d7f85a81f119ad7498ebe444d2e22c2af0b86b069416ace48b3311a"
-dependencies = [
- "bytes",
- "itoa",
-]
-
-[[package]]
-name = "http-body"
-version = "1.0.1"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "1efedce1fb8e6913f23e0c92de8e62cd5b772a67e7b3946df930a62566c93184"
-dependencies = [
- "bytes",
- "http",
-]
-
-[[package]]
-name = "http-body-util"
-version = "0.1.3"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "b021d93e26becf5dc7e1b75b1bed1fd93124b374ceb73f43d4d4eafec896a64a"
-dependencies = [
- "bytes",
- "futures-core",
- "http",
- "http-body",
- "pin-project-lite",
-]
-
-[[package]]
-name = "httparse"
-version = "1.10.1"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "6dbf3de79e51f3d586ab4cb9d5c3e2c14aa28ed23d180cf89b4df0454a69cc87"
-
-[[package]]
-name = "hyper"
-version = "1.8.1"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "2ab2d4f250c3d7b1c9fcdff1cece94ea4e2dfbec68614f7b87cb205f24ca9d11"
-dependencies = [
- "atomic-waker",
- "bytes",
- "futures-channel",
- "futures-core",
- "h2",
- "http",
- "http-body",
- "httparse",
- "itoa",
- "pin-project-lite",
- "pin-utils",
- "smallvec",
- "tokio",
- "want",
-]
-
-[[package]]
-name = "hyper-rustls"
-version = "0.27.7"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "e3c93eb611681b207e1fe55d5a71ecf91572ec8a6705cdb6857f7d8d5242cf58"
-dependencies = [
- "http",
- "hyper",
- "hyper-util",
- "rustls",
- "rustls-native-certs",
- "rustls-pki-types",
- "tokio",
- "tokio-rustls",
- "tower-service",
-]
-
-[[package]]
-name = "hyper-util"
-version = "0.1.19"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "727805d60e7938b76b826a6ef209eb70eaa1812794f9424d4a4e2d740662df5f"
-dependencies = [
- "base64",
- "bytes",
- "futures-channel",
- "futures-core",
- "futures-util",
- "http",
- "http-body",
- "hyper",
- "ipnet",
- "libc",
- "percent-encoding",
- "pin-project-lite",
- "socket2",
- "system-configuration",
- "tokio",
- "tower-service",
- "tracing",
- "windows-registry",
-]
-
-[[package]]
-name = "icu_collections"
-version = "2.1.1"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "4c6b649701667bbe825c3b7e6388cb521c23d88644678e83c0c4d0a621a34b43"
-dependencies = [
- "displaydoc",
- "potential_utf",
- "yoke",
- "zerofrom",
- "zerovec",
-]
-
-[[package]]
-name = "icu_locale_core"
-version = "2.1.1"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "edba7861004dd3714265b4db54a3c390e880ab658fec5f7db895fae2046b5bb6"
-dependencies = [
- "displaydoc",
- "litemap",
- "tinystr",
- "writeable",
- "zerovec",
-]
-
-[[package]]
-name = "icu_normalizer"
-version = "2.1.1"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "5f6c8828b67bf8908d82127b2054ea1b4427ff0230ee9141c54251934ab1b599"
-dependencies = [
- "icu_collections",
- "icu_normalizer_data",
- "icu_properties",
- "icu_provider",
- "smallvec",
- "zerovec",
-]
-
-[[package]]
-name = "icu_normalizer_data"
-version = "2.1.1"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "7aedcccd01fc5fe81e6b489c15b247b8b0690feb23304303a9e560f37efc560a"
-
-[[package]]
-name = "icu_properties"
-version = "2.1.2"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "020bfc02fe870ec3a66d93e677ccca0562506e5872c650f893269e08615d74ec"
-dependencies = [
- "icu_collections",
- "icu_locale_core",
- "icu_properties_data",
- "icu_provider",
- "zerotrie",
- "zerovec",
-]
-
-[[package]]
-name = "icu_properties_data"
-version = "2.1.2"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "616c294cf8d725c6afcd8f55abc17c56464ef6211f9ed59cccffe534129c77af"
-
-[[package]]
-name = "icu_provider"
-version = "2.1.1"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "85962cf0ce02e1e0a629cc34e7ca3e373ce20dda4c4d7294bbd0bf1fdb59e614"
-dependencies = [
- "displaydoc",
- "icu_locale_core",
- "writeable",
- "yoke",
- "zerofrom",
- "zerotrie",
- "zerovec",
-]
-
-[[package]]
-name = "idna"
-version = "1.1.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "3b0875f23caa03898994f6ddc501886a45c7d3d62d04d2d90788d47be1b1e4de"
-dependencies = [
- "idna_adapter",
- "smallvec",
- "utf8_iter",
-]
-
-[[package]]
-name = "idna_adapter"
-version = "1.2.1"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "3acae9609540aa318d1bc588455225fb2085b9ed0c4f6bd0d9d5bcd86f1a0344"
-dependencies = [
- "icu_normalizer",
- "icu_properties",
-]
-
-[[package]]
-name = "indexmap"
-version = "2.13.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "7714e70437a7dc3ac8eb7e6f8df75fd8eb422675fc7678aff7364301092b1017"
-dependencies = [
- "equivalent",
- "hashbrown",
- "serde",
- "serde_core",
-]
-
-[[package]]
-name = "inout"
-version = "0.1.4"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "879f10e63c20629ecabbb64a8010319738c66a5cd0c29b02d63d272b03751d01"
-dependencies = [
- "block-padding",
- "generic-array",
-]
-
-[[package]]
-name = "ipnet"
-version = "2.11.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "469fb0b9cefa57e3ef31275ee7cacb78f2fdca44e4765491884a2b119d4eb130"
-
-[[package]]
-name = "iri-string"
-version = "0.7.10"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "c91338f0783edbd6195decb37bae672fd3b165faffb89bf7b9e6942f8b1a731a"
-dependencies = [
- "memchr",
- "serde",
-]
-
-[[package]]
-name = "itoa"
-version = "1.0.17"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "92ecc6618181def0457392ccd0ee51198e065e016d1d527a7ac1b6dc7c1f09d2"
-
-[[package]]
-name = "js-sys"
-version = "0.3.85"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "8c942ebf8e95485ca0d52d97da7c5a2c387d0e7f0ba4c35e93bfcaee045955b3"
-dependencies = [
- "once_cell",
- "wasm-bindgen",
-]
-
-[[package]]
-name = "lazy_static"
-version = "1.5.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "bbd2bcb4c963f2ddae06a2efc7e9f3591312473c50c6685e1f298068316e66fe"
-
-[[package]]
-name = "libc"
-version = "0.2.180"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "bcc35a38544a891a5f7c865aca548a982ccb3b8650a5b06d0fd33a10283c56fc"
-
-[[package]]
-name = "linux-raw-sys"
-version = "0.11.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "df1d3c3b53da64cf5760482273a98e575c651a67eec7f77df96b5b642de8f039"
-
-[[package]]
-name = "litemap"
-version = "0.8.1"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "6373607a59f0be73a39b6fe456b8192fcc3585f602af20751600e974dd455e77"
-
-[[package]]
-name = "log"
-version = "0.4.29"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "5e5032e24019045c762d3c0f28f5b6b8bbf38563a65908389bf7978758920897"
-
-[[package]]
-name = "lru-slab"
-version = "0.1.2"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "112b39cec0b298b6c1999fee3e31427f74f676e4cb9879ed1a121b43661a4154"
-
-[[package]]
-name = "md-5"
-version = "0.10.6"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "d89e7ee0cfbedfc4da3340218492196241d89eefb6dab27de5df917a6d2e78cf"
-dependencies = [
- "cfg-if",
- "digest",
-]
-
-[[package]]
-name = "memchr"
-version = "2.7.6"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "f52b00d39961fc5b2736ea853c9cc86238e165017a493d1d5c8eac6bdc4cc273"
-
-[[package]]
-name = "mime"
-version = "0.3.17"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "6877bb514081ee2a7ff5ef9de3281f14a4dd4bceac4c09388074a6b5df8a139a"
-
-[[package]]
-name = "minimal-lexical"
-version = "0.2.1"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "68354c5c6bd36d73ff3feceb05efa59b6acb7626617f4962be322a825e61f79a"
-
-[[package]]
-name = "mio"
-version = "1.1.1"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "a69bcab0ad47271a0234d9422b131806bf3968021e5dc9328caf2d4cd58557fc"
-dependencies = [
- "libc",
- "wasi",
- "windows-sys 0.61.2",
-]
-
-[[package]]
-name = "nom"
-version = "7.1.3"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "d273983c5a657a70a3e8f2a01329822f3b8c8172b73826411a55751e404a0a4a"
-dependencies = [
- "memchr",
- "minimal-lexical",
-]
-
-[[package]]
-name = "num-bigint"
-version = "0.4.6"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "a5e44f723f1133c9deac646763579fdb3ac745e418f2a7af9cd0c431da1f20b9"
-dependencies = [
- "num-integer",
- "num-traits",
-]
-
-[[package]]
-name = "num-integer"
-version = "0.1.46"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "7969661fd2958a5cb096e56c8e1ad0444ac2bbcd0061bd28660485a44879858f"
-dependencies = [
- "num-traits",
-]
-
-[[package]]
-name = "num-traits"
-version = "0.2.19"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "071dfc062690e90b734c0b2273ce72ad0ffa95f0c74596bc250dcfd960262841"
-dependencies = [
- "autocfg",
-]
-
-[[package]]
-name = "once_cell"
-version = "1.21.3"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "42f5e15c9953c5e4ccceeb2e7382a716482c34515315f7b03532b8b4e8393d2d"
-
-[[package]]
-name = "opaque-debug"
-version = "0.3.1"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "c08d65885ee38876c4f86fa503fb49d7b507c2b62552df7c70b2fce627e06381"
-
-[[package]]
-name = "openssl-probe"
-version = "0.2.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "9f50d9b3dabb09ecd771ad0aa242ca6894994c130308ca3d7684634df8037391"
-
-[[package]]
-name = "password-hash"
-version = "0.5.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "346f04948ba92c43e8469c1ee6736c7563d71012b17d40745260fe106aac2166"
-dependencies = [
- "base64ct",
- "rand_core 0.6.4",
- "subtle",
-]
-
-[[package]]
-name = "percent-encoding"
-version = "2.3.2"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "9b4f627cb1b25917193a259e49bdad08f671f8d9708acfd5fe0a8c1455d87220"
-
-[[package]]
-name = "pin-project-lite"
-version = "0.2.16"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "3b3cff922bd51709b605d9ead9aa71031d81447142d828eb4a6eba76fe619f9b"
-
-[[package]]
-name = "pin-utils"
-version = "0.1.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "8b870d8c151b6f2fb93e84a13146138f05d02ed11c7e7c54f8826aaaf7c9f184"
-
-[[package]]
-name = "plain"
-version = "0.2.3"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "b4596b6d070b27117e987119b4dac604f3c58cfb0b191112e24771b2faeac1a6"
-
-[[package]]
-name = "poly1305"
-version = "0.8.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "8159bd90725d2df49889a078b54f4f79e87f1f8a8444194cdca81d38f5393abf"
-dependencies = [
- "cpufeatures",
- "opaque-debug",
- "universal-hash",
-]
-
-[[package]]
-name = "potential_utf"
-version = "0.1.4"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "b73949432f5e2a09657003c25bca5e19a0e9c84f8058ca374f49e0ebe605af77"
-dependencies = [
- "zerovec",
-]
-
-[[package]]
-name = "ppv-lite86"
-version = "0.2.21"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "85eae3c4ed2f50dcfe72643da4befc30deadb458a9b590d720cde2f2b1e97da9"
-dependencies = [
- "zerocopy",
-]
-
-[[package]]
-name = "proc-macro2"
-version = "1.0.105"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "535d180e0ecab6268a3e718bb9fd44db66bbbc256257165fc699dadf70d16fe7"
-dependencies = [
- "unicode-ident",
-]
-
-[[package]]
-name = "quinn"
-version = "0.11.9"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "b9e20a958963c291dc322d98411f541009df2ced7b5a4f2bd52337638cfccf20"
-dependencies = [
- "bytes",
- "cfg_aliases",
- "pin-project-lite",
- "quinn-proto",
- "quinn-udp",
- "rustc-hash",
- "rustls",
- "socket2",
- "thiserror 2.0.17",
- "tokio",
- "tracing",
- "web-time",
-]
-
-[[package]]
-name = "quinn-proto"
-version = "0.11.13"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "f1906b49b0c3bc04b5fe5d86a77925ae6524a19b816ae38ce1e426255f1d8a31"
-dependencies = [
- "bytes",
- "getrandom 0.3.4",
- "lru-slab",
- "rand",
- "ring",
- "rustc-hash",
- "rustls",
- "rustls-pki-types",
- "slab",
- "thiserror 2.0.17",
- "tinyvec",
- "tracing",
- "web-time",
-]
-
-[[package]]
-name = "quinn-udp"
-version = "0.5.14"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "addec6a0dcad8a8d96a771f815f0eaf55f9d1805756410b39f5fa81332574cbd"
-dependencies = [
- "cfg_aliases",
- "libc",
- "once_cell",
- "socket2",
- "tracing",
- "windows-sys 0.60.2",
-]
-
-[[package]]
-name = "quote"
-version = "1.0.43"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "dc74d9a594b72ae6656596548f56f667211f8a97b3d4c3d467150794690dc40a"
-dependencies = [
- "proc-macro2",
-]
-
-[[package]]
-name = "r-efi"
-version = "5.3.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "69cdb34c158ceb288df11e18b4bd39de994f6657d83847bdffdbd7f346754b0f"
-
-[[package]]
-name = "rand"
-version = "0.9.2"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "6db2770f06117d490610c7488547d543617b21bfa07796d7a12f6f1bd53850d1"
-dependencies = [
- "rand_chacha",
- "rand_core 0.9.5",
-]
-
-[[package]]
-name = "rand_chacha"
-version = "0.9.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "d3022b5f1df60f26e1ffddd6c66e8aa15de382ae63b3a0c1bfc0e4d3e3f325cb"
-dependencies = [
- "ppv-lite86",
- "rand_core 0.9.5",
-]
-
-[[package]]
-name = "rand_core"
-version = "0.6.4"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "ec0be4795e2f6a28069bec0b5ff3e2ac9bafc99e6a9a7dc3547996c5c816922c"
-dependencies = [
- "getrandom 0.2.17",
-]
-
-[[package]]
-name = "rand_core"
-version = "0.9.5"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "76afc826de14238e6e8c374ddcc1fa19e374fd8dd986b0d2af0d02377261d83c"
-dependencies = [
- "getrandom 0.3.4",
-]
-
-[[package]]
-name = "reqwest"
-version = "0.12.28"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "eddd3ca559203180a307f12d114c268abf583f59b03cb906fd0b3ff8646c1147"
-dependencies = [
- "base64",
- "bytes",
- "encoding_rs",
- "futures-core",
- "h2",
- "http",
- "http-body",
- "http-body-util",
- "hyper",
- "hyper-rustls",
- "hyper-util",
- "js-sys",
- "log",
- "mime",
- "percent-encoding",
- "pin-project-lite",
- "quinn",
- "rustls",
- "rustls-native-certs",
- "rustls-pki-types",
- "serde",
- "serde_json",
- "serde_urlencoded",
- "sync_wrapper",
- "tokio",
- "tokio-rustls",
- "tower",
- "tower-http",
- "tower-service",
- "url",
- "wasm-bindgen",
- "wasm-bindgen-futures",
- "web-sys",
-]
-
-[[package]]
-name = "ring"
-version = "0.17.14"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "a4689e6c2294d81e88dc6261c768b63bc4fcdb852be6d1352498b114f61383b7"
-dependencies = [
- "cc",
- "cfg-if",
- "getrandom 0.2.17",
- "libc",
- "untrusted",
- "windows-sys 0.52.0",
-]
-
-[[package]]
-name = "rustc-hash"
-version = "2.1.1"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "357703d41365b4b27c590e3ed91eabb1b663f07c4c084095e60cbed4362dff0d"
-
-[[package]]
-name = "rustc_version"
-version = "0.4.1"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "cfcb3a22ef46e85b45de6ee7e79d063319ebb6594faafcf1c225ea92ab6e9b92"
-dependencies = [
- "semver",
-]
-
-[[package]]
-name = "rustix"
-version = "1.1.3"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "146c9e247ccc180c1f61615433868c99f3de3ae256a30a43b49f67c2d9171f34"
-dependencies = [
- "bitflags",
- "errno",
- "libc",
- "linux-raw-sys",
- "windows-sys 0.61.2",
-]
-
-[[package]]
-name = "rustls"
-version = "0.23.36"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "c665f33d38cea657d9614f766881e4d510e0eda4239891eea56b4cadcf01801b"
-dependencies = [
- "once_cell",
- "ring",
- "rustls-pki-types",
- "rustls-webpki",
- "subtle",
- "zeroize",
-]
-
-[[package]]
-name = "rustls-native-certs"
-version = "0.8.3"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "612460d5f7bea540c490b2b6395d8e34a953e52b491accd6c86c8164c5932a63"
-dependencies = [
- "openssl-probe",
- "rustls-pki-types",
- "schannel",
- "security-framework",
-]
-
-[[package]]
-name = "rustls-pki-types"
-version = "1.14.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "be040f8b0a225e40375822a563fa9524378b9d63112f53e19ffff34df5d33fdd"
-dependencies = [
- "web-time",
- "zeroize",
-]
-
-[[package]]
-name = "rustls-webpki"
-version = "0.103.9"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "d7df23109aa6c1567d1c575b9952556388da57401e4ace1d15f79eedad0d8f53"
-dependencies = [
- "ring",
- "rustls-pki-types",
- "untrusted",
-]
-
-[[package]]
-name = "rustversion"
-version = "1.0.22"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "b39cdef0fa800fc44525c84ccb54a029961a8215f9619753635a9c0d2538d46d"
-
-[[package]]
-name = "ryu"
-version = "1.0.22"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "a50f4cf475b65d88e057964e0e9bb1f0aa9bbb2036dc65c64596b42932536984"
-
-[[package]]
-name = "salsa20"
-version = "0.10.2"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "97a22f5af31f73a954c10289c93e8a50cc23d971e80ee446f1f6f7137a088213"
-dependencies = [
- "cipher",
-]
-
-[[package]]
-name = "schannel"
-version = "0.1.28"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "891d81b926048e76efe18581bf793546b4c0eaf8448d72be8de2bbee5fd166e1"
-dependencies = [
- "windows-sys 0.61.2",
-]
-
-[[package]]
-name = "scroll"
-version = "0.12.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "6ab8598aa408498679922eff7fa985c25d58a90771bd6be794434c5277eab1a6"
-dependencies = [
- "scroll_derive",
-]
-
-[[package]]
-name = "scroll_derive"
-version = "0.12.1"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "1783eabc414609e28a5ba76aee5ddd52199f7107a0b24c2e9746a1ecc34a683d"
-dependencies = [
- "proc-macro2",
- "quote",
- "syn",
-]
-
-[[package]]
-name = "security-framework"
-version = "3.5.1"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "b3297343eaf830f66ede390ea39da1d462b6b0c1b000f420d0a83f898bbbe6ef"
-dependencies = [
- "bitflags",
- "core-foundation 0.10.1",
- "core-foundation-sys",
- "libc",
- "security-framework-sys",
-]
-
-[[package]]
-name = "security-framework-sys"
-version = "2.15.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "cc1f0cbffaac4852523ce30d8bd3c5cdc873501d96ff467ca09b6767bb8cd5c0"
-dependencies = [
- "core-foundation-sys",
- "libc",
-]
-
-[[package]]
-name = "semver"
-version = "1.0.27"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "d767eb0aabc880b29956c35734170f26ed551a859dbd361d140cdbeca61ab1e2"
-dependencies = [
- "serde",
- "serde_core",
-]
-
-[[package]]
-name = "serde"
-version = "1.0.228"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "9a8e94ea7f378bd32cbbd37198a4a91436180c5bb472411e48b5ec2e2124ae9e"
-dependencies = [
- "serde_core",
- "serde_derive",
-]
-
-[[package]]
-name = "serde_core"
-version = "1.0.228"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "41d385c7d4ca58e59fc732af25c3983b67ac852c1a25000afe1175de458b67ad"
-dependencies = [
- "serde_derive",
-]
-
-[[package]]
-name = "serde_derive"
-version = "1.0.228"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "d540f220d3187173da220f885ab66608367b6574e925011a9353e4badda91d79"
-dependencies = [
- "proc-macro2",
- "quote",
- "syn",
-]
-
-[[package]]
-name = "serde_json"
-version = "1.0.149"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "83fc039473c5595ace860d8c4fafa220ff474b3fc6bfdb4293327f1a37e94d86"
-dependencies = [
- "itoa",
- "memchr",
- "serde",
- "serde_core",
- "zmij",
-]
-
-[[package]]
-name = "serde_spanned"
-version = "1.0.4"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "f8bbf91e5a4d6315eee45e704372590b30e260ee83af6639d64557f51b067776"
-dependencies = [
- "serde_core",
-]
-
-[[package]]
-name = "serde_urlencoded"
-version = "0.7.1"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "d3491c14715ca2294c4d6a88f15e84739788c1d030eed8c110436aafdaa2f3fd"
-dependencies = [
- "form_urlencoded",
- "itoa",
- "ryu",
- "serde",
-]
-
-[[package]]
-name = "sha2"
-version = "0.10.9"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "a7507d819769d01a365ab707794a4084392c824f54a7a6a7862f8c3d0892b283"
-dependencies = [
- "cfg-if",
- "cpufeatures",
- "digest",
-]
-
-[[package]]
-name = "shlex"
-version = "1.3.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "0fda2ff0d084019ba4d7c6f371c95d8fd75ce3524c3cb8fb653a3023f6323e64"
-
-[[package]]
-name = "siphasher"
-version = "1.0.1"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "56199f7ddabf13fe5074ce809e7d3f42b42ae711800501b5b16ea82ad029c39d"
-
-[[package]]
-name = "slab"
-version = "0.4.11"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "7a2ae44ef20feb57a68b23d846850f861394c2e02dc425a50098ae8c90267589"
-
-[[package]]
-name = "smallvec"
-version = "1.15.1"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "67b1b7a3b5fe4f1376887184045fcf45c69e92af734b7aaddc05fb777b6fbd03"
-
-[[package]]
-name = "smawk"
-version = "0.3.2"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "b7c388c1b5e93756d0c740965c41e8822f866621d41acbdf6336a6a168f8840c"
-
-[[package]]
-name = "socket2"
-version = "0.6.1"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "17129e116933cf371d018bb80ae557e889637989d8638274fb25622827b03881"
-dependencies = [
- "libc",
- "windows-sys 0.60.2",
-]
-
-[[package]]
-name = "srp"
-version = "0.6.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "4cdd40049b29ab1315ccba7ffcf1eece8162982eab14edfac3cf2c2ffab18193"
-dependencies = [
- "digest",
- "generic-array",
- "lazy_static",
- "num-bigint",
- "subtle",
-]
-
-[[package]]
-name = "stable_deref_trait"
-version = "1.2.1"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "6ce2be8dc25455e1f91df71bfa12ad37d7af1092ae736f3a6cd0e37bc7810596"
-
-[[package]]
-name = "static_assertions"
-version = "1.1.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "a2eb9349b6444b326872e140eb1cf5e7c522154d69e7a0ffb0fb81c06b37543f"
-
-[[package]]
-name = "subtle"
-version = "2.6.1"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "13c2bddecc57b384dee18652358fb23172facb8a2c51ccc10d74c157bdea3292"
-
-[[package]]
-name = "syn"
-version = "2.0.114"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "d4d107df263a3013ef9b1879b0df87d706ff80f65a86ea879bd9c31f9b307c2a"
-dependencies = [
- "proc-macro2",
- "quote",
- "unicode-ident",
-]
-
-[[package]]
-name = "sync_wrapper"
-version = "1.0.2"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "0bf256ce5efdfa370213c1dabab5935a12e49f2c58d15e9eac2870d3b4f27263"
-dependencies = [
- "futures-core",
-]
-
-[[package]]
-name = "synstructure"
-version = "0.13.2"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "728a70f3dbaf5bab7f0c4b1ac8d7ae5ea60a4b5549c8a5914361c99147a709d2"
-dependencies = [
- "proc-macro2",
- "quote",
- "syn",
-]
-
-[[package]]
-name = "system-configuration"
-version = "0.6.1"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "3c879d448e9d986b661742763247d3693ed13609438cf3d006f51f5368a5ba6b"
-dependencies = [
- "bitflags",
- "core-foundation 0.9.4",
- "system-configuration-sys",
-]
-
-[[package]]
-name = "system-configuration-sys"
-version = "0.6.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "8e1d1b10ced5ca923a1fcb8d03e96b8d3268065d724548c0211415ff6ac6bac4"
-dependencies = [
- "core-foundation-sys",
- "libc",
-]
-
-[[package]]
-name = "tempfile"
-version = "3.24.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "655da9c7eb6305c55742045d5a8d2037996d61d8de95806335c7c86ce0f82e9c"
-dependencies = [
- "fastrand",
- "getrandom 0.3.4",
- "once_cell",
- "rustix",
- "windows-sys 0.61.2",
-]
-
-[[package]]
-name = "textwrap"
-version = "0.16.2"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "c13547615a44dc9c452a8a534638acdf07120d4b6847c8178705da06306a3057"
-dependencies = [
- "smawk",
-]
-
-[[package]]
-name = "thiserror"
-version = "1.0.69"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "b6aaf5339b578ea85b50e080feb250a3e8ae8cfcdff9a461c9ec2904bc923f52"
-dependencies = [
- "thiserror-impl 1.0.69",
-]
-
-[[package]]
-name = "thiserror"
-version = "2.0.17"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "f63587ca0f12b72a0600bcba1d40081f830876000bb46dd2337a3051618f4fc8"
-dependencies = [
- "thiserror-impl 2.0.17",
-]
-
-[[package]]
-name = "thiserror-impl"
-version = "1.0.69"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "4fee6c4efc90059e10f81e6d42c60a18f76588c3d74cb83a0b242a2b6c7504c1"
-dependencies = [
- "proc-macro2",
- "quote",
- "syn",
-]
-
-[[package]]
-name = "thiserror-impl"
-version = "2.0.17"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "3ff15c8ecd7de3849db632e14d18d2571fa09dfc5ed93479bc4485c7a517c913"
-dependencies = [
- "proc-macro2",
- "quote",
- "syn",
-]
-
-[[package]]
-name = "tinystr"
-version = "0.8.2"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "42d3e9c45c09de15d06dd8acf5f4e0e399e85927b7f00711024eb7ae10fa4869"
-dependencies = [
- "displaydoc",
- "zerovec",
-]
-
-[[package]]
-name = "tinyvec"
-version = "1.10.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "bfa5fdc3bce6191a1dbc8c02d5c8bffcf557bafa17c124c5264a458f1b0613fa"
-dependencies = [
- "tinyvec_macros",
-]
-
-[[package]]
-name = "tinyvec_macros"
-version = "0.1.1"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "1f3ccbac311fea05f86f61904b462b55fb3df8837a366dfc601a0161d0532f20"
-
-[[package]]
-name = "tokio"
-version = "1.49.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "72a2903cd7736441aac9df9d7688bd0ce48edccaadf181c3b90be801e81d3d86"
-dependencies = [
- "bytes",
- "libc",
- "mio",
- "pin-project-lite",
- "socket2",
- "windows-sys 0.61.2",
-]
-
-[[package]]
-name = "tokio-rustls"
-version = "0.26.4"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "1729aa945f29d91ba541258c8df89027d5792d85a8841fb65e8bf0f4ede4ef61"
-dependencies = [
- "rustls",
- "tokio",
-]
-
-[[package]]
-name = "tokio-util"
-version = "0.7.18"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "9ae9cec805b01e8fc3fd2fe289f89149a9b66dd16786abd8b19cfa7b48cb0098"
-dependencies = [
- "bytes",
- "futures-core",
- "futures-sink",
- "pin-project-lite",
- "tokio",
-]
-
-[[package]]
-name = "toml"
-version = "0.9.11+spec-1.1.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "f3afc9a848309fe1aaffaed6e1546a7a14de1f935dc9d89d32afd9a44bab7c46"
-dependencies = [
- "indexmap",
- "serde_core",
- "serde_spanned",
- "toml_datetime",
- "toml_parser",
- "toml_writer",
- "winnow",
-]
-
-[[package]]
-name = "toml_datetime"
-version = "0.7.5+spec-1.1.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "92e1cfed4a3038bc5a127e35a2d360f145e1f4b971b551a2ba5fd7aedf7e1347"
-dependencies = [
- "serde_core",
-]
-
-[[package]]
-name = "toml_parser"
-version = "1.0.6+spec-1.1.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "a3198b4b0a8e11f09dd03e133c0280504d0801269e9afa46362ffde1cbeebf44"
-dependencies = [
- "winnow",
-]
-
-[[package]]
-name = "toml_writer"
-version = "1.0.6+spec-1.1.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "ab16f14aed21ee8bfd8ec22513f7287cd4a91aa92e44edfe2c17ddd004e92607"
-
-[[package]]
-name = "tower"
-version = "0.5.3"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "ebe5ef63511595f1344e2d5cfa636d973292adc0eec1f0ad45fae9f0851ab1d4"
-dependencies = [
- "futures-core",
- "futures-util",
- "pin-project-lite",
- "sync_wrapper",
- "tokio",
- "tower-layer",
- "tower-service",
-]
-
-[[package]]
-name = "tower-http"
-version = "0.6.8"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "d4e6559d53cc268e5031cd8429d05415bc4cb4aefc4aa5d6cc35fbf5b924a1f8"
-dependencies = [
- "bitflags",
- "bytes",
- "futures-util",
- "http",
- "http-body",
- "iri-string",
- "pin-project-lite",
- "tower",
- "tower-layer",
- "tower-service",
-]
-
-[[package]]
-name = "tower-layer"
-version = "0.3.3"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "121c2a6cda46980bb0fcd1647ffaf6cd3fc79a013de288782836f6df9c48780e"
-
-[[package]]
-name = "tower-service"
-version = "0.3.3"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "8df9b6e13f2d32c91b9bd719c00d1958837bc7dec474d94952798cc8e69eeec3"
-
-[[package]]
-name = "tracing"
-version = "0.1.44"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "63e71662fa4b2a2c3a26f570f037eb95bb1f85397f3cd8076caed2f026a6d100"
-dependencies = [
- "pin-project-lite",
- "tracing-core",
-]
-
-[[package]]
-name = "tracing-core"
-version = "0.1.36"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "db97caf9d906fbde555dd62fa95ddba9eecfd14cb388e4f491a66d74cd5fb79a"
-dependencies = [
- "once_cell",
-]
-
-[[package]]
-name = "try-lock"
-version = "0.2.5"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "e421abadd41a4225275504ea4d6566923418b7f05506fbc9c0fe86ba7396114b"
-
-[[package]]
-name = "typenum"
-version = "1.19.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "562d481066bde0658276a35467c4af00bdc6ee726305698a55b86e61d7ad82bb"
-
-[[package]]
-name = "unicode-ident"
-version = "1.0.22"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "9312f7c4f6ff9069b165498234ce8be658059c6728633667c526e27dc2cf1df5"
-
-[[package]]
-name = "uniffi"
-version = "0.31.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "b8c6dec3fc6645f71a16a3fa9ff57991028153bd194ca97f4b55e610c73ce66a"
-dependencies = [
- "anyhow",
- "cargo_metadata",
- "uniffi_bindgen",
- "uniffi_build",
- "uniffi_core",
- "uniffi_macros",
- "uniffi_pipeline",
-]
-
-[[package]]
-name = "uniffi_bindgen"
-version = "0.31.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "4ed0150801958d4825da56a41c71f000a457ac3a4613fa9647df78ac4b6b6881"
-dependencies = [
- "anyhow",
- "askama",
- "camino",
- "cargo_metadata",
- "fs-err",
- "glob",
- "goblin",
- "heck",
- "indexmap",
- "once_cell",
- "serde",
- "tempfile",
- "textwrap",
- "toml",
- "uniffi_internal_macros",
- "uniffi_meta",
- "uniffi_pipeline",
- "uniffi_udl",
-]
-
-[[package]]
-name = "uniffi_build"
-version = "0.31.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "b78fd9271a4c2e85bd2c266c5a9ede1fac676eb39fd77f636c27eaf67426fd5f"
-dependencies = [
- "anyhow",
- "camino",
- "uniffi_bindgen",
-]
-
-[[package]]
-name = "uniffi_core"
-version = "0.31.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "b0ef62e69762fbb9386dcb6c87cd3dd05d525fa8a3a579a290892e60ddbda47e"
-dependencies = [
- "anyhow",
- "bytes",
- "once_cell",
- "static_assertions",
-]
-
-[[package]]
-name = "uniffi_internal_macros"
-version = "0.31.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "98f51ebca0d9a4b2aa6c644d5ede45c56f73906b96403c08a1985e75ccb64a01"
-dependencies = [
- "anyhow",
- "indexmap",
- "proc-macro2",
- "quote",
- "syn",
-]
-
-[[package]]
-name = "uniffi_macros"
-version = "0.31.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "db9d12529f1223d014fd501e5f29ca0884d15d6ed5ddddd9f506e55350327dc3"
-dependencies = [
- "camino",
- "fs-err",
- "once_cell",
- "proc-macro2",
- "quote",
- "serde",
- "syn",
- "toml",
- "uniffi_meta",
-]
-
-[[package]]
-name = "uniffi_meta"
-version = "0.31.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "9df6d413db2827c68588f8149d30d49b71d540d46539e435b23a7f7dbd4d4f86"
-dependencies = [
- "anyhow",
- "siphasher",
- "uniffi_internal_macros",
- "uniffi_pipeline",
-]
-
-[[package]]
-name = "uniffi_pipeline"
-version = "0.31.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "a806dddc8208f22efd7e95a5cdf88ed43d0f3271e8f63b47e757a8bbdb43b63a"
-dependencies = [
- "anyhow",
- "heck",
- "indexmap",
- "tempfile",
- "uniffi_internal_macros",
-]
-
-[[package]]
-name = "uniffi_udl"
-version = "0.31.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "0d1a7339539bf6f6fa3e9b534dece13f778bda2d54b1a6d4e40b4d6090ac26e7"
-dependencies = [
- "anyhow",
- "textwrap",
- "uniffi_meta",
- "weedle2",
-]
-
-[[package]]
-name = "universal-hash"
-version = "0.5.1"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "fc1de2c688dc15305988b563c3854064043356019f97a4b46276fe734c4f07ea"
-dependencies = [
- "crypto-common",
- "subtle",
-]
-
-[[package]]
-name = "untrusted"
-version = "0.9.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "8ecb6da28b8a351d773b68d5825ac39017e680750f980f3a1a85cd8dd28a47c1"
-
-[[package]]
-name = "url"
-version = "2.5.8"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "ff67a8a4397373c3ef660812acab3268222035010ab8680ec4215f38ba3d0eed"
-dependencies = [
- "form_urlencoded",
- "idna",
- "percent-encoding",
- "serde",
-]
-
-[[package]]
-name = "utf8_iter"
-version = "1.0.4"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "b6c140620e7ffbb22c2dee59cafe6084a59b5ffc27a8859a5f0d494b5d52b6be"
-
-[[package]]
-name = "version_check"
-version = "0.9.5"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "0b928f33d975fc6ad9f86c8f283853ad26bdd5b10b7f1542aa2fa15e2289105a"
-
-[[package]]
-name = "want"
-version = "0.3.1"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "bfa7760aed19e106de2c7c0b581b509f2f25d3dacaf737cb82ac61bc6d760b0e"
-dependencies = [
- "try-lock",
-]
-
-[[package]]
-name = "wasi"
-version = "0.11.1+wasi-snapshot-preview1"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "ccf3ec651a847eb01de73ccad15eb7d99f80485de043efb2f370cd654f4ea44b"
-
-[[package]]
-name = "wasip2"
-version = "1.0.2+wasi-0.2.9"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "9517f9239f02c069db75e65f174b3da828fe5f5b945c4dd26bd25d89c03ebcf5"
-dependencies = [
- "wit-bindgen",
-]
-
-[[package]]
-name = "wasm-bindgen"
-version = "0.2.108"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "64024a30ec1e37399cf85a7ffefebdb72205ca1c972291c51512360d90bd8566"
-dependencies = [
- "cfg-if",
- "once_cell",
- "rustversion",
- "wasm-bindgen-macro",
- "wasm-bindgen-shared",
-]
-
-[[package]]
-name = "wasm-bindgen-futures"
-version = "0.4.58"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "70a6e77fd0ae8029c9ea0063f87c46fde723e7d887703d74ad2616d792e51e6f"
-dependencies = [
- "cfg-if",
- "futures-util",
- "js-sys",
- "once_cell",
- "wasm-bindgen",
- "web-sys",
-]
-
-[[package]]
-name = "wasm-bindgen-macro"
-version = "0.2.108"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "008b239d9c740232e71bd39e8ef6429d27097518b6b30bdf9086833bd5b6d608"
-dependencies = [
- "quote",
- "wasm-bindgen-macro-support",
-]
-
-[[package]]
-name = "wasm-bindgen-macro-support"
-version = "0.2.108"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "5256bae2d58f54820e6490f9839c49780dff84c65aeab9e772f15d5f0e913a55"
-dependencies = [
- "bumpalo",
- "proc-macro2",
- "quote",
- "syn",
- "wasm-bindgen-shared",
-]
-
-[[package]]
-name = "wasm-bindgen-shared"
-version = "0.2.108"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "1f01b580c9ac74c8d8f0c0e4afb04eeef2acf145458e52c03845ee9cd23e3d12"
-dependencies = [
- "unicode-ident",
-]
-
-[[package]]
-name = "web-sys"
-version = "0.3.85"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "312e32e551d92129218ea9a2452120f4aabc03529ef03e4d0d82fb2780608598"
-dependencies = [
- "js-sys",
- "wasm-bindgen",
-]
-
-[[package]]
-name = "web-time"
-version = "1.1.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "5a6580f308b1fad9207618087a65c04e7a10bc77e02c8e84e9b00dd4b12fa0bb"
-dependencies = [
- "js-sys",
- "wasm-bindgen",
-]
-
-[[package]]
-name = "weedle2"
-version = "5.0.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "998d2c24ec099a87daf9467808859f9d82b61f1d9c9701251aea037f514eae0e"
-dependencies = [
- "nom",
-]
-
-[[package]]
-name = "windows-link"
-version = "0.2.1"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "f0805222e57f7521d6a62e36fa9163bc891acd422f971defe97d64e70d0a4fe5"
-
-[[package]]
-name = "windows-registry"
-version = "0.6.1"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "02752bf7fbdcce7f2a27a742f798510f3e5ad88dbe84871e5168e2120c3d5720"
-dependencies = [
- "windows-link",
- "windows-result",
- "windows-strings",
-]
-
-[[package]]
-name = "windows-result"
-version = "0.4.1"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "7781fa89eaf60850ac3d2da7af8e5242a5ea78d1a11c49bf2910bb5a73853eb5"
-dependencies = [
- "windows-link",
-]
-
-[[package]]
-name = "windows-strings"
-version = "0.5.1"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "7837d08f69c77cf6b07689544538e017c1bfcf57e34b4c0ff58e6c2cd3b37091"
-dependencies = [
- "windows-link",
-]
-
-[[package]]
-name = "windows-sys"
-version = "0.52.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "282be5f36a8ce781fad8c8ae18fa3f9beff57ec1b52cb3de0789201425d9a33d"
-dependencies = [
- "windows-targets 0.52.6",
-]
-
-[[package]]
-name = "windows-sys"
-version = "0.60.2"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "f2f500e4d28234f72040990ec9d39e3a6b950f9f22d3dba18416c35882612bcb"
-dependencies = [
- "windows-targets 0.53.5",
-]
-
-[[package]]
-name = "windows-sys"
-version = "0.61.2"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "ae137229bcbd6cdf0f7b80a31df61766145077ddf49416a728b02cb3921ff3fc"
-dependencies = [
- "windows-link",
-]
-
-[[package]]
-name = "windows-targets"
-version = "0.52.6"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "9b724f72796e036ab90c1021d4780d4d3d648aca59e491e6b98e725b84e99973"
-dependencies = [
- "windows_aarch64_gnullvm 0.52.6",
- "windows_aarch64_msvc 0.52.6",
- "windows_i686_gnu 0.52.6",
- "windows_i686_gnullvm 0.52.6",
- "windows_i686_msvc 0.52.6",
- "windows_x86_64_gnu 0.52.6",
- "windows_x86_64_gnullvm 0.52.6",
- "windows_x86_64_msvc 0.52.6",
-]
-
-[[package]]
-name = "windows-targets"
-version = "0.53.5"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "4945f9f551b88e0d65f3db0bc25c33b8acea4d9e41163edf90dcd0b19f9069f3"
-dependencies = [
- "windows-link",
- "windows_aarch64_gnullvm 0.53.1",
- "windows_aarch64_msvc 0.53.1",
- "windows_i686_gnu 0.53.1",
- "windows_i686_gnullvm 0.53.1",
- "windows_i686_msvc 0.53.1",
- "windows_x86_64_gnu 0.53.1",
- "windows_x86_64_gnullvm 0.53.1",
- "windows_x86_64_msvc 0.53.1",
-]
-
-[[package]]
-name = "windows_aarch64_gnullvm"
-version = "0.52.6"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "32a4622180e7a0ec044bb555404c800bc9fd9ec262ec147edd5989ccd0c02cd3"
-
-[[package]]
-name = "windows_aarch64_gnullvm"
-version = "0.53.1"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "a9d8416fa8b42f5c947f8482c43e7d89e73a173cead56d044f6a56104a6d1b53"
-
-[[package]]
-name = "windows_aarch64_msvc"
-version = "0.52.6"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "09ec2a7bb152e2252b53fa7803150007879548bc709c039df7627cabbd05d469"
-
-[[package]]
-name = "windows_aarch64_msvc"
-version = "0.53.1"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "b9d782e804c2f632e395708e99a94275910eb9100b2114651e04744e9b125006"
-
-[[package]]
-name = "windows_i686_gnu"
-version = "0.52.6"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "8e9b5ad5ab802e97eb8e295ac6720e509ee4c243f69d781394014ebfe8bbfa0b"
-
-[[package]]
-name = "windows_i686_gnu"
-version = "0.53.1"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "960e6da069d81e09becb0ca57a65220ddff016ff2d6af6a223cf372a506593a3"
-
-[[package]]
-name = "windows_i686_gnullvm"
-version = "0.52.6"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "0eee52d38c090b3caa76c563b86c3a4bd71ef1a819287c19d586d7334ae8ed66"
-
-[[package]]
-name = "windows_i686_gnullvm"
-version = "0.53.1"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "fa7359d10048f68ab8b09fa71c3daccfb0e9b559aed648a8f95469c27057180c"
-
-[[package]]
-name = "windows_i686_msvc"
-version = "0.52.6"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "240948bc05c5e7c6dabba28bf89d89ffce3e303022809e73deaefe4f6ec56c66"
-
-[[package]]
-name = "windows_i686_msvc"
-version = "0.53.1"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "1e7ac75179f18232fe9c285163565a57ef8d3c89254a30685b57d83a38d326c2"
-
-[[package]]
-name = "windows_x86_64_gnu"
-version = "0.52.6"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "147a5c80aabfbf0c7d901cb5895d1de30ef2907eb21fbbab29ca94c5b08b1a78"
-
-[[package]]
-name = "windows_x86_64_gnu"
-version = "0.53.1"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "9c3842cdd74a865a8066ab39c8a7a473c0778a3f29370b5fd6b4b9aa7df4a499"
-
-[[package]]
-name = "windows_x86_64_gnullvm"
-version = "0.52.6"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "24d5b23dc417412679681396f2b49f3de8c1473deb516bd34410872eff51ed0d"
-
-[[package]]
-name = "windows_x86_64_gnullvm"
-version = "0.53.1"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "0ffa179e2d07eee8ad8f57493436566c7cc30ac536a3379fdf008f47f6bb7ae1"
-
-[[package]]
-name = "windows_x86_64_msvc"
-version = "0.52.6"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "589f6da84c646204747d1270a2a5661ea66ed1cced2631d546fdfb155959f9ec"
-
-[[package]]
-name = "windows_x86_64_msvc"
-version = "0.53.1"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "d6bbff5f0aada427a1e5a6da5f1f98158182f26556f345ac9e04d36d0ebed650"
-
-[[package]]
-name = "winnow"
-version = "0.7.14"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "5a5364e9d77fcdeeaa6062ced926ee3381faa2ee02d3eb83a5c27a8825540829"
-dependencies = [
- "memchr",
-]
-
-[[package]]
-name = "wit-bindgen"
-version = "0.51.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "d7249219f66ced02969388cf2bb044a09756a083d0fab1e566056b04d9fbcaa5"
-
-[[package]]
-name = "writeable"
-version = "0.6.2"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "9edde0db4769d2dc68579893f2306b26c6ecfbe0ef499b013d731b7b9247e0b9"
-
-[[package]]
-name = "x25519-dalek"
-version = "2.0.1"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "c7e468321c81fb07fa7f4c636c3972b9100f0346e5b6a9f2bd0603a52f7ed277"
-dependencies = [
- "curve25519-dalek",
- "rand_core 0.6.4",
- "serde",
- "zeroize",
-]
-
-[[package]]
-name = "xsalsa20poly1305"
-version = "0.9.1"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "02a6dad357567f81cd78ee75f7c61f1b30bb2fe4390be8fb7c69e2ac8dffb6c7"
-dependencies = [
- "aead",
- "poly1305",
- "salsa20",
- "subtle",
- "zeroize",
-]
-
-[[package]]
-name = "yoke"
-version = "0.8.1"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "72d6e5c6afb84d73944e5cedb052c4680d5657337201555f9f2a16b7406d4954"
-dependencies = [
- "stable_deref_trait",
- "yoke-derive",
- "zerofrom",
-]
-
-[[package]]
-name = "yoke-derive"
-version = "0.8.1"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "b659052874eb698efe5b9e8cf382204678a0086ebf46982b79d6ca3182927e5d"
-dependencies = [
- "proc-macro2",
- "quote",
- "syn",
- "synstructure",
-]
-
-[[package]]
-name = "zerocopy"
-version = "0.8.33"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "668f5168d10b9ee831de31933dc111a459c97ec93225beb307aed970d1372dfd"
-dependencies = [
- "zerocopy-derive",
-]
-
-[[package]]
-name = "zerocopy-derive"
-version = "0.8.33"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "2c7962b26b0a8685668b671ee4b54d007a67d4eaf05fda79ac0ecf41e32270f1"
-dependencies = [
- "proc-macro2",
- "quote",
- "syn",
-]
-
-[[package]]
-name = "zerofrom"
-version = "0.1.6"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "50cc42e0333e05660c3587f3bf9d0478688e15d870fab3346451ce7f8c9fbea5"
-dependencies = [
- "zerofrom-derive",
-]
-
-[[package]]
-name = "zerofrom-derive"
-version = "0.1.6"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "d71e5d6e06ab090c67b5e44993ec16b72dcbaabc526db883a360057678b48502"
-dependencies = [
- "proc-macro2",
- "quote",
- "syn",
- "synstructure",
-]
-
-[[package]]
-name = "zeroize"
-version = "1.8.2"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "b97154e67e32c85465826e8bcc1c59429aaaf107c1e4a9e53c8d8ccd5eff88d0"
-dependencies = [
- "zeroize_derive",
-]
-
-[[package]]
-name = "zeroize_derive"
-version = "1.4.3"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "85a5b4158499876c763cb03bc4e49185d3cccbabb15b33c627f7884f43db852e"
-dependencies = [
- "proc-macro2",
- "quote",
- "syn",
-]
-
-[[package]]
-name = "zerotrie"
-version = "0.2.3"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "2a59c17a5562d507e4b54960e8569ebee33bee890c70aa3fe7b97e85a9fd7851"
-dependencies = [
- "displaydoc",
- "yoke",
- "zerofrom",
-]
-
-[[package]]
-name = "zerovec"
-version = "0.11.5"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "6c28719294829477f525be0186d13efa9a3c602f7ec202ca9e353d310fb9a002"
-dependencies = [
- "yoke",
- "zerofrom",
- "zerovec-derive",
-]
-
-[[package]]
-name = "zerovec-derive"
-version = "0.11.2"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "eadce39539ca5cb3985590102671f2567e659fca9666581ad3411d59207951f3"
-dependencies = [
- "proc-macro2",
- "quote",
- "syn",
-]
-
-[[package]]
-name = "zmij"
-version = "1.0.15"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "94f63c051f4fe3c1509da62131a678643c5b6fbdc9273b2b79d4378ebda003d2"
diff --git a/rust/uniffi/core_uniffi/Cargo.toml b/rust/uniffi/core_uniffi/Cargo.toml
deleted file mode 100644
index e4ece8704b..0000000000
--- a/rust/uniffi/core_uniffi/Cargo.toml
+++ /dev/null
@@ -1,18 +0,0 @@
-[package]
-name = "core_uniffi"
-version = "0.1.0"
-edition = "2021"
-
-[lib]
-name = "core_uniffi"
-crate-type = ["cdylib", "staticlib"]
-
-[dependencies]
-base64 = "0.22"
-once_cell = "1.19"
-thiserror = "1.0"
-uniffi = "0.31.0"
-ente-core = { path = "../../core", features = ["srp"] }
-
-[build-dependencies]
-uniffi = { version = "0.31.0", features = ["build"] }
diff --git a/rust/uniffi/core_uniffi/build.rs b/rust/uniffi/core_uniffi/build.rs
deleted file mode 100644
index 374ce75562..0000000000
--- a/rust/uniffi/core_uniffi/build.rs
+++ /dev/null
@@ -1,3 +0,0 @@
-fn main() {
- uniffi::generate_scaffolding("./src/core_uniffi.udl").unwrap();
-}
diff --git a/rust/uniffi/core_uniffi/src/core_uniffi.udl b/rust/uniffi/core_uniffi/src/core_uniffi.udl
deleted file mode 100644
index da111f0d6d..0000000000
--- a/rust/uniffi/core_uniffi/src/core_uniffi.udl
+++ /dev/null
@@ -1,60 +0,0 @@
-dictionary AuthSecrets {
- sequence<u8> master_key;
- sequence<u8> secret_key;
- sequence<u8> token;
-};
-
-dictionary KeyAttributes {
- string kek_salt;
- string encrypted_key;
- string key_decryption_nonce;
- string public_key;
- string encrypted_secret_key;
- string secret_key_decryption_nonce;
- u32? mem_limit;
- u32? ops_limit;
-};
-
-dictionary SrpAttributes {
- string srp_user_id;
- string srp_salt;
- string kek_salt;
- u32 mem_limit;
- u32 ops_limit;
- boolean is_email_mfa_enabled;
-};
-
-dictionary SrpSessionResult {
- string srp_a;
-};
-
-dictionary SrpVerifyResult {
- string srp_m1;
-};
-
-[Error]
-interface EnsuError {
- Message(string reason);
-};
-
-namespace core_uniffi {
- [Throws=EnsuError]
- void init_crypto();
-
- [Throws=EnsuError]
- SrpSessionResult srp_start(string password, SrpAttributes srp_attrs);
-
- [Throws=EnsuError]
- SrpVerifyResult srp_finish(string srp_b);
-
- void srp_clear();
-
- [Throws=EnsuError]
- AuthSecrets srp_decrypt_secrets(KeyAttributes key_attrs, string? encrypted_token, string? plain_token);
-
- [Throws=EnsuError]
- sequence<u8> derive_kek_for_login(string password, string kek_salt, u32 mem_limit, u32 ops_limit);
-
- [Throws=EnsuError]
- AuthSecrets decrypt_secrets_with_kek(sequence<u8> kek, KeyAttributes key_attrs, string? encrypted_token, string? plain_token);
-};
diff --git a/rust/uniffi/core_uniffi/src/lib.rs b/rust/uniffi/core_uniffi/src/lib.rs
deleted file mode 100644
index f60038cac5..0000000000
--- a/rust/uniffi/core_uniffi/src/lib.rs
+++ /dev/null
@@ -1,271 +0,0 @@
-use base64::{
- engine::general_purpose::{STANDARD as BASE64_STANDARD, URL_SAFE as BASE64_URL_SAFE},
- Engine,
-};
-use once_cell::sync::Lazy;
-use std::sync::{Mutex, MutexGuard};
-
-use ente_core::{auth, crypto};
-
-uniffi::include_scaffolding!("core_uniffi");
-
-#[derive(Debug, Clone, PartialEq, Eq, Hash)]
-pub struct AuthSecrets {
- pub master_key: Vec<u8>,
- pub secret_key: Vec<u8>,
- pub token: Vec<u8>,
-}
-
-#[derive(Debug, Clone, PartialEq, Eq, Hash)]
-pub struct KeyAttributes {
- pub kek_salt: String,
- pub encrypted_key: String,
- pub key_decryption_nonce: String,
- pub public_key: String,
- pub encrypted_secret_key: String,
- pub secret_key_decryption_nonce: String,
- pub mem_limit: Option<u32>,
- pub ops_limit: Option<u32>,
-}
-
-#[derive(Debug, Clone, PartialEq, Eq, Hash)]
-pub struct SrpAttributes {
- pub srp_user_id: String,
- pub srp_salt: String,
- pub kek_salt: String,
- pub mem_limit: u32,
- pub ops_limit: u32,
- pub is_email_mfa_enabled: bool,
-}
-
-#[derive(Debug, Clone, PartialEq, Eq, Hash)]
-pub struct SrpSessionResult {
- pub srp_a: String,
-}
-
-#[derive(Debug, Clone, PartialEq, Eq, Hash)]
-pub struct SrpVerifyResult {
- pub srp_m1: String,
-}
-
-#[derive(Debug, thiserror::Error)]
-pub enum EnsuError {
- #[error("{reason}")]
- Message { reason: String },
-}
-
-impl From<auth::AuthError> for EnsuError {
- fn from(err: auth::AuthError) -> Self {
- EnsuError::Message {
- reason: err.to_string(),
- }
- }
-}
-
-struct SrpState {
- session: auth::SrpSession,
- kek: crypto::SecretVec,
-}
-
-static SRP_STATE: Lazy<Mutex<Option<SrpState>>> = Lazy::new(|| Mutex::new(None));
-
-fn lock_srp_state() -> Result<MutexGuard<'static, Option<SrpState>>, EnsuError> {
- SRP_STATE.lock().map_err(|_| EnsuError::Message {
- reason: "SRP state lock poisoned".to_string(),
- })
-}
-
-fn to_core_key_attrs(attrs: &KeyAttributes) -> auth::KeyAttributes {
- auth::KeyAttributes {
- kek_salt: attrs.kek_salt.clone(),
- encrypted_key: attrs.encrypted_key.clone(),
- key_decryption_nonce: attrs.key_decryption_nonce.clone(),
- public_key: attrs.public_key.clone(),
- encrypted_secret_key: attrs.encrypted_secret_key.clone(),
- secret_key_decryption_nonce: attrs.secret_key_decryption_nonce.clone(),
- mem_limit: attrs.mem_limit,
- ops_limit: attrs.ops_limit,
- master_key_encrypted_with_recovery_key: None,
- master_key_decryption_nonce: None,
- recovery_key_encrypted_with_master_key: None,
- recovery_key_decryption_nonce: None,
- }
-}
-
-fn to_core_srp_attrs(attrs: &SrpAttributes) -> auth::SrpAttributes {
- auth::SrpAttributes {
- srp_user_id: attrs.srp_user_id.clone(),
- srp_salt: attrs.srp_salt.clone(),
- mem_limit: attrs.mem_limit,
- ops_limit: attrs.ops_limit,
- kek_salt: attrs.kek_salt.clone(),
- is_email_mfa_enabled: attrs.is_email_mfa_enabled,
- }
-}
-
-fn secrets_from_login_result(result: auth::LoginResult) -> AuthSecrets {
- AuthSecrets {
- master_key: result.master_key,
- secret_key: result.secret_key,
- token: result.token,
- }
-}
-
-fn secrets_from_decrypted(result: auth::DecryptedSecrets) -> AuthSecrets {
- AuthSecrets {
- master_key: result.master_key,
- secret_key: result.secret_key,
- token: result.token,
- }
-}
-
-fn decode_token(token: &str) -> Result<Vec<u8>, EnsuError> {
- // Tokens are generated by the server as base64 URL-safe with padding
- // (Go's base64.URLEncoding). Older tokens might still be standard base64.
- BASE64_URL_SAFE
- .decode(token)
- .or_else(|_| BASE64_STANDARD.decode(token))
- .map_err(|e| EnsuError::Message {
- reason: format!("token: {}", e),
- })
-}
-
-pub fn init_crypto() -> Result<(), EnsuError> {
- crypto::init().map_err(|e| EnsuError::Message {
- reason: e.to_string(),
- })
-}
-
-pub fn srp_start(
- password: String,
- srp_attrs: SrpAttributes,
-) -> Result<SrpSessionResult, EnsuError> {
- let srp_attrs_core = to_core_srp_attrs(&srp_attrs);
- let creds = auth::derive_srp_credentials(&password, &srp_attrs_core)?;
-
- let srp_salt = crypto::decode_b64(&srp_attrs.srp_salt).map_err(|e| EnsuError::Message {
- reason: format!("srp_salt: {}", e),
- })?;
-
- let session = auth::SrpSession::new(&srp_attrs.srp_user_id, &srp_salt, &creds.login_key)?;
- let srp_a = crypto::encode_b64(&session.public_a());
-
- let mut guard = lock_srp_state()?;
- if guard.is_some() {
- return Err(EnsuError::Message {
- reason:
- "SRP session already initialized. Call srp_clear() before starting a new session"
- .to_string(),
- });
- }
-
- *guard = Some(SrpState {
- session,
- kek: crypto::SecretVec::new(creds.kek),
- });
-
- Ok(SrpSessionResult { srp_a })
-}
-
-pub fn srp_finish(srp_b: String) -> Result<SrpVerifyResult, EnsuError> {
- let mut guard = lock_srp_state()?;
- let state = guard.as_mut().ok_or_else(|| EnsuError::Message {
- reason: "SRP session not initialized".to_string(),
- })?;
-
- let srp_b_bytes = crypto::decode_b64(&srp_b).map_err(|e| EnsuError::Message {
- reason: format!("srp_b: {}", e),
- })?;
-
- let srp_m1 = state.session.compute_m1(&srp_b_bytes)?;
- let srp_m1 = crypto::encode_b64(&srp_m1);
-
- Ok(SrpVerifyResult { srp_m1 })
-}
-
-pub fn srp_clear() {
- // Best-effort cleanup. Even if the lock is poisoned, we should avoid panicking.
- match SRP_STATE.lock() {
- Ok(mut guard) => {
- *guard = None;
- }
- Err(poisoned) => {
- let mut guard = poisoned.into_inner();
- *guard = None;
- }
- }
-}
-
-pub fn srp_decrypt_secrets(
- key_attrs: KeyAttributes,
- encrypted_token: Option<String>,
- plain_token: Option<String>,
-) -> Result<AuthSecrets, EnsuError> {
- // Consume the SRP state so KEK doesn't linger in memory if the caller forgets srp_clear().
- let state = {
- let mut guard = lock_srp_state()?;
- guard.take().ok_or_else(|| EnsuError::Message {
- reason: "SRP session not initialized".to_string(),
- })?
- };
-
- let core_attrs = to_core_key_attrs(&key_attrs);
-
- if let Some(token) = encrypted_token {
- let result = auth::decrypt_secrets(&state.kek, &core_attrs, &token)?;
- return Ok(secrets_from_decrypted(result));
- }
-
- if let Some(token) = plain_token {
- let (master_key, secret_key) = auth::decrypt_keys_only(&state.kek, &core_attrs)?;
- let token_bytes = decode_token(&token)?;
- return Ok(AuthSecrets {
- master_key,
- secret_key,
- token: token_bytes,
- });
- }
-
- Err(EnsuError::Message {
- reason: "Missing auth token".to_string(),
- })
-}
-
-pub fn derive_kek_for_login(
- password: String,
- kek_salt: String,
- mem_limit: u32,
- ops_limit: u32,
-) -> Result<Vec<u8>, EnsuError> {
- let kek = auth::derive_kek(&password, &kek_salt, mem_limit, ops_limit)?;
- Ok(kek)
-}
-
-pub fn decrypt_secrets_with_kek(
- kek: Vec<u8>,
- key_attrs: KeyAttributes,
- encrypted_token: Option<String>,
- plain_token: Option<String>,
-) -> Result<AuthSecrets, EnsuError> {
- let kek = crypto::SecretVec::new(kek);
- let core_attrs = to_core_key_attrs(&key_attrs);
-
- if let Some(token) = encrypted_token {
- let result = auth::decrypt_secrets_with_kek(&kek, &core_attrs, &token)?;
- return Ok(secrets_from_login_result(result));
- }
-
- if let Some(token) = plain_token {
- let (master_key, secret_key) = auth::decrypt_keys_only(&kek, &core_attrs)?;
- let token_bytes = decode_token(&token)?;
- return Ok(AuthSecrets {
- master_key,
- secret_key,
- token: token_bytes,
- });
- }
-
- Err(EnsuError::Message {
- reason: "Missing auth token".to_string(),
- })
-}
diff --git a/rust/uniffi/core_uniffi/uniffi.toml b/rust/uniffi/core_uniffi/uniffi.toml
deleted file mode 100644
index f8dded3b17..0000000000
--- a/rust/uniffi/core_uniffi/uniffi.toml
+++ /dev/null
@@ -1,2 +0,0 @@
-[bindings.kotlin]
-package_name = "io.ente.ensu.crypto"