mirror of
https://github.com/pchuan98/codex.git
synced 2026-07-01 00:31:56 +08:00
TUI: remove simple legacy_core re-exports (#18605)
## Summary The TUI still imported several symbols through the transitional app-server-client `legacy_core` facade even though those symbols are already owned by smaller crates. This PR narrows that facade by rewiring those imports directly to their owner crates. ## Changes No functional changes, just import rewiring. This is part of our ongoing effort to whittle away at the `legacy_core` namespace, which represents all of the remaining symbols that the TUI imports from the core.
This commit is contained in:
committed by
GitHub
Unverified
parent
fa8943fe7e
commit
87fc21ff60
Generated
+3
@@ -2970,6 +2970,7 @@ dependencies = [
|
||||
"codex-cloud-requirements",
|
||||
"codex-config",
|
||||
"codex-connectors",
|
||||
"codex-core-skills",
|
||||
"codex-exec-server",
|
||||
"codex-features",
|
||||
"codex-feedback",
|
||||
@@ -2981,6 +2982,7 @@ dependencies = [
|
||||
"codex-model-provider-info",
|
||||
"codex-models-manager",
|
||||
"codex-otel",
|
||||
"codex-plugin",
|
||||
"codex-protocol",
|
||||
"codex-realtime-webrtc",
|
||||
"codex-rollout",
|
||||
@@ -2994,6 +2996,7 @@ dependencies = [
|
||||
"codex-utils-elapsed",
|
||||
"codex-utils-fuzzy-match",
|
||||
"codex-utils-oss",
|
||||
"codex-utils-plugins",
|
||||
"codex-utils-pty",
|
||||
"codex-utils-sandbox-summary",
|
||||
"codex-utils-sleep-inhibitor",
|
||||
|
||||
@@ -64,28 +64,16 @@ pub use crate::remote::RemoteAppServerConnectArgs;
|
||||
/// module exists so clients can remove a direct `codex-core` dependency
|
||||
/// while legacy startup/config paths are migrated to RPCs.
|
||||
pub mod legacy_core {
|
||||
pub use codex_core::Cursor;
|
||||
pub use codex_core::DEFAULT_AGENTS_MD_FILENAME;
|
||||
pub use codex_core::INTERACTIVE_SESSION_SOURCES;
|
||||
pub use codex_core::LOCAL_AGENTS_MD_FILENAME;
|
||||
pub use codex_core::McpManager;
|
||||
pub use codex_core::PLUGIN_TEXT_MENTION_SIGIL;
|
||||
pub use codex_core::RolloutRecorder;
|
||||
pub use codex_core::TOOL_MENTION_SIGIL;
|
||||
pub use codex_core::ThreadItem;
|
||||
pub use codex_core::ThreadSortKey;
|
||||
pub use codex_core::ThreadsPage;
|
||||
pub use codex_core::append_message_history_entry;
|
||||
pub use codex_core::check_execpolicy_for_warnings;
|
||||
pub use codex_core::find_thread_meta_by_name_str;
|
||||
pub use codex_core::find_thread_name_by_id;
|
||||
pub use codex_core::find_thread_names_by_ids;
|
||||
pub use codex_core::format_exec_policy_error_with_source;
|
||||
pub use codex_core::grant_read_root_non_elevated;
|
||||
pub use codex_core::lookup_message_history_entry;
|
||||
pub use codex_core::message_history_metadata;
|
||||
pub use codex_core::path_utils;
|
||||
pub use codex_core::read_session_meta_line;
|
||||
pub use codex_core::web_search_detail;
|
||||
|
||||
pub mod config {
|
||||
@@ -124,10 +112,6 @@ pub mod legacy_core {
|
||||
pub use codex_core::review_prompts::*;
|
||||
}
|
||||
|
||||
pub mod skills {
|
||||
pub use codex_core::skills::*;
|
||||
}
|
||||
|
||||
pub mod test_support {
|
||||
pub use codex_core::test_support::*;
|
||||
}
|
||||
|
||||
@@ -34,6 +34,7 @@ codex-chatgpt = { workspace = true }
|
||||
codex-cloud-requirements = { workspace = true }
|
||||
codex-config = { workspace = true }
|
||||
codex-connectors = { workspace = true }
|
||||
codex-core-skills = { workspace = true }
|
||||
codex-exec-server = { workspace = true }
|
||||
codex-features = { workspace = true }
|
||||
codex-feedback = { workspace = true }
|
||||
@@ -43,6 +44,7 @@ codex-login = { workspace = true }
|
||||
codex-model-provider-info = { workspace = true }
|
||||
codex-models-manager = { workspace = true }
|
||||
codex-otel = { workspace = true }
|
||||
codex-plugin = { workspace = true }
|
||||
codex-protocol = { workspace = true }
|
||||
codex-realtime-webrtc = { workspace = true }
|
||||
codex-rollout = { workspace = true }
|
||||
@@ -55,6 +57,7 @@ codex-utils-cli = { workspace = true }
|
||||
codex-utils-elapsed = { workspace = true }
|
||||
codex-utils-fuzzy-match = { workspace = true }
|
||||
codex-utils-oss = { workspace = true }
|
||||
codex-utils-plugins = { workspace = true }
|
||||
codex-utils-sandbox-summary = { workspace = true }
|
||||
codex-utils-sleep-inhibitor = { workspace = true }
|
||||
codex-utils-string = { workspace = true }
|
||||
|
||||
@@ -31,11 +31,9 @@ use crate::bottom_pane::ApprovalRequest;
|
||||
use crate::bottom_pane::StatusLineItem;
|
||||
use crate::bottom_pane::TerminalTitleItem;
|
||||
use crate::chatwidget::UserMessage;
|
||||
use crate::history_cell::HistoryCell;
|
||||
use crate::legacy_core::plugins::PluginCapabilitySummary;
|
||||
|
||||
use codex_config::types::ApprovalsReviewer;
|
||||
use codex_features::Feature;
|
||||
use codex_plugin::PluginCapabilitySummary;
|
||||
use codex_protocol::config_types::CollaborationModeMask;
|
||||
use codex_protocol::config_types::Personality;
|
||||
use codex_protocol::config_types::ServiceTier;
|
||||
@@ -45,6 +43,8 @@ use codex_protocol::protocol::SandboxPolicy;
|
||||
use codex_realtime_webrtc::RealtimeWebrtcEvent;
|
||||
use codex_realtime_webrtc::RealtimeWebrtcSessionHandle;
|
||||
|
||||
use crate::history_cell::HistoryCell;
|
||||
|
||||
#[derive(Debug, Clone, Copy, PartialEq, Eq)]
|
||||
pub(crate) enum RealtimeAudioDeviceKind {
|
||||
Microphone,
|
||||
|
||||
@@ -206,12 +206,16 @@ use crate::bottom_pane::textarea::TextAreaState;
|
||||
use crate::clipboard_paste::normalize_pasted_path;
|
||||
use crate::clipboard_paste::pasted_image_format;
|
||||
use crate::history_cell;
|
||||
use crate::legacy_core::plugins::PluginCapabilitySummary;
|
||||
use crate::legacy_core::skills::model::SkillMetadata;
|
||||
use crate::tui::FrameRequester;
|
||||
use crate::ui_consts::LIVE_PREFIX_COLS;
|
||||
use codex_app_server_protocol::AppInfo;
|
||||
#[cfg(test)]
|
||||
use codex_core_skills::model::SkillInterface;
|
||||
use codex_core_skills::model::SkillMetadata;
|
||||
use codex_file_search::FileMatch;
|
||||
#[cfg(test)]
|
||||
use codex_plugin::AppConnectorId;
|
||||
use codex_plugin::PluginCapabilitySummary;
|
||||
use std::cell::RefCell;
|
||||
use std::collections::HashMap;
|
||||
use std::collections::HashSet;
|
||||
@@ -5233,7 +5237,7 @@ mod tests {
|
||||
name: "google-calendar:availability".to_string(),
|
||||
description: "Find availability and plan event changes".to_string(),
|
||||
short_description: None,
|
||||
interface: Some(crate::legacy_core::skills::model::SkillInterface {
|
||||
interface: Some(SkillInterface {
|
||||
display_name: Some("Google Calendar".to_string()),
|
||||
short_description: None,
|
||||
icon_small: None,
|
||||
@@ -5255,9 +5259,7 @@ mod tests {
|
||||
),
|
||||
has_skills: true,
|
||||
mcp_server_names: vec!["google-calendar".to_string()],
|
||||
app_connector_ids: vec![crate::legacy_core::plugins::AppConnectorId(
|
||||
"google_calendar".to_string(),
|
||||
)],
|
||||
app_connector_ids: vec![AppConnectorId("google_calendar".to_string())],
|
||||
}]));
|
||||
composer.set_connector_mentions(Some(ConnectorsSnapshot {
|
||||
connectors: vec![AppInfo {
|
||||
@@ -5307,9 +5309,7 @@ mod tests {
|
||||
),
|
||||
has_skills: true,
|
||||
mcp_server_names: vec!["sample".to_string()],
|
||||
app_connector_ids: vec![crate::legacy_core::plugins::AppConnectorId(
|
||||
"calendar".to_string(),
|
||||
)],
|
||||
app_connector_ids: vec![AppConnectorId("calendar".to_string())],
|
||||
}]));
|
||||
},
|
||||
);
|
||||
@@ -5328,7 +5328,7 @@ mod tests {
|
||||
name: "google-calendar-skill".to_string(),
|
||||
description: "Find availability and plan event changes".to_string(),
|
||||
short_description: None,
|
||||
interface: Some(crate::legacy_core::skills::model::SkillInterface {
|
||||
interface: Some(SkillInterface {
|
||||
display_name: Some("Google Calendar".to_string()),
|
||||
short_description: None,
|
||||
icon_small: None,
|
||||
|
||||
@@ -23,16 +23,16 @@ use crate::bottom_pane::pending_thread_approvals::PendingThreadApprovals;
|
||||
use crate::bottom_pane::unified_exec_footer::UnifiedExecFooter;
|
||||
use crate::key_hint;
|
||||
use crate::key_hint::KeyBinding;
|
||||
use crate::legacy_core::plugins::PluginCapabilitySummary;
|
||||
use crate::legacy_core::skills::model::SkillMetadata;
|
||||
use crate::render::renderable::FlexRenderable;
|
||||
use crate::render::renderable::Renderable;
|
||||
use crate::render::renderable::RenderableItem;
|
||||
use crate::tui::FrameRequester;
|
||||
use bottom_pane_view::BottomPaneView;
|
||||
use bottom_pane_view::ViewCompletion;
|
||||
use codex_core_skills::model::SkillMetadata;
|
||||
use codex_features::Features;
|
||||
use codex_file_search::FileMatch;
|
||||
use codex_plugin::PluginCapabilitySummary;
|
||||
use codex_protocol::request_user_input::RequestUserInputEvent;
|
||||
use codex_protocol::user_input::TextElement;
|
||||
use crossterm::event::KeyCode;
|
||||
|
||||
@@ -61,8 +61,6 @@ use crate::legacy_core::config::Config;
|
||||
use crate::legacy_core::config::Constrained;
|
||||
use crate::legacy_core::config::ConstraintResult;
|
||||
use crate::legacy_core::config_loader::ConfigLayerStackOrdering;
|
||||
use crate::legacy_core::find_thread_name_by_id;
|
||||
use crate::legacy_core::skills::model::SkillMetadata;
|
||||
#[cfg(target_os = "windows")]
|
||||
use crate::legacy_core::windows_sandbox::WindowsSandboxLevelExt;
|
||||
use crate::mention_codec::LinkedMention;
|
||||
@@ -109,6 +107,7 @@ use codex_chatgpt::connectors;
|
||||
use codex_config::types::ApprovalsReviewer;
|
||||
use codex_config::types::Notifications;
|
||||
use codex_config::types::WindowsSandboxModeToml;
|
||||
use codex_core_skills::model::SkillMetadata;
|
||||
use codex_features::FEATURES;
|
||||
use codex_features::Feature;
|
||||
#[cfg(test)]
|
||||
@@ -119,6 +118,7 @@ use codex_git_utils::local_git_branches;
|
||||
use codex_git_utils::recent_commits;
|
||||
use codex_otel::RuntimeMetricsSummary;
|
||||
use codex_otel::SessionTelemetry;
|
||||
use codex_plugin::PluginCapabilitySummary;
|
||||
use codex_protocol::ThreadId;
|
||||
use codex_protocol::account::PlanType;
|
||||
use codex_protocol::approvals::ElicitationRequestEvent;
|
||||
@@ -222,6 +222,7 @@ use codex_protocol::request_user_input::RequestUserInputQuestionOption;
|
||||
use codex_protocol::user_input::ByteRange;
|
||||
use codex_protocol::user_input::TextElement;
|
||||
use codex_protocol::user_input::UserInput;
|
||||
use codex_rollout::find_thread_name_by_id;
|
||||
use codex_terminal_detection::Multiplexer;
|
||||
use codex_terminal_detection::TerminalInfo;
|
||||
use codex_terminal_detection::TerminalName;
|
||||
@@ -9973,9 +9974,7 @@ impl ChatWidget {
|
||||
}
|
||||
}
|
||||
|
||||
fn plugins_for_mentions(
|
||||
&self,
|
||||
) -> Option<&[crate::legacy_core::plugins::PluginCapabilitySummary]> {
|
||||
fn plugins_for_mentions(&self) -> Option<&[PluginCapabilitySummary]> {
|
||||
if !self.config.features.enabled(Feature::Plugins) {
|
||||
return None;
|
||||
}
|
||||
@@ -10709,7 +10708,7 @@ impl ChatWidget {
|
||||
|
||||
pub(crate) fn on_plugin_mentions_loaded(
|
||||
&mut self,
|
||||
plugins: Option<Vec<crate::legacy_core::plugins::PluginCapabilitySummary>>,
|
||||
plugins: Option<Vec<PluginCapabilitySummary>>,
|
||||
) {
|
||||
self.bottom_pane.set_plugin_mentions(plugins);
|
||||
}
|
||||
|
||||
@@ -8,19 +8,19 @@ use crate::bottom_pane::SelectionViewParams;
|
||||
use crate::bottom_pane::SkillsToggleItem;
|
||||
use crate::bottom_pane::SkillsToggleView;
|
||||
use crate::bottom_pane::popup_consts::standard_popup_hint_line;
|
||||
use crate::legacy_core::TOOL_MENTION_SIGIL;
|
||||
use crate::legacy_core::skills::model::SkillDependencies;
|
||||
use crate::legacy_core::skills::model::SkillInterface;
|
||||
use crate::legacy_core::skills::model::SkillMetadata;
|
||||
use crate::legacy_core::skills::model::SkillToolDependency;
|
||||
use crate::skills_helpers::skill_description;
|
||||
use crate::skills_helpers::skill_display_name;
|
||||
use codex_app_server_protocol::AppInfo;
|
||||
use codex_core_skills::model::SkillDependencies;
|
||||
use codex_core_skills::model::SkillInterface;
|
||||
use codex_core_skills::model::SkillMetadata;
|
||||
use codex_core_skills::model::SkillToolDependency;
|
||||
use codex_protocol::parse_command::ParsedCommand;
|
||||
use codex_protocol::protocol::ListSkillsResponseEvent;
|
||||
use codex_protocol::protocol::SkillMetadata as ProtocolSkillMetadata;
|
||||
use codex_protocol::protocol::SkillsListEntry;
|
||||
use codex_utils_absolute_path::AbsolutePathBuf;
|
||||
use codex_utils_plugins::mention_syntax::TOOL_MENTION_SIGIL;
|
||||
|
||||
impl ChatWidget {
|
||||
pub(crate) fn open_skills_list(&mut self) {
|
||||
|
||||
@@ -26,7 +26,6 @@ pub(super) use crate::legacy_core::config_loader::ConfigRequirements;
|
||||
pub(super) use crate::legacy_core::config_loader::ConfigRequirementsToml;
|
||||
pub(super) use crate::legacy_core::config_loader::RequirementSource;
|
||||
pub(super) use crate::legacy_core::plugins::OPENAI_CURATED_MARKETPLACE_NAME;
|
||||
pub(super) use crate::legacy_core::skills::model::SkillMetadata;
|
||||
pub(super) use crate::model_catalog::ModelCatalog;
|
||||
pub(super) use crate::test_backend::VT100Backend;
|
||||
pub(super) use crate::test_support::PathBufExt;
|
||||
@@ -101,6 +100,7 @@ pub(super) use codex_config::types::ApprovalsReviewer;
|
||||
pub(super) use codex_config::types::Notifications;
|
||||
#[cfg(target_os = "windows")]
|
||||
pub(super) use codex_config::types::WindowsSandboxModeToml;
|
||||
pub(super) use codex_core_skills::model::SkillMetadata;
|
||||
pub(super) use codex_features::FEATURES;
|
||||
pub(super) use codex_features::Feature;
|
||||
pub(super) use codex_git_utils::CommitLogEntry;
|
||||
|
||||
@@ -1032,16 +1032,15 @@ async fn submit_user_message_emits_structured_plugin_mentions_from_bindings() {
|
||||
msg: EventMsg::SessionConfigured(configured),
|
||||
});
|
||||
chat.set_feature_enabled(Feature::Plugins, /*enabled*/ true);
|
||||
chat.bottom_pane.set_plugin_mentions(Some(vec![
|
||||
crate::legacy_core::plugins::PluginCapabilitySummary {
|
||||
chat.bottom_pane
|
||||
.set_plugin_mentions(Some(vec![codex_plugin::PluginCapabilitySummary {
|
||||
config_name: "sample@test".to_string(),
|
||||
display_name: "Sample Plugin".to_string(),
|
||||
description: None,
|
||||
has_skills: true,
|
||||
mcp_server_names: Vec::new(),
|
||||
app_connector_ids: Vec::new(),
|
||||
},
|
||||
]));
|
||||
}]));
|
||||
|
||||
chat.submit_user_message(UserMessage {
|
||||
text: "$sample".to_string(),
|
||||
|
||||
@@ -14,10 +14,8 @@ use crate::legacy_core::config_loader::CloudRequirementsLoader;
|
||||
use crate::legacy_core::config_loader::ConfigLoadError;
|
||||
use crate::legacy_core::config_loader::LoaderOverrides;
|
||||
use crate::legacy_core::config_loader::format_config_error_with_source;
|
||||
use crate::legacy_core::find_thread_meta_by_name_str;
|
||||
use crate::legacy_core::format_exec_policy_error_with_source;
|
||||
use crate::legacy_core::path_utils;
|
||||
use crate::legacy_core::read_session_meta_line;
|
||||
use crate::legacy_core::windows_sandbox::WindowsSandboxLevelExt;
|
||||
use additional_dirs::add_dir_warning_message;
|
||||
use app::App;
|
||||
@@ -51,6 +49,8 @@ use codex_protocol::protocol::AskForApproval;
|
||||
use codex_protocol::protocol::RolloutItem;
|
||||
use codex_protocol::protocol::RolloutLine;
|
||||
use codex_protocol::protocol::TurnContextItem;
|
||||
use codex_rollout::find_thread_meta_by_name_str;
|
||||
use codex_rollout::read_session_meta_line;
|
||||
use codex_rollout::state_db::get_state_db;
|
||||
use codex_state::log_db;
|
||||
use codex_terminal_detection::terminal_info;
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
use std::collections::HashMap;
|
||||
use std::collections::VecDeque;
|
||||
|
||||
use crate::legacy_core::PLUGIN_TEXT_MENTION_SIGIL;
|
||||
use crate::legacy_core::TOOL_MENTION_SIGIL;
|
||||
use codex_utils_plugins::mention_syntax::PLUGIN_TEXT_MENTION_SIGIL;
|
||||
use codex_utils_plugins::mention_syntax::TOOL_MENTION_SIGIL;
|
||||
|
||||
#[derive(Clone, Debug, PartialEq, Eq)]
|
||||
pub(crate) struct LinkedMention {
|
||||
|
||||
@@ -7,14 +7,7 @@ use std::sync::Arc;
|
||||
use crate::app_server_session::AppServerSession;
|
||||
use crate::diff_render::display_path_for;
|
||||
use crate::key_hint;
|
||||
use crate::legacy_core::Cursor;
|
||||
use crate::legacy_core::INTERACTIVE_SESSION_SOURCES;
|
||||
use crate::legacy_core::RolloutRecorder;
|
||||
use crate::legacy_core::ThreadItem;
|
||||
use crate::legacy_core::ThreadSortKey;
|
||||
use crate::legacy_core::ThreadsPage;
|
||||
use crate::legacy_core::config::Config;
|
||||
use crate::legacy_core::find_thread_names_by_ids;
|
||||
use crate::legacy_core::path_utils;
|
||||
use crate::text_formatting::truncate_text;
|
||||
use crate::tui::FrameRequester;
|
||||
@@ -27,6 +20,13 @@ use codex_app_server_protocol::ThreadListParams;
|
||||
use codex_app_server_protocol::ThreadSortKey as AppServerThreadSortKey;
|
||||
use codex_app_server_protocol::ThreadSourceKind;
|
||||
use codex_protocol::ThreadId;
|
||||
use codex_rollout::Cursor;
|
||||
use codex_rollout::INTERACTIVE_SESSION_SOURCES;
|
||||
use codex_rollout::RolloutRecorder;
|
||||
use codex_rollout::ThreadItem;
|
||||
use codex_rollout::ThreadSortKey;
|
||||
use codex_rollout::ThreadsPage;
|
||||
use codex_rollout::find_thread_names_by_ids;
|
||||
use color_eyre::eyre::Result;
|
||||
use crossterm::event::KeyCode;
|
||||
use crossterm::event::KeyEvent;
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
use crate::legacy_core::skills::model::SkillMetadata;
|
||||
use codex_core_skills::model::SkillMetadata;
|
||||
use codex_utils_fuzzy_match::fuzzy_match;
|
||||
|
||||
use crate::text_formatting::truncate_text;
|
||||
|
||||
Reference in New Issue
Block a user