mirror of
https://github.com/pchuan98/codex.git
synced 2026-07-01 00:31:56 +08:00
[codex] reduce module visibility (#16978)
## Summary - reduce public module visibility across Rust crates, preferring private or crate-private modules with explicit crate-root public exports - update external call sites and tests to use the intended public crate APIs instead of reaching through module trees - add the module visibility guideline to AGENTS.md ## Validation - `cargo check --workspace --all-targets --message-format=short` passed before the final fix/format pass - `just fix` completed successfully - `just fmt` completed successfully - `git diff --check` passed
This commit is contained in:
committed by
GitHub
Unverified
parent
89f1a44afa
commit
413c1e1fdf
@@ -7,8 +7,8 @@
|
||||
mod cli;
|
||||
mod event_processor;
|
||||
mod event_processor_with_human_output;
|
||||
pub mod event_processor_with_jsonl_output;
|
||||
pub mod exec_events;
|
||||
pub(crate) mod event_processor_with_jsonl_output;
|
||||
pub(crate) mod exec_events;
|
||||
|
||||
pub use cli::Cli;
|
||||
pub use cli::Command;
|
||||
@@ -85,7 +85,42 @@ use codex_utils_absolute_path::AbsolutePathBuf;
|
||||
use codex_utils_oss::ensure_oss_provider_ready;
|
||||
use codex_utils_oss::get_default_model_for_oss_provider;
|
||||
use event_processor_with_human_output::EventProcessorWithHumanOutput;
|
||||
use event_processor_with_jsonl_output::EventProcessorWithJsonOutput;
|
||||
pub use event_processor_with_jsonl_output::CodexStatus;
|
||||
pub use event_processor_with_jsonl_output::CollectedThreadEvents;
|
||||
pub use event_processor_with_jsonl_output::EventProcessorWithJsonOutput;
|
||||
pub use exec_events::AgentMessageItem;
|
||||
pub use exec_events::CollabAgentState;
|
||||
pub use exec_events::CollabAgentStatus;
|
||||
pub use exec_events::CollabTool;
|
||||
pub use exec_events::CollabToolCallItem;
|
||||
pub use exec_events::CollabToolCallStatus;
|
||||
pub use exec_events::CommandExecutionItem;
|
||||
pub use exec_events::CommandExecutionStatus;
|
||||
pub use exec_events::ErrorItem;
|
||||
pub use exec_events::FileChangeItem;
|
||||
pub use exec_events::FileUpdateChange;
|
||||
pub use exec_events::ItemCompletedEvent;
|
||||
pub use exec_events::ItemStartedEvent;
|
||||
pub use exec_events::ItemUpdatedEvent;
|
||||
pub use exec_events::McpToolCallItem;
|
||||
pub use exec_events::McpToolCallItemError;
|
||||
pub use exec_events::McpToolCallItemResult;
|
||||
pub use exec_events::McpToolCallStatus;
|
||||
pub use exec_events::PatchApplyStatus;
|
||||
pub use exec_events::PatchChangeKind;
|
||||
pub use exec_events::ReasoningItem;
|
||||
pub use exec_events::ThreadErrorEvent;
|
||||
pub use exec_events::ThreadEvent;
|
||||
pub use exec_events::ThreadItem as ExecThreadItem;
|
||||
pub use exec_events::ThreadItemDetails;
|
||||
pub use exec_events::ThreadStartedEvent;
|
||||
pub use exec_events::TodoItem;
|
||||
pub use exec_events::TodoListItem;
|
||||
pub use exec_events::TurnCompletedEvent;
|
||||
pub use exec_events::TurnFailedEvent;
|
||||
pub use exec_events::TurnStartedEvent;
|
||||
pub use exec_events::Usage;
|
||||
pub use exec_events::WebSearchItem;
|
||||
use serde_json::Value;
|
||||
use std::collections::HashMap;
|
||||
use std::io::IsTerminal;
|
||||
@@ -105,7 +140,6 @@ use tracing_subscriber::prelude::*;
|
||||
use uuid::Uuid;
|
||||
|
||||
use crate::cli::Command as ExecCommand;
|
||||
use crate::event_processor::CodexStatus;
|
||||
use crate::event_processor::EventProcessor;
|
||||
|
||||
const DEFAULT_ANALYTICS_ENABLED: bool = true;
|
||||
|
||||
@@ -37,42 +37,42 @@ use codex_protocol::protocol::SessionConfiguredEvent;
|
||||
use pretty_assertions::assert_eq;
|
||||
use serde_json::json;
|
||||
|
||||
use codex_exec::event_processor_with_jsonl_output::CodexStatus;
|
||||
use codex_exec::event_processor_with_jsonl_output::CollectedThreadEvents;
|
||||
use codex_exec::event_processor_with_jsonl_output::EventProcessorWithJsonOutput;
|
||||
use codex_exec::exec_events::AgentMessageItem;
|
||||
use codex_exec::exec_events::CollabAgentState;
|
||||
use codex_exec::exec_events::CollabAgentStatus;
|
||||
use codex_exec::exec_events::CollabTool;
|
||||
use codex_exec::exec_events::CollabToolCallItem;
|
||||
use codex_exec::exec_events::CollabToolCallStatus;
|
||||
use codex_exec::exec_events::CommandExecutionItem;
|
||||
use codex_exec::exec_events::CommandExecutionStatus;
|
||||
use codex_exec::exec_events::ErrorItem;
|
||||
use codex_exec::exec_events::FileChangeItem;
|
||||
use codex_exec::exec_events::FileUpdateChange as ExecFileUpdateChange;
|
||||
use codex_exec::exec_events::ItemCompletedEvent;
|
||||
use codex_exec::exec_events::ItemStartedEvent;
|
||||
use codex_exec::exec_events::ItemUpdatedEvent;
|
||||
use codex_exec::exec_events::McpToolCallItem;
|
||||
use codex_exec::exec_events::McpToolCallItemError;
|
||||
use codex_exec::exec_events::McpToolCallItemResult;
|
||||
use codex_exec::exec_events::McpToolCallStatus;
|
||||
use codex_exec::exec_events::PatchApplyStatus;
|
||||
use codex_exec::exec_events::PatchChangeKind;
|
||||
use codex_exec::exec_events::ReasoningItem;
|
||||
use codex_exec::exec_events::ThreadErrorEvent;
|
||||
use codex_exec::exec_events::ThreadEvent;
|
||||
use codex_exec::exec_events::ThreadItem as ExecThreadItem;
|
||||
use codex_exec::exec_events::ThreadItemDetails;
|
||||
use codex_exec::exec_events::ThreadStartedEvent;
|
||||
use codex_exec::exec_events::TodoItem;
|
||||
use codex_exec::exec_events::TodoListItem;
|
||||
use codex_exec::exec_events::TurnCompletedEvent;
|
||||
use codex_exec::exec_events::TurnFailedEvent;
|
||||
use codex_exec::exec_events::TurnStartedEvent;
|
||||
use codex_exec::exec_events::Usage;
|
||||
use codex_exec::exec_events::WebSearchItem;
|
||||
use codex_exec::AgentMessageItem;
|
||||
use codex_exec::CodexStatus;
|
||||
use codex_exec::CollabAgentState;
|
||||
use codex_exec::CollabAgentStatus;
|
||||
use codex_exec::CollabTool;
|
||||
use codex_exec::CollabToolCallItem;
|
||||
use codex_exec::CollabToolCallStatus;
|
||||
use codex_exec::CollectedThreadEvents;
|
||||
use codex_exec::CommandExecutionItem;
|
||||
use codex_exec::CommandExecutionStatus;
|
||||
use codex_exec::ErrorItem;
|
||||
use codex_exec::EventProcessorWithJsonOutput;
|
||||
use codex_exec::ExecThreadItem;
|
||||
use codex_exec::FileChangeItem;
|
||||
use codex_exec::FileUpdateChange as ExecFileUpdateChange;
|
||||
use codex_exec::ItemCompletedEvent;
|
||||
use codex_exec::ItemStartedEvent;
|
||||
use codex_exec::ItemUpdatedEvent;
|
||||
use codex_exec::McpToolCallItem;
|
||||
use codex_exec::McpToolCallItemError;
|
||||
use codex_exec::McpToolCallItemResult;
|
||||
use codex_exec::McpToolCallStatus;
|
||||
use codex_exec::PatchApplyStatus;
|
||||
use codex_exec::PatchChangeKind;
|
||||
use codex_exec::ReasoningItem;
|
||||
use codex_exec::ThreadErrorEvent;
|
||||
use codex_exec::ThreadEvent;
|
||||
use codex_exec::ThreadItemDetails;
|
||||
use codex_exec::ThreadStartedEvent;
|
||||
use codex_exec::TodoItem;
|
||||
use codex_exec::TodoListItem;
|
||||
use codex_exec::TurnCompletedEvent;
|
||||
use codex_exec::TurnFailedEvent;
|
||||
use codex_exec::TurnStartedEvent;
|
||||
use codex_exec::Usage;
|
||||
use codex_exec::WebSearchItem;
|
||||
|
||||
#[test]
|
||||
fn map_todo_items_preserves_text_and_completion_state() {
|
||||
|
||||
@@ -42,7 +42,7 @@ async fn spawn_command_under_sandbox(
|
||||
stdio_policy: StdioPolicy,
|
||||
env: HashMap<String, String>,
|
||||
) -> std::io::Result<Child> {
|
||||
use codex_core::landlock::spawn_command_under_linux_sandbox;
|
||||
use codex_core::spawn_command_under_linux_sandbox;
|
||||
let codex_linux_sandbox_exe = core_test_support::find_codex_linux_sandbox_exe()
|
||||
.map_err(|err| io::Error::new(io::ErrorKind::NotFound, err))?;
|
||||
spawn_command_under_linux_sandbox(
|
||||
|
||||
Reference in New Issue
Block a user