From 6568280c6d0e03dc69c554f8bef4417fa224d978 Mon Sep 17 00:00:00 2001 From: Assaf Vayner Date: Fri, 2 May 2025 11:49:13 +0200 Subject: [PATCH 1/5] add token refresher --- cas_client/src/http_client.rs | 2 + cas_client/src/interface.rs | 5 +- data/src/migration_tool/hub_client.rs | 3 +- hf_xet/src/token_refresh.rs | 3 +- hf_xet_wasm/Cargo.lock | 64 +++++------ hf_xet_wasm/Cargo.toml | 9 +- hf_xet_wasm/examples/simple.rs | 2 +- hf_xet_wasm/src/interface.rs | 2 + hf_xet_wasm/src/interface/auth.rs | 60 +++++++++++ hf_xet_wasm/src/interface/session.rs | 101 ++++++++++++++++++ hf_xet_wasm/src/lib.rs | 9 ++ .../src/wasm_deduplication_interface.rs | 4 +- hf_xet_wasm/src/wasm_file_cleaner.rs | 5 +- hf_xet_wasm/src/wasm_file_upload_session.rs | 10 +- hf_xet_wasm/src/xorb_uploader.rs | 4 +- utils/src/auth.rs | 14 +-- 16 files changed, 240 insertions(+), 57 deletions(-) create mode 100644 hf_xet_wasm/src/interface.rs create mode 100644 hf_xet_wasm/src/interface/auth.rs create mode 100644 hf_xet_wasm/src/interface/session.rs diff --git a/cas_client/src/http_client.rs b/cas_client/src/http_client.rs index 566265f6..47cb0a9f 100644 --- a/cas_client/src/http_client.rs +++ b/cas_client/src/http_client.rs @@ -78,6 +78,7 @@ impl RetryConfig { /// Builds authenticated HTTP Client to talk to CAS. /// Includes retry middleware with exponential backoff. +#[allow(unused_variables)] pub fn build_auth_http_client( auth_config: &Option, retry_config: RetryConfig, @@ -106,6 +107,7 @@ pub fn build_auth_http_client( /// Builds HTTP Client to talk to CAS. /// Includes retry middleware with exponential backoff. +#[allow(unused_variables)] pub fn build_http_client( retry_config: RetryConfig, ) -> std::result::Result { diff --git a/cas_client/src/interface.rs b/cas_client/src/interface.rs index d4ba036b..6c1e595c 100644 --- a/cas_client/src/interface.rs +++ b/cas_client/src/interface.rs @@ -1,6 +1,7 @@ -use mdb_shard::shard_file_reconstructor::FileReconstructor; - +#[cfg(not(target_family = "wasm"))] use crate::CasClientError; +#[cfg(not(target_family = "wasm"))] +use mdb_shard::shard_file_reconstructor::FileReconstructor; /// A Client to the Shard service. The shard service /// provides for diff --git a/data/src/migration_tool/hub_client.rs b/data/src/migration_tool/hub_client.rs index 5a97aff7..04e8de13 100644 --- a/data/src/migration_tool/hub_client.rs +++ b/data/src/migration_tool/hub_client.rs @@ -78,7 +78,8 @@ pub struct HubClientTokenRefresher { pub client: Arc, } -#[async_trait] +#[cfg_attr(not(target_family = "wasm"), async_trait::async_trait)] +#[cfg_attr(target_family = "wasm", async_trait::async_trait(?Send))] impl TokenRefresher for HubClientTokenRefresher { async fn refresh(&self) -> std::result::Result { let client = self.client.clone(); diff --git a/hf_xet/src/token_refresh.rs b/hf_xet/src/token_refresh.rs index 786a219c..3665b144 100644 --- a/hf_xet/src/token_refresh.rs +++ b/hf_xet/src/token_refresh.rs @@ -49,7 +49,8 @@ impl WrappedTokenRefresher { } } -#[async_trait] +#[cfg_attr(not(target_family = "wasm"), async_trait::async_trait)] +#[cfg_attr(target_family = "wasm", async_trait::async_trait(?Send))] impl TokenRefresher for WrappedTokenRefresher { async fn refresh(&self) -> Result { Python::with_gil(|py| { diff --git a/hf_xet_wasm/Cargo.lock b/hf_xet_wasm/Cargo.lock index 929c1a1c..972fb420 100644 --- a/hf_xet_wasm/Cargo.lock +++ b/hf_xet_wasm/Cargo.lock @@ -1021,6 +1021,39 @@ dependencies = [ "libc", ] +[[package]] +name = "hf_xet_wasm" +version = "0.0.1" +dependencies = [ + "async-channel", + "async-trait", + "blake3", + "cas_client", + "cas_object", + "cas_types", + "console_error_panic_hook", + "console_log", + "deduplication", + "env_logger", + "futures", + "futures-io", + "getrandom 0.3.2", + "js-sys", + "log", + "mdb_shard", + "merkledb", + "merklehash", + "serde", + "sha2", + "thiserror 2.0.12", + "tokio", + "utils", + "wasm-bindgen", + "wasm-bindgen-futures", + "wasm_thread", + "web-sys", +] + [[package]] name = "http" version = "1.3.1" @@ -2892,37 +2925,6 @@ dependencies = [ "web-sys", ] -[[package]] -name = "wasm_xet" -version = "0.0.1" -dependencies = [ - "async-channel", - "async-trait", - "blake3", - "cas_client", - "cas_object", - "console_error_panic_hook", - "console_log", - "deduplication", - "env_logger", - "futures", - "futures-io", - "getrandom 0.3.2", - "js-sys", - "log", - "mdb_shard", - "merkledb", - "merklehash", - "sha2", - "thiserror 2.0.12", - "tokio", - "utils", - "wasm-bindgen", - "wasm-bindgen-futures", - "wasm_thread", - "web-sys", -] - [[package]] name = "web-sys" version = "0.3.77" diff --git a/hf_xet_wasm/Cargo.toml b/hf_xet_wasm/Cargo.toml index ef9c7cba..8b19b2b3 100644 --- a/hf_xet_wasm/Cargo.toml +++ b/hf_xet_wasm/Cargo.toml @@ -1,11 +1,10 @@ [package] -name = "wasm_xet" +name = "hf_xet_wasm" version = "0.0.1" edition = "2021" -#[features] -#default = ["es_modules"] -#es_modules = [] +[lib] +crate-type = ["cdylib", "rlib"] [dependencies] wasm-bindgen = "0.2.95" @@ -47,7 +46,9 @@ mdb_shard = { path = "../mdb_shard" } merkledb = { path = "../merkledb" } cas_object = { path = "../cas_object" } cas_client = { path = "../cas_client" } +cas_types = { path = "../cas_types" } utils = { path = "../utils" } +serde = { version = "1.0.217", features = ["derive"] } [package.metadata.docs.rs] diff --git a/hf_xet_wasm/examples/simple.rs b/hf_xet_wasm/examples/simple.rs index 9bcd2589..c6375f8f 100644 --- a/hf_xet_wasm/examples/simple.rs +++ b/hf_xet_wasm/examples/simple.rs @@ -142,7 +142,7 @@ pub async fn clean_file(file: web_sys::File, endpoint: String, jwt_token: String let upload_session = Arc::new(FileUploadSession::new(Arc::new(config))); - let mut handle = upload_session.start_clean(); + let mut handle = upload_session.start_clean("".to_string()); const READ_BUF_SIZE: usize = 8 * 1024 * 1024; let mut buf = vec![0u8; READ_BUF_SIZE]; diff --git a/hf_xet_wasm/src/interface.rs b/hf_xet_wasm/src/interface.rs new file mode 100644 index 00000000..c2ff86bd --- /dev/null +++ b/hf_xet_wasm/src/interface.rs @@ -0,0 +1,2 @@ +pub(crate) mod auth; +pub(crate) mod session; \ No newline at end of file diff --git a/hf_xet_wasm/src/interface/auth.rs b/hf_xet_wasm/src/interface/auth.rs new file mode 100644 index 00000000..814213b3 --- /dev/null +++ b/hf_xet_wasm/src/interface/auth.rs @@ -0,0 +1,60 @@ + +use std::fmt::{Debug, Formatter}; +use std::sync::Arc; +use tokio::sync::Mutex; +use wasm_bindgen::JsValue; +use wasm_bindgen::prelude::*; + +#[wasm_bindgen] +extern "C" { + pub type TokenInfo; + #[wasm_bindgen(method, getter)] + pub fn token(this: &TokenInfo) -> String; + #[wasm_bindgen(method, getter)] + pub fn expiration(this: &TokenInfo) -> u64; + + pub type TokenRefresher; + #[wasm_bindgen(method, catch)] + pub async fn refresh_token(this: &TokenRefresher) -> Result; +} + +/// interface TokenRefresher { +/// refresh_token(): Promise; +/// } + +impl From for utils::auth::TokenInfo { + fn from(value: TokenInfo) -> Self { + (value.token(), value.expiration()) + } +} + +impl Debug for TokenRefresher { + fn fmt(&self, f: &mut Formatter<'_>) -> std::fmt::Result { + write!(f, "TokenRefresher") + } +} + +#[derive(Debug, Clone)] +pub(crate) struct WrappedTokenRefresher(Arc>); + +unsafe impl Send for WrappedTokenRefresher {} +unsafe impl Sync for WrappedTokenRefresher {} + +impl From for WrappedTokenRefresher { + fn from(value: TokenRefresher) -> Self { + WrappedTokenRefresher(Arc::new(Mutex::new(value))) + } +} + +#[async_trait::async_trait(?Send)] +impl utils::auth::TokenRefresher for WrappedTokenRefresher { + async fn refresh(&self) -> Result { + self.0 + .lock() + .await + .refresh_token() + .await + .map(utils::auth::TokenInfo::from) + .map_err(|e| utils::errors::AuthError::token_refresh_failure(format!("{e:?}"))) + } +} diff --git a/hf_xet_wasm/src/interface/session.rs b/hf_xet_wasm/src/interface/session.rs new file mode 100644 index 00000000..73952ab6 --- /dev/null +++ b/hf_xet_wasm/src/interface/session.rs @@ -0,0 +1,101 @@ +#![allow(dead_code)] + +use std::sync::Arc; + +use cas_object::CompressionScheme; +use cas_types::HexMerkleHash; +use futures::AsyncReadExt; +use serde::{Deserialize, Serialize}; +use utils::auth::AuthConfig; +use wasm_bindgen::prelude::*; +use web_sys::Blob; + +use crate::blob_reader::BlobReader; +use crate::configurations::{DataConfig, RepoSalt, ShardConfig, TranslatorConfig}; +use crate::interface::auth::WrappedTokenRefresher; + +fn convert_error(e: impl std::error::Error) -> JsValue { + JsValue::from(format!("{e:?}")) +} + +#[derive(Debug, Clone, Serialize, Deserialize)] +struct PointerFile { + pub file_size: u64, + pub file_hash: HexMerkleHash, +} + +#[wasm_bindgen] +pub struct XetSession { + upload: Arc, +} + +#[wasm_bindgen] +impl XetSession { + #[wasm_bindgen(constructor)] + pub fn new( + endpoint: String, + token_info: super::auth::TokenInfo, + token_refresher: super::auth::TokenRefresher, + ) -> Self { + let (token, token_expiration): utils::auth::TokenInfo = token_info.into(); + let auth = AuthConfig { + token, + token_expiration, + token_refresher: Arc::new(WrappedTokenRefresher::from(token_refresher)), + }; + + let config = TranslatorConfig { + data_config: DataConfig { + endpoint, + compression: Some(CompressionScheme::LZ4), + auth: Some(auth), + prefix: "default".to_owned(), + }, + shard_config: ShardConfig { + prefix: "default-merkledb".to_owned(), + repo_salt: RepoSalt::default(), + }, + }; + let upload = crate::wasm_file_upload_session::FileUploadSession::new(Arc::new(config)); + + Self { + upload: Arc::new(upload), + } + } + + #[wasm_bindgen(js_name = "uploadFileFromRawData")] + pub async fn upload_file_from_raw(&self, tracker_id: String, file: Vec) -> Result<(), JsValue> { + let blob = Blob::new_with_u8_array_sequence(&js_sys::Uint8Array::from(file.as_slice()))?; + self.upload_file_from_blob(tracker_id, blob).await + } + + #[wasm_bindgen(js_name = "uploadFileFromBlob")] + pub async fn upload_file_from_blob(&self, tracker_id: String, blob: Blob) -> Result<(), JsValue> { + // read from blob async + let mut cleaner = self.upload.start_clean(tracker_id); + + let mut reader = BlobReader::new(blob)?; + + let mut buf = vec![0u8; 1024 * 10]; // 10KB buffer + + loop { + let num_read = reader.read(&mut buf).await.map_err(convert_error)?; + if num_read == 0 { + break; + } + cleaner.add_data(&buf[0..num_read]).await.map_err(convert_error)?; + } + + Ok(()) + } + + #[wasm_bindgen] + pub async fn finalize(self) -> Result<(), JsValue> { + // flush the session + self.upload + .finalize() + .await + .map_err(|e| JsValue::from_str(&format!("{:?}", e)))?; + Ok(()) + } +} diff --git a/hf_xet_wasm/src/lib.rs b/hf_xet_wasm/src/lib.rs index e3cab8c2..43e99af4 100644 --- a/hf_xet_wasm/src/lib.rs +++ b/hf_xet_wasm/src/lib.rs @@ -1,3 +1,6 @@ +#[cfg(not(target_family = "wasm"))] +compile_error!("This crate is only meant to be used on the WebAssembly target"); + pub mod blob_reader; pub mod configurations; mod errors; @@ -6,3 +9,9 @@ mod wasm_deduplication_interface; mod wasm_file_cleaner; pub mod wasm_file_upload_session; mod xorb_uploader; +mod interface; + +pub use interface::{ + auth::{TokenInfo, TokenRefresher}, + session::XetSession, +}; diff --git a/hf_xet_wasm/src/wasm_deduplication_interface.rs b/hf_xet_wasm/src/wasm_deduplication_interface.rs index 7d42ba1a..7c2a5054 100644 --- a/hf_xet_wasm/src/wasm_deduplication_interface.rs +++ b/hf_xet_wasm/src/wasm_deduplication_interface.rs @@ -84,10 +84,10 @@ impl DeduplicationDataInterface for UploadSessionDataManager { let keyed_shard = self.shard.entry(hmac_key).or_insert(MDBInMemoryShard::default()); for ci in cas_info { - keyed_shard.add_cas_block(ci); + keyed_shard.add_cas_block(ci)?; } - any_result = true; + any_result = true } } diff --git a/hf_xet_wasm/src/wasm_file_cleaner.rs b/hf_xet_wasm/src/wasm_file_cleaner.rs index 401b6d4e..a491f4a4 100644 --- a/hf_xet_wasm/src/wasm_file_cleaner.rs +++ b/hf_xet_wasm/src/wasm_file_cleaner.rs @@ -11,6 +11,8 @@ use super::wasm_file_upload_session::FileUploadSession; /// A class that encapsulates the clean and data task around a single file for wasm runtime. pub struct SingleFileCleaner { + _tracker: String, + // Common state session: Arc, @@ -25,8 +27,9 @@ pub struct SingleFileCleaner { } impl SingleFileCleaner { - pub fn new(session: Arc) -> Self { + pub fn new(session: Arc, _tracker: String) -> Self { Self { + _tracker, session: session.clone(), chunker: Chunker::default(), dedup_manager: FileDeduper::new(UploadSessionDataManager::new(session)), diff --git a/hf_xet_wasm/src/wasm_file_upload_session.rs b/hf_xet_wasm/src/wasm_file_upload_session.rs index 41201ea9..df4d3d9b 100644 --- a/hf_xet_wasm/src/wasm_file_upload_session.rs +++ b/hf_xet_wasm/src/wasm_file_upload_session.rs @@ -12,7 +12,7 @@ use tokio::sync::Mutex; use super::configurations::TranslatorConfig; use super::errors::*; use crate::wasm_file_cleaner::SingleFileCleaner; -use crate::xorb_uploader::{self, XorbUploader}; +use crate::xorb_uploader::XorbUploader; static UPLOAD_CONCURRENCY: usize = 1; @@ -58,15 +58,15 @@ impl FileUploadSession { } } - pub fn start_clean(self: &Arc) -> SingleFileCleaner { - SingleFileCleaner::new(self.clone()) + pub fn start_clean(self: &Arc, tracker: String) -> SingleFileCleaner { + SingleFileCleaner::new(self.clone(), tracker) } pub(crate) async fn register_single_file_clean_completion( self: &Arc, mut file_data: DataAggregator, - dedup_metrics: &DeduplicationMetrics, - xorbs_dependencies: Vec, + _dedup_metrics: &DeduplicationMetrics, + _xorbs_dependencies: Vec, ) -> Result<()> { // Merge in the remaining file data; uploading a new xorb if need be. { diff --git a/hf_xet_wasm/src/xorb_uploader.rs b/hf_xet_wasm/src/xorb_uploader.rs index 93559954..920c0c7f 100644 --- a/hf_xet_wasm/src/xorb_uploader.rs +++ b/hf_xet_wasm/src/xorb_uploader.rs @@ -65,7 +65,7 @@ impl XorbUploader { self.input_queues[self.index] .send(input) .await - .map_err(DataProcessingError::internal); + .map_err(DataProcessingError::internal)?; self.index = (self.index + 1) % self.workers.len(); @@ -108,7 +108,7 @@ fn upload_worker( log::info!("worker get value message, uploading"); let ret = client.put(&cas_prefix, &xorb_hash, xorb_data, chunks_and_boundaries).await; - output.send(ret).await; + let _ = output.send(ret).await; } }) }) diff --git a/utils/src/auth.rs b/utils/src/auth.rs index bf1f5956..329d008a 100644 --- a/utils/src/auth.rs +++ b/utils/src/auth.rs @@ -2,8 +2,6 @@ use std::fmt::Debug; use std::sync::Arc; use std::time::{SystemTime, UNIX_EPOCH}; -use async_trait::async_trait; - use crate::errors::AuthError; /// Helper type for information about an auth token. @@ -11,7 +9,8 @@ use crate::errors::AuthError; pub type TokenInfo = (String, u64); /// Helper to provide auth tokens to CAS. -#[async_trait] +#[cfg_attr(not(target_family = "wasm"), async_trait::async_trait)] +#[cfg_attr(target_family = "wasm", async_trait::async_trait(?Send))] pub trait TokenRefresher: Debug + Send + Sync { /// Get a new auth token for CAS and the unixtime (in seconds) for expiration async fn refresh(&self) -> Result; @@ -20,7 +19,8 @@ pub trait TokenRefresher: Debug + Send + Sync { #[derive(Debug)] pub struct NoOpTokenRefresher; -#[async_trait] +#[cfg_attr(not(target_family = "wasm"), async_trait::async_trait)] +#[cfg_attr(target_family = "wasm", async_trait::async_trait(?Send))] impl TokenRefresher for NoOpTokenRefresher { async fn refresh(&self) -> Result { Ok(("token".to_string(), 0)) @@ -30,7 +30,8 @@ impl TokenRefresher for NoOpTokenRefresher { #[derive(Debug)] pub struct ErrTokenRefresher; -#[async_trait] +#[cfg_attr(not(target_family = "wasm"), async_trait::async_trait)] +#[cfg_attr(target_family = "wasm", async_trait::async_trait(?Send))] impl TokenRefresher for ErrTokenRefresher { async fn refresh(&self) -> Result { Err(AuthError::RefreshFunctionNotCallable("Token refresh not expected".to_string())) @@ -90,7 +91,6 @@ impl TokenProvider { } pub async fn get_valid_token(&mut self) -> Result { - #[cfg(not(target_family = "wasm"))] if self.is_expired() { let (new_token, new_expiry) = self.refresher.refresh().await?; self.token = new_token; @@ -99,7 +99,7 @@ impl TokenProvider { Ok(self.token.clone()) } - #[cfg(not(target_family = "wasm"))] + // #[cfg(not(target_family = "wasm"))] fn is_expired(&self) -> bool { let cur_time = SystemTime::now() .duration_since(UNIX_EPOCH) From e4ee6e40aba065f98354d7adbcbcb4642e5027ef Mon Sep 17 00:00:00 2001 From: Assaf Vayner Date: Fri, 2 May 2025 17:14:07 +0200 Subject: [PATCH 2/5] session --- hf_xet_wasm/Cargo.lock | 8 +- hf_xet_wasm/Cargo.toml | 2 +- hf_xet_wasm/build_wasm.sh | 1 + hf_xet_wasm/examples/simple.rs | 13 +- hf_xet_wasm/examples/xet_meta.js | 140 ++++++++++----------- hf_xet_wasm/src/{interface => }/auth.rs | 2 +- hf_xet_wasm/src/interface.rs | 2 - hf_xet_wasm/src/lib.rs | 8 +- hf_xet_wasm/src/{interface => }/session.rs | 17 ++- utils/src/auth.rs | 11 +- 10 files changed, 99 insertions(+), 105 deletions(-) rename hf_xet_wasm/src/{interface => }/auth.rs (96%) delete mode 100644 hf_xet_wasm/src/interface.rs rename hf_xet_wasm/src/{interface => }/session.rs (86%) diff --git a/hf_xet_wasm/Cargo.lock b/hf_xet_wasm/Cargo.lock index 972fb420..8c6a2766 100644 --- a/hf_xet_wasm/Cargo.lock +++ b/hf_xet_wasm/Cargo.lock @@ -1367,9 +1367,9 @@ checksum = "4a5f13b858c8d314ee3e8f639011f7ccefe71f97f96e50151fb991f267928e2c" [[package]] name = "jiff" -version = "0.2.10" +version = "0.2.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5a064218214dc6a10fbae5ec5fa888d80c45d611aba169222fc272072bf7aef6" +checksum = "27e77966151130221b079bcec80f1f34a9e414fa489d99152a201c07fd2182bc" dependencies = [ "jiff-static", "log", @@ -1380,9 +1380,9 @@ dependencies = [ [[package]] name = "jiff-static" -version = "0.2.10" +version = "0.2.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "199b7932d97e325aff3a7030e141eafe7f2c6268e1d1b24859b753a627f45254" +checksum = "97265751f8a9a4228476f2fc17874a9e7e70e96b893368e42619880fe143b48a" dependencies = [ "proc-macro2", "quote", diff --git a/hf_xet_wasm/Cargo.toml b/hf_xet_wasm/Cargo.toml index 8b19b2b3..6dbdde3a 100644 --- a/hf_xet_wasm/Cargo.toml +++ b/hf_xet_wasm/Cargo.toml @@ -7,7 +7,7 @@ edition = "2021" crate-type = ["cdylib", "rlib"] [dependencies] -wasm-bindgen = "0.2.95" +wasm-bindgen = "0.2.100" wasm-bindgen-futures = "0.4.50" tokio = { version = "1.44", features = ["sync"] } futures-io = "0.3.31" diff --git a/hf_xet_wasm/build_wasm.sh b/hf_xet_wasm/build_wasm.sh index 4517e5aa..4efa5819 100755 --- a/hf_xet_wasm/build_wasm.sh +++ b/hf_xet_wasm/build_wasm.sh @@ -18,4 +18,5 @@ RUSTFLAGS='-C target-feature=+atomics,+bulk-memory,+mutable-globals --cfg getran RUSTFLAGS='--cfg getrandom_backend="wasm_js"' wasm-bindgen \ target/wasm32-unknown-unknown/release/examples/simple.wasm \ --out-dir ./examples/target/ \ + --typescript \ --target web diff --git a/hf_xet_wasm/examples/simple.rs b/hf_xet_wasm/examples/simple.rs index c6375f8f..b69b8e7c 100644 --- a/hf_xet_wasm/examples/simple.rs +++ b/hf_xet_wasm/examples/simple.rs @@ -6,9 +6,9 @@ use tokio::sync::mpsc; use utils::auth::AuthConfig; use wasm_bindgen::prelude::*; use wasm_thread as thread; -use wasm_xet::blob_reader::BlobReader; -use wasm_xet::configurations::{DataConfig, RepoSalt, ShardConfig, TranslatorConfig}; -use wasm_xet::wasm_file_upload_session::FileUploadSession; +use hf_xet_wasm::blob_reader::BlobReader; +use hf_xet_wasm::configurations::{DataConfig, RepoSalt, ShardConfig, TranslatorConfig}; +use hf_xet_wasm::wasm_file_upload_session::FileUploadSession; fn main() { #[cfg(target_arch = "wasm32")] @@ -20,7 +20,7 @@ fn main() { #[cfg(not(target_arch = "wasm32"))] env_logger::init_from_env(env_logger::Env::default().filter_or(env_logger::DEFAULT_FILTER_ENV, "info")); - log::info!("Starting init wasm_xet..."); + log::info!("Starting init hf_xet_wasm..."); log::info!("Done"); } @@ -80,7 +80,7 @@ pub async fn test_async_blob_reader(file: web_sys::File) -> String { let s: u32 = data_local.iter().map(|&x| x as u32).sum(); sum += s; } - o_tx.send(sum).await; + let _ = o_tx.send(sum).await; }) })); let Ok(()) = tx.send(data_local).await else { @@ -91,7 +91,6 @@ pub async fn test_async_blob_reader(file: web_sys::File) -> String { log::info!("data sent"); } - let mut id = inputs.len() - 1; for (id, input) in inputs.into_iter().enumerate() { log::info!("closing input {id}"); drop(input); @@ -167,7 +166,7 @@ pub async fn clean_file(file: web_sys::File, endpoint: String, jwt_token: String log::info!("processed {total_read} bytes"); } - let Ok((file_hash, metrics)) = handle.finish().await else { + let Ok((file_hash, _metrics)) = handle.finish().await else { log::info!("failed to finish cleaner"); return "".to_owned(); }; diff --git a/hf_xet_wasm/examples/xet_meta.js b/hf_xet_wasm/examples/xet_meta.js index 5703ff13..ba3d22e9 100644 --- a/hf_xet_wasm/examples/xet_meta.js +++ b/hf_xet_wasm/examples/xet_meta.js @@ -1,90 +1,90 @@ function xetMetadataOrNone(jsonData) { - /** - * Extract XET metadata from the HTTP body or return null if not found. - * - * @param {jsonData} - HTTP body in JSON to extract the XET metadata from. - * @returns {XetMetadata|null} The extracted metadata or null if missing. - */ + /** + * Extract XET metadata from the HTTP body or return null if not found. + * + * @param {jsonData} - HTTP body in JSON to extract the XET metadata from. + * @returns {XetMetadata|null} The extracted metadata or null if missing. + */ - const xetEndpoint = jsonData.casUrl; - const accessToken = jsonData.accessToken; - const expiration = jsonData.exp; + const xetEndpoint = jsonData.casUrl; + const accessToken = jsonData.accessToken; + const expiration = jsonData.exp; - if (xetEndpoint == undefined || accessToken == undefined || expiration == undefined) { - return null; - } + if (xetEndpoint == undefined || accessToken == undefined || expiration == undefined) { + return null; + } - const expirationUnixEpoch = parseInt(expiration, 10); - if (isNaN(expirationUnixEpoch)) { - return null; - } + const expirationUnixEpoch = parseInt(expiration, 10); + if (isNaN(expirationUnixEpoch)) { + return null; + } - return { - endpoint: xetEndpoint, - accessToken: accessToken, - expirationUnixEpoch: expirationUnixEpoch, - }; + return { + endpoint: xetEndpoint, + accessToken: accessToken, + expirationUnixEpoch: expirationUnixEpoch, + }; } async function fetchXetMetadataFromRepoInfo({ - tokenType, - repoId, - repoType, - headers, - params = null -}) { - /** - * Uses the repo info to request a XET access token from Hub. - * - * @param {string} tokenType - Type of the token to request: "read" or "write". - * @param {string} repoId - A namespace (user or an organization) and a repo name separated by a `/`. - * @param {string} repoType - Type of the repo to upload to: "model", "dataset", or "space". - * @param {Object} headers - Headers to use for the request, including authorization headers and user agent. - * @param {Object|null} params - Additional parameters to pass with the request. - * @returns {Promise} The metadata needed to make the request to the XET storage service. - * @throws {Error} If the Hub API returned an error or the response is improperly formatted. - */ + tokenType, + repoId, + repoType, + headers, + params = null, + }) { + /** + * Uses the repo info to request a XET access token from Hub. + * + * @param {string} tokenType - Type of the token to request: "read" or "write". + * @param {string} repoId - A namespace (user or an organization) and a repo name separated by a `/`. + * @param {string} repoType - Type of the repo to upload to: "model", "dataset", or "space". + * @param {Object} headers - Headers to use for the request, including authorization headers and user agent. + * @param {Object|null} params - Additional parameters to pass with the request. + * @returns {Promise} The metadata needed to make the request to the XET storage service. + * @throws {Error} If the Hub API returned an error or the response is improperly formatted. + */ - const url = `https://huggingface.co/api/${repoType}s/${repoId}/xet-${tokenType}-token/main}`; - console.log(`${url}`); + const url = `http://localhost:5564/api/${repoType}s/${repoId}/xet-${tokenType}-token/main`; + console.log(`${url}`); - return fetchXetMetadataWithUrl(url, headers, params); + return fetchXetMetadataWithUrl(url, headers, params); } async function fetchXetMetadataWithUrl(url, headers, params = null) { - /** - * Requests the XET access token from the supplied URL. - * - * @param {string} url - The access token endpoint URL. - * @param {Object} headers - Headers to use for the request, including authorization headers and user agent. - * @param {Object|null} params - Additional parameters to pass with the request. - * @returns {Promise} The metadata needed to make the request to the XET storage service. - * @throws {Error} If the Hub API returned an error or the response is improperly formatted. - */ + /** + * Requests the XET access token from the supplied URL. + * + * @param {string} url - The access token endpoint URL. + * @param {Object} headers - Headers to use for the request, including authorization headers and user agent. + * @param {Object|null} params - Additional parameters to pass with the request. + * @returns {Promise} The metadata needed to make the request to the XET storage service. + * @throws {Error} If the Hub API returned an error or the response is improperly formatted. + */ - const response = await fetch(url, { - method: "GET", - headers: headers - }); + const response = await fetch(url, { + method: "GET", + headers: headers, + }); - // Get headers - // const hedrs = response.headers; - // hedrs.forEach((value, key) => { - // console.log(`${key}: ${value}`); - // }); + // Get headers + // const hedrs = response.headers; + // hedrs.forEach((value, key) => { + // console.log(`${key}: ${value}`); + // }); - const jsonData = await response.json(); - // console.log("Response Body :", jsonData); + const jsonData = await response.json(); + // console.log("Response Body :", jsonData); - if (!response.ok) { - console.log("response not ok"); - throw new Error(`HTTP error! Status: ${response.status}`); - } + if (!response.ok) { + console.log("response not ok"); + throw new Error(`HTTP error! Status: ${response.status}`); + } - const metadata = xetMetadataOrNone(jsonData); - if (!metadata) { - throw new Error("XET headers have not been correctly set by the server."); - } + const metadata = xetMetadataOrNone(jsonData); + if (!metadata) { + throw new Error("XET headers have not been correctly set by the server."); + } - return metadata; + return metadata; } \ No newline at end of file diff --git a/hf_xet_wasm/src/interface/auth.rs b/hf_xet_wasm/src/auth.rs similarity index 96% rename from hf_xet_wasm/src/interface/auth.rs rename to hf_xet_wasm/src/auth.rs index 814213b3..bbbaf7b7 100644 --- a/hf_xet_wasm/src/interface/auth.rs +++ b/hf_xet_wasm/src/auth.rs @@ -14,7 +14,7 @@ extern "C" { pub fn expiration(this: &TokenInfo) -> u64; pub type TokenRefresher; - #[wasm_bindgen(method, catch)] + #[wasm_bindgen(method, catch, js_name="refreshToken")] pub async fn refresh_token(this: &TokenRefresher) -> Result; } diff --git a/hf_xet_wasm/src/interface.rs b/hf_xet_wasm/src/interface.rs deleted file mode 100644 index c2ff86bd..00000000 --- a/hf_xet_wasm/src/interface.rs +++ /dev/null @@ -1,2 +0,0 @@ -pub(crate) mod auth; -pub(crate) mod session; \ No newline at end of file diff --git a/hf_xet_wasm/src/lib.rs b/hf_xet_wasm/src/lib.rs index 43e99af4..f378bd90 100644 --- a/hf_xet_wasm/src/lib.rs +++ b/hf_xet_wasm/src/lib.rs @@ -1,17 +1,15 @@ #[cfg(not(target_family = "wasm"))] compile_error!("This crate is only meant to be used on the WebAssembly target"); +mod auth; pub mod blob_reader; pub mod configurations; mod errors; +mod session; mod sha256; mod wasm_deduplication_interface; mod wasm_file_cleaner; pub mod wasm_file_upload_session; mod xorb_uploader; -mod interface; -pub use interface::{ - auth::{TokenInfo, TokenRefresher}, - session::XetSession, -}; +pub use session::XetSession; \ No newline at end of file diff --git a/hf_xet_wasm/src/interface/session.rs b/hf_xet_wasm/src/session.rs similarity index 86% rename from hf_xet_wasm/src/interface/session.rs rename to hf_xet_wasm/src/session.rs index 73952ab6..99421982 100644 --- a/hf_xet_wasm/src/interface/session.rs +++ b/hf_xet_wasm/src/session.rs @@ -10,9 +10,10 @@ use utils::auth::AuthConfig; use wasm_bindgen::prelude::*; use web_sys::Blob; +use crate::auth::{TokenInfo, TokenRefresher, WrappedTokenRefresher}; use crate::blob_reader::BlobReader; use crate::configurations::{DataConfig, RepoSalt, ShardConfig, TranslatorConfig}; -use crate::interface::auth::WrappedTokenRefresher; +use crate::wasm_file_upload_session::FileUploadSession; fn convert_error(e: impl std::error::Error) -> JsValue { JsValue::from(format!("{e:?}")) @@ -24,19 +25,15 @@ struct PointerFile { pub file_hash: HexMerkleHash, } -#[wasm_bindgen] +#[wasm_bindgen(js_name = "XetSession")] pub struct XetSession { - upload: Arc, + upload: Arc, } -#[wasm_bindgen] +#[wasm_bindgen(js_class = "XetSession")] impl XetSession { #[wasm_bindgen(constructor)] - pub fn new( - endpoint: String, - token_info: super::auth::TokenInfo, - token_refresher: super::auth::TokenRefresher, - ) -> Self { + pub fn new(endpoint: String, token_info: TokenInfo, token_refresher: TokenRefresher) -> Self { let (token, token_expiration): utils::auth::TokenInfo = token_info.into(); let auth = AuthConfig { token, @@ -56,7 +53,7 @@ impl XetSession { repo_salt: RepoSalt::default(), }, }; - let upload = crate::wasm_file_upload_session::FileUploadSession::new(Arc::new(config)); + let upload = FileUploadSession::new(Arc::new(config)); Self { upload: Arc::new(upload), diff --git a/utils/src/auth.rs b/utils/src/auth.rs index 329d008a..65df8b8e 100644 --- a/utils/src/auth.rs +++ b/utils/src/auth.rs @@ -101,10 +101,11 @@ impl TokenProvider { // #[cfg(not(target_family = "wasm"))] fn is_expired(&self) -> bool { - let cur_time = SystemTime::now() - .duration_since(UNIX_EPOCH) - .map(|d| d.as_secs()) - .unwrap_or(u64::MAX); - self.expiration <= cur_time + // let cur_time = SystemTime::now() + // .duration_since(UNIX_EPOCH) + // .map(|d| d.as_secs()) + // .unwrap_or(u64::MAX); + // self.expiration <= cur_time + false } } From 102bc18013ab386125fbd343393539e27efaa4c9 Mon Sep 17 00:00:00 2001 From: Assaf Vayner Date: Thu, 22 May 2025 14:50:53 -0700 Subject: [PATCH 3/5] lint --- hf_xet_wasm/Cargo.lock | 3344 ++++++++++++++++++++++++++++++++++++ hf_xet_wasm/src/auth.rs | 13 +- hf_xet_wasm/src/session.rs | 5 +- 3 files changed, 3352 insertions(+), 10 deletions(-) create mode 100644 hf_xet_wasm/Cargo.lock diff --git a/hf_xet_wasm/Cargo.lock b/hf_xet_wasm/Cargo.lock new file mode 100644 index 00000000..6aa7eba5 --- /dev/null +++ b/hf_xet_wasm/Cargo.lock @@ -0,0 +1,3344 @@ +# This file is automatically @generated by Cargo. +# It is not intended for manual editing. +version = 4 + +[[package]] +name = "addr2line" +version = "0.24.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dfbe277e56a376000877090da837660b4427aad530e3028d44e0bffe4f89a1c1" +dependencies = [ + "gimli", +] + +[[package]] +name = "adler2" +version = "2.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "512761e0bb2578dd7380c6baaa0f4ce03e84f95e960231d1dec8bf4d7d6e2627" + +[[package]] +name = "aho-corasick" +version = "1.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8e60d3430d3a69478ad0993f19238d2df97c507009a52b3c10addcd7f6bcb916" +dependencies = [ + "memchr", +] + +[[package]] +name = "anstream" +version = "0.6.18" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8acc5369981196006228e28809f761875c0327210a891e941f4c683b3a99529b" +dependencies = [ + "anstyle", + "anstyle-parse", + "anstyle-query", + "anstyle-wincon", + "colorchoice", + "is_terminal_polyfill", + "utf8parse", +] + +[[package]] +name = "anstyle" +version = "1.0.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "55cc3b69f167a1ef2e161439aa98aed94e6028e5f9a59be9a6ffb47aef1651f9" + +[[package]] +name = "anstyle-parse" +version = "0.2.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3b2d16507662817a6a20a9ea92df6652ee4f94f914589377d69f3b21bc5798a9" +dependencies = [ + "utf8parse", +] + +[[package]] +name = "anstyle-query" +version = "1.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "79947af37f4177cfead1110013d678905c37501914fba0efea834c3fe9a8d60c" +dependencies = [ + "windows-sys 0.59.0", +] + +[[package]] +name = "anstyle-wincon" +version = "3.0.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6680de5231bd6ee4c6191b8a1325daa282b415391ec9d3a37bd34f2060dc73fa" +dependencies = [ + "anstyle", + "once_cell_polyfill", + "windows-sys 0.59.0", +] + +[[package]] +name = "anyhow" +version = "1.0.98" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e16d2d3311acee920a9eb8d33b8cbc1787ce4a264e85f964c2404b969bdcd487" + +[[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 = "async-channel" +version = "2.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "89b47800b0be77592da0afd425cc03468052844aff33b84e33cc696f64e77b6a" +dependencies = [ + "concurrent-queue", + "event-listener-strategy", + "futures-core", + "pin-project-lite", +] + +[[package]] +name = "async-trait" +version = "0.1.88" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e539d3fca749fcee5236ab05e93a52867dd549cc157c8cb7f99595f3cedffdb5" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.101", +] + +[[package]] +name = "atomic-waker" +version = "1.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1505bd5d3d116872e7271a6d4e16d81d0c8570876c8de68093a09ac269d8aac0" + +[[package]] +name = "atty" +version = "0.2.14" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d9b39be18770d11421cdb1b9947a45dd3f37e93092cbf377614828a319d5fee8" +dependencies = [ + "hermit-abi", + "libc", + "winapi", +] + +[[package]] +name = "autocfg" +version = "1.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ace50bade8e6234aa140d9a2f552bbee1db4d353f69b8217bc503490fc1a9f26" + +[[package]] +name = "backtrace" +version = "0.3.75" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6806a6321ec58106fea15becdad98371e28d92ccbc7c8f1b3b6dd724fe8f1002" +dependencies = [ + "addr2line", + "cfg-if 1.0.0", + "libc", + "miniz_oxide", + "object", + "rustc-demangle", + "windows-targets 0.52.6", +] + +[[package]] +name = "base64" +version = "0.22.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "72b3254f16251a8381aa12e40e3c4d2f0199f8c6508fbecb9d91f575e0fbb8c6" + +[[package]] +name = "bincode" +version = "1.3.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b1f45e9417d87227c7a56d22e471c6206462cba514c7590c09aff4cf6d1ddcad" +dependencies = [ + "serde", +] + +[[package]] +name = "bitflags" +version = "1.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a" + +[[package]] +name = "bitflags" +version = "2.9.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1b8e56985ec62d17e9c1001dc89c88ecd7dc08e47eba5ec7c29c7b5eeecde967" + +[[package]] +name = "blake3" +version = "1.8.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3888aaa89e4b2a40fca9848e400f6a658a5a3978de7be858e209cafa8be9a4a0" +dependencies = [ + "arrayref", + "arrayvec", + "cc", + "cfg-if 1.0.0", + "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 = "bumpalo" +version = "3.17.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1628fb46dfa0b37568d12e5edd512553eccf6a22a78e8bde00bb4aed84d5bdbf" + +[[package]] +name = "bytemuck" +version = "1.23.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9134a6ef01ce4b366b50689c94f82c14bc72bc5d0386829828a2e2752ef7958c" + +[[package]] +name = "byteorder" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1fd0f2584146f6f2ef48085050886acf353beff7305ebd1ae69500e27c67f64b" + +[[package]] +name = "bytes" +version = "1.10.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d71b6127be86fdcfddb610f7182ac57211d4b18a3e9c82eb2d17662f2227ad6a" + +[[package]] +name = "cas_client" +version = "0.14.5" +dependencies = [ + "anyhow", + "async-trait", + "cas_object", + "cas_types", + "chunk_cache", + "deduplication", + "derivative", + "error_printer", + "file_utils", + "futures", + "heed", + "http", + "log", + "mdb_shard", + "merkledb", + "merklehash", + "reqwest", + "reqwest-middleware", + "reqwest-retry", + "tempfile", + "thiserror 2.0.12", + "tokio", + "tracing", + "url", + "utils", + "xet_threadpool", +] + +[[package]] +name = "cas_object" +version = "0.1.0" +dependencies = [ + "anyhow", + "blake3", + "bytes", + "clap 4.5.38", + "countio", + "csv", + "error_printer", + "futures", + "half", + "lz4_flex", + "mdb_shard", + "merkledb", + "merklehash", + "rand 0.9.1", + "serde", + "thiserror 2.0.12", + "tokio", + "tokio-util", + "tracing", + "utils", +] + +[[package]] +name = "cas_types" +version = "0.1.0" +dependencies = [ + "merklehash", + "serde", + "serde_repr", + "thiserror 2.0.12", +] + +[[package]] +name = "cc" +version = "1.2.23" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5f4ac86a9e5bc1e2b3449ab9d7d3a6a405e3d1bb28d7b9be8614f55846ae3766" +dependencies = [ + "shlex", +] + +[[package]] +name = "cfg-if" +version = "0.1.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4785bdd1c96b2a846b2bd7cc02e86b6b3dbf14e7e53446c4f54c92a361040822" + +[[package]] +name = "cfg-if" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" + +[[package]] +name = "chunk_cache" +version = "0.1.0" +dependencies = [ + "base64", + "cas_types", + "crc32fast", + "error_printer", + "file_utils", + "log", + "merklehash", + "mockall", + "once_cell", + "rand 0.8.5", + "thiserror 2.0.12", + "tracing", + "utils", +] + +[[package]] +name = "clap" +version = "3.2.25" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4ea181bf566f71cb9a5d17a59e1871af638180a18fb0035c92ae62b705207123" +dependencies = [ + "atty", + "bitflags 1.3.2", + "clap_derive 3.2.25", + "clap_lex 0.2.4", + "indexmap 1.9.3", + "once_cell", + "strsim 0.10.0", + "termcolor", + "textwrap", +] + +[[package]] +name = "clap" +version = "4.5.38" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ed93b9805f8ba930df42c2590f05453d5ec36cbb85d018868a5b24d31f6ac000" +dependencies = [ + "clap_builder", + "clap_derive 4.5.32", +] + +[[package]] +name = "clap_builder" +version = "4.5.38" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "379026ff283facf611b0ea629334361c4211d1b12ee01024eec1591133b04120" +dependencies = [ + "anstream", + "anstyle", + "clap_lex 0.7.4", + "strsim 0.11.1", +] + +[[package]] +name = "clap_derive" +version = "3.2.25" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ae6371b8bdc8b7d3959e9cf7b22d4435ef3e79e138688421ec654acf8c81b008" +dependencies = [ + "heck 0.4.1", + "proc-macro-error", + "proc-macro2", + "quote", + "syn 1.0.109", +] + +[[package]] +name = "clap_derive" +version = "4.5.32" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "09176aae279615badda0765c0c0b3f6ed53f4709118af73cf4655d85d1530cd7" +dependencies = [ + "heck 0.5.0", + "proc-macro2", + "quote", + "syn 2.0.101", +] + +[[package]] +name = "clap_lex" +version = "0.2.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2850f2f5a82cbf437dd5af4d49848fbdfc27c157c3d010345776f952765261c5" +dependencies = [ + "os_str_bytes", +] + +[[package]] +name = "clap_lex" +version = "0.7.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f46ad14479a25103f283c0f10005961cf086d8dc42205bb44c46ac563475dca6" + +[[package]] +name = "colorchoice" +version = "1.0.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5b63caa9aa9397e2d9480a9b13673856c78d8ac123288526c37d7839f2a86990" + +[[package]] +name = "colored" +version = "2.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "117725a109d387c937a1533ce01b450cbde6b88abceea8473c4d7a85853cda3c" +dependencies = [ + "lazy_static", + "windows-sys 0.59.0", +] + +[[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 = "console_error_panic_hook" +version = "0.1.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a06aeb73f470f66dcdbf7223caeebb85984942f22f1adb2a088cf9668146bbbc" +dependencies = [ + "cfg-if 1.0.0", + "wasm-bindgen", +] + +[[package]] +name = "console_log" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "be8aed40e4edbf4d3b4431ab260b63fdc40f5780a4766824329ea0f1eefe3c0f" +dependencies = [ + "log", + "wasm-bindgen", + "web-sys", +] + +[[package]] +name = "constant_time_eq" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7c74b8349d32d297c9134b8c88677813a227df8f779daa29bfc29c183fe3dca6" + +[[package]] +name = "core-foundation" +version = "0.9.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "91e195e091a93c46f7102ec7818a2aa394e1e1771c3ab4825963fa03e45afb8f" +dependencies = [ + "core-foundation-sys", + "libc", +] + +[[package]] +name = "core-foundation-sys" +version = "0.8.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "773648b94d0e5d620f64f280777445740e61fe701025087ec8b57f45c791888b" + +[[package]] +name = "countio" +version = "0.2.19" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cdbee2fbff35a44b492c859b1b2e32e94b631f1d3ea2831dd8393861564180e3" +dependencies = [ + "futures-io", +] + +[[package]] +name = "cpufeatures" +version = "0.2.17" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "59ed5838eebb26a2bb2e58f6d5b5316989ae9d08bab10e0e6d103e656d1b0280" +dependencies = [ + "libc", +] + +[[package]] +name = "crc32fast" +version = "1.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a97769d94ddab943e4510d138150169a2758b5ef3eb191a9ee688de3e23ef7b3" +dependencies = [ + "cfg-if 1.0.0", +] + +[[package]] +name = "crossbeam-deque" +version = "0.8.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9dd111b7b7f7d55b72c0a6ae361660ee5853c9af73f70c3c2ef6858b950e2e51" +dependencies = [ + "crossbeam-epoch", + "crossbeam-utils", +] + +[[package]] +name = "crossbeam-epoch" +version = "0.9.18" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5b82ac4a3c2ca9c3460964f020e1402edd5753411d7737aa39c3714ad1b5420e" +dependencies = [ + "crossbeam-utils", +] + +[[package]] +name = "crossbeam-queue" +version = "0.3.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0f58bbc28f91df819d0aa2a2c00cd19754769c2fad90579b3592b1c9ba7a3115" +dependencies = [ + "crossbeam-utils", +] + +[[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.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "43da5946c66ffcc7745f48db692ffbb10a83bfe0afd96235c5c2a4fb23994929" + +[[package]] +name = "crypto-common" +version = "0.1.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1bfb12502f3fc46cca1bb51ac28df9d618d813cdc3d2f25b9fe775a34af26bb3" +dependencies = [ + "generic-array", + "typenum", +] + +[[package]] +name = "csv" +version = "1.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "acdc4883a9c96732e4733212c01447ebd805833b7275a73ca3ee080fd77afdaf" +dependencies = [ + "csv-core", + "itoa", + "ryu", + "serde", +] + +[[package]] +name = "csv-core" +version = "0.1.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7d02f3b0da4c6504f86e9cd789d8dbafab48c2321be74e9987593de5a894d93d" +dependencies = [ + "memchr", +] + +[[package]] +name = "ctor" +version = "0.1.26" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6d2301688392eb071b0bf1a37be05c469d3cc4dbbd95df672fe28ab021e6a096" +dependencies = [ + "quote", + "syn 1.0.109", +] + +[[package]] +name = "deduplication" +version = "0.14.5" +dependencies = [ + "async-trait", + "gearhash", + "lazy_static", + "mdb_shard", + "merkledb", + "merklehash", + "more-asserts", + "utils", +] + +[[package]] +name = "derivative" +version = "2.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fcc3dd5e9e9c0b295d6e1e4d811fb6f157d5ffd784b8d202fc62eac8035a770b" +dependencies = [ + "proc-macro2", + "quote", + "syn 1.0.109", +] + +[[package]] +name = "digest" +version = "0.10.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9ed9a281f7bc9b7576e61468ba615a66a5c8cfdff42420a70aa82701a3b1e292" +dependencies = [ + "block-buffer", + "crypto-common", +] + +[[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.101", +] + +[[package]] +name = "downcast" +version = "0.11.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1435fa1053d8b2fbbe9be7e97eca7f33d37b28409959813daefc1446a14247f1" + +[[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 1.0.0", +] + +[[package]] +name = "env_filter" +version = "0.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "186e05a59d4c50738528153b83b0b0194d3a29507dfec16eccd4b342903397d0" +dependencies = [ + "log", + "regex", +] + +[[package]] +name = "env_logger" +version = "0.11.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "13c863f0904021b108aa8b2f55046443e6b1ebde8fd4a15c399893aae4fa069f" +dependencies = [ + "anstream", + "anstyle", + "env_filter", + "jiff", + "log", +] + +[[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.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cea14ef9355e3beab063703aa9dab15afd25f0667c341310c1e5274bb1d0da18" +dependencies = [ + "libc", + "windows-sys 0.59.0", +] + +[[package]] +name = "error_printer" +version = "0.14.5" +dependencies = [ + "tracing", +] + +[[package]] +name = "event-listener" +version = "5.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3492acde4c3fc54c845eaab3eed8bd00c7a7d881f78bfc801e43a93dec1331ae" +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", + "pin-project-lite", +] + +[[package]] +name = "fastrand" +version = "2.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "37909eebbb50d72f9059c3b6d82c0463f2ff062c9e95845c43a6c9c0355411be" + +[[package]] +name = "file_utils" +version = "0.14.2" +dependencies = [ + "colored", + "lazy_static", + "libc", + "rand 0.8.5", + "tracing", + "whoami", + "winapi", +] + +[[package]] +name = "fnv" +version = "1.0.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3f9eec918d3f24069decb9af1554cad7c880e2da24a9afd88aca000531ab82c1" + +[[package]] +name = "foreign-types" +version = "0.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f6f339eb8adc052cd2ca78910fda869aefa38d22d5cb648e6485e4d3fc06f3b1" +dependencies = [ + "foreign-types-shared", +] + +[[package]] +name = "foreign-types-shared" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "00b0228411908ca8685dba7fc2cdd70ec9990a6e753e89b6ac91a84c40fbaf4b" + +[[package]] +name = "form_urlencoded" +version = "1.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e13624c2627564efccf4934284bdd98cbaa14e79b0b5a141218e507b3a823456" +dependencies = [ + "percent-encoding", +] + +[[package]] +name = "fragile" +version = "2.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "28dd6caf6059519a65843af8fe2a3ae298b14b80179855aeb4adc2c1934ee619" + +[[package]] +name = "futures" +version = "0.3.31" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "65bc07b1a8bc7c85c5f2e110c476c7389b4554ba72af57d8445ea63a576b0876" +dependencies = [ + "futures-channel", + "futures-core", + "futures-executor", + "futures-io", + "futures-sink", + "futures-task", + "futures-util", +] + +[[package]] +name = "futures-channel" +version = "0.3.31" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2dff15bf788c671c1934e366d07e30c1814a8ef514e1af724a602e8a2fbe1b10" +dependencies = [ + "futures-core", + "futures-sink", +] + +[[package]] +name = "futures-core" +version = "0.3.31" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "05f29059c0c2090612e8d742178b0580d2dc940c837851ad723096f87af6663e" + +[[package]] +name = "futures-executor" +version = "0.3.31" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1e28d1d997f585e54aebc3f97d39e72338912123a67330d723fdbb564d646c9f" +dependencies = [ + "futures-core", + "futures-task", + "futures-util", +] + +[[package]] +name = "futures-io" +version = "0.3.31" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9e5c1b78ca4aae1ac06c48a526a655760685149f0d465d21f37abfe57ce075c6" + +[[package]] +name = "futures-macro" +version = "0.3.31" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "162ee34ebcb7c64a8abebc059ce0fee27c2262618d7b60ed8faf72fef13c3650" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.101", +] + +[[package]] +name = "futures-sink" +version = "0.3.31" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e575fab7d1e0dcb8d0c7bcf9a63ee213816ab51902e6d244a95819acacf1d4f7" + +[[package]] +name = "futures-task" +version = "0.3.31" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f90f7dce0722e95104fcb095585910c0977252f286e354b5e3bd38902cd99988" + +[[package]] +name = "futures-util" +version = "0.3.31" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9fa08315bb612088cc391249efdc3bc77536f16c91f6cf495e6fbe85b20a4a81" +dependencies = [ + "futures-channel", + "futures-core", + "futures-io", + "futures-macro", + "futures-sink", + "futures-task", + "memchr", + "pin-project-lite", + "pin-utils", + "slab", +] + +[[package]] +name = "gearhash" +version = "0.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c8cf82cf76cd16485e56295a1377c775ce708c9f1a0be6b029076d60a245d213" +dependencies = [ + "cfg-if 0.1.10", +] + +[[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.16" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "335ff9f135e4384c8150d6f27c6daed433577f86b4750418338c01a1a2528592" +dependencies = [ + "cfg-if 1.0.0", + "js-sys", + "libc", + "wasi 0.11.0+wasi-snapshot-preview1", + "wasm-bindgen", +] + +[[package]] +name = "getrandom" +version = "0.3.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "26145e563e54f2cadc477553f1ec5ee650b00862f0a58bcd12cbdc5f0ea2d2f4" +dependencies = [ + "cfg-if 1.0.0", + "js-sys", + "libc", + "r-efi", + "wasi 0.14.2+wasi-0.2.4", + "wasm-bindgen", +] + +[[package]] +name = "gimli" +version = "0.31.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "07e28edb80900c19c28f1072f2e8aeca7fa06b23cd4169cefe1af5aa3260783f" + +[[package]] +name = "h2" +version = "0.4.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a9421a676d1b147b16b82c9225157dc629087ef8ec4d5e2960f9437a90dac0a5" +dependencies = [ + "atomic-waker", + "bytes", + "fnv", + "futures-core", + "futures-sink", + "http", + "indexmap 2.9.0", + "slab", + "tokio", + "tokio-util", + "tracing", +] + +[[package]] +name = "half" +version = "2.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "459196ed295495a68f7d7fe1d84f6c4b7ff0e21fe3017b2f283c6fac3ad803c9" +dependencies = [ + "cfg-if 1.0.0", + "crunchy", +] + +[[package]] +name = "hashbrown" +version = "0.12.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8a9ee70c43aaf417c914396645a0fa852624801b24ebb7ae78fe8272889ac888" + +[[package]] +name = "hashbrown" +version = "0.15.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "84b26c544d002229e640969970a2e74021aadf6e2f96372b9c58eff97de08eb3" + +[[package]] +name = "heck" +version = "0.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "95505c38b4572b2d910cecb0281560f54b440a19336cbbcb27bf6ce6adc6f5a8" + +[[package]] +name = "heck" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2304e00983f87ffb38b55b444b5e3b60a884b5d30c0fca7d82fe33449bbe55ea" + +[[package]] +name = "heed" +version = "0.11.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "269c7486ed6def5d7b59a427cec3e87b4d4dd4381d01e21c8c9f2d3985688392" +dependencies = [ + "bytemuck", + "byteorder", + "heed-traits", + "heed-types", + "libc", + "lmdb-rkv-sys", + "once_cell", + "page_size", + "serde", + "synchronoise", + "url", +] + +[[package]] +name = "heed-traits" +version = "0.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a53a94e5b2fd60417e83ffdfe136c39afacff0d4ac1d8d01cd66928ac610e1a2" + +[[package]] +name = "heed-types" +version = "0.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9a6cf0a6952fcedc992602d5cddd1e3fff091fbe87d38636e3ec23a31f32acbd" +dependencies = [ + "bincode", + "bytemuck", + "byteorder", + "heed-traits", + "serde", + "serde_json", +] + +[[package]] +name = "hermit-abi" +version = "0.1.19" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "62b467343b94ba476dcb2500d242dadbb39557df889310ac77c5d99100aaac33" +dependencies = [ + "libc", +] + +[[package]] +name = "hf_xet_wasm" +version = "0.0.1" +dependencies = [ + "anyhow", + "async-channel", + "async-trait", + "blake3", + "cas_client", + "cas_object", + "cas_types", + "console_error_panic_hook", + "console_log", + "deduplication", + "env_logger", + "futures", + "futures-io", + "getrandom 0.3.3", + "js-sys", + "log", + "mdb_shard", + "merkledb", + "merklehash", + "reqwest", + "serde", + "serde_json", + "sha2", + "thiserror 2.0.12", + "tokio", + "tokio-stream", + "tokio_with_wasm", + "utils", + "wasm-bindgen", + "wasm-bindgen-futures", + "wasm-bindgen-test", + "wasm_thread", + "web-sys", +] + +[[package]] +name = "http" +version = "1.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f4a85d31aea989eead29a3aaf9e1115a180df8282431156e533de47660892565" +dependencies = [ + "bytes", + "fnv", + "itoa", +] + +[[package]] +name = "http-body" +version = "1.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1efedce1fb8e6913f23e0c92de8e62cd5b772a67e7b3946df930a62566c93184" +dependencies = [ + "bytes", + "http", +] + +[[package]] +name = "http-body-util" +version = "0.1.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.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cc2b571658e38e0c01b1fdca3bbbe93c00d3d71693ff2770043f8c29bc7d6f80" +dependencies = [ + "bytes", + "futures-channel", + "futures-util", + "h2", + "http", + "http-body", + "httparse", + "itoa", + "pin-project-lite", + "smallvec", + "tokio", + "want", +] + +[[package]] +name = "hyper-rustls" +version = "0.27.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2d191583f3da1305256f22463b9bb0471acad48a4e534a5218b9963e9c1f59b2" +dependencies = [ + "futures-util", + "http", + "hyper", + "hyper-util", + "rustls", + "rustls-pki-types", + "tokio", + "tokio-rustls", + "tower-service", +] + +[[package]] +name = "hyper-tls" +version = "0.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "70206fc6890eaca9fde8a0bf71caa2ddfc9fe045ac9e5c70df101a7dbde866e0" +dependencies = [ + "bytes", + "http-body-util", + "hyper", + "hyper-util", + "native-tls", + "tokio", + "tokio-native-tls", + "tower-service", +] + +[[package]] +name = "hyper-util" +version = "0.1.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cf9f1e950e0d9d1d3c47184416723cf29c0d1f93bd8cccf37e4beb6b44f31710" +dependencies = [ + "bytes", + "futures-channel", + "futures-util", + "http", + "http-body", + "hyper", + "libc", + "pin-project-lite", + "socket2", + "tokio", + "tower-service", + "tracing", +] + +[[package]] +name = "icu_collections" +version = "2.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "200072f5d0e3614556f94a9930d5dc3e0662a652823904c3a75dc3b0af7fee47" +dependencies = [ + "displaydoc", + "potential_utf", + "yoke", + "zerofrom", + "zerovec", +] + +[[package]] +name = "icu_locale_core" +version = "2.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0cde2700ccaed3872079a65fb1a78f6c0a36c91570f28755dda67bc8f7d9f00a" +dependencies = [ + "displaydoc", + "litemap", + "tinystr", + "writeable", + "zerovec", +] + +[[package]] +name = "icu_normalizer" +version = "2.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "436880e8e18df4d7bbc06d58432329d6458cc84531f7ac5f024e93deadb37979" +dependencies = [ + "displaydoc", + "icu_collections", + "icu_normalizer_data", + "icu_properties", + "icu_provider", + "smallvec", + "zerovec", +] + +[[package]] +name = "icu_normalizer_data" +version = "2.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "00210d6893afc98edb752b664b8890f0ef174c8adbb8d0be9710fa66fbbf72d3" + +[[package]] +name = "icu_properties" +version = "2.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "016c619c1eeb94efb86809b015c58f479963de65bdb6253345c1a1276f22e32b" +dependencies = [ + "displaydoc", + "icu_collections", + "icu_locale_core", + "icu_properties_data", + "icu_provider", + "potential_utf", + "zerotrie", + "zerovec", +] + +[[package]] +name = "icu_properties_data" +version = "2.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "298459143998310acd25ffe6810ed544932242d3f07083eee1084d83a71bd632" + +[[package]] +name = "icu_provider" +version = "2.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "03c80da27b5f4187909049ee2d72f276f0d9f99a42c306bd0131ecfe04d8e5af" +dependencies = [ + "displaydoc", + "icu_locale_core", + "stable_deref_trait", + "tinystr", + "writeable", + "yoke", + "zerofrom", + "zerotrie", + "zerovec", +] + +[[package]] +name = "idna" +version = "1.0.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "686f825264d630750a544639377bae737628043f20d38bbc029e8f29ea968a7e" +dependencies = [ + "idna_adapter", + "smallvec", + "utf8_iter", +] + +[[package]] +name = "idna_adapter" +version = "1.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3acae9609540aa318d1bc588455225fb2085b9ed0c4f6bd0d9d5bcd86f1a0344" +dependencies = [ + "icu_normalizer", + "icu_properties", +] + +[[package]] +name = "indexmap" +version = "1.9.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bd070e393353796e801d209ad339e89596eb4c8d430d18ede6a1cced8fafbd99" +dependencies = [ + "autocfg", + "hashbrown 0.12.3", +] + +[[package]] +name = "indexmap" +version = "2.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cea70ddb795996207ad57735b50c5982d8844f38ba9ee5f1aedcfb708a2aa11e" +dependencies = [ + "equivalent", + "hashbrown 0.15.3", +] + +[[package]] +name = "instant" +version = "0.1.13" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e0242819d153cba4b4b05a5a8f2a7e9bbf97b6055b2a002b395c96b5ff3c0222" +dependencies = [ + "cfg-if 1.0.0", + "js-sys", + "wasm-bindgen", + "web-sys", +] + +[[package]] +name = "ipnet" +version = "2.11.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "469fb0b9cefa57e3ef31275ee7cacb78f2fdca44e4765491884a2b119d4eb130" + +[[package]] +name = "is_terminal_polyfill" +version = "1.70.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7943c866cc5cd64cbc25b2e01621d07fa8eb2a1a23160ee81ce38704e97b8ecf" + +[[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.15" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4a5f13b858c8d314ee3e8f639011f7ccefe71f97f96e50151fb991f267928e2c" + +[[package]] +name = "jiff" +version = "0.2.14" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a194df1107f33c79f4f93d02c80798520551949d59dfad22b6157048a88cca93" +dependencies = [ + "jiff-static", + "log", + "portable-atomic", + "portable-atomic-util", + "serde", +] + +[[package]] +name = "jiff-static" +version = "0.2.14" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6c6e1db7ed32c6c71b759497fae34bf7933636f75a251b9e736555da426f6442" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.101", +] + +[[package]] +name = "js-sys" +version = "0.3.77" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1cfaf33c695fc6e08064efbc1f72ec937429614f25eef83af942d0e227c3a28f" +dependencies = [ + "once_cell", + "wasm-bindgen", +] + +[[package]] +name = "lazy_static" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bbd2bcb4c963f2ddae06a2efc7e9f3591312473c50c6685e1f298068316e66fe" + +[[package]] +name = "libc" +version = "0.2.172" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d750af042f7ef4f724306de029d18836c26c1765a54a6a3f094cbd23a7267ffa" + +[[package]] +name = "linux-raw-sys" +version = "0.9.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cd945864f07fe9f5371a27ad7b52a172b4b499999f1d97574c9fa68373937e12" + +[[package]] +name = "litemap" +version = "0.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "241eaef5fd12c88705a01fc1066c48c4b36e0dd4377dcdc7ec3942cea7a69956" + +[[package]] +name = "lmdb-rkv-sys" +version = "0.11.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "61b9ce6b3be08acefa3003c57b7565377432a89ec24476bbe72e11d101f852fe" +dependencies = [ + "cc", + "libc", + "pkg-config", +] + +[[package]] +name = "lock_api" +version = "0.4.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "07af8b9cdd281b7915f413fa73f29ebd5d55d0d3f0155584dade1ff18cea1b17" +dependencies = [ + "autocfg", + "scopeguard", +] + +[[package]] +name = "log" +version = "0.4.27" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "13dc2df351e3202783a1fe0d44375f7295ffb4049267b0f3018346dc122a1d94" + +[[package]] +name = "lz4_flex" +version = "0.11.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "75761162ae2b0e580d7e7c390558127e5f01b4194debd6221fd8c207fc80e3f5" +dependencies = [ + "twox-hash", +] + +[[package]] +name = "mdb_shard" +version = "0.14.5" +dependencies = [ + "anyhow", + "async-trait", + "blake3", + "clap 3.2.25", + "futures-io", + "futures-util", + "itertools", + "lazy_static", + "merklehash", + "rand 0.9.1", + "regex", + "serde", + "static_assertions", + "tempfile", + "thiserror 2.0.12", + "tokio", + "tracing", + "utils", + "uuid", +] + +[[package]] +name = "memchr" +version = "2.7.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "78ca9ab1a0babb1e7d5695e3530886289c18cf2f87ec19a575a0abdce112e3a3" + +[[package]] +name = "merkledb" +version = "0.14.5" +dependencies = [ + "async-trait", + "bincode", + "bitflags 1.3.2", + "blake3", + "clap 3.2.25", + "gearhash", + "lazy_static", + "merklehash", + "rand_chacha 0.9.0", + "rayon", + "rustc-hash", + "serde", + "tempfile", + "thiserror 2.0.12", + "tracing", + "utils", + "walkdir", +] + +[[package]] +name = "merklehash" +version = "0.14.5" +dependencies = [ + "base64", + "blake3", + "getrandom 0.3.3", + "heed", + "rand 0.9.1", + "safe-transmute", + "serde", +] + +[[package]] +name = "mime" +version = "0.3.17" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6877bb514081ee2a7ff5ef9de3281f14a4dd4bceac4c09388074a6b5df8a139a" + +[[package]] +name = "minicov" +version = "0.3.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f27fe9f1cc3c22e1687f9446c2083c4c5fc7f0bcf1c7a86bdbded14985895b4b" +dependencies = [ + "cc", + "walkdir", +] + +[[package]] +name = "miniz_oxide" +version = "0.8.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3be647b768db090acb35d5ec5db2b0e1f1de11133ca123b9eacf5137868f892a" +dependencies = [ + "adler2", +] + +[[package]] +name = "mio" +version = "1.0.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2886843bf800fba2e3377cff24abf6379b4c4d5c6681eaf9ea5b0d15090450bd" +dependencies = [ + "libc", + "wasi 0.11.0+wasi-snapshot-preview1", + "windows-sys 0.52.0", +] + +[[package]] +name = "mockall" +version = "0.13.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "39a6bfcc6c8c7eed5ee98b9c3e33adc726054389233e201c95dab2d41a3839d2" +dependencies = [ + "cfg-if 1.0.0", + "downcast", + "fragile", + "mockall_derive", + "predicates", + "predicates-tree", +] + +[[package]] +name = "mockall_derive" +version = "0.13.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "25ca3004c2efe9011bd4e461bd8256445052b9615405b4f7ea43fc8ca5c20898" +dependencies = [ + "cfg-if 1.0.0", + "proc-macro2", + "quote", + "syn 2.0.101", +] + +[[package]] +name = "more-asserts" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1fafa6961cabd9c63bcd77a45d7e3b7f3b552b70417831fb0f56db717e72407e" + +[[package]] +name = "native-tls" +version = "0.2.14" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "87de3442987e9dbec73158d5c715e7ad9072fda936bb03d19d7fa10e00520f0e" +dependencies = [ + "libc", + "log", + "openssl", + "openssl-probe", + "openssl-sys", + "schannel", + "security-framework", + "security-framework-sys", + "tempfile", +] + +[[package]] +name = "object" +version = "0.36.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "62948e14d923ea95ea2c7c86c71013138b66525b86bdc08d2dcc262bdb497b87" +dependencies = [ + "memchr", +] + +[[package]] +name = "once_cell" +version = "1.21.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "42f5e15c9953c5e4ccceeb2e7382a716482c34515315f7b03532b8b4e8393d2d" + +[[package]] +name = "once_cell_polyfill" +version = "1.70.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a4895175b425cb1f87721b59f0f286c2092bd4af812243672510e1ac53e2e0ad" + +[[package]] +name = "openssl" +version = "0.10.72" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fedfea7d58a1f73118430a55da6a286e7b044961736ce96a16a17068ea25e5da" +dependencies = [ + "bitflags 2.9.1", + "cfg-if 1.0.0", + "foreign-types", + "libc", + "once_cell", + "openssl-macros", + "openssl-sys", +] + +[[package]] +name = "openssl-macros" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a948666b637a0f465e8564c73e89d4dde00d72d4d473cc972f390fc3dcee7d9c" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.101", +] + +[[package]] +name = "openssl-probe" +version = "0.1.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d05e27ee213611ffe7d6348b942e8f942b37114c00cc03cec254295a4a17852e" + +[[package]] +name = "openssl-sys" +version = "0.9.108" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e145e1651e858e820e4860f7b9c5e169bc1d8ce1c86043be79fa7b7634821847" +dependencies = [ + "cc", + "libc", + "pkg-config", + "vcpkg", +] + +[[package]] +name = "os_str_bytes" +version = "6.6.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e2355d85b9a3786f481747ced0e0ff2ba35213a1f9bd406ed906554d7af805a1" + +[[package]] +name = "page_size" +version = "0.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "eebde548fbbf1ea81a99b128872779c437752fb99f217c45245e1a61dcd9edcd" +dependencies = [ + "libc", + "winapi", +] + +[[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.11.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7d17b78036a60663b797adeaee46f5c9dfebb86948d1255007a1d6be0271ff99" +dependencies = [ + "instant", + "lock_api", + "parking_lot_core 0.8.6", +] + +[[package]] +name = "parking_lot" +version = "0.12.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f1bf18183cf54e8d6059647fc3063646a1801cf30896933ec2311622cc4b9a27" +dependencies = [ + "lock_api", + "parking_lot_core 0.9.10", +] + +[[package]] +name = "parking_lot_core" +version = "0.8.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "60a2cfe6f0ad2bfc16aefa463b497d5c7a5ecd44a23efa72aa342d90177356dc" +dependencies = [ + "cfg-if 1.0.0", + "instant", + "libc", + "redox_syscall 0.2.16", + "smallvec", + "winapi", +] + +[[package]] +name = "parking_lot_core" +version = "0.9.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1e401f977ab385c9e4e3ab30627d6f26d00e2c73eef317493c4ec6d468726cf8" +dependencies = [ + "cfg-if 1.0.0", + "libc", + "redox_syscall 0.5.12", + "smallvec", + "windows-targets 0.52.6", +] + +[[package]] +name = "paste" +version = "0.1.18" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "45ca20c77d80be666aef2b45486da86238fabe33e38306bd3118fe4af33fa880" +dependencies = [ + "paste-impl", + "proc-macro-hack", +] + +[[package]] +name = "paste-impl" +version = "0.1.18" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d95a7db200b97ef370c8e6de0088252f7e0dfff7d047a28528e47456c0fc98b6" +dependencies = [ + "proc-macro-hack", +] + +[[package]] +name = "percent-encoding" +version = "2.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e3148f5046208a5d56bcfc03053e3ca6334e51da8dfb19b6cdc8b306fae3283e" + +[[package]] +name = "pin-project" +version = "1.1.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "677f1add503faace112b9f1373e43e9e054bfdd22ff1a63c1bc485eaec6a6a8a" +dependencies = [ + "pin-project-internal", +] + +[[package]] +name = "pin-project-internal" +version = "1.1.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6e918e4ff8c4549eb882f14b3a4bc8c8bc93de829416eacf579f1207a8fbf861" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.101", +] + +[[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 = "portable-atomic" +version = "1.11.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "350e9b48cbc6b0e028b0473b114454c6316e57336ee184ceab6e53f72c178b3e" + +[[package]] +name = "portable-atomic-util" +version = "0.2.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d8a2f0d8d040d7848a709caf78912debcc3f33ee4b3cac47d73d1e1069e83507" +dependencies = [ + "portable-atomic", +] + +[[package]] +name = "potential_utf" +version = "0.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e5a7c30837279ca13e7c867e9e40053bc68740f988cb07f7ca6df43cc734b585" +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 = "predicates" +version = "3.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a5d19ee57562043d37e82899fade9a22ebab7be9cef5026b07fda9cdd4293573" +dependencies = [ + "anstyle", + "predicates-core", +] + +[[package]] +name = "predicates-core" +version = "1.0.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "727e462b119fe9c93fd0eb1429a5f7647394014cf3c04ab2c0350eeb09095ffa" + +[[package]] +name = "predicates-tree" +version = "1.0.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "72dd2d6d381dfb73a193c7fca536518d7caee39fc8503f74e7dc0be0531b425c" +dependencies = [ + "predicates-core", + "termtree", +] + +[[package]] +name = "proc-macro-error" +version = "1.0.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "da25490ff9892aab3fcf7c36f08cfb902dd3e71ca0f9f9517bea02a73a5ce38c" +dependencies = [ + "proc-macro-error-attr", + "proc-macro2", + "quote", + "syn 1.0.109", + "version_check", +] + +[[package]] +name = "proc-macro-error-attr" +version = "1.0.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a1be40180e52ecc98ad80b184934baf3d0d29f979574e439af5a55274b35f869" +dependencies = [ + "proc-macro2", + "quote", + "version_check", +] + +[[package]] +name = "proc-macro-hack" +version = "0.5.20+deprecated" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dc375e1527247fe1a97d8b7156678dfe7c1af2fc075c9a4db3690ecd2a148068" + +[[package]] +name = "proc-macro2" +version = "1.0.95" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "02b3e5e68a3a1a02aad3ec490a98007cbc13c37cbe84a3cd7b8e406d76e7f778" +dependencies = [ + "unicode-ident", +] + +[[package]] +name = "quote" +version = "1.0.40" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1885c039570dc00dcb4ff087a89e185fd56bae234ddc7f056a945bf36467248d" +dependencies = [ + "proc-macro2", +] + +[[package]] +name = "r-efi" +version = "5.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "74765f6d916ee2faa39bc8e68e4f3ed8949b48cccdac59983d287a7cb71ce9c5" + +[[package]] +name = "rand" +version = "0.8.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "34af8d1a0e25924bc5b7c43c079c942339d8f0a8b57c39049bef581b46327404" +dependencies = [ + "libc", + "rand_chacha 0.3.1", + "rand_core 0.6.4", +] + +[[package]] +name = "rand" +version = "0.9.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9fbfd9d094a40bf3ae768db9361049ace4c0e04a4fd6b359518bd7b73a73dd97" +dependencies = [ + "rand_chacha 0.9.0", + "rand_core 0.9.3", +] + +[[package]] +name = "rand_chacha" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e6c10a63a0fa32252be49d21e7709d4d4baf8d231c2dbce1eaa8141b9b127d88" +dependencies = [ + "ppv-lite86", + "rand_core 0.6.4", +] + +[[package]] +name = "rand_chacha" +version = "0.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d3022b5f1df60f26e1ffddd6c66e8aa15de382ae63b3a0c1bfc0e4d3e3f325cb" +dependencies = [ + "ppv-lite86", + "rand_core 0.9.3", +] + +[[package]] +name = "rand_core" +version = "0.6.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ec0be4795e2f6a28069bec0b5ff3e2ac9bafc99e6a9a7dc3547996c5c816922c" +dependencies = [ + "getrandom 0.2.16", +] + +[[package]] +name = "rand_core" +version = "0.9.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "99d9a13982dcf210057a8a78572b2217b667c3beacbf3a0d8b454f6f82837d38" +dependencies = [ + "getrandom 0.3.3", +] + +[[package]] +name = "rayon" +version = "1.10.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b418a60154510ca1a002a752ca9714984e21e4241e804d32555251faf8b78ffa" +dependencies = [ + "either", + "rayon-core", +] + +[[package]] +name = "rayon-core" +version = "1.12.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1465873a3dfdaa8ae7cb14b4383657caab0b3e8a0aa9ae8e04b044854c8dfce2" +dependencies = [ + "crossbeam-deque", + "crossbeam-utils", +] + +[[package]] +name = "redox_syscall" +version = "0.2.16" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fb5a58c1855b4b6819d59012155603f0b22ad30cad752600aadfcb695265519a" +dependencies = [ + "bitflags 1.3.2", +] + +[[package]] +name = "redox_syscall" +version = "0.5.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "928fca9cf2aa042393a8325b9ead81d2f0df4cb12e1e24cef072922ccd99c5af" +dependencies = [ + "bitflags 2.9.1", +] + +[[package]] +name = "regex" +version = "1.11.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b544ef1b4eac5dc2db33ea63606ae9ffcfac26c1416a2806ae0bf5f56b201191" +dependencies = [ + "aho-corasick", + "memchr", + "regex-automata", + "regex-syntax", +] + +[[package]] +name = "regex-automata" +version = "0.4.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "809e8dc61f6de73b46c85f4c96486310fe304c434cfa43669d7b40f711150908" +dependencies = [ + "aho-corasick", + "memchr", + "regex-syntax", +] + +[[package]] +name = "regex-syntax" +version = "0.8.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2b15c43186be67a4fd63bee50d0303afffcef381492ebe2c5d87f324e1b8815c" + +[[package]] +name = "reqwest" +version = "0.12.15" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d19c46a6fdd48bc4dab94b6103fccc55d34c67cc0ad04653aad4ea2a07cd7bbb" +dependencies = [ + "base64", + "bytes", + "encoding_rs", + "futures-core", + "futures-util", + "h2", + "http", + "http-body", + "http-body-util", + "hyper", + "hyper-rustls", + "hyper-tls", + "hyper-util", + "ipnet", + "js-sys", + "log", + "mime", + "native-tls", + "once_cell", + "percent-encoding", + "pin-project-lite", + "rustls-pemfile", + "serde", + "serde_json", + "serde_urlencoded", + "sync_wrapper", + "system-configuration", + "tokio", + "tokio-native-tls", + "tokio-util", + "tower", + "tower-service", + "url", + "wasm-bindgen", + "wasm-bindgen-futures", + "wasm-streams", + "web-sys", + "windows-registry", +] + +[[package]] +name = "reqwest-middleware" +version = "0.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "57f17d28a6e6acfe1733fe24bcd30774d13bffa4b8a22535b4c8c98423088d4e" +dependencies = [ + "anyhow", + "async-trait", + "http", + "reqwest", + "serde", + "thiserror 1.0.69", + "tower-service", +] + +[[package]] +name = "reqwest-retry" +version = "0.7.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "29c73e4195a6bfbcb174b790d9b3407ab90646976c55de58a6515da25d851178" +dependencies = [ + "anyhow", + "async-trait", + "futures", + "getrandom 0.2.16", + "http", + "hyper", + "parking_lot 0.11.2", + "reqwest", + "reqwest-middleware", + "retry-policies", + "thiserror 1.0.69", + "tokio", + "tracing", + "wasm-timer", +] + +[[package]] +name = "retry-policies" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5875471e6cab2871bc150ecb8c727db5113c9338cc3354dc5ee3425b6aa40a1c" +dependencies = [ + "rand 0.8.5", +] + +[[package]] +name = "ring" +version = "0.17.14" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a4689e6c2294d81e88dc6261c768b63bc4fcdb852be6d1352498b114f61383b7" +dependencies = [ + "cc", + "cfg-if 1.0.0", + "getrandom 0.2.16", + "libc", + "untrusted", + "windows-sys 0.52.0", +] + +[[package]] +name = "rustc-demangle" +version = "0.1.24" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "719b953e2095829ee67db738b3bfa9fa368c94900df327b3f07fe6e794d2fe1f" + +[[package]] +name = "rustc-hash" +version = "1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "08d43f7aa6b08d49f382cde6a7982047c3426db949b1424bc4b7ec9ae12c6ce2" + +[[package]] +name = "rustix" +version = "1.0.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c71e83d6afe7ff64890ec6b71d6a69bb8a610ab78ce364b3352876bb4c801266" +dependencies = [ + "bitflags 2.9.1", + "errno", + "libc", + "linux-raw-sys", + "windows-sys 0.59.0", +] + +[[package]] +name = "rustls" +version = "0.23.27" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "730944ca083c1c233a75c09f199e973ca499344a2b7ba9e755c457e86fb4a321" +dependencies = [ + "once_cell", + "rustls-pki-types", + "rustls-webpki", + "subtle", + "zeroize", +] + +[[package]] +name = "rustls-pemfile" +version = "2.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dce314e5fee3f39953d46bb63bb8a46d40c2f8fb7cc5a3b6cab2bde9721d6e50" +dependencies = [ + "rustls-pki-types", +] + +[[package]] +name = "rustls-pki-types" +version = "1.12.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "229a4a4c221013e7e1f1a043678c5cc39fe5171437c88fb47151a21e6f5b5c79" +dependencies = [ + "zeroize", +] + +[[package]] +name = "rustls-webpki" +version = "0.103.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e4a72fe2bcf7a6ac6fd7d0b9e5cb68aeb7d4c0a0271730218b3e92d43b4eb435" +dependencies = [ + "ring", + "rustls-pki-types", + "untrusted", +] + +[[package]] +name = "rustversion" +version = "1.0.21" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8a0d197bd2c9dc6e53b84da9556a69ba4cdfab8619eb41a8bd1cc2027a0f6b1d" + +[[package]] +name = "ryu" +version = "1.0.20" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "28d3b2b1366ec20994f1fd18c3c594f05c5dd4bc44d8bb0c1c632c8d6829481f" + +[[package]] +name = "safe-transmute" +version = "0.11.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3944826ff8fa8093089aba3acb4ef44b9446a99a16f3bf4e74af3f77d340ab7d" + +[[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.27" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1f29ebaa345f945cec9fbbc532eb307f0fdad8161f281b6369539c8d84876b3d" +dependencies = [ + "windows-sys 0.59.0", +] + +[[package]] +name = "scopeguard" +version = "1.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "94143f37725109f92c262ed2cf5e59bce7498c01bcc1502d7b9afe439a4e9f49" + +[[package]] +name = "security-framework" +version = "2.11.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "897b2245f0b511c87893af39b033e5ca9cce68824c4d7e7630b5a1d339658d02" +dependencies = [ + "bitflags 2.9.1", + "core-foundation", + "core-foundation-sys", + "libc", + "security-framework-sys", +] + +[[package]] +name = "security-framework-sys" +version = "2.14.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "49db231d56a190491cb4aeda9527f1ad45345af50b0851622a7adb8c03b01c32" +dependencies = [ + "core-foundation-sys", + "libc", +] + +[[package]] +name = "serde" +version = "1.0.219" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5f0e2c6ed6606019b4e29e69dbaba95b11854410e5347d525002456dbbb786b6" +dependencies = [ + "serde_derive", +] + +[[package]] +name = "serde_derive" +version = "1.0.219" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5b0276cf7f2c73365f7157c8123c21cd9a50fbbd844757af28ca1f5925fc2a00" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.101", +] + +[[package]] +name = "serde_json" +version = "1.0.140" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "20068b6e96dc6c9bd23e01df8827e6c7e1f2fddd43c21810382803c136b99373" +dependencies = [ + "itoa", + "memchr", + "ryu", + "serde", +] + +[[package]] +name = "serde_repr" +version = "0.1.20" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "175ee3e80ae9982737ca543e96133087cbd9a485eecc3bc4de9c1a37b47ea59c" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.101", +] + +[[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 1.0.0", + "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.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9203b8055f63a2a00e2f593bb0510367fe707d7ff1e5c872de2f537b339e5410" +dependencies = [ + "libc", +] + +[[package]] +name = "slab" +version = "0.4.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8f92a496fb766b417c996b9c5e57daf2f7ad3b0bebe1ccfca4856390e3d3bb67" +dependencies = [ + "autocfg", +] + +[[package]] +name = "smallvec" +version = "1.15.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8917285742e9f3e1683f0a9c4e6b57960b7314d0b08d30d1ecd426713ee2eee9" + +[[package]] +name = "socket2" +version = "0.5.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4f5fd57c80058a56cf5c777ab8a126398ece8e442983605d280a44ce79d0edef" +dependencies = [ + "libc", + "windows-sys 0.52.0", +] + +[[package]] +name = "stable_deref_trait" +version = "1.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a8f112729512f8e442d81f95a8a7ddf2b7c6b8a1a6f509a95864142b30cab2d3" + +[[package]] +name = "static_assertions" +version = "1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a2eb9349b6444b326872e140eb1cf5e7c522154d69e7a0ffb0fb81c06b37543f" + +[[package]] +name = "strsim" +version = "0.10.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "73473c0e59e6d5812c5dfe2a064a6444949f089e20eec9a2e5506596494e4623" + +[[package]] +name = "strsim" +version = "0.11.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7da8b5736845d9f2fcb837ea5d9e2628564b3b043a70948a3f0b778838c5fb4f" + +[[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.101" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8ce2b7fc941b3a24138a0a7cf8e858bfc6a992e7978a068a5c760deb0ed43caf" +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 = "synchronoise" +version = "1.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3dbc01390fc626ce8d1cffe3376ded2b72a11bb70e1c75f404a210e4daa4def2" +dependencies = [ + "crossbeam-queue", +] + +[[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.101", +] + +[[package]] +name = "system-configuration" +version = "0.6.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3c879d448e9d986b661742763247d3693ed13609438cf3d006f51f5368a5ba6b" +dependencies = [ + "bitflags 2.9.1", + "core-foundation", + "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.20.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e8a64e3985349f2441a1a9ef0b853f869006c3855f2cda6862a94d26ebb9d6a1" +dependencies = [ + "fastrand", + "getrandom 0.3.3", + "once_cell", + "rustix", + "windows-sys 0.59.0", +] + +[[package]] +name = "termcolor" +version = "1.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "06794f8f6c5c898b3275aebefa6b8a1cb24cd2c6c79397ab15774837a0bc5755" +dependencies = [ + "winapi-util", +] + +[[package]] +name = "termtree" +version = "0.5.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8f50febec83f5ee1df3015341d8bd429f2d1cc62bcba7ea2076759d315084683" + +[[package]] +name = "textwrap" +version = "0.16.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c13547615a44dc9c452a8a534638acdf07120d4b6847c8178705da06306a3057" + +[[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.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "567b8a2dae586314f7be2a752ec7474332959c6460e02bde30d702a66d488708" +dependencies = [ + "thiserror-impl 2.0.12", +] + +[[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.101", +] + +[[package]] +name = "thiserror-impl" +version = "2.0.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7f7cf42b4507d8ea322120659672cf1b9dbb93f8f2d4ecfd6e51350ff5b17a1d" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.101", +] + +[[package]] +name = "tinystr" +version = "0.8.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5d4f6d1145dcb577acf783d4e601bc1d76a13337bb54e6233add580b07344c8b" +dependencies = [ + "displaydoc", + "zerovec", +] + +[[package]] +name = "tokio" +version = "1.45.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2513ca694ef9ede0fb23fe71a4ee4107cb102b9dc1930f6d0fd77aae068ae165" +dependencies = [ + "backtrace", + "bytes", + "libc", + "mio", + "parking_lot 0.12.3", + "pin-project-lite", + "signal-hook-registry", + "socket2", + "tokio-macros", + "windows-sys 0.52.0", +] + +[[package]] +name = "tokio-macros" +version = "2.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6e06d43f1345a3bcd39f6a56dbb7dcab2ba47e68e8ac134855e7e2bdbaf8cab8" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.101", +] + +[[package]] +name = "tokio-native-tls" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bbae76ab933c85776efabc971569dd6119c580d8f5d448769dec1764bf796ef2" +dependencies = [ + "native-tls", + "tokio", +] + +[[package]] +name = "tokio-rustls" +version = "0.26.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8e727b36a1a0e8b74c376ac2211e40c2c8af09fb4013c60d910495810f008e9b" +dependencies = [ + "rustls", + "tokio", +] + +[[package]] +name = "tokio-stream" +version = "0.1.17" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "eca58d7bba4a75707817a2c44174253f9236b2d5fbd055602e9d5c07c139a047" +dependencies = [ + "futures-core", + "pin-project-lite", + "tokio", +] + +[[package]] +name = "tokio-util" +version = "0.7.15" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "66a539a9ad6d5d281510d5bd368c973d636c02dbf8a67300bfb6b950696ad7df" +dependencies = [ + "bytes", + "futures-core", + "futures-sink", + "pin-project-lite", + "tokio", +] + +[[package]] +name = "tokio_with_wasm" +version = "0.8.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ed200846e8d48af28bd5724098dde6986c4a9f5136eb8e07477a078f054053cf" +dependencies = [ + "js-sys", + "tokio", + "tokio_with_wasm_proc", + "wasm-bindgen", + "wasm-bindgen-futures", + "web-sys", +] + +[[package]] +name = "tokio_with_wasm_proc" +version = "0.8.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "499ed9d797c376545920fa64c39c3efb34217ba4db826102db6c3912555291c9" +dependencies = [ + "quote", + "syn 2.0.101", +] + +[[package]] +name = "tower" +version = "0.5.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d039ad9159c98b70ecfd540b2573b97f7f52c3e8d9f8ad57a24b916a536975f9" +dependencies = [ + "futures-core", + "futures-util", + "pin-project-lite", + "sync_wrapper", + "tokio", + "tower-layer", + "tower-service", +] + +[[package]] +name = "tower-layer" +version = "0.3.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "121c2a6cda46980bb0fcd1647ffaf6cd3fc79a013de288782836f6df9c48780e" + +[[package]] +name = "tower-service" +version = "0.3.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8df9b6e13f2d32c91b9bd719c00d1958837bc7dec474d94952798cc8e69eeec3" + +[[package]] +name = "tracing" +version = "0.1.41" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "784e0ac535deb450455cbfa28a6f0df145ea1bb7ae51b821cf5e7927fdcfbdd0" +dependencies = [ + "pin-project-lite", + "tracing-attributes", + "tracing-core", +] + +[[package]] +name = "tracing-attributes" +version = "0.1.28" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "395ae124c09f9e6918a2310af6038fba074bcf474ac352496d5910dd59a2226d" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.101", +] + +[[package]] +name = "tracing-core" +version = "0.1.33" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e672c95779cf947c5311f83787af4fa8fffd12fb27e4993211a84bdfd9610f9c" +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 = "twox-hash" +version = "1.6.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "97fee6b57c6a41524a810daee9286c02d7752c4253064d0b05472833a438f675" +dependencies = [ + "cfg-if 1.0.0", + "static_assertions", +] + +[[package]] +name = "typenum" +version = "1.18.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1dccffe3ce07af9386bfd29e80c0ab1a8205a2fc34e4bcd40364df902cfa8f3f" + +[[package]] +name = "unicode-ident" +version = "1.0.18" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5a5f39404a5da50712a4c1eecf25e90dd62b613502b7e925fd4e4d19b5c96512" + +[[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.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "32f8b686cadd1473f4bd0117a5d28d36b1ade384ea9b5069a1c40aefed7fda60" +dependencies = [ + "form_urlencoded", + "idna", + "percent-encoding", +] + +[[package]] +name = "utf8_iter" +version = "1.0.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b6c140620e7ffbb22c2dee59cafe6084a59b5ffc27a8859a5f0d494b5d52b6be" + +[[package]] +name = "utf8parse" +version = "0.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "06abde3611657adf66d383f00b093d7faecc7fa57071cce2578660c9f1010821" + +[[package]] +name = "utils" +version = "0.14.5" +dependencies = [ + "async-trait", + "bytes", + "ctor", + "futures", + "lazy_static", + "log", + "merklehash", + "parking_lot 0.11.2", + "paste", + "pin-project", + "thiserror 2.0.12", + "tokio", + "tracing", +] + +[[package]] +name = "uuid" +version = "1.16.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "458f7a779bf54acc9f347480ac654f68407d3aab21269a6e3c9f922acd9e2da9" +dependencies = [ + "getrandom 0.3.3", + "js-sys", + "wasm-bindgen", +] + +[[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.0+wasi-snapshot-preview1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9c8d87e72b64a3b4db28d11ce29237c246188f4f51057d65a7eab63b7987e423" + +[[package]] +name = "wasi" +version = "0.14.2+wasi-0.2.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9683f9a5a998d873c0d21fcbe3c083009670149a8fab228644b8bd36b2c48cb3" +dependencies = [ + "wit-bindgen-rt", +] + +[[package]] +name = "wasite" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b8dad83b4f25e74f184f64c43b150b91efe7647395b42289f38e50566d82855b" + +[[package]] +name = "wasm-bindgen" +version = "0.2.100" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1edc8929d7499fc4e8f0be2262a241556cfc54a0bea223790e71446f2aab1ef5" +dependencies = [ + "cfg-if 1.0.0", + "once_cell", + "rustversion", + "wasm-bindgen-macro", +] + +[[package]] +name = "wasm-bindgen-backend" +version = "0.2.100" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2f0a0651a5c2bc21487bde11ee802ccaf4c51935d0d3d42a6101f98161700bc6" +dependencies = [ + "bumpalo", + "log", + "proc-macro2", + "quote", + "syn 2.0.101", + "wasm-bindgen-shared", +] + +[[package]] +name = "wasm-bindgen-futures" +version = "0.4.50" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "555d470ec0bc3bb57890405e5d4322cc9ea83cebb085523ced7be4144dac1e61" +dependencies = [ + "cfg-if 1.0.0", + "js-sys", + "once_cell", + "wasm-bindgen", + "web-sys", +] + +[[package]] +name = "wasm-bindgen-macro" +version = "0.2.100" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7fe63fc6d09ed3792bd0897b314f53de8e16568c2b3f7982f468c0bf9bd0b407" +dependencies = [ + "quote", + "wasm-bindgen-macro-support", +] + +[[package]] +name = "wasm-bindgen-macro-support" +version = "0.2.100" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8ae87ea40c9f689fc23f209965b6fb8a99ad69aeeb0231408be24920604395de" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.101", + "wasm-bindgen-backend", + "wasm-bindgen-shared", +] + +[[package]] +name = "wasm-bindgen-shared" +version = "0.2.100" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1a05d73b933a847d6cccdda8f838a22ff101ad9bf93e33684f39c1f5f0eece3d" +dependencies = [ + "unicode-ident", +] + +[[package]] +name = "wasm-bindgen-test" +version = "0.3.50" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "66c8d5e33ca3b6d9fa3b4676d774c5778031d27a578c2b007f905acf816152c3" +dependencies = [ + "js-sys", + "minicov", + "wasm-bindgen", + "wasm-bindgen-futures", + "wasm-bindgen-test-macro", +] + +[[package]] +name = "wasm-bindgen-test-macro" +version = "0.3.50" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "17d5042cc5fa009658f9a7333ef24291b1291a25b6382dd68862a7f3b969f69b" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.101", +] + +[[package]] +name = "wasm-streams" +version = "0.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "15053d8d85c7eccdbefef60f06769760a563c7f0a9d6902a13d35c7800b0ad65" +dependencies = [ + "futures-util", + "js-sys", + "wasm-bindgen", + "wasm-bindgen-futures", + "web-sys", +] + +[[package]] +name = "wasm-timer" +version = "0.2.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "be0ecb0db480561e9a7642b5d3e4187c128914e58aa84330b9493e3eb68c5e7f" +dependencies = [ + "futures", + "js-sys", + "parking_lot 0.11.2", + "pin-utils", + "wasm-bindgen", + "wasm-bindgen-futures", + "web-sys", +] + +[[package]] +name = "wasm_thread" +version = "0.3.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b7516db7f32decdadb1c3b8deb1b7d78b9df7606c5cc2f6241737c2ab3a0258e" +dependencies = [ + "futures", + "js-sys", + "wasm-bindgen", + "web-sys", +] + +[[package]] +name = "web-sys" +version = "0.3.77" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "33b6dd2ef9186f1f2072e409e99cd22a975331a6b3591b12c764e0e55c60d5d2" +dependencies = [ + "js-sys", + "wasm-bindgen", +] + +[[package]] +name = "whoami" +version = "1.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6994d13118ab492c3c80c1f81928718159254c53c472bf9ce36f8dae4add02a7" +dependencies = [ + "redox_syscall 0.5.12", + "wasite", + "web-sys", +] + +[[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.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cf221c93e13a30d793f7645a0e7762c55d169dbb0a49671918a2319d289b10bb" +dependencies = [ + "windows-sys 0.59.0", +] + +[[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.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "76840935b766e1b0a05c0066835fb9ec80071d4c09a16f6bd5f7e655e3c14c38" + +[[package]] +name = "windows-registry" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4286ad90ddb45071efd1a66dfa43eb02dd0dfbae1545ad6cc3c51cf34d7e8ba3" +dependencies = [ + "windows-result", + "windows-strings", + "windows-targets 0.53.0", +] + +[[package]] +name = "windows-result" +version = "0.3.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "56f42bd332cc6c8eac5af113fc0c1fd6a8fd2aa08a0119358686e5160d0586c6" +dependencies = [ + "windows-link", +] + +[[package]] +name = "windows-strings" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "87fa48cc5d406560701792be122a10132491cff9d0aeb23583cc2dcafc847319" +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.59.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1e38bc4d79ed67fd075bcc251a1c39b32a1776bbe92e5bef1f0bf1f8c531853b" +dependencies = [ + "windows-targets 0.52.6", +] + +[[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.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b1e4c7e8ceaaf9cb7d7507c974735728ab453b67ef8f18febdd7c11fe59dca8b" +dependencies = [ + "windows_aarch64_gnullvm 0.53.0", + "windows_aarch64_msvc 0.53.0", + "windows_i686_gnu 0.53.0", + "windows_i686_gnullvm 0.53.0", + "windows_i686_msvc 0.53.0", + "windows_x86_64_gnu 0.53.0", + "windows_x86_64_gnullvm 0.53.0", + "windows_x86_64_msvc 0.53.0", +] + +[[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.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "86b8d5f90ddd19cb4a147a5fa63ca848db3df085e25fee3cc10b39b6eebae764" + +[[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.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c7651a1f62a11b8cbd5e0d42526e55f2c99886c77e007179efff86c2b137e66c" + +[[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.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c1dc67659d35f387f5f6c479dc4e28f1d4bb90ddd1a5d3da2e5d97b42d6272c3" + +[[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.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9ce6ccbdedbf6d6354471319e781c0dfef054c81fbc7cf83f338a4296c0cae11" + +[[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.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "581fee95406bb13382d2f65cd4a908ca7b1e4c2f1917f143ba16efe98a589b5d" + +[[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.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2e55b5ac9ea33f2fc1716d1742db15574fd6fc8dadc51caab1c16a3d3b4190ba" + +[[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.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0a6e035dd0599267ce1ee132e51c27dd29437f63325753051e71dd9e42406c57" + +[[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.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "271414315aff87387382ec3d271b52d7ae78726f5d44ac98b4f4030c91880486" + +[[package]] +name = "wit-bindgen-rt" +version = "0.39.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6f42320e61fe2cfd34354ecb597f86f413484a798ba44a8ca1165c58d42da6c1" +dependencies = [ + "bitflags 2.9.1", +] + +[[package]] +name = "writeable" +version = "0.6.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ea2f10b9bb0928dfb1b42b65e1f9e36f7f54dbdf08457afefb38afcdec4fa2bb" + +[[package]] +name = "xet_threadpool" +version = "0.1.0" +dependencies = [ + "thiserror 2.0.12", + "tokio", + "tracing", +] + +[[package]] +name = "yoke" +version = "0.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5f41bb01b8226ef4bfd589436a297c53d118f65921786300e427be8d487695cc" +dependencies = [ + "serde", + "stable_deref_trait", + "yoke-derive", + "zerofrom", +] + +[[package]] +name = "yoke-derive" +version = "0.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "38da3c9736e16c5d3c8c597a9aaa5d1fa565d0532ae05e27c24aa62fb32c0ab6" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.101", + "synstructure", +] + +[[package]] +name = "zerocopy" +version = "0.8.25" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a1702d9583232ddb9174e01bb7c15a2ab8fb1bc6f227aa1233858c351a3ba0cb" +dependencies = [ + "zerocopy-derive", +] + +[[package]] +name = "zerocopy-derive" +version = "0.8.25" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "28a6e20d751156648aa063f3800b706ee209a32c0b4d9f24be3d980b01be55ef" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.101", +] + +[[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.101", + "synstructure", +] + +[[package]] +name = "zeroize" +version = "1.8.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ced3678a2879b30306d323f4542626697a464a97c0a07c9aebf7ebca65cd4dde" + +[[package]] +name = "zerotrie" +version = "0.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "36f0bbd478583f79edad978b407914f61b2972f5af6fa089686016be8f9af595" +dependencies = [ + "displaydoc", + "yoke", + "zerofrom", +] + +[[package]] +name = "zerovec" +version = "0.11.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4a05eb080e015ba39cc9e23bbe5e7fb04d5fb040350f99f34e338d5fdd294428" +dependencies = [ + "yoke", + "zerofrom", + "zerovec-derive", +] + +[[package]] +name = "zerovec-derive" +version = "0.11.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5b96237efa0c878c64bd89c436f661be4e46b2f3eff1ebb976f7ef2321d2f58f" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.101", +] diff --git a/hf_xet_wasm/src/auth.rs b/hf_xet_wasm/src/auth.rs index bbbaf7b7..8160ef73 100644 --- a/hf_xet_wasm/src/auth.rs +++ b/hf_xet_wasm/src/auth.rs @@ -1,9 +1,9 @@ - use std::fmt::{Debug, Formatter}; use std::sync::Arc; + use tokio::sync::Mutex; -use wasm_bindgen::JsValue; use wasm_bindgen::prelude::*; +use wasm_bindgen::JsValue; #[wasm_bindgen] extern "C" { @@ -14,13 +14,13 @@ extern "C" { pub fn expiration(this: &TokenInfo) -> u64; pub type TokenRefresher; - #[wasm_bindgen(method, catch, js_name="refreshToken")] + #[wasm_bindgen(method, catch, js_name = "refreshToken")] pub async fn refresh_token(this: &TokenRefresher) -> Result; } -/// interface TokenRefresher { -/// refresh_token(): Promise; -/// } +// interface TokenRefresher { +// refresh_token(): Promise; +// } impl From for utils::auth::TokenInfo { fn from(value: TokenInfo) -> Self { @@ -42,6 +42,7 @@ unsafe impl Sync for WrappedTokenRefresher {} impl From for WrappedTokenRefresher { fn from(value: TokenRefresher) -> Self { + #[allow(clippy::arc_with_non_send_sync)] WrappedTokenRefresher(Arc::new(Mutex::new(value))) } } diff --git a/hf_xet_wasm/src/session.rs b/hf_xet_wasm/src/session.rs index 99421982..b8400c3e 100644 --- a/hf_xet_wasm/src/session.rs +++ b/hf_xet_wasm/src/session.rs @@ -89,10 +89,7 @@ impl XetSession { #[wasm_bindgen] pub async fn finalize(self) -> Result<(), JsValue> { // flush the session - self.upload - .finalize() - .await - .map_err(|e| JsValue::from_str(&format!("{:?}", e)))?; + self.upload.finalize().await.map_err(|e| JsValue::from_str(&format!("{e:?}")))?; Ok(()) } } From 0ca7e4f78cf2d62083f59e5ee675d6ba3c8c3bea Mon Sep 17 00:00:00 2001 From: Assaf Vayner Date: Wed, 28 May 2025 09:30:52 -0700 Subject: [PATCH 4/5] working with session inferface --- Cargo.lock | 1 + hf_xet/Cargo.lock | 1 + hf_xet_wasm/Cargo.lock | 24 +++++++++++- hf_xet_wasm/Cargo.toml | 10 ++--- hf_xet_wasm/examples/commit.js | 4 +- hf_xet_wasm/examples/index.html | 63 +++++++++++++++++++++++++++----- hf_xet_wasm/examples/simple.rs | 16 ++------ hf_xet_wasm/examples/xet_meta.js | 3 +- hf_xet_wasm/src/auth.rs | 4 +- hf_xet_wasm/src/session.rs | 26 ++++++++----- utils/Cargo.toml | 2 + utils/src/auth.rs | 19 ++++++---- 12 files changed, 124 insertions(+), 49 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 85571774..1225d2c9 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -4074,6 +4074,7 @@ dependencies = [ "thiserror 2.0.11", "tokio", "tracing", + "web-time", "xet_threadpool", ] diff --git a/hf_xet/Cargo.lock b/hf_xet/Cargo.lock index 82284886..c932eb68 100644 --- a/hf_xet/Cargo.lock +++ b/hf_xet/Cargo.lock @@ -3554,6 +3554,7 @@ dependencies = [ "thiserror 2.0.11", "tokio", "tracing", + "web-time", ] [[package]] diff --git a/hf_xet_wasm/Cargo.lock b/hf_xet_wasm/Cargo.lock index 6aa7eba5..26bf8989 100644 --- a/hf_xet_wasm/Cargo.lock +++ b/hf_xet_wasm/Cargo.lock @@ -1045,8 +1045,8 @@ dependencies = [ "mdb_shard", "merkledb", "merklehash", - "reqwest", "serde", + "serde-wasm-bindgen", "serde_json", "sha2", "thiserror 2.0.12", @@ -2270,6 +2270,17 @@ dependencies = [ "serde_derive", ] +[[package]] +name = "serde-wasm-bindgen" +version = "0.6.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8302e169f0eddcc139c70f139d19d6467353af16f9fce27e8c30158036a1e16b" +dependencies = [ + "js-sys", + "serde", + "wasm-bindgen", +] + [[package]] name = "serde_derive" version = "1.0.219" @@ -2782,6 +2793,7 @@ dependencies = [ "thiserror 2.0.12", "tokio", "tracing", + "web-time", ] [[package]] @@ -2992,6 +3004,16 @@ dependencies = [ "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 = "whoami" version = "1.6.0" diff --git a/hf_xet_wasm/Cargo.toml b/hf_xet_wasm/Cargo.toml index fb9aa033..7d09451c 100644 --- a/hf_xet_wasm/Cargo.toml +++ b/hf_xet_wasm/Cargo.toml @@ -28,10 +28,10 @@ web-sys = { version = "0.3.72", features = [ "Window", "Navigator", "WorkerNavigator", - "Headers", - "Request", - "RequestInit", - "RequestMode", + "Headers", + "Request", + "RequestInit", + "RequestMode", "Response", ] } js-sys = "0.3.72" @@ -47,7 +47,6 @@ console_error_panic_hook = "0.1.7" async-trait = "0.1.88" thiserror = "2.0" async-channel = "2.3.1" -reqwest = { version = "0.12.15", features = ["json", "stream"] } anyhow = "1" serde_json = "1.0.140" @@ -60,6 +59,7 @@ cas_client = { path = "../cas_client" } cas_types = { path = "../cas_types" } utils = { path = "../utils" } serde = { version = "1.0.217", features = ["derive"] } +serde-wasm-bindgen = "0.6.5" [package.metadata.docs.rs] diff --git a/hf_xet_wasm/examples/commit.js b/hf_xet_wasm/examples/commit.js index 554d248c..ba389d02 100644 --- a/hf_xet_wasm/examples/commit.js +++ b/hf_xet_wasm/examples/commit.js @@ -10,7 +10,7 @@ * @param {string} hf_token The HF token for auth * @returns {Promise} A promise that resolves if the commit is successful, or rejects if an error occurs. */ -async function commit(file_name, sha256, file_size, repo_type, repo_id, revision, hf_token) { +async function commit(endpoint, file_name, sha256, file_size, repo_type, repo_id, revision, hf_token) { const obj1 = { key: "header", value: { @@ -32,7 +32,7 @@ async function commit(file_name, sha256, file_size, repo_type, repo_id, revision // Serialize to JSON string and concatenate with a newline. const body = `${JSON.stringify(obj1)}\n${JSON.stringify(obj2)}`; - const url = `https://huggingface.co/api/${repo_type}s/${repo_id}/commit/${revision}`; + const url = `${endpoint}/api/${repo_type}s/${repo_id}/commit/${revision}`; try { const response = await fetch(url, { diff --git a/hf_xet_wasm/examples/index.html b/hf_xet_wasm/examples/index.html index 01247c65..e59947df 100644 --- a/hf_xet_wasm/examples/index.html +++ b/hf_xet_wasm/examples/index.html @@ -13,24 +13,23 @@