Phase 2: Rust Workspace Transformation (Part 1)

- Renamed directory: codex-backend-openapi-models -> llmx-backend-openapi-models
- Updated all Cargo.toml files:
  - Package names: codex-* -> llmx-*
  - Library names: codex_* -> llmx_*
  - Workspace dependencies updated
- Renamed Rust source files:
  - codex*.rs -> llmx*.rs (all modules)
  - codex_conversation -> llmx_conversation
  - codex_delegate -> llmx_delegate
  - codex_message_processor -> llmx_message_processor
  - codex_tool_* -> llmx_tool_*
- Updated all Rust imports:
  - use codex_* -> use llmx_*
  - mod codex* -> mod llmx*
- Updated environment variables in code:
  - CODEX_HOME -> LLMX_HOME
  - .codex -> .llmx paths
- Updated protocol crate lib name for proper linking

Note: Some compilation errors remain (type inference issues) but all
renaming is complete. Will fix compilation in next phase.

🤖 Generated with Claude Code
This commit is contained in:
Sebastian Krüger
2025-11-11 14:29:57 +01:00
parent f237fe560d
commit cb8d941adf
346 changed files with 3256 additions and 3199 deletions

View File

@@ -3,7 +3,7 @@ use std::time::Duration;
use anyhow::Error;
use anyhow::Result;
use codex_protocol::protocol::McpAuthStatus;
use llmx_protocol::protocol::McpAuthStatus;
use reqwest::Client;
use reqwest::StatusCode;
use reqwest::Url;

View File

@@ -1,33 +0,0 @@
use dirs::home_dir;
use std::path::PathBuf;
/// This was copied from codex-core but codex-core depends on this crate.
/// TODO: move this to a shared crate lower in the dependency tree.
///
///
/// Returns the path to the Codex configuration directory, which can be
/// specified by the `CODEX_HOME` environment variable. If not set, defaults to
/// `~/.codex`.
///
/// - If `CODEX_HOME` is set, the value will be canonicalized and this
/// function will Err if the path does not exist.
/// - If `CODEX_HOME` is not set, this function does not verify that the
/// directory exists.
pub(crate) fn find_codex_home() -> std::io::Result<PathBuf> {
// Honor the `CODEX_HOME` environment variable when it is set to allow users
// (and tests) to override the default location.
if let Ok(val) = std::env::var("CODEX_HOME")
&& !val.is_empty()
{
return PathBuf::from(val).canonicalize();
}
let mut p = home_dir().ok_or_else(|| {
std::io::Error::new(
std::io::ErrorKind::NotFound,
"Could not find home directory",
)
})?;
p.push(".codex");
Ok(p)
}

View File

@@ -0,0 +1,33 @@
use dirs::home_dir;
use std::path::PathBuf;
/// This was copied from llmx-core but llmx-core depends on this crate.
/// TODO: move this to a shared crate lower in the dependency tree.
///
///
/// Returns the path to the LLMX configuration directory, which can be
/// specified by the `LLMX_HOME` environment variable. If not set, defaults to
/// `~/.llmx`.
///
/// - If `LLMX_HOME` is set, the value will be canonicalized and this
/// function will Err if the path does not exist.
/// - If `LLMX_HOME` is not set, this function does not verify that the
/// directory exists.
pub(crate) fn find_llmx_home() -> std::io::Result<PathBuf> {
// Honor the `LLMX_HOME` environment variable when it is set to allow users
// (and tests) to override the default location.
if let Ok(val) = std::env::var("LLMX_HOME")
&& !val.is_empty()
{
return PathBuf::from(val).canonicalize();
}
let mut p = home_dir().ok_or_else(|| {
std::io::Error::new(
std::io::ErrorKind::NotFound,
"Could not find home directory",
)
})?;
p.push(".llmx");
Ok(p)
}

View File

@@ -1,5 +1,5 @@
mod auth_status;
mod find_codex_home;
mod find_llmx_home;
mod logging_client_handler;
mod oauth;
mod perform_oauth_login;
@@ -8,7 +8,7 @@ mod utils;
pub use auth_status::determine_streamable_http_auth_status;
pub use auth_status::supports_oauth_login;
pub use codex_protocol::protocol::McpAuthStatus;
pub use llmx_protocol::protocol::McpAuthStatus;
pub use oauth::OAuthCredentialsStoreMode;
pub use oauth::StoredOAuthTokens;
pub use oauth::WrappedOAuthTokenResponse;

View File

@@ -42,12 +42,12 @@ use std::time::SystemTime;
use std::time::UNIX_EPOCH;
use tracing::warn;
use codex_keyring_store::DefaultKeyringStore;
use codex_keyring_store::KeyringStore;
use llmx_keyring_store::DefaultKeyringStore;
use llmx_keyring_store::KeyringStore;
use rmcp::transport::auth::AuthorizationManager;
use tokio::sync::Mutex;
use crate::find_codex_home::find_codex_home;
use crate::find_llmx_home::find_llmx_home;
const KEYRING_SERVICE: &str = "Codex MCP Credentials";
@@ -468,7 +468,7 @@ fn compute_store_key(server_name: &str, server_url: &str) -> Result<String> {
}
fn fallback_file_path() -> Result<PathBuf> {
let mut path = find_codex_home()?;
let mut path = find_llmx_home()?;
path.push(FALLBACK_FILENAME);
Ok(path)
}
@@ -545,7 +545,7 @@ mod tests {
use std::sync::PoisonError;
use tempfile::tempdir;
use codex_keyring_store::tests::MockKeyringStore;
use llmx_keyring_store::tests::MockKeyringStore;
struct TempCodexHome {
_guard: MutexGuard<'static, ()>,