Dependency cleanup (#100)

* Sort all Cargo.toml deps for less conflicts

* Move relative path deps to workspace

* Standardize workspace imports

* Rename ‘client’ to ‘logos-chat’

* Cleanups
This commit is contained in:
Jazz Turner-Baggs 2026-05-20 13:18:25 -07:00 committed by GitHub
parent d972741157
commit b7888c1a70
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
29 changed files with 130 additions and 92 deletions

26
Cargo.lock generated
View File

@ -278,8 +278,8 @@ dependencies = [
"arboard", "arboard",
"base64", "base64",
"clap", "clap",
"client",
"crossterm 0.29.0", "crossterm 0.29.0",
"logos-chat",
"ratatui", "ratatui",
"serde", "serde",
"serde_json", "serde_json",
@ -359,23 +359,12 @@ version = "1.1.0"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "c8d4a3bb8b1e0c1050499d1815f5ab16d04f0959b233085fb31653fbfc9d98f9" checksum = "c8d4a3bb8b1e0c1050499d1815f5ab16d04f0959b233085fb31653fbfc9d98f9"
[[package]]
name = "client"
version = "0.1.0"
dependencies = [
"chat-sqlite",
"components",
"libchat",
"tempfile",
"thiserror",
]
[[package]] [[package]]
name = "client-ffi" name = "client-ffi"
version = "0.1.0" version = "0.1.0"
dependencies = [ dependencies = [
"client",
"libchat", "libchat",
"logos-chat",
"safer-ffi", "safer-ffi",
] ]
@ -1744,6 +1733,17 @@ version = "0.4.29"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "5e5032e24019045c762d3c0f28f5b6b8bbf38563a65908389bf7978758920897" checksum = "5e5032e24019045c762d3c0f28f5b6b8bbf38563a65908389bf7978758920897"
[[package]]
name = "logos-chat"
version = "0.1.0"
dependencies = [
"chat-sqlite",
"components",
"libchat",
"tempfile",
"thiserror",
]
[[package]] [[package]]
name = "lru" name = "lru"
version = "0.12.5" version = "0.12.5"

View File

@ -3,15 +3,15 @@
resolver = "3" resolver = "3"
members = [ members = [
"core/sqlite", "bin/chat-cli",
"core/conversations", "core/conversations",
"core/crypto", "core/crypto",
"core/double-ratchets", "core/double-ratchets",
"core/storage",
"core/integration_tests_core", "core/integration_tests_core",
"crates/client", "core/sqlite",
"core/storage",
"crates/client-ffi", "crates/client-ffi",
"bin/chat-cli", "crates/client",
"extensions/components", "extensions/components",
] ]
@ -27,12 +27,16 @@ default-members = [
] ]
[workspace.dependencies] [workspace.dependencies]
blake2 = "0.10" # Internal Workspace dependency declarations (sorted)
crypto = { path = "core/crypto" } chat-sqlite = { path = "core/sqlite" }
libchat = { path = "core/conversations" } components = { path = "extensions/components" }
logoschat_components = {package="components", path ="extensions/components"} crypto = { path = "core/crypto" }
sqlite = { path = "core/sqlite"} libchat = { path = "core/conversations" }
storage = { path = "core/storage" } logos-chat = { path = "crates/client" }
storage = { path = "core/storage" }
# External Workspace dependency declarations (sorted)
blake2 = "0.10"
# Panicking across FFI boundaries is UB; abort is the correct strategy for a # Panicking across FFI boundaries is UB; abort is the correct strategy for a
# C FFI library. # C FFI library.

View File

@ -8,16 +8,19 @@ name = "chat-cli"
path = "src/main.rs" path = "src/main.rs"
[dependencies] [dependencies]
# Reference a specific commit so updates to the Core does not break examples # Workspace dependencies (sorted)
client = { path = "../../crates/client" } logos-chat = { workspace = true }
ratatui = "0.29"
crossterm = "0.29" # External dependencies (sorted)
clap = { version = "4", features = ["derive"] }
anyhow = "1.0" anyhow = "1.0"
serde = { version = "1.0", features = ["derive"] }
serde_json = "1.0"
arboard = "3" arboard = "3"
base64 = "0.22" base64 = "0.22"
clap = { version = "4", features = ["derive"] }
crossterm = "0.29"
ratatui = "0.29"
serde = { version = "1.0", features = ["derive"] }
serde_json = "1.0"
thiserror = "2" thiserror = "2"
tracing = "0.1" tracing = "0.1"
tracing-subscriber = { version = "0.3", features = ["env-filter"] } tracing-subscriber = { version = "0.3", features = ["env-filter"] }

View File

@ -5,7 +5,7 @@ use std::sync::mpsc;
use anyhow::Result; use anyhow::Result;
use arboard::Clipboard; use arboard::Clipboard;
use client::{ConversationIdOwned, DeliveryService}; use logos_chat::{ChatClient, ConversationIdOwned, DeliveryService};
use serde::{Deserialize, Serialize}; use serde::{Deserialize, Serialize};
use crate::utils::now; use crate::utils::now;
@ -42,7 +42,7 @@ pub struct AppState {
} }
pub struct ChatApp<D: DeliveryService> { pub struct ChatApp<D: DeliveryService> {
pub client: client::ChatClient<D>, pub client: ChatClient<D>,
inbound: mpsc::Receiver<Vec<u8>>, inbound: mpsc::Receiver<Vec<u8>>,
pub state: AppState, pub state: AppState,
/// Ephemeral command output — not persisted, cleared on chat switch. /// Ephemeral command output — not persisted, cleared on chat switch.
@ -55,7 +55,7 @@ pub struct ChatApp<D: DeliveryService> {
impl<D: DeliveryService + 'static> ChatApp<D> { impl<D: DeliveryService + 'static> ChatApp<D> {
pub fn new( pub fn new(
client: client::ChatClient<D>, client: ChatClient<D>,
inbound: mpsc::Receiver<Vec<u8>>, inbound: mpsc::Receiver<Vec<u8>>,
user_name: &str, user_name: &str,
data_dir: &Path, data_dir: &Path,

View File

@ -8,7 +8,7 @@ use std::sync::mpsc;
use anyhow::{Context, Result}; use anyhow::{Context, Result};
use clap::{Parser, ValueEnum}; use clap::{Parser, ValueEnum};
use client::DeliveryService; use logos_chat::DeliveryService;
use app::ChatApp; use app::ChatApp;
@ -105,9 +105,9 @@ fn run<D: DeliveryService + 'static>(
.context("db path contains non-UTF-8 characters")? .context("db path contains non-UTF-8 characters")?
.to_string(); .to_string();
let client = client::ChatClient::open( let client = logos_chat::ChatClient::open(
cli.name.clone(), cli.name.clone(),
client::StorageConfig::Encrypted { logos_chat::StorageConfig::Encrypted {
path: db_str, path: db_str,
key: "chat-cli".to_string(), key: "chat-cli".to_string(),
}, },
@ -160,9 +160,9 @@ fn run_logos_delivery(cli: Cli) -> Result<()> {
.to_str() .to_str()
.context("db path contains non-UTF-8 characters")? .context("db path contains non-UTF-8 characters")?
.to_string(); .to_string();
client::ChatClient::open( logos_chat::ChatClient::open(
cli.name.clone(), cli.name.clone(),
client::StorageConfig::Encrypted { logos_chat::StorageConfig::Encrypted {
path: db_str, path: db_str,
key: "chat-cli".to_string(), key: "chat-cli".to_string(),
}, },
@ -171,7 +171,7 @@ fn run_logos_delivery(cli: Cli) -> Result<()> {
.map_err(|e| anyhow::anyhow!("{e:?}")) .map_err(|e| anyhow::anyhow!("{e:?}"))
.context("failed to open persistent client")? .context("failed to open persistent client")?
} }
None => client::ChatClient::new(cli.name.clone(), delivery), None => logos_chat::ChatClient::new(cli.name.clone(), delivery),
}; };
let mut app = ChatApp::new(client, inbound, &cli.name, &data_dir)?; let mut app = ChatApp::new(client, inbound, &cli.name, &data_dir)?;

View File

@ -6,7 +6,7 @@ use std::sync::mpsc;
use std::thread; use std::thread;
use std::time::{Duration, SystemTime, UNIX_EPOCH}; use std::time::{Duration, SystemTime, UNIX_EPOCH};
use client::{AddressedEnvelope, DeliveryService}; use logos_chat::{AddressedEnvelope, DeliveryService};
#[derive(Debug, thiserror::Error)] #[derive(Debug, thiserror::Error)]
pub enum FileTransportError { pub enum FileTransportError {

View File

@ -18,7 +18,7 @@ use std::time::Duration;
use base64::Engine; use base64::Engine;
use base64::engine::general_purpose::STANDARD as BASE64; use base64::engine::general_purpose::STANDARD as BASE64;
use client::{AddressedEnvelope, DeliveryService}; use logos_chat::{AddressedEnvelope, DeliveryService};
use tracing::{error, info, warn}; use tracing::{error, info, warn};
use wrapper::LogosNodeCtx; use wrapper::LogosNodeCtx;

View File

@ -16,7 +16,7 @@ use ratatui::{
widgets::{Block, Borders, List, ListItem, Paragraph, Wrap}, widgets::{Block, Borders, List, ListItem, Paragraph, Wrap},
}; };
use client::DeliveryService; use logos_chat::DeliveryService;
use crate::app::ChatApp; use crate::app::ChatApp;

View File

@ -7,23 +7,29 @@ edition = "2024"
crate-type = ["rlib","staticlib"] crate-type = ["rlib","staticlib"]
[dependencies] [dependencies]
# Workspace dependencies (sorted)
blake2 = { workspace = true }
chat-sqlite = { workspace = true }
crypto = { workspace = true }
storage = { workspace = true }
# External dependencies (sorted)
base64 = "0.22" base64 = "0.22"
sqlite = { package = "chat-sqlite", path = "../sqlite" }
blake2.workspace = true
chat-proto = { git = "https://github.com/logos-messaging/chat_proto" } chat-proto = { git = "https://github.com/logos-messaging/chat_proto" }
crypto = { path = "../crypto" }
double-ratchets = { path = "../double-ratchets" } double-ratchets = { path = "../double-ratchets" }
hex = "0.4.3" hex = "0.4.3"
openmls = { version = "0.8.1", features = ["libcrux-provider"] }
openmls_libcrux_crypto = "0.3.1"
openmls_traits = "0.5.0"
prost = "0.14.1" prost = "0.14.1"
rand_core = { version = "0.6" } rand_core = { version = "0.6" }
safer-ffi = "0.1.13" safer-ffi = "0.1.13"
thiserror = "2.0.17" thiserror = "2.0.17"
x25519-dalek = { version = "2.0.1", features = ["static_secrets", "reusable_secrets", "getrandom"] } x25519-dalek = { version = "2.0.1", features = ["static_secrets", "reusable_secrets", "getrandom"] }
storage = { path = "../storage" }
openmls = { version = "0.8.1", features = ["libcrux-provider"] }
openmls_libcrux_crypto = "0.3.1"
openmls_traits = "0.5.0"
[dev-dependencies] [dev-dependencies]
components = { package = "components", path = "../../extensions/components" } # Workspace dependencies (sorted)
components = { workspace = true }
# External dependencies (sorted)
tempfile = "3" tempfile = "3"

View File

@ -281,8 +281,8 @@ impl<S: ConversationStore + RatchetStore> Debug for PrivateV1Convo<S> {
#[cfg(test)] #[cfg(test)]
mod tests { mod tests {
use chat_sqlite::{ChatStorage, StorageConfig};
use crypto::PrivateKey; use crypto::PrivateKey;
use sqlite::{ChatStorage, StorageConfig};
use super::*; use super::*;

View File

@ -260,7 +260,7 @@ mod tests {
use std::cell::RefCell; use std::cell::RefCell;
use super::*; use super::*;
use sqlite::{ChatStorage, StorageConfig}; use chat_sqlite::{ChatStorage, StorageConfig};
#[test] #[test]
fn test_invite_privatev1_roundtrip() { fn test_invite_privatev1_roundtrip() {

View File

@ -11,11 +11,11 @@ mod types;
mod utils; mod utils;
pub use account::LogosAccount; pub use account::LogosAccount;
pub use chat_sqlite::ChatStorage;
pub use chat_sqlite::StorageConfig;
pub use context::{Context, ConversationId, ConversationIdOwned, Introduction}; pub use context::{Context, ConversationId, ConversationIdOwned, Introduction};
pub use conversation::GroupConvo; pub use conversation::GroupConvo;
pub use errors::ChatError; pub use errors::ChatError;
pub use service_traits::{DeliveryService, RegistrationService}; pub use service_traits::{DeliveryService, RegistrationService};
pub use sqlite::ChatStorage;
pub use sqlite::StorageConfig;
pub use types::{AccountId, AddressedEnvelope, ContentData}; pub use types::{AccountId, AddressedEnvelope, ContentData};
pub use utils::hex_trunc; pub use utils::hex_trunc;

View File

@ -4,12 +4,13 @@ version = "0.1.0"
edition = "2024" edition = "2024"
[dependencies] [dependencies]
x25519-dalek = { version = "2.0.1", features = ["static_secrets"] } # External dependencies (sorted)
hkdf = "0.12"
sha2 = "0.10"
rand_core = { version = "0.6", features = ["getrandom"] }
ed25519-dalek = { version = "2.2.0", features = ["rand_core"] } ed25519-dalek = { version = "2.2.0", features = ["rand_core"] }
xeddsa = "1.0.2"
zeroize = {version = "1.8.2", features= ["derive"]}
generic-array = "1.3.5" generic-array = "1.3.5"
hkdf = "0.12"
rand_core = { version = "0.6", features = ["getrandom"] }
sha2 = "0.10"
thiserror = "2" thiserror = "2"
x25519-dalek = { version = "2.0.1", features = ["static_secrets"] }
xeddsa = "1.0.2"
zeroize = { version = "1.8.2", features = ["derive"] }

View File

@ -7,17 +7,23 @@ edition = "2024"
crate-type = ["rlib", "cdylib"] crate-type = ["rlib", "cdylib"]
[dependencies] [dependencies]
x25519-dalek = { version="2.0.1", features=["static_secrets"] } # Workspace dependencies (sorted)
chacha20poly1305 = "0.10.1"
rand_core = "0.6.4"
rand = "0.9.3"
hkdf = "0.12.4"
thiserror = "2"
blake2 = "0.10.6"
zeroize = "1.8.2"
storage = { workspace = true } storage = { workspace = true }
# External dependencies (sorted)
blake2 = "0.10.6"
chacha20poly1305 = "0.10.1"
hkdf = "0.12.4"
rand = "0.9.3"
rand_core = "0.6.4"
serde = "1.0" serde = "1.0"
thiserror = "2"
x25519-dalek = { version = "2.0.1", features = ["static_secrets"] }
zeroize = "1.8.2"
[dev-dependencies] [dev-dependencies]
sqlite = { package = "chat-sqlite", path = "../sqlite" } # Workspace dependencies (sorted)
chat-sqlite = { workspace = true }
# External dependencies (sorted)
tempfile = "3" tempfile = "3"

View File

@ -2,8 +2,8 @@
//! //!
//! Run with: cargo run --example out_of_order_demo -p double-ratchets //! Run with: cargo run --example out_of_order_demo -p double-ratchets
use chat_sqlite::{ChatStorage, StorageConfig};
use double_ratchets::{InstallationKeyPair, RatchetSession}; use double_ratchets::{InstallationKeyPair, RatchetSession};
use sqlite::{ChatStorage, StorageConfig};
use tempfile::NamedTempFile; use tempfile::NamedTempFile;
fn main() { fn main() {

View File

@ -2,8 +2,8 @@
//! //!
//! Run with: cargo run --example storage_demo -p double-ratchets //! Run with: cargo run --example storage_demo -p double-ratchets
use chat_sqlite::{ChatStorage, StorageConfig};
use double_ratchets::{InstallationKeyPair, RatchetSession}; use double_ratchets::{InstallationKeyPair, RatchetSession};
use sqlite::{ChatStorage, StorageConfig};
use tempfile::NamedTempFile; use tempfile::NamedTempFile;
fn main() { fn main() {

View File

@ -168,7 +168,7 @@ fn save_state<S: RatchetStore, D: HkdfInfo>(
mod tests { mod tests {
use super::*; use super::*;
use crate::hkdf::DefaultDomain; use crate::hkdf::DefaultDomain;
use sqlite::ChatStorage; use chat_sqlite::ChatStorage;
fn create_test_storage() -> ChatStorage { fn create_test_storage() -> ChatStorage {
ChatStorage::in_memory() ChatStorage::in_memory()

View File

@ -7,9 +7,11 @@ edition = "2024"
# name = "integration_tests_core" # name = "integration_tests_core"
[dev-dependencies] [dev-dependencies]
# Workspace dependencies (sorted)
components = { workspace = true }
libchat = { workspace = true } libchat = { workspace = true }
chat-sqlite = { workspace = true }
storage = { workspace = true } storage = { workspace = true }
sqlite = {package = "chat-sqlite", path ="../sqlite"}
components = { path = "../../extensions/components" } # External dependencies (sorted)
tempfile = "3" tempfile = "3"

View File

@ -1,5 +1,5 @@
use chat_sqlite::{ChatStorage, StorageConfig};
use libchat::{Context, Introduction}; use libchat::{Context, Introduction};
use sqlite::{ChatStorage, StorageConfig};
use storage::{ConversationStore, IdentityStore}; use storage::{ConversationStore, IdentityStore};
use tempfile::tempdir; use tempfile::tempdir;

View File

@ -5,11 +5,15 @@ edition = "2024"
description = "SQLite storage implementation for libchat" description = "SQLite storage implementation for libchat"
[dependencies] [dependencies]
crypto = { path = "../crypto" } # Workspace dependencies (sorted)
crypto = { workspace = true }
storage = { workspace = true }
# External dependencies (sorted)
hex = "0.4.3" hex = "0.4.3"
storage = { path = "../storage" }
zeroize = { version = "1.8.2", features = ["derive"] }
rusqlite = { version = "0.35", features = ["bundled-sqlcipher-vendored-openssl"] } rusqlite = { version = "0.35", features = ["bundled-sqlcipher-vendored-openssl"] }
zeroize = { version = "1.8.2", features = ["derive"] }
[dev-dependencies] [dev-dependencies]
# External dependencies (sorted)
tempfile = "3" tempfile = "3"

View File

@ -5,5 +5,8 @@ edition = "2024"
description = "Shared storage layer for libchat" description = "Shared storage layer for libchat"
[dependencies] [dependencies]
crypto = { path = "../crypto" } # Workspace dependencies (sorted)
crypto = { workspace = true }
# External dependencies (sorted)
thiserror = "2" thiserror = "2"

View File

@ -11,9 +11,12 @@ name = "generate-headers"
required-features = ["headers"] required-features = ["headers"]
[dependencies] [dependencies]
safer-ffi = "0.1.13" # Workspace dependencies (sorted)
client = { path = "../client" }
libchat = { workspace = true } libchat = { workspace = true }
logos-chat = { workspace = true }
# External dependencies (sorted)
safer-ffi = "0.1.13"
[features] [features]
headers = ["safer-ffi/headers"] headers = ["safer-ffi/headers"]

View File

@ -2,7 +2,7 @@ use safer_ffi::prelude::*;
use std::sync::Arc; use std::sync::Arc;
use crate::delivery::{CDelivery, DeliverFn}; use crate::delivery::{CDelivery, DeliverFn};
use client::{ChatClient, ClientError}; use logos_chat::{ChatClient, ClientError};
// --------------------------------------------------------------------------- // ---------------------------------------------------------------------------
// Opaque client handle // Opaque client handle
@ -205,7 +205,7 @@ fn client_send_message(
Ok(s) => s, Ok(s) => s,
Err(_) => return ErrorCode::BadUtf8, Err(_) => return ErrorCode::BadUtf8,
}; };
let convo_id_owned: client::ConversationIdOwned = Arc::from(id_str); let convo_id_owned: logos_chat::ConversationIdOwned = Arc::from(id_str);
match handle.0.send_message(&convo_id_owned, content.as_slice()) { match handle.0.send_message(&convo_id_owned, content.as_slice()) {
Ok(()) => ErrorCode::None, Ok(()) => ErrorCode::None,
Err(ClientError::Delivery(_)) => ErrorCode::DeliveryFail, Err(ClientError::Delivery(_)) => ErrorCode::DeliveryFail,

View File

@ -1,5 +1,5 @@
use client::DeliveryService;
use libchat::AddressedEnvelope; use libchat::AddressedEnvelope;
use logos_chat::DeliveryService;
/// C callback invoked for each outbound envelope. Return 0 or positive on success, negative on /// C callback invoked for each outbound envelope. Return 0 or positive on success, negative on
/// error. `addr_ptr/addr_len` is the delivery address; `data_ptr/data_len` is the encrypted /// error. `addr_ptr/addr_len` is the delivery address; `data_ptr/data_len` is the encrypted

View File

@ -1,5 +1,5 @@
[package] [package]
name = "client" name = "logos-chat"
version = "0.1.0" version = "0.1.0"
edition = "2024" edition = "2024"
@ -7,10 +7,14 @@ edition = "2024"
crate-type = ["rlib"] crate-type = ["rlib"]
[dependencies] [dependencies]
# Workspace dependencies (sorted)
chat-sqlite = { workspace = true }
components = { workspace = true}
libchat = { workspace = true } libchat = { workspace = true }
logoschat_components = { workspace = true}
chat-sqlite = { path = "../../core/sqlite" } # External dependencies (sorted)
thiserror = "2" thiserror = "2"
[dev-dependencies] [dev-dependencies]
# External dependencies (sorted)
tempfile = "3" tempfile = "3"

View File

@ -1,4 +1,4 @@
use client::{ChatClient, ConversationIdOwned, InProcessDelivery}; use logos_chat::{ChatClient, ConversationIdOwned, InProcessDelivery};
use std::sync::Arc; use std::sync::Arc;
fn main() { fn main() {

View File

@ -3,7 +3,7 @@ use libchat::{
DeliveryService, Introduction, StorageConfig, DeliveryService, Introduction, StorageConfig,
}; };
use logoschat_components::EphemeralRegistry; use components::EphemeralRegistry;
use crate::errors::ClientError; use crate::errors::ClientError;

View File

@ -1,4 +1,4 @@
use client::{ use logos_chat::{
ChatClient, ContentData, ConversationIdOwned, Cursor, InProcessDelivery, StorageConfig, ChatClient, ContentData, ConversationIdOwned, Cursor, InProcessDelivery, StorageConfig,
}; };
use std::sync::Arc; use std::sync::Arc;

View File

@ -4,8 +4,10 @@ version = "0.1.0"
edition = "2024" edition = "2024"
[dependencies] [dependencies]
# Workspace dependencies (sorted)
crypto = { workspace = true } # Needed because Storage traits require "Identity" struct
libchat = { workspace = true } libchat = { workspace = true }
storage = { workspace = true } storage = { workspace = true }
crypto = { workspace = true } # Needed because Storage traits require "Identity" struct
hex = "0.4.3" # External dependencies (sorted)
hex = "0.4.3"