mirror of
https://github.com/pchuan98/codex.git
synced 2026-07-01 00:31:56 +08:00
Add codex-core public API listing (#20243)
Summary: - Add a checked-in codex-core public API listing generated by cargo-public-api. - Add scripts/regen-public-api.sh with an embedded crate list, auto-install for cargo-public-api 0.51.0, pinned nightly, and --check mode. - Add Rust CI jobs on the codex Linux x64 runner pool to verify the listing stays up to date. Testing: - bash -n scripts/regen-public-api.sh - just regen-public-api --check - yq '.' .github/workflows/rust-ci.yml .github/workflows/rust-ci-full.yml - git diff --check
This commit is contained in:
committed by
GitHub
Unverified
parent
782191547c
commit
8de2a7a16d
Generated
+18
-12
@@ -2479,6 +2479,23 @@ dependencies = [
|
||||
"zstd 0.13.3",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "codex-core-api"
|
||||
version = "0.0.0"
|
||||
dependencies = [
|
||||
"codex-analytics",
|
||||
"codex-arg0",
|
||||
"codex-config",
|
||||
"codex-core",
|
||||
"codex-exec-server",
|
||||
"codex-features",
|
||||
"codex-login",
|
||||
"codex-model-provider-info",
|
||||
"codex-models-manager",
|
||||
"codex-protocol",
|
||||
"codex-utils-absolute-path",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "codex-core-plugins"
|
||||
version = "0.0.0"
|
||||
@@ -3498,18 +3515,7 @@ version = "0.0.0"
|
||||
dependencies = [
|
||||
"anyhow",
|
||||
"clap",
|
||||
"codex-arg0",
|
||||
"codex-config",
|
||||
"codex-core",
|
||||
"codex-exec-server",
|
||||
"codex-features",
|
||||
"codex-login",
|
||||
"codex-model-provider-info",
|
||||
"codex-models-manager",
|
||||
"codex-protocol",
|
||||
"codex-rollout",
|
||||
"codex-thread-store",
|
||||
"codex-utils-absolute-path",
|
||||
"codex-core-api",
|
||||
"tracing",
|
||||
]
|
||||
|
||||
|
||||
@@ -32,6 +32,7 @@ members = [
|
||||
"shell-escalation",
|
||||
"skills",
|
||||
"core",
|
||||
"core-api",
|
||||
"core-plugins",
|
||||
"core-skills",
|
||||
"hooks",
|
||||
@@ -144,6 +145,7 @@ codex-code-mode = { path = "code-mode" }
|
||||
codex-config = { path = "config" }
|
||||
codex-connectors = { path = "connectors" }
|
||||
codex-core = { path = "core" }
|
||||
codex-core-api = { path = "core-api" }
|
||||
codex-core-plugins = { path = "core-plugins" }
|
||||
codex-core-skills = { path = "core-skills" }
|
||||
codex-device-key = { path = "device-key" }
|
||||
|
||||
@@ -0,0 +1,6 @@
|
||||
load("//:defs.bzl", "codex_rust_crate")
|
||||
|
||||
codex_rust_crate(
|
||||
name = "core-api",
|
||||
crate_name = "codex_core_api",
|
||||
)
|
||||
@@ -0,0 +1,26 @@
|
||||
[package]
|
||||
edition.workspace = true
|
||||
license.workspace = true
|
||||
name = "codex-core-api"
|
||||
version.workspace = true
|
||||
|
||||
[lib]
|
||||
doctest = false
|
||||
name = "codex_core_api"
|
||||
path = "src/lib.rs"
|
||||
|
||||
[lints]
|
||||
workspace = true
|
||||
|
||||
[dependencies]
|
||||
codex-arg0 = { workspace = true }
|
||||
codex-analytics = { workspace = true }
|
||||
codex-config = { workspace = true }
|
||||
codex-core = { workspace = true }
|
||||
codex-exec-server = { workspace = true }
|
||||
codex-features = { workspace = true }
|
||||
codex-login = { workspace = true }
|
||||
codex-model-provider-info = { workspace = true }
|
||||
codex-models-manager = { workspace = true }
|
||||
codex-protocol = { workspace = true }
|
||||
codex-utils-absolute-path = { workspace = true }
|
||||
@@ -0,0 +1,72 @@
|
||||
//! Public facade for thread management APIs built on `codex-core`.
|
||||
|
||||
#![deny(private_bounds, private_interfaces, unreachable_pub)]
|
||||
|
||||
pub use codex_analytics::AnalyticsEventsClient;
|
||||
pub use codex_arg0::Arg0DispatchPaths;
|
||||
pub use codex_arg0::arg0_dispatch_or_else;
|
||||
pub use codex_config::ConfigLayerStack;
|
||||
pub use codex_config::config_toml::ProjectConfig;
|
||||
pub use codex_config::config_toml::RealtimeAudioConfig;
|
||||
pub use codex_config::config_toml::RealtimeConfig;
|
||||
pub use codex_config::types::AuthCredentialsStoreMode;
|
||||
pub use codex_config::types::History;
|
||||
pub use codex_config::types::MemoriesConfig;
|
||||
pub use codex_config::types::ModelAvailabilityNuxConfig;
|
||||
pub use codex_config::types::Notice;
|
||||
pub use codex_config::types::OAuthCredentialsStoreMode;
|
||||
pub use codex_config::types::OtelConfig;
|
||||
pub use codex_config::types::ToolSuggestConfig;
|
||||
pub use codex_config::types::TuiKeymap;
|
||||
pub use codex_config::types::TuiNotificationSettings;
|
||||
pub use codex_config::types::UriBasedFileOpener;
|
||||
pub use codex_core::CodexThread;
|
||||
pub use codex_core::ForkSnapshot;
|
||||
pub use codex_core::McpManager;
|
||||
pub use codex_core::NewThread;
|
||||
pub use codex_core::StartThreadOptions;
|
||||
pub use codex_core::ThreadManager;
|
||||
pub use codex_core::ThreadShutdownReport;
|
||||
pub use codex_core::config::Config;
|
||||
pub use codex_core::config::Constrained;
|
||||
pub use codex_core::config::GhostSnapshotConfig;
|
||||
pub use codex_core::config::MultiAgentV2Config;
|
||||
pub use codex_core::config::Permissions;
|
||||
pub use codex_core::config::TerminalResizeReflowConfig;
|
||||
pub use codex_core::config::ThreadStoreConfig;
|
||||
pub use codex_core::config::find_codex_home;
|
||||
pub use codex_core::plugins::PluginsManager;
|
||||
pub use codex_core::skills::SkillsManager;
|
||||
pub use codex_core::thread_store_from_config;
|
||||
pub use codex_exec_server::EnvironmentManager;
|
||||
pub use codex_exec_server::EnvironmentManagerArgs;
|
||||
pub use codex_exec_server::ExecServerRuntimePaths;
|
||||
pub use codex_features::Feature;
|
||||
pub use codex_login::AuthManager;
|
||||
pub use codex_login::default_client::set_default_originator;
|
||||
pub use codex_model_provider_info::OPENAI_PROVIDER_ID;
|
||||
pub use codex_model_provider_info::built_in_model_providers;
|
||||
pub use codex_models_manager::collaboration_mode_presets::CollaborationModesConfig;
|
||||
pub use codex_models_manager::manager::RefreshStrategy;
|
||||
pub use codex_models_manager::manager::SharedModelsManager;
|
||||
pub use codex_protocol::ThreadId;
|
||||
pub use codex_protocol::config_types::AltScreenMode;
|
||||
pub use codex_protocol::config_types::ApprovalsReviewer;
|
||||
pub use codex_protocol::config_types::CollaborationModeMask;
|
||||
pub use codex_protocol::config_types::ShellEnvironmentPolicy;
|
||||
pub use codex_protocol::config_types::WebSearchMode;
|
||||
pub use codex_protocol::dynamic_tools::DynamicToolSpec;
|
||||
pub use codex_protocol::error::Result as CodexResult;
|
||||
pub use codex_protocol::models::PermissionProfile;
|
||||
pub use codex_protocol::openai_models::ModelPreset;
|
||||
pub use codex_protocol::protocol::AskForApproval;
|
||||
pub use codex_protocol::protocol::EventMsg;
|
||||
pub use codex_protocol::protocol::InitialHistory;
|
||||
pub use codex_protocol::protocol::McpServerRefreshConfig;
|
||||
pub use codex_protocol::protocol::Op;
|
||||
pub use codex_protocol::protocol::SessionConfiguredEvent;
|
||||
pub use codex_protocol::protocol::SessionSource;
|
||||
pub use codex_protocol::protocol::TurnEnvironmentSelection;
|
||||
pub use codex_protocol::protocol::W3cTraceContext;
|
||||
pub use codex_protocol::user_input::UserInput;
|
||||
pub use codex_utils_absolute_path::AbsolutePathBuf;
|
||||
@@ -119,6 +119,7 @@ pub use thread_manager::ForkSnapshot;
|
||||
pub use thread_manager::NewThread;
|
||||
pub use thread_manager::StartThreadOptions;
|
||||
pub use thread_manager::ThreadManager;
|
||||
pub use thread_manager::ThreadShutdownReport;
|
||||
pub use thread_manager::build_models_manager;
|
||||
pub use thread_manager::thread_store_from_config;
|
||||
pub use web_search::web_search_action_detail;
|
||||
|
||||
@@ -10,16 +10,8 @@ workspace = true
|
||||
[dependencies]
|
||||
anyhow = { workspace = true }
|
||||
clap = { workspace = true, features = ["derive"] }
|
||||
codex-arg0 = { workspace = true }
|
||||
codex-config = { workspace = true }
|
||||
codex-core = { workspace = true }
|
||||
codex-exec-server = { workspace = true }
|
||||
codex-features = { workspace = true }
|
||||
codex-login = { workspace = true }
|
||||
codex-model-provider-info = { workspace = true }
|
||||
codex-models-manager = { workspace = true }
|
||||
codex-protocol = { workspace = true }
|
||||
codex-rollout = { workspace = true }
|
||||
codex-thread-store = { workspace = true }
|
||||
codex-utils-absolute-path = { workspace = true }
|
||||
# Keep this sample limited to a single Codex workspace dependency.
|
||||
# Add new Codex surface area to `codex-core-api` instead of depending on
|
||||
# additional `codex-*` crates here.
|
||||
codex-core-api = { workspace = true }
|
||||
tracing = { workspace = true }
|
||||
|
||||
@@ -1,7 +1,8 @@
|
||||
# ThreadManager Sample
|
||||
|
||||
Small one-shot binary that starts a Codex thread with `ThreadManager`, submits a
|
||||
single user turn, and prints the final assistant message.
|
||||
Small one-shot binary that starts a Codex thread with `ThreadManager` from
|
||||
`codex-core-api`, submits a single user turn, and prints the final assistant
|
||||
message.
|
||||
|
||||
```sh
|
||||
cargo run -p codex-thread-manager-sample -- "Say hello"
|
||||
|
||||
@@ -8,56 +8,55 @@ use std::sync::Arc;
|
||||
use anyhow::Context;
|
||||
use anyhow::bail;
|
||||
use clap::Parser;
|
||||
use codex_arg0::Arg0DispatchPaths;
|
||||
use codex_arg0::arg0_dispatch_or_else;
|
||||
use codex_config::ConfigLayerStack;
|
||||
use codex_config::config_toml::ProjectConfig;
|
||||
use codex_config::config_toml::RealtimeAudioConfig;
|
||||
use codex_config::config_toml::RealtimeConfig;
|
||||
use codex_config::types::AuthCredentialsStoreMode;
|
||||
use codex_config::types::History;
|
||||
use codex_config::types::MemoriesConfig;
|
||||
use codex_config::types::ModelAvailabilityNuxConfig;
|
||||
use codex_config::types::Notice;
|
||||
use codex_config::types::OAuthCredentialsStoreMode;
|
||||
use codex_config::types::OtelConfig;
|
||||
use codex_config::types::ToolSuggestConfig;
|
||||
use codex_config::types::TuiKeymap;
|
||||
use codex_config::types::TuiNotificationSettings;
|
||||
use codex_config::types::UriBasedFileOpener;
|
||||
use codex_core::CodexThread;
|
||||
use codex_core::NewThread;
|
||||
use codex_core::ThreadManager;
|
||||
use codex_core::config::Config;
|
||||
use codex_core::config::Constrained;
|
||||
use codex_core::config::GhostSnapshotConfig;
|
||||
use codex_core::config::MultiAgentV2Config;
|
||||
use codex_core::config::Permissions;
|
||||
use codex_core::config::TerminalResizeReflowConfig;
|
||||
use codex_core::config::ThreadStoreConfig;
|
||||
use codex_core::config::find_codex_home;
|
||||
use codex_exec_server::EnvironmentManager;
|
||||
use codex_exec_server::EnvironmentManagerArgs;
|
||||
use codex_exec_server::ExecServerRuntimePaths;
|
||||
use codex_features::Feature;
|
||||
use codex_login::AuthManager;
|
||||
use codex_login::default_client::set_default_originator;
|
||||
use codex_model_provider_info::OPENAI_PROVIDER_ID;
|
||||
use codex_model_provider_info::built_in_model_providers;
|
||||
use codex_models_manager::collaboration_mode_presets::CollaborationModesConfig;
|
||||
use codex_protocol::config_types::AltScreenMode;
|
||||
use codex_protocol::config_types::ApprovalsReviewer;
|
||||
use codex_protocol::config_types::ShellEnvironmentPolicy;
|
||||
use codex_protocol::config_types::WebSearchMode;
|
||||
use codex_protocol::models::PermissionProfile;
|
||||
use codex_protocol::protocol::AskForApproval;
|
||||
use codex_protocol::protocol::EventMsg;
|
||||
use codex_protocol::protocol::Op;
|
||||
use codex_protocol::protocol::SessionSource;
|
||||
use codex_protocol::user_input::UserInput;
|
||||
use codex_rollout::RolloutConfig;
|
||||
use codex_thread_store::LocalThreadStore;
|
||||
use codex_utils_absolute_path::AbsolutePathBuf;
|
||||
use codex_core_api::AbsolutePathBuf;
|
||||
use codex_core_api::AltScreenMode;
|
||||
use codex_core_api::ApprovalsReviewer;
|
||||
use codex_core_api::Arg0DispatchPaths;
|
||||
use codex_core_api::AskForApproval;
|
||||
use codex_core_api::AuthCredentialsStoreMode;
|
||||
use codex_core_api::AuthManager;
|
||||
use codex_core_api::CodexThread;
|
||||
use codex_core_api::CollaborationModesConfig;
|
||||
use codex_core_api::Config;
|
||||
use codex_core_api::ConfigLayerStack;
|
||||
use codex_core_api::Constrained;
|
||||
use codex_core_api::EnvironmentManager;
|
||||
use codex_core_api::EnvironmentManagerArgs;
|
||||
use codex_core_api::EventMsg;
|
||||
use codex_core_api::ExecServerRuntimePaths;
|
||||
use codex_core_api::Feature;
|
||||
use codex_core_api::GhostSnapshotConfig;
|
||||
use codex_core_api::History;
|
||||
use codex_core_api::MemoriesConfig;
|
||||
use codex_core_api::ModelAvailabilityNuxConfig;
|
||||
use codex_core_api::MultiAgentV2Config;
|
||||
use codex_core_api::NewThread;
|
||||
use codex_core_api::Notice;
|
||||
use codex_core_api::OAuthCredentialsStoreMode;
|
||||
use codex_core_api::OPENAI_PROVIDER_ID;
|
||||
use codex_core_api::Op;
|
||||
use codex_core_api::OtelConfig;
|
||||
use codex_core_api::PermissionProfile;
|
||||
use codex_core_api::Permissions;
|
||||
use codex_core_api::ProjectConfig;
|
||||
use codex_core_api::RealtimeAudioConfig;
|
||||
use codex_core_api::RealtimeConfig;
|
||||
use codex_core_api::SessionSource;
|
||||
use codex_core_api::ShellEnvironmentPolicy;
|
||||
use codex_core_api::TerminalResizeReflowConfig;
|
||||
use codex_core_api::ThreadManager;
|
||||
use codex_core_api::ThreadStoreConfig;
|
||||
use codex_core_api::ToolSuggestConfig;
|
||||
use codex_core_api::TuiKeymap;
|
||||
use codex_core_api::TuiNotificationSettings;
|
||||
use codex_core_api::UriBasedFileOpener;
|
||||
use codex_core_api::UserInput;
|
||||
use codex_core_api::WebSearchMode;
|
||||
use codex_core_api::arg0_dispatch_or_else;
|
||||
use codex_core_api::built_in_model_providers;
|
||||
use codex_core_api::find_codex_home;
|
||||
use codex_core_api::set_default_originator;
|
||||
use codex_core_api::thread_store_from_config;
|
||||
|
||||
#[derive(Debug, Parser)]
|
||||
#[command(
|
||||
@@ -110,7 +109,7 @@ async fn run_main(arg0_paths: Arg0DispatchPaths) -> anyhow::Result<()> {
|
||||
config.codex_self_exe.clone(),
|
||||
config.codex_linux_sandbox_exe.clone(),
|
||||
)?;
|
||||
let thread_store = Arc::new(LocalThreadStore::new(RolloutConfig::from_view(&config)));
|
||||
let thread_store = thread_store_from_config(&config);
|
||||
let environment_manager =
|
||||
Arc::new(EnvironmentManager::new(EnvironmentManagerArgs::new(local_runtime_paths)).await);
|
||||
let thread_manager = ThreadManager::new(
|
||||
|
||||
Reference in New Issue
Block a user