Move config schema helper out of codex-core package

Keep package-level codex-core checks focused on the library by moving the schema writer binary into its own workspace package and updating the just recipe to call that package directly.

Co-authored-by: Codex <noreply@openai.com>
This commit is contained in:
starr-openai
2026-03-19 20:13:35 -07:00
parent c91e0b1ac8
commit 14f7bc3f3b
6 changed files with 31 additions and 11 deletions

10
codex-rs/Cargo.lock generated
View File

@@ -1833,7 +1833,6 @@ dependencies = [
"bm25",
"chardetng",
"chrono",
"clap",
"codex-api",
"codex-app-server-protocol",
"codex-apply-patch",
@@ -2913,6 +2912,15 @@ dependencies = [
"winres",
]
[[package]]
name = "codex-write-config-schema"
version = "0.0.0"
dependencies = [
"anyhow",
"clap",
"codex-core",
]
[[package]]
name = "color-eyre"
version = "0.6.5"

View File

@@ -65,6 +65,7 @@ members = [
"utils/oss",
"utils/fuzzy-match",
"utils/stream-parser",
"write-config-schema",
"codex-client",
"codex-api",
"state",

View File

@@ -9,10 +9,6 @@ doctest = false
name = "codex_core"
path = "src/lib.rs"
[[bin]]
name = "codex-write-config-schema"
path = "src/bin/config_schema.rs"
[lints]
workspace = true
@@ -26,7 +22,6 @@ base64 = { workspace = true }
bm25 = { workspace = true }
chardetng = { workspace = true }
chrono = { workspace = true, features = ["serde"] }
clap = { workspace = true, features = ["derive"] }
codex-api = { workspace = true }
codex-app-server-protocol = { workspace = true }
codex-apply-patch = { workspace = true }

View File

@@ -0,0 +1,13 @@
[package]
edition.workspace = true
license.workspace = true
name = "codex-write-config-schema"
version.workspace = true
[lints]
workspace = true
[dependencies]
anyhow = { workspace = true }
clap = { workspace = true, features = ["derive"] }
codex-core = { workspace = true }

View File

@@ -1,6 +1,7 @@
use std::path::PathBuf;
use anyhow::Result;
use clap::Parser;
use std::path::PathBuf;
/// Generate the JSON Schema for `config.toml` and write it to `config.schema.json`.
#[derive(Parser)]
@@ -12,9 +13,11 @@ struct Args {
fn main() -> Result<()> {
let args = Args::parse();
let out_path = args
.out
.unwrap_or_else(|| PathBuf::from(env!("CARGO_MANIFEST_DIR")).join("config.schema.json"));
let out_path = args.out.unwrap_or_else(|| {
PathBuf::from(env!("CARGO_MANIFEST_DIR"))
.join("../core")
.join("config.schema.json")
});
codex_core::config::schema::write_config_schema(&out_path)?;
Ok(())
}

View File

@@ -76,7 +76,7 @@ mcp-server-run *args:
# Regenerate the json schema for config.toml from the current config types.
write-config-schema:
cargo run -p codex-core --bin codex-write-config-schema
cargo run -p codex-write-config-schema
# Regenerate vendored app-server protocol schema artifacts.
write-app-server-schema *args: