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

@@ -1,4 +1,4 @@
use codex_core::protocol::SandboxPolicy;
use llmx_core::protocol::SandboxPolicy;
use std::path::PathBuf;
/// Returns a warning describing why `--add-dir` entries will be ignored for the
@@ -32,7 +32,7 @@ fn format_warning(additional_dirs: &[PathBuf]) -> String {
#[cfg(test)]
mod tests {
use super::add_dir_warning_message;
use codex_core::protocol::SandboxPolicy;
use llmx_core::protocol::SandboxPolicy;
use pretty_assertions::assert_eq;
use std::path::PathBuf;

View File

@@ -14,16 +14,16 @@ use crate::resume_picker::ResumeSelection;
use crate::tui;
use crate::tui::TuiEvent;
use crate::update_action::UpdateAction;
use codex_ansi_escape::ansi_escape_line;
use codex_core::AuthManager;
use codex_core::ConversationManager;
use codex_core::config::Config;
use codex_core::config::edit::ConfigEditsBuilder;
use codex_core::model_family::find_family_for_model;
use codex_core::protocol::SessionSource;
use codex_core::protocol::TokenUsage;
use codex_core::protocol_config_types::ReasoningEffort as ReasoningEffortConfig;
use codex_protocol::ConversationId;
use llmx_ansi_escape::ansi_escape_line;
use llmx_core::AuthManager;
use llmx_core::ConversationManager;
use llmx_core::config::Config;
use llmx_core::config::edit::ConfigEditsBuilder;
use llmx_core::model_family::find_family_for_model;
use llmx_core::protocol::SessionSource;
use llmx_core::protocol::TokenUsage;
use llmx_core::protocol_config_types::ReasoningEffort as ReasoningEffortConfig;
use llmx_protocol::ConversationId;
use color_eyre::eyre::Result;
use color_eyre::eyre::WrapErr;
use crossterm::event::KeyCode;
@@ -76,7 +76,7 @@ pub(crate) struct App {
// Esc-backtracking state grouped
pub(crate) backtrack: crate::app_backtrack::BacktrackState,
pub(crate) feedback: codex_feedback::CodexFeedback,
pub(crate) feedback: llmx_feedback::CodexFeedback,
/// Set when the user confirms an update; propagated on exit.
pub(crate) pending_update_action: Option<UpdateAction>,
@@ -94,7 +94,7 @@ impl App {
initial_prompt: Option<String>,
initial_images: Vec<PathBuf>,
resume_selection: ResumeSelection,
feedback: codex_feedback::CodexFeedback,
feedback: llmx_feedback::CodexFeedback,
) -> Result<AppExitInfo> {
use tokio_stream::StreamExt;
let (app_event_tx, mut app_event_rx) = unbounded_channel();
@@ -177,11 +177,11 @@ impl App {
// On startup, if Auto mode (workspace-write) or ReadOnly is active, warn about world-writable dirs on Windows.
#[cfg(target_os = "windows")]
{
let should_check = codex_core::get_platform_sandbox().is_some()
let should_check = llmx_core::get_platform_sandbox().is_some()
&& matches!(
app.config.sandbox_policy,
codex_core::protocol::SandboxPolicy::WorkspaceWrite { .. }
| codex_core::protocol::SandboxPolicy::ReadOnly
llmx_core::protocol::SandboxPolicy::WorkspaceWrite { .. }
| llmx_core::protocol::SandboxPolicy::ReadOnly
)
&& !app
.config
@@ -461,8 +461,8 @@ impl App {
#[cfg(target_os = "windows")]
let policy_is_workspace_write_or_ro = matches!(
policy,
codex_core::protocol::SandboxPolicy::WorkspaceWrite { .. }
| codex_core::protocol::SandboxPolicy::ReadOnly
llmx_core::protocol::SandboxPolicy::WorkspaceWrite { .. }
| llmx_core::protocol::SandboxPolicy::ReadOnly
);
self.chat_widget.set_sandbox_policy(policy);
@@ -476,7 +476,7 @@ impl App {
return Ok(true);
}
let should_check = codex_core::get_platform_sandbox().is_some()
let should_check = llmx_core::get_platform_sandbox().is_some()
&& policy_is_workspace_write_or_ro
&& !self.chat_widget.world_writable_warning_hidden();
if should_check {
@@ -582,7 +582,7 @@ impl App {
Ok(true)
}
pub(crate) fn token_usage(&self) -> codex_core::protocol::TokenUsage {
pub(crate) fn token_usage(&self) -> llmx_core::protocol::TokenUsage {
self.chat_widget.token_usage()
}
@@ -664,7 +664,7 @@ impl App {
canon.display().to_string().replace('/', "\\")
}
tokio::task::spawn_blocking(move || {
let result = codex_windows_sandbox::preflight_audit_everyone_writable(
let result = llmx_windows_sandbox::preflight_audit_everyone_writable(
&cwd,
&env_map,
Some(logs_base_dir.as_path()),
@@ -715,11 +715,11 @@ mod tests {
use crate::history_cell::HistoryCell;
use crate::history_cell::UserHistoryCell;
use crate::history_cell::new_session_info;
use codex_core::AuthManager;
use codex_core::CodexAuth;
use codex_core::ConversationManager;
use codex_core::protocol::SessionConfiguredEvent;
use codex_protocol::ConversationId;
use llmx_core::AuthManager;
use llmx_core::CodexAuth;
use llmx_core::ConversationManager;
use llmx_core::protocol::SessionConfiguredEvent;
use llmx_protocol::ConversationId;
use ratatui::prelude::Line;
use std::path::PathBuf;
use std::sync::Arc;
@@ -751,7 +751,7 @@ mod tests {
enhanced_keys_supported: false,
commit_anim_running: Arc::new(AtomicBool::new(false)),
backtrack: BacktrackState::default(),
feedback: codex_feedback::CodexFeedback::new(),
feedback: llmx_feedback::CodexFeedback::new(),
pending_update_action: None,
skip_world_writable_scan_once: false,
}

View File

@@ -8,8 +8,8 @@ use crate::history_cell::UserHistoryCell;
use crate::pager_overlay::Overlay;
use crate::tui;
use crate::tui::TuiEvent;
use codex_core::protocol::ConversationPathResponseEvent;
use codex_protocol::ConversationId;
use llmx_core::protocol::ConversationPathResponseEvent;
use llmx_protocol::ConversationId;
use color_eyre::eyre::Result;
use crossterm::event::KeyCode;
use crossterm::event::KeyEvent;
@@ -320,8 +320,8 @@ impl App {
&self,
path: PathBuf,
nth_user_message: usize,
cfg: codex_core::config::Config,
) -> codex_core::error::Result<codex_core::NewConversation> {
cfg: llmx_core::config::Config,
) -> llmx_core::error::Result<llmx_core::NewConversation> {
self.server
.fork_conversation(nth_user_message, cfg, path)
.await
@@ -331,8 +331,8 @@ impl App {
fn install_forked_conversation(
&mut self,
tui: &mut tui::Tui,
cfg: codex_core::config::Config,
new_conv: codex_core::NewConversation,
cfg: llmx_core::config::Config,
new_conv: llmx_core::NewConversation,
nth_user_message: usize,
prefill: &str,
) {

View File

@@ -1,17 +1,17 @@
use std::path::PathBuf;
use codex_common::approval_presets::ApprovalPreset;
use codex_common::model_presets::ModelPreset;
use codex_core::protocol::ConversationPathResponseEvent;
use codex_core::protocol::Event;
use codex_file_search::FileMatch;
use llmx_common::approval_presets::ApprovalPreset;
use llmx_common::model_presets::ModelPreset;
use llmx_core::protocol::ConversationPathResponseEvent;
use llmx_core::protocol::Event;
use llmx_file_search::FileMatch;
use crate::bottom_pane::ApprovalRequest;
use crate::history_cell::HistoryCell;
use codex_core::protocol::AskForApproval;
use codex_core::protocol::SandboxPolicy;
use codex_core::protocol_config_types::ReasoningEffort;
use llmx_core::protocol::AskForApproval;
use llmx_core::protocol::SandboxPolicy;
use llmx_core::protocol_config_types::ReasoningEffort;
#[allow(clippy::large_enum_variant)]
#[derive(Debug)]
@@ -26,7 +26,7 @@ pub(crate) enum AppEvent {
/// Forward an `Op` to the Agent. Using an `AppEvent` for this avoids
/// bubbling channels through layers of widgets.
CodexOp(codex_core::protocol::Op),
CodexOp(llmx_core::protocol::Op),
/// Kick off an asynchronous file search for the given query (text after
/// the `@`). Previous searches may be cancelled by the app layer so there

View File

@@ -16,11 +16,11 @@ use crate::key_hint::KeyBinding;
use crate::render::highlight::highlight_bash_to_lines;
use crate::render::renderable::ColumnRenderable;
use crate::render::renderable::Renderable;
use codex_core::protocol::FileChange;
use codex_core::protocol::Op;
use codex_core::protocol::ReviewDecision;
use codex_core::protocol::SandboxCommandAssessment;
use codex_core::protocol::SandboxRiskLevel;
use llmx_core::protocol::FileChange;
use llmx_core::protocol::Op;
use llmx_core::protocol::ReviewDecision;
use llmx_core::protocol::SandboxCommandAssessment;
use llmx_core::protocol::SandboxRiskLevel;
use crossterm::event::KeyCode;
use crossterm::event::KeyEvent;
use crossterm::event::KeyEventKind;

View File

@@ -41,8 +41,8 @@ use crate::render::renderable::Renderable;
use crate::slash_command::SlashCommand;
use crate::slash_command::built_in_slash_commands;
use crate::style::user_message_style;
use codex_protocol::custom_prompts::CustomPrompt;
use codex_protocol::custom_prompts::PROMPTS_CMD_PREFIX;
use llmx_protocol::custom_prompts::CustomPrompt;
use llmx_protocol::custom_prompts::PROMPTS_CMD_PREFIX;
use crate::app_event::AppEvent;
use crate::app_event_sender::AppEventSender;
@@ -52,7 +52,7 @@ use crate::clipboard_paste::normalize_pasted_path;
use crate::clipboard_paste::pasted_image_format;
use crate::history_cell;
use crate::ui_consts::LIVE_PREFIX_COLS;
use codex_file_search::FileMatch;
use llmx_file_search::FileMatch;
use std::cell::RefCell;
use std::collections::HashMap;
use std::path::Path;

View File

@@ -2,7 +2,7 @@ use std::collections::HashMap;
use crate::app_event::AppEvent;
use crate::app_event_sender::AppEventSender;
use codex_core::protocol::Op;
use llmx_core::protocol::Op;
/// State machine that manages shell-style history navigation (Up/Down) inside
/// the chat composer. This struct is intentionally decoupled from the
@@ -198,7 +198,7 @@ impl ChatComposerHistory {
mod tests {
use super::*;
use crate::app_event::AppEvent;
use codex_core::protocol::Op;
use llmx_core::protocol::Op;
use tokio::sync::mpsc::unbounded_channel;
#[test]

View File

@@ -10,9 +10,9 @@ use crate::render::Insets;
use crate::render::RectExt;
use crate::slash_command::SlashCommand;
use crate::slash_command::built_in_slash_commands;
use codex_common::fuzzy_match::fuzzy_match;
use codex_protocol::custom_prompts::CustomPrompt;
use codex_protocol::custom_prompts::PROMPTS_CMD_PREFIX;
use llmx_common::fuzzy_match::fuzzy_match;
use llmx_protocol::custom_prompts::CustomPrompt;
use llmx_protocol::custom_prompts::PROMPTS_CMD_PREFIX;
use std::collections::HashSet;
/// A selectable item in the popup: either a built-in command or a user prompt.

View File

@@ -32,7 +32,7 @@ const BASE_ISSUE_URL: &str = "https://github.com/openai/codex/issues/new?templat
/// both logs and rollout with classification + metadata.
pub(crate) struct FeedbackNoteView {
category: FeedbackCategory,
snapshot: codex_feedback::CodexLogSnapshot,
snapshot: llmx_feedback::CodexLogSnapshot,
rollout_path: Option<PathBuf>,
app_event_tx: AppEventSender,
include_logs: bool,
@@ -46,7 +46,7 @@ pub(crate) struct FeedbackNoteView {
impl FeedbackNoteView {
pub(crate) fn new(
category: FeedbackCategory,
snapshot: codex_feedback::CodexLogSnapshot,
snapshot: llmx_feedback::CodexLogSnapshot,
rollout_path: Option<PathBuf>,
app_event_tx: AppEventSender,
include_logs: bool,
@@ -483,7 +483,7 @@ mod tests {
fn make_view(category: FeedbackCategory) -> FeedbackNoteView {
let (tx_raw, _rx) = tokio::sync::mpsc::unbounded_channel::<AppEvent>();
let tx = AppEventSender::new(tx_raw);
let snapshot = codex_feedback::CodexFeedback::new().snapshot(None);
let snapshot = llmx_feedback::CodexFeedback::new().snapshot(None);
FeedbackNoteView::new(category, snapshot, None, tx, true)
}

View File

@@ -1,4 +1,4 @@
use codex_file_search::FileMatch;
use llmx_file_search::FileMatch;
use ratatui::buffer::Buffer;
use ratatui::layout::Rect;
use ratatui::widgets::WidgetRef;

View File

@@ -8,7 +8,7 @@ use crate::render::renderable::Renderable;
use crate::render::renderable::RenderableItem;
use crate::tui::FrameRequester;
use bottom_pane_view::BottomPaneView;
use codex_file_search::FileMatch;
use llmx_file_search::FileMatch;
use crossterm::event::KeyCode;
use crossterm::event::KeyEvent;
use ratatui::buffer::Buffer;
@@ -47,7 +47,7 @@ pub(crate) enum CancellationEvent {
pub(crate) use chat_composer::ChatComposer;
pub(crate) use chat_composer::InputResult;
use codex_protocol::custom_prompts::CustomPrompt;
use llmx_protocol::custom_prompts::CustomPrompt;
use crate::status_indicator_widget::StatusIndicatorWidget;
pub(crate) use list_selection_view::SelectionAction;

View File

@@ -1,5 +1,5 @@
use codex_protocol::custom_prompts::CustomPrompt;
use codex_protocol::custom_prompts::PROMPTS_CMD_PREFIX;
use llmx_protocol::custom_prompts::CustomPrompt;
use llmx_protocol::custom_prompts::PROMPTS_CMD_PREFIX;
use lazy_static::lazy_static;
use regex_lite::Regex;
use shlex::Shlex;

View File

@@ -3,51 +3,51 @@ use std::collections::VecDeque;
use std::path::PathBuf;
use std::sync::Arc;
use codex_core::config::Config;
use codex_core::config::types::Notifications;
use codex_core::git_info::current_branch_name;
use codex_core::git_info::local_git_branches;
use codex_core::project_doc::DEFAULT_PROJECT_DOC_FILENAME;
use codex_core::protocol::AgentMessageDeltaEvent;
use codex_core::protocol::AgentMessageEvent;
use codex_core::protocol::AgentReasoningDeltaEvent;
use codex_core::protocol::AgentReasoningEvent;
use codex_core::protocol::AgentReasoningRawContentDeltaEvent;
use codex_core::protocol::AgentReasoningRawContentEvent;
use codex_core::protocol::ApplyPatchApprovalRequestEvent;
use codex_core::protocol::BackgroundEventEvent;
use codex_core::protocol::DeprecationNoticeEvent;
use codex_core::protocol::ErrorEvent;
use codex_core::protocol::Event;
use codex_core::protocol::EventMsg;
use codex_core::protocol::ExecApprovalRequestEvent;
use codex_core::protocol::ExecCommandBeginEvent;
use codex_core::protocol::ExecCommandEndEvent;
use codex_core::protocol::ExitedReviewModeEvent;
use codex_core::protocol::ListCustomPromptsResponseEvent;
use codex_core::protocol::McpListToolsResponseEvent;
use codex_core::protocol::McpToolCallBeginEvent;
use codex_core::protocol::McpToolCallEndEvent;
use codex_core::protocol::Op;
use codex_core::protocol::PatchApplyBeginEvent;
use codex_core::protocol::RateLimitSnapshot;
use codex_core::protocol::ReviewRequest;
use codex_core::protocol::StreamErrorEvent;
use codex_core::protocol::TaskCompleteEvent;
use codex_core::protocol::TokenUsage;
use codex_core::protocol::TokenUsageInfo;
use codex_core::protocol::TurnAbortReason;
use codex_core::protocol::TurnDiffEvent;
use codex_core::protocol::UndoCompletedEvent;
use codex_core::protocol::UndoStartedEvent;
use codex_core::protocol::UserMessageEvent;
use codex_core::protocol::ViewImageToolCallEvent;
use codex_core::protocol::WarningEvent;
use codex_core::protocol::WebSearchBeginEvent;
use codex_core::protocol::WebSearchEndEvent;
use codex_protocol::ConversationId;
use codex_protocol::parse_command::ParsedCommand;
use codex_protocol::user_input::UserInput;
use llmx_core::config::Config;
use llmx_core::config::types::Notifications;
use llmx_core::git_info::current_branch_name;
use llmx_core::git_info::local_git_branches;
use llmx_core::project_doc::DEFAULT_PROJECT_DOC_FILENAME;
use llmx_core::protocol::AgentMessageDeltaEvent;
use llmx_core::protocol::AgentMessageEvent;
use llmx_core::protocol::AgentReasoningDeltaEvent;
use llmx_core::protocol::AgentReasoningEvent;
use llmx_core::protocol::AgentReasoningRawContentDeltaEvent;
use llmx_core::protocol::AgentReasoningRawContentEvent;
use llmx_core::protocol::ApplyPatchApprovalRequestEvent;
use llmx_core::protocol::BackgroundEventEvent;
use llmx_core::protocol::DeprecationNoticeEvent;
use llmx_core::protocol::ErrorEvent;
use llmx_core::protocol::Event;
use llmx_core::protocol::EventMsg;
use llmx_core::protocol::ExecApprovalRequestEvent;
use llmx_core::protocol::ExecCommandBeginEvent;
use llmx_core::protocol::ExecCommandEndEvent;
use llmx_core::protocol::ExitedReviewModeEvent;
use llmx_core::protocol::ListCustomPromptsResponseEvent;
use llmx_core::protocol::McpListToolsResponseEvent;
use llmx_core::protocol::McpToolCallBeginEvent;
use llmx_core::protocol::McpToolCallEndEvent;
use llmx_core::protocol::Op;
use llmx_core::protocol::PatchApplyBeginEvent;
use llmx_core::protocol::RateLimitSnapshot;
use llmx_core::protocol::ReviewRequest;
use llmx_core::protocol::StreamErrorEvent;
use llmx_core::protocol::TaskCompleteEvent;
use llmx_core::protocol::TokenUsage;
use llmx_core::protocol::TokenUsageInfo;
use llmx_core::protocol::TurnAbortReason;
use llmx_core::protocol::TurnDiffEvent;
use llmx_core::protocol::UndoCompletedEvent;
use llmx_core::protocol::UndoStartedEvent;
use llmx_core::protocol::UserMessageEvent;
use llmx_core::protocol::ViewImageToolCallEvent;
use llmx_core::protocol::WarningEvent;
use llmx_core::protocol::WebSearchBeginEvent;
use llmx_core::protocol::WebSearchEndEvent;
use llmx_protocol::ConversationId;
use llmx_protocol::parse_command::ParsedCommand;
use llmx_protocol::user_input::UserInput;
use crossterm::event::KeyCode;
use crossterm::event::KeyEvent;
use crossterm::event::KeyEventKind;
@@ -109,17 +109,17 @@ use crate::streaming::controller::StreamController;
use std::path::Path;
use chrono::Local;
use codex_common::approval_presets::ApprovalPreset;
use codex_common::approval_presets::builtin_approval_presets;
use codex_common::model_presets::ModelPreset;
use codex_common::model_presets::builtin_model_presets;
use codex_core::AuthManager;
use codex_core::ConversationManager;
use codex_core::protocol::AskForApproval;
use codex_core::protocol::SandboxPolicy;
use codex_core::protocol_config_types::ReasoningEffort as ReasoningEffortConfig;
use codex_file_search::FileMatch;
use codex_protocol::plan_tool::UpdatePlanArgs;
use llmx_common::approval_presets::ApprovalPreset;
use llmx_common::approval_presets::builtin_approval_presets;
use llmx_common::model_presets::ModelPreset;
use llmx_common::model_presets::builtin_model_presets;
use llmx_core::AuthManager;
use llmx_core::ConversationManager;
use llmx_core::protocol::AskForApproval;
use llmx_core::protocol::SandboxPolicy;
use llmx_core::protocol_config_types::ReasoningEffort as ReasoningEffortConfig;
use llmx_file_search::FileMatch;
use llmx_protocol::plan_tool::UpdatePlanArgs;
use strum::IntoEnumIterator;
const USER_SHELL_COMMAND_HELP_TITLE: &str = "Prefix a command with ! to run it locally";
@@ -229,7 +229,7 @@ pub(crate) struct ChatWidgetInit {
pub(crate) initial_images: Vec<PathBuf>,
pub(crate) enhanced_keys_supported: bool,
pub(crate) auth_manager: Arc<AuthManager>,
pub(crate) feedback: codex_feedback::CodexFeedback,
pub(crate) feedback: llmx_feedback::CodexFeedback,
}
#[derive(Default)]
@@ -285,7 +285,7 @@ pub(crate) struct ChatWidget {
last_rendered_width: std::cell::Cell<Option<usize>>,
// Feedback sink for /feedback
feedback: codex_feedback::CodexFeedback,
feedback: llmx_feedback::CodexFeedback,
// Current session rollout path (if known)
current_rollout_path: Option<PathBuf>,
}
@@ -336,7 +336,7 @@ impl ChatWidget {
}
// --- Small event handlers ---
fn on_session_configured(&mut self, event: codex_core::protocol::SessionConfiguredEvent) {
fn on_session_configured(&mut self, event: llmx_core::protocol::SessionConfiguredEvent) {
self.bottom_pane
.set_history_metadata(event.history_log_id, event.history_entry_count);
self.conversation_id = Some(event.session_id);
@@ -638,7 +638,7 @@ impl ChatWidget {
fn on_exec_command_output_delta(
&mut self,
_ev: codex_core::protocol::ExecCommandOutputDeltaEvent,
_ev: llmx_core::protocol::ExecCommandOutputDeltaEvent,
) {
// TODO: Handle streaming exec output if/when implemented
}
@@ -659,7 +659,7 @@ impl ChatWidget {
self.request_redraw();
}
fn on_patch_apply_end(&mut self, event: codex_core::protocol::PatchApplyEndEvent) {
fn on_patch_apply_end(&mut self, event: llmx_core::protocol::PatchApplyEndEvent) {
let ev2 = event.clone();
self.defer_or_handle(
|q| q.push_patch_end(event),
@@ -696,9 +696,9 @@ impl ChatWidget {
fn on_get_history_entry_response(
&mut self,
event: codex_core::protocol::GetHistoryEntryResponseEvent,
event: llmx_core::protocol::GetHistoryEntryResponseEvent,
) {
let codex_core::protocol::GetHistoryEntryResponseEvent {
let llmx_core::protocol::GetHistoryEntryResponseEvent {
offset,
log_id,
entry,
@@ -874,7 +874,7 @@ impl ChatWidget {
pub(crate) fn handle_patch_apply_end_now(
&mut self,
event: codex_core::protocol::PatchApplyEndEvent,
event: llmx_core::protocol::PatchApplyEndEvent,
) {
// If the patch was successful, just let the "Edited" block stand.
// Otherwise, add a failure block.
@@ -1062,8 +1062,8 @@ impl ChatWidget {
/// Create a ChatWidget attached to an existing conversation (e.g., a fork).
pub(crate) fn new_from_existing(
common: ChatWidgetInit,
conversation: std::sync::Arc<codex_core::CodexConversation>,
session_configured: codex_core::protocol::SessionConfiguredEvent,
conversation: std::sync::Arc<llmx_core::CodexConversation>,
session_configured: llmx_core::protocol::SessionConfiguredEvent,
) -> Self {
let ChatWidgetInit {
config,
@@ -1265,7 +1265,7 @@ impl ChatWidget {
self.request_exit();
}
SlashCommand::Logout => {
if let Err(e) = codex_core::auth::logout(
if let Err(e) = llmx_core::auth::logout(
&self.config.codex_home,
self.config.cli_auth_credentials_store_mode,
) {
@@ -1313,11 +1313,11 @@ impl ChatWidget {
}
}
SlashCommand::TestApproval => {
use codex_core::protocol::EventMsg;
use llmx_core::protocol::EventMsg;
use std::collections::HashMap;
use codex_core::protocol::ApplyPatchApprovalRequestEvent;
use codex_core::protocol::FileChange;
use llmx_core::protocol::ApplyPatchApprovalRequestEvent;
use llmx_core::protocol::FileChange;
self.app_event_tx.send(AppEvent::CodexEvent(Event {
id: "1".to_string(),
@@ -1611,7 +1611,7 @@ impl ChatWidget {
}
} else {
let message_text =
codex_core::review_format::format_review_findings_block(&output.findings, None);
llmx_core::review_format::format_review_findings_block(&output.findings, None);
let mut message_lines: Vec<ratatui::text::Line<'static>> = Vec::new();
append_markdown(&message_text, None, &mut message_lines);
let body_cell = AgentMessageCell::new(message_lines, true);
@@ -2049,7 +2049,7 @@ impl ChatWidget {
let description_text = preset.description;
let description = if cfg!(target_os = "windows")
&& preset.id == "auto"
&& codex_core::get_platform_sandbox().is_none()
&& llmx_core::get_platform_sandbox().is_none()
{
Some(format!(
"{description_text}\nRequires Windows Subsystem for Linux (WSL). Show installation instructions..."
@@ -2073,7 +2073,7 @@ impl ChatWidget {
} else if preset.id == "auto" {
#[cfg(target_os = "windows")]
{
if codex_core::get_platform_sandbox().is_none() {
if llmx_core::get_platform_sandbox().is_none() {
vec![Box::new(|tx| {
tx.send(AppEvent::ShowWindowsAutoModeInstructions);
})]
@@ -2092,7 +2092,7 @@ impl ChatWidget {
env_map.insert(k, v);
}
let (sample_paths, extra_count, failed_scan) =
match codex_windows_sandbox::preflight_audit_everyone_writable(
match llmx_windows_sandbox::preflight_audit_everyone_writable(
&self.config.cwd,
&env_map,
Some(self.config.codex_home.as_path()),
@@ -2185,7 +2185,7 @@ impl ChatWidget {
for (k, v) in std::env::vars() {
env_map.insert(k, v);
}
match codex_windows_sandbox::preflight_audit_everyone_writable(
match llmx_windows_sandbox::preflight_audit_everyone_writable(
&self.config.cwd,
&env_map,
Some(self.config.codex_home.as_path()),
@@ -2643,7 +2643,7 @@ impl ChatWidget {
}
pub(crate) async fn show_review_commit_picker(&mut self, cwd: &Path) {
let commits = codex_core::git_info::recent_commits(cwd, 100).await;
let commits = llmx_core::git_info::recent_commits(cwd, 100).await;
let mut items: Vec<SelectionItem> = Vec::with_capacity(commits.len());
for entry in commits {
@@ -2865,7 +2865,7 @@ fn extract_first_bold(s: &str) -> Option<String> {
#[cfg(test)]
pub(crate) fn show_review_commit_picker_with_entries(
chat: &mut ChatWidget,
entries: Vec<codex_core::git_info::CommitLogEntry>,
entries: Vec<llmx_core::git_info::CommitLogEntry>,
) {
let mut items: Vec<SelectionItem> = Vec::with_capacity(entries.len());
for entry in entries {

View File

@@ -1,10 +1,10 @@
use std::sync::Arc;
use codex_core::CodexConversation;
use codex_core::ConversationManager;
use codex_core::NewConversation;
use codex_core::config::Config;
use codex_core::protocol::Op;
use llmx_core::CodexConversation;
use llmx_core::ConversationManager;
use llmx_core::NewConversation;
use llmx_core::config::Config;
use llmx_core::protocol::Op;
use tokio::sync::mpsc::UnboundedSender;
use tokio::sync::mpsc::unbounded_channel;
@@ -36,10 +36,10 @@ pub(crate) fn spawn_agent(
};
// Forward the captured `SessionConfigured` event so it can be rendered in the UI.
let ev = codex_core::protocol::Event {
let ev = llmx_core::protocol::Event {
// The `id` does not matter for rendering, so we can use a fake value.
id: "".to_string(),
msg: codex_core::protocol::EventMsg::SessionConfigured(session_configured),
msg: llmx_core::protocol::EventMsg::SessionConfigured(session_configured),
};
app_event_tx_clone.send(AppEvent::CodexEvent(ev));
@@ -66,7 +66,7 @@ pub(crate) fn spawn_agent(
/// events and accepts Ops for submission.
pub(crate) fn spawn_agent_from_existing(
conversation: std::sync::Arc<CodexConversation>,
session_configured: codex_core::protocol::SessionConfiguredEvent,
session_configured: llmx_core::protocol::SessionConfiguredEvent,
app_event_tx: AppEventSender,
) -> UnboundedSender<Op> {
let (codex_op_tx, mut codex_op_rx) = unbounded_channel::<Op>();
@@ -74,9 +74,9 @@ pub(crate) fn spawn_agent_from_existing(
let app_event_tx_clone = app_event_tx;
tokio::spawn(async move {
// Forward the captured `SessionConfigured` event so it can be rendered in the UI.
let ev = codex_core::protocol::Event {
let ev = llmx_core::protocol::Event {
id: "".to_string(),
msg: codex_core::protocol::EventMsg::SessionConfigured(session_configured),
msg: llmx_core::protocol::EventMsg::SessionConfigured(session_configured),
};
app_event_tx_clone.send(AppEvent::CodexEvent(ev));

View File

@@ -1,12 +1,12 @@
use std::collections::VecDeque;
use codex_core::protocol::ApplyPatchApprovalRequestEvent;
use codex_core::protocol::ExecApprovalRequestEvent;
use codex_core::protocol::ExecCommandBeginEvent;
use codex_core::protocol::ExecCommandEndEvent;
use codex_core::protocol::McpToolCallBeginEvent;
use codex_core::protocol::McpToolCallEndEvent;
use codex_core::protocol::PatchApplyEndEvent;
use llmx_core::protocol::ApplyPatchApprovalRequestEvent;
use llmx_core::protocol::ExecApprovalRequestEvent;
use llmx_core::protocol::ExecCommandBeginEvent;
use llmx_core::protocol::ExecCommandEndEvent;
use llmx_core::protocol::McpToolCallBeginEvent;
use llmx_core::protocol::McpToolCallEndEvent;
use llmx_core::protocol::PatchApplyEndEvent;
use super::ChatWidget;

View File

@@ -4,48 +4,48 @@ use crate::app_event_sender::AppEventSender;
use crate::test_backend::VT100Backend;
use crate::tui::FrameRequester;
use assert_matches::assert_matches;
use codex_common::approval_presets::builtin_approval_presets;
use codex_common::model_presets::ModelPreset;
use codex_common::model_presets::ReasoningEffortPreset;
use codex_core::AuthManager;
use codex_core::CodexAuth;
use codex_core::config::Config;
use codex_core::config::ConfigOverrides;
use codex_core::config::ConfigToml;
use codex_core::config::OPENAI_DEFAULT_MODEL;
use codex_core::protocol::AgentMessageDeltaEvent;
use codex_core::protocol::AgentMessageEvent;
use codex_core::protocol::AgentReasoningDeltaEvent;
use codex_core::protocol::AgentReasoningEvent;
use codex_core::protocol::ApplyPatchApprovalRequestEvent;
use codex_core::protocol::Event;
use codex_core::protocol::EventMsg;
use codex_core::protocol::ExecApprovalRequestEvent;
use codex_core::protocol::ExecCommandBeginEvent;
use codex_core::protocol::ExecCommandEndEvent;
use codex_core::protocol::ExitedReviewModeEvent;
use codex_core::protocol::FileChange;
use codex_core::protocol::Op;
use codex_core::protocol::PatchApplyBeginEvent;
use codex_core::protocol::PatchApplyEndEvent;
use codex_core::protocol::RateLimitWindow;
use codex_core::protocol::ReviewCodeLocation;
use codex_core::protocol::ReviewFinding;
use codex_core::protocol::ReviewLineRange;
use codex_core::protocol::ReviewOutputEvent;
use codex_core::protocol::ReviewRequest;
use codex_core::protocol::StreamErrorEvent;
use codex_core::protocol::TaskCompleteEvent;
use codex_core::protocol::TaskStartedEvent;
use codex_core::protocol::UndoCompletedEvent;
use codex_core::protocol::UndoStartedEvent;
use codex_core::protocol::ViewImageToolCallEvent;
use codex_core::protocol::WarningEvent;
use codex_protocol::ConversationId;
use codex_protocol::parse_command::ParsedCommand;
use codex_protocol::plan_tool::PlanItemArg;
use codex_protocol::plan_tool::StepStatus;
use codex_protocol::plan_tool::UpdatePlanArgs;
use llmx_common::approval_presets::builtin_approval_presets;
use llmx_common::model_presets::ModelPreset;
use llmx_common::model_presets::ReasoningEffortPreset;
use llmx_core::AuthManager;
use llmx_core::CodexAuth;
use llmx_core::config::Config;
use llmx_core::config::ConfigOverrides;
use llmx_core::config::ConfigToml;
use llmx_core::config::OPENAI_DEFAULT_MODEL;
use llmx_core::protocol::AgentMessageDeltaEvent;
use llmx_core::protocol::AgentMessageEvent;
use llmx_core::protocol::AgentReasoningDeltaEvent;
use llmx_core::protocol::AgentReasoningEvent;
use llmx_core::protocol::ApplyPatchApprovalRequestEvent;
use llmx_core::protocol::Event;
use llmx_core::protocol::EventMsg;
use llmx_core::protocol::ExecApprovalRequestEvent;
use llmx_core::protocol::ExecCommandBeginEvent;
use llmx_core::protocol::ExecCommandEndEvent;
use llmx_core::protocol::ExitedReviewModeEvent;
use llmx_core::protocol::FileChange;
use llmx_core::protocol::Op;
use llmx_core::protocol::PatchApplyBeginEvent;
use llmx_core::protocol::PatchApplyEndEvent;
use llmx_core::protocol::RateLimitWindow;
use llmx_core::protocol::ReviewCodeLocation;
use llmx_core::protocol::ReviewFinding;
use llmx_core::protocol::ReviewLineRange;
use llmx_core::protocol::ReviewOutputEvent;
use llmx_core::protocol::ReviewRequest;
use llmx_core::protocol::StreamErrorEvent;
use llmx_core::protocol::TaskCompleteEvent;
use llmx_core::protocol::TaskStartedEvent;
use llmx_core::protocol::UndoCompletedEvent;
use llmx_core::protocol::UndoStartedEvent;
use llmx_core::protocol::ViewImageToolCallEvent;
use llmx_core::protocol::WarningEvent;
use llmx_protocol::ConversationId;
use llmx_protocol::parse_command::ParsedCommand;
use llmx_protocol::plan_tool::PlanItemArg;
use llmx_protocol::plan_tool::StepStatus;
use llmx_protocol::plan_tool::UpdatePlanArgs;
use crossterm::event::KeyCode;
use crossterm::event::KeyEvent;
use crossterm::event::KeyModifiers;
@@ -122,7 +122,7 @@ fn resumed_initial_messages_render_history() {
let conversation_id = ConversationId::new();
let rollout_file = NamedTempFile::new().unwrap();
let configured = codex_core::protocol::SessionConfiguredEvent {
let configured = llmx_core::protocol::SessionConfiguredEvent {
session_id: conversation_id,
model: "test-model".to_string(),
reasoning_effort: Some(ReasoningEffortConfig::default()),
@@ -261,7 +261,7 @@ async fn helpers_are_available_and_do_not_panic() {
initial_images: Vec::new(),
enhanced_keys_supported: false,
auth_manager,
feedback: codex_feedback::CodexFeedback::new(),
feedback: llmx_feedback::CodexFeedback::new(),
};
let mut w = ChatWidget::new(init, conversation_manager);
// Basic construction sanity.
@@ -317,7 +317,7 @@ fn make_chatwidget_manual() -> (
is_review_mode: false,
needs_final_message_separator: false,
last_rendered_width: std::cell::Cell::new(None),
feedback: codex_feedback::CodexFeedback::new(),
feedback: llmx_feedback::CodexFeedback::new(),
current_rollout_path: None,
};
(widget, rx, op_rx)
@@ -633,7 +633,7 @@ fn begin_exec(chat: &mut ChatWidget, call_id: &str, raw_cmd: &str) {
// Build the full command vec and parse it using core's parser,
// then convert to protocol variants for the event payload.
let command = vec!["bash".to_string(), "-lc".to_string(), raw_cmd.to_string()];
let parsed_cmd: Vec<ParsedCommand> = codex_core::parse_command::parse_command(&command);
let parsed_cmd: Vec<ParsedCommand> = llmx_core::parse_command::parse_command(&command);
chat.handle_codex_event(Event {
id: call_id.to_string(),
msg: EventMsg::ExecCommandBegin(ExecCommandBeginEvent {
@@ -1128,12 +1128,12 @@ fn review_commit_picker_shows_subjects_without_timestamps() {
// Show commit picker with synthetic entries.
let entries = vec![
codex_core::git_info::CommitLogEntry {
llmx_core::git_info::CommitLogEntry {
sha: "1111111deadbeef".to_string(),
timestamp: 0,
subject: "Add new feature X".to_string(),
},
codex_core::git_info::CommitLogEntry {
llmx_core::git_info::CommitLogEntry {
sha: "2222222cafebabe".to_string(),
timestamp: 0,
subject: "Fix bug Y".to_string(),
@@ -1252,7 +1252,7 @@ fn interrupt_exec_marks_failed_snapshot() {
// cause the active exec cell to be finalized as failed and flushed.
chat.handle_codex_event(Event {
id: "call-int".into(),
msg: EventMsg::TurnAborted(codex_core::protocol::TurnAbortedEvent {
msg: EventMsg::TurnAborted(llmx_core::protocol::TurnAbortedEvent {
reason: TurnAbortReason::Interrupted,
}),
});
@@ -1285,7 +1285,7 @@ fn interrupted_turn_error_message_snapshot() {
// Abort the turn (like pressing Esc) and drain inserted history.
chat.handle_codex_event(Event {
id: "task-1".into(),
msg: EventMsg::TurnAborted(codex_core::protocol::TurnAbortedEvent {
msg: EventMsg::TurnAborted(llmx_core::protocol::TurnAbortedEvent {
reason: TurnAbortReason::Interrupted,
}),
});
@@ -1704,7 +1704,7 @@ async fn binary_size_transcript_snapshot() {
..
} => {
// Re-parse the command
let parsed_cmd = codex_core::parse_command::parse_command(&e.command);
let parsed_cmd = llmx_core::parse_command::parse_command(&e.command);
Event {
id: ev.id,
msg: EventMsg::ExecCommandBegin(ExecCommandBeginEvent {
@@ -1951,7 +1951,7 @@ fn interrupt_restores_queued_messages_into_composer() {
// Deliver a TurnAborted event with Interrupted reason (as if Esc was pressed).
chat.handle_codex_event(Event {
id: "turn-1".into(),
msg: EventMsg::TurnAborted(codex_core::protocol::TurnAbortedEvent {
msg: EventMsg::TurnAborted(llmx_core::protocol::TurnAbortedEvent {
reason: TurnAbortReason::Interrupted,
}),
});
@@ -1989,7 +1989,7 @@ fn interrupt_prepends_queued_messages_before_existing_composer_text() {
chat.handle_codex_event(Event {
id: "turn-1".into(),
msg: EventMsg::TurnAborted(codex_core::protocol::TurnAbortedEvent {
msg: EventMsg::TurnAborted(llmx_core::protocol::TurnAbortedEvent {
reason: TurnAbortReason::Interrupted,
}),
});
@@ -2059,7 +2059,7 @@ fn ui_snapshots_small_heights_task_running() {
// task (status indicator active) while an approval request is shown.
#[test]
fn status_widget_and_approval_modal_snapshot() {
use codex_core::protocol::ExecApprovalRequestEvent;
use llmx_core::protocol::ExecApprovalRequestEvent;
let (mut chat, _rx, _op_rx) = make_chatwidget_manual();
// Begin a running task so the status indicator would be active.
@@ -2347,7 +2347,7 @@ fn apply_patch_approval_sends_op_with_submission_id() {
while let Ok(app_ev) = rx.try_recv() {
if let AppEvent::CodexOp(Op::PatchApproval { id, decision }) = app_ev {
assert_eq!(id, "sub-123");
assert_matches!(decision, codex_core::protocol::ReviewDecision::Approved);
assert_matches!(decision, llmx_core::protocol::ReviewDecision::Approved);
found = true;
break;
}
@@ -2394,7 +2394,7 @@ fn apply_patch_full_flow_integration_like() {
match forwarded {
Op::PatchApproval { id, decision } => {
assert_eq!(id, "sub-xyz");
assert_matches!(decision, codex_core::protocol::ReviewDecision::Approved);
assert_matches!(decision, llmx_core::protocol::ReviewDecision::Approved);
}
other => panic!("unexpected op forwarded: {other:?}"),
}

View File

@@ -1,7 +1,7 @@
use clap::Parser;
use clap::ValueHint;
use codex_common::ApprovalModeCliArg;
use codex_common::CliConfigOverrides;
use llmx_common::ApprovalModeCliArg;
use llmx_common::CliConfigOverrides;
use std::path::PathBuf;
#[derive(Parser, Debug)]
@@ -45,7 +45,7 @@ pub struct Cli {
/// Select the sandbox policy to use when executing model-generated shell
/// commands.
#[arg(long = "sandbox", short = 's')]
pub sandbox_mode: Option<codex_common::SandboxModeCliArg>,
pub sandbox_mode: Option<llmx_common::SandboxModeCliArg>,
/// Configure when the model requires human approval before executing a command.
#[arg(long = "ask-for-approval", short = 'a')]

View File

@@ -18,8 +18,8 @@ use crate::render::line_utils::prefix_lines;
use crate::render::renderable::ColumnRenderable;
use crate::render::renderable::InsetRenderable;
use crate::render::renderable::Renderable;
use codex_core::git_info::get_git_repo_root;
use codex_core::protocol::FileChange;
use llmx_core::git_info::get_git_repo_root;
use llmx_core::protocol::FileChange;
// Internal representation for diff line rendering
enum DiffLineType {

View File

@@ -1,7 +1,7 @@
use std::time::Duration;
use std::time::Instant;
use codex_protocol::parse_command::ParsedCommand;
use llmx_protocol::parse_command::ParsedCommand;
#[derive(Clone, Debug, Default)]
pub(crate) struct CommandOutput {

View File

@@ -12,9 +12,9 @@ use crate::shimmer::shimmer_spans;
use crate::wrapping::RtOptions;
use crate::wrapping::word_wrap_line;
use crate::wrapping::word_wrap_lines;
use codex_ansi_escape::ansi_escape_line;
use codex_common::elapsed::format_duration;
use codex_protocol::parse_command::ParsedCommand;
use llmx_ansi_escape::ansi_escape_line;
use llmx_common::elapsed::format_duration;
use llmx_protocol::parse_command::ParsedCommand;
use itertools::Itertools;
use ratatui::prelude::*;
use ratatui::style::Modifier;

View File

@@ -1,7 +1,7 @@
use std::path::Path;
use std::path::PathBuf;
use codex_core::bash::extract_bash_command;
use llmx_core::bash::extract_bash_command;
use dirs::home_dir;
use shlex::try_join;

View File

@@ -18,7 +18,7 @@
//! 4. If there is a in-flight search that is not a prefix of the latest thing
//! the user typed, it is cancelled.
use codex_file_search as file_search;
use llmx_file_search as file_search;
use std::num::NonZeroUsize;
use std::path::PathBuf;
use std::sync::Arc;

View File

@@ -22,18 +22,18 @@ use crate::wrapping::RtOptions;
use crate::wrapping::word_wrap_line;
use crate::wrapping::word_wrap_lines;
use base64::Engine;
use codex_common::format_env_display::format_env_display;
use codex_core::config::Config;
use codex_core::config::types::McpServerTransportConfig;
use codex_core::config::types::ReasoningSummaryFormat;
use codex_core::protocol::FileChange;
use codex_core::protocol::McpAuthStatus;
use codex_core::protocol::McpInvocation;
use codex_core::protocol::SessionConfiguredEvent;
use codex_core::protocol_config_types::ReasoningEffort as ReasoningEffortConfig;
use codex_protocol::plan_tool::PlanItemArg;
use codex_protocol::plan_tool::StepStatus;
use codex_protocol::plan_tool::UpdatePlanArgs;
use llmx_common::format_env_display::format_env_display;
use llmx_core::config::Config;
use llmx_core::config::types::McpServerTransportConfig;
use llmx_core::config::types::ReasoningSummaryFormat;
use llmx_core::protocol::FileChange;
use llmx_core::protocol::McpAuthStatus;
use llmx_core::protocol::McpInvocation;
use llmx_core::protocol::SessionConfiguredEvent;
use llmx_core::protocol_config_types::ReasoningEffort as ReasoningEffortConfig;
use llmx_protocol::plan_tool::PlanItemArg;
use llmx_protocol::plan_tool::StepStatus;
use llmx_protocol::plan_tool::UpdatePlanArgs;
use image::DynamicImage;
use image::ImageReader;
use mcp_types::EmbeddedResourceResource;
@@ -390,9 +390,9 @@ fn exec_snippet(command: &[String]) -> String {
pub fn new_approval_decision_cell(
command: Vec<String>,
decision: codex_core::protocol::ReviewDecision,
decision: llmx_core::protocol::ReviewDecision,
) -> Box<dyn HistoryCell> {
use codex_core::protocol::ReviewDecision::*;
use llmx_core::protocol::ReviewDecision::*;
let (symbol, summary): (Span<'static>, Vec<Span<'static>>) = match decision {
Approved => {
@@ -1465,13 +1465,13 @@ mod tests {
use crate::exec_cell::CommandOutput;
use crate::exec_cell::ExecCall;
use crate::exec_cell::ExecCell;
use codex_core::config::Config;
use codex_core::config::ConfigOverrides;
use codex_core::config::ConfigToml;
use codex_core::config::types::McpServerConfig;
use codex_core::config::types::McpServerTransportConfig;
use codex_core::protocol::McpAuthStatus;
use codex_protocol::parse_command::ParsedCommand;
use llmx_core::config::Config;
use llmx_core::config::ConfigOverrides;
use llmx_core::config::ConfigToml;
use llmx_core::config::types::McpServerConfig;
use llmx_core::config::types::McpServerTransportConfig;
use llmx_core::protocol::McpAuthStatus;
use llmx_protocol::parse_command::ParsedCommand;
use dirs::home_dir;
use pretty_assertions::assert_eq;
use serde_json::json;

View File

@@ -6,20 +6,20 @@
use additional_dirs::add_dir_warning_message;
use app::App;
pub use app::AppExitInfo;
use codex_app_server_protocol::AuthMode;
use codex_core::AuthManager;
use codex_core::BUILT_IN_OSS_MODEL_PROVIDER_ID;
use codex_core::CodexAuth;
use codex_core::INTERACTIVE_SESSION_SOURCES;
use codex_core::RolloutRecorder;
use codex_core::auth::enforce_login_restrictions;
use codex_core::config::Config;
use codex_core::config::ConfigOverrides;
use codex_core::find_conversation_path_by_id_str;
use codex_core::get_platform_sandbox;
use codex_core::protocol::AskForApproval;
use codex_ollama::DEFAULT_OSS_MODEL;
use codex_protocol::config_types::SandboxMode;
use llmx_app_server_protocol::AuthMode;
use llmx_core::AuthManager;
use llmx_core::BUILT_IN_OSS_MODEL_PROVIDER_ID;
use llmx_core::CodexAuth;
use llmx_core::INTERACTIVE_SESSION_SOURCES;
use llmx_core::RolloutRecorder;
use llmx_core::auth::enforce_login_restrictions;
use llmx_core::config::Config;
use llmx_core::config::ConfigOverrides;
use llmx_core::find_conversation_path_by_id_str;
use llmx_core::get_platform_sandbox;
use llmx_core::protocol::AskForApproval;
use llmx_ollama::DEFAULT_OSS_MODEL;
use llmx_protocol::config_types::SandboxMode;
use opentelemetry_appender_tracing::layer::OpenTelemetryTracingBridge;
use std::fs::OpenOptions;
use std::path::PathBuf;
@@ -162,7 +162,7 @@ pub async fn run_main(
additional_writable_roots: additional_dirs,
};
let raw_overrides = cli.config_overrides.raw_overrides.clone();
let overrides_cli = codex_common::CliConfigOverrides { raw_overrides };
let overrides_cli = llmx_common::CliConfigOverrides { raw_overrides };
let cli_kv_overrides = match overrides_cli.parse_overrides() {
Ok(v) => v,
#[allow(clippy::print_stderr)]
@@ -189,7 +189,7 @@ pub async fn run_main(
}
let active_profile = config.active_profile.clone();
let log_dir = codex_core::config::log_dir(&config)?;
let log_dir = llmx_core::config::log_dir(&config)?;
std::fs::create_dir_all(&log_dir)?;
// Open (or create) your log file, appending to it.
let mut log_file_opts = OpenOptions::new();
@@ -223,7 +223,7 @@ pub async fn run_main(
.with_span_events(tracing_subscriber::fmt::format::FmtSpan::CLOSE)
.with_filter(env_filter());
let feedback = codex_feedback::CodexFeedback::new();
let feedback = llmx_feedback::CodexFeedback::new();
let targets = Targets::new().with_default(tracing::Level::TRACE);
let feedback_layer = tracing_subscriber::fmt::layer()
@@ -233,12 +233,12 @@ pub async fn run_main(
.with_filter(targets);
if cli.oss {
codex_ollama::ensure_oss_ready(&config)
llmx_ollama::ensure_oss_ready(&config)
.await
.map_err(|e| std::io::Error::other(format!("OSS setup failed: {e}")))?;
}
let otel = codex_core::otel_init::build_provider(&config, env!("CARGO_PKG_VERSION"));
let otel = llmx_core::otel_init::build_provider(&config, env!("CARGO_PKG_VERSION"));
#[allow(clippy::print_stderr)]
let otel = match otel {
@@ -251,7 +251,7 @@ pub async fn run_main(
if let Some(provider) = otel.as_ref() {
let otel_layer = OpenTelemetryTracingBridge::new(&provider.logger).with_filter(
tracing_subscriber::filter::filter_fn(codex_core::otel_init::codex_export_filter),
tracing_subscriber::filter::filter_fn(llmx_core::otel_init::codex_export_filter),
);
let _ = tracing_subscriber::registry()
@@ -284,7 +284,7 @@ async fn run_ratatui_app(
overrides: ConfigOverrides,
cli_kv_overrides: Vec<(String, toml::Value)>,
active_profile: Option<String>,
feedback: codex_feedback::CodexFeedback,
feedback: llmx_feedback::CodexFeedback,
) -> color_eyre::Result<AppExitInfo> {
color_eyre::install()?;
@@ -313,7 +313,7 @@ async fn run_ratatui_app(
UpdatePromptOutcome::RunUpdate(action) => {
crate::tui::restore()?;
return Ok(AppExitInfo {
token_usage: codex_core::protocol::TokenUsage::default(),
token_usage: llmx_core::protocol::TokenUsage::default(),
conversation_id: None,
update_action: Some(action),
});
@@ -359,7 +359,7 @@ async fn run_ratatui_app(
session_log::log_session_end();
let _ = tui.terminal.clear();
return Ok(AppExitInfo {
token_usage: codex_core::protocol::TokenUsage::default(),
token_usage: llmx_core::protocol::TokenUsage::default(),
conversation_id: None,
update_action: None,
});
@@ -372,7 +372,7 @@ async fn run_ratatui_app(
tracing::error!("Failed to write WSL instructions: {err}");
}
return Ok(AppExitInfo {
token_usage: codex_core::protocol::TokenUsage::default(),
token_usage: llmx_core::protocol::TokenUsage::default(),
conversation_id: None,
update_action: None,
});
@@ -408,7 +408,7 @@ async fn run_ratatui_app(
error!("Failed to write resume error message: {err}");
}
return Ok(AppExitInfo {
token_usage: codex_core::protocol::TokenUsage::default(),
token_usage: llmx_core::protocol::TokenUsage::default(),
conversation_id: None,
update_action: None,
});
@@ -445,7 +445,7 @@ async fn run_ratatui_app(
restore();
session_log::log_session_end();
return Ok(AppExitInfo {
token_usage: codex_core::protocol::TokenUsage::default(),
token_usage: llmx_core::protocol::TokenUsage::default(),
conversation_id: None,
update_action: None,
});
@@ -573,10 +573,10 @@ fn should_show_login_screen(login_status: LoginStatus, config: &Config) -> bool
#[cfg(test)]
mod tests {
use super::*;
use codex_core::config::ConfigOverrides;
use codex_core::config::ConfigToml;
use codex_core::config::ProjectConfig;
use codex_core::set_windows_sandbox_enabled;
use llmx_core::config::ConfigOverrides;
use llmx_core::config::ConfigToml;
use llmx_core::config::ProjectConfig;
use llmx_core::set_windows_sandbox_enabled;
use serial_test::serial;
use tempfile::TempDir;

View File

@@ -1,8 +1,8 @@
use clap::Parser;
use codex_arg0::arg0_dispatch_or_else;
use codex_common::CliConfigOverrides;
use codex_tui::Cli;
use codex_tui::run_main;
use llmx_arg0::arg0_dispatch_or_else;
use llmx_common::CliConfigOverrides;
use llmx_tui::Cli;
use llmx_tui::run_main;
#[derive(Parser, Debug)]
struct TopCli {
@@ -24,7 +24,7 @@ fn main() -> anyhow::Result<()> {
let exit_info = run_main(inner, codex_linux_sandbox_exe).await?;
let token_usage = exit_info.token_usage;
if !token_usage.is_zero() {
println!("{}", codex_core::protocol::FinalOutput::from(token_usage),);
println!("{}", llmx_core::protocol::FinalOutput::from(token_usage),);
}
Ok(())
})

View File

@@ -1,13 +1,13 @@
#![allow(clippy::unwrap_used)]
use codex_core::AuthManager;
use codex_core::auth::AuthCredentialsStoreMode;
use codex_core::auth::CLIENT_ID;
use codex_core::auth::login_with_api_key;
use codex_core::auth::read_openai_api_key_from_env;
use codex_login::ServerOptions;
use codex_login::ShutdownHandle;
use codex_login::run_login_server;
use llmx_core::AuthManager;
use llmx_core::auth::AuthCredentialsStoreMode;
use llmx_core::auth::CLIENT_ID;
use llmx_core::auth::login_with_api_key;
use llmx_core::auth::read_openai_api_key_from_env;
use llmx_login::ServerOptions;
use llmx_login::ShutdownHandle;
use llmx_login::run_login_server;
use crossterm::event::KeyCode;
use crossterm::event::KeyEvent;
use crossterm::event::KeyEventKind;
@@ -29,8 +29,8 @@ use ratatui::widgets::Paragraph;
use ratatui::widgets::WidgetRef;
use ratatui::widgets::Wrap;
use codex_app_server_protocol::AuthMode;
use codex_protocol::config_types::ForcedLoginMethod;
use llmx_app_server_protocol::AuthMode;
use llmx_protocol::config_types::ForcedLoginMethod;
use std::sync::RwLock;
use crate::LoginStatus;
@@ -650,7 +650,7 @@ mod tests {
use pretty_assertions::assert_eq;
use tempfile::TempDir;
use codex_core::auth::AuthCredentialsStoreMode;
use llmx_core::auth::AuthCredentialsStoreMode;
fn widget_forced_chatgpt() -> (AuthModeWidget, TempDir) {
let codex_home = TempDir::new().unwrap();

View File

@@ -1,6 +1,6 @@
use codex_core::AuthManager;
use codex_core::config::Config;
use codex_core::git_info::get_git_repo_root;
use llmx_core::AuthManager;
use llmx_core::config::Config;
use llmx_core::git_info::get_git_repo_root;
use crossterm::event::KeyCode;
use crossterm::event::KeyEvent;
use crossterm::event::KeyEventKind;
@@ -11,8 +11,8 @@ use ratatui::style::Color;
use ratatui::widgets::Clear;
use ratatui::widgets::WidgetRef;
use codex_app_server_protocol::AuthMode;
use codex_protocol::config_types::ForcedLoginMethod;
use llmx_app_server_protocol::AuthMode;
use llmx_protocol::config_types::ForcedLoginMethod;
use crate::LoginStatus;
use crate::onboarding::auth::AuthModeWidget;

View File

@@ -1,7 +1,7 @@
use std::path::PathBuf;
use codex_core::config::set_project_trusted;
use codex_core::git_info::resolve_root_git_project_for_trust;
use llmx_core::config::set_project_trusted;
use llmx_core::git_info::resolve_root_git_project_for_trust;
use crossterm::event::KeyCode;
use crossterm::event::KeyEvent;
use crossterm::event::KeyEventKind;

View File

@@ -1,6 +1,6 @@
use std::path::PathBuf;
use codex_core::config::edit::ConfigEditsBuilder;
use llmx_core::config::edit::ConfigEditsBuilder;
use crossterm::event::KeyCode;
use crossterm::event::KeyEvent;
use crossterm::event::KeyEventKind;

View File

@@ -579,7 +579,7 @@ fn render_offset_content(
#[cfg(test)]
mod tests {
use super::*;
use codex_core::protocol::ReviewDecision;
use llmx_core::protocol::ReviewDecision;
use insta::assert_snapshot;
use std::collections::HashMap;
use std::path::PathBuf;
@@ -590,8 +590,8 @@ mod tests {
use crate::history_cell;
use crate::history_cell::HistoryCell;
use crate::history_cell::new_patch_event;
use codex_core::protocol::FileChange;
use codex_protocol::parse_command::ParsedCommand;
use llmx_core::protocol::FileChange;
use llmx_protocol::parse_command::ParsedCommand;
use ratatui::Terminal;
use ratatui::backend::TestBackend;
use ratatui::text::Text;

View File

@@ -5,12 +5,12 @@ use std::sync::Arc;
use chrono::DateTime;
use chrono::Utc;
use codex_core::ConversationItem;
use codex_core::ConversationsPage;
use codex_core::Cursor;
use codex_core::INTERACTIVE_SESSION_SOURCES;
use codex_core::RolloutRecorder;
use codex_protocol::items::TurnItem;
use llmx_core::ConversationItem;
use llmx_core::ConversationsPage;
use llmx_core::Cursor;
use llmx_core::INTERACTIVE_SESSION_SOURCES;
use llmx_core::RolloutRecorder;
use llmx_protocol::items::TurnItem;
use color_eyre::eyre::Result;
use crossterm::event::KeyCode;
use crossterm::event::KeyEvent;
@@ -31,7 +31,7 @@ use crate::text_formatting::truncate_text;
use crate::tui::FrameRequester;
use crate::tui::Tui;
use crate::tui::TuiEvent;
use codex_protocol::models::ResponseItem;
use llmx_protocol::models::ResponseItem;
const PAGE_SIZE: usize = 25;
const LOAD_NEAR_THRESHOLD: usize = 5;
@@ -636,7 +636,7 @@ fn extract_timestamp(value: &serde_json::Value) -> Option<DateTime<Utc>> {
fn preview_from_head(head: &[serde_json::Value]) -> Option<String> {
head.iter()
.filter_map(|value| serde_json::from_value::<ResponseItem>(value.clone()).ok())
.find_map(|item| match codex_core::parse_turn_item(&item) {
.find_map(|item| match llmx_core::parse_turn_item(&item) {
Some(TurnItem::UserMessage(user)) => Some(user.message()),
_ => None,
})

View File

@@ -6,8 +6,8 @@ use std::sync::LazyLock;
use std::sync::Mutex;
use std::sync::OnceLock;
use codex_core::config::Config;
use codex_core::protocol::Op;
use llmx_core::config::Config;
use llmx_core::protocol::Op;
use serde::Serialize;
use serde_json::json;
@@ -88,7 +88,7 @@ pub(crate) fn maybe_init(config: &Config) {
let path = if let Ok(path) = std::env::var("CODEX_TUI_SESSION_LOG_PATH") {
PathBuf::from(path)
} else {
let mut p = match codex_core::config::log_dir(config) {
let mut p = match llmx_core::config::log_dir(config) {
Ok(dir) => dir,
Err(_) => std::env::temp_dir(),
};

View File

@@ -5,11 +5,11 @@ use crate::history_cell::with_border_with_inner_width;
use crate::version::CODEX_CLI_VERSION;
use chrono::DateTime;
use chrono::Local;
use codex_common::create_config_summary_entries;
use codex_core::config::Config;
use codex_core::protocol::SandboxPolicy;
use codex_core::protocol::TokenUsage;
use codex_protocol::ConversationId;
use llmx_common::create_config_summary_entries;
use llmx_core::config::Config;
use llmx_core::protocol::SandboxPolicy;
use llmx_core::protocol::TokenUsage;
use llmx_protocol::ConversationId;
use ratatui::prelude::*;
use ratatui::style::Stylize;
use std::collections::BTreeSet;

View File

@@ -2,9 +2,9 @@ use crate::exec_command::relativize_to_home;
use crate::text_formatting;
use chrono::DateTime;
use chrono::Local;
use codex_core::auth::load_auth_dot_json;
use codex_core::config::Config;
use codex_core::project_doc::discover_project_doc_paths;
use llmx_core::auth::load_auth_dot_json;
use llmx_core::config::Config;
use llmx_core::project_doc::discover_project_doc_paths;
use std::path::Path;
use unicode_width::UnicodeWidthStr;

View File

@@ -5,8 +5,8 @@ use chrono::DateTime;
use chrono::Duration as ChronoDuration;
use chrono::Local;
use chrono::Utc;
use codex_core::protocol::RateLimitSnapshot;
use codex_core::protocol::RateLimitWindow;
use llmx_core::protocol::RateLimitSnapshot;
use llmx_core::protocol::RateLimitWindow;
const STATUS_LIMIT_BAR_SEGMENTS: usize = 20;
const STATUS_LIMIT_BAR_FILLED: &str = "";

View File

@@ -4,15 +4,15 @@ use crate::history_cell::HistoryCell;
use chrono::Duration as ChronoDuration;
use chrono::TimeZone;
use chrono::Utc;
use codex_core::config::Config;
use codex_core::config::ConfigOverrides;
use codex_core::config::ConfigToml;
use codex_core::protocol::RateLimitSnapshot;
use codex_core::protocol::RateLimitWindow;
use codex_core::protocol::SandboxPolicy;
use codex_core::protocol::TokenUsage;
use codex_protocol::config_types::ReasoningEffort;
use codex_protocol::config_types::ReasoningSummary;
use llmx_core::config::Config;
use llmx_core::config::ConfigOverrides;
use llmx_core::config::ConfigToml;
use llmx_core::protocol::RateLimitSnapshot;
use llmx_core::protocol::RateLimitWindow;
use llmx_core::protocol::SandboxPolicy;
use llmx_core::protocol::TokenUsage;
use llmx_protocol::config_types::ReasoningEffort;
use llmx_protocol::config_types::ReasoningSummary;
use insta::assert_snapshot;
use ratatui::prelude::*;
use std::path::PathBuf;

View File

@@ -4,7 +4,7 @@
use std::time::Duration;
use std::time::Instant;
use codex_core::protocol::Op;
use llmx_core::protocol::Op;
use crossterm::event::KeyCode;
use ratatui::buffer::Buffer;
use ratatui::layout::Rect;

View File

@@ -12,7 +12,7 @@ use crate::tui::Tui;
use crate::tui::TuiEvent;
use crate::update_action::UpdateAction;
use crate::updates;
use codex_core::config::Config;
use llmx_core::config::Config;
use color_eyre::Result;
use crossterm::event::KeyCode;
use crossterm::event::KeyEvent;

View File

@@ -5,8 +5,8 @@ use crate::update_action::UpdateAction;
use chrono::DateTime;
use chrono::Duration;
use chrono::Utc;
use codex_core::config::Config;
use codex_core::default_client::create_client;
use llmx_core::config::Config;
use llmx_core::default_client::create_client;
use serde::Deserialize;
use serde::Serialize;
use std::path::Path;