mirror of
https://github.com/openai/codex.git
synced 2026-11-13 14:46:14 +00:00
Precompute app-server protocol exports (#36212)
## Why Normal app-server protocol builds do not need the `ts-rs` and `schemars` implementations used to generate schema exports. ## What changed - Embed compressed stable and experimental TypeScript and JSON schema exports, and serve the existing export APIs from those artifacts. - Use no-op schema derives in non-test builds while keeping the real generators available for fixture regeneration and tests. - Move schema fixture regeneration behind a Python helper and update `just write-app-server-schema --experimental` to refresh the experimental embedded exports. ## Testing - Verify embedded exports match freshly generated stable and experimental schemas. - Verify export options and on-disk output remain compatible. GitOrigin-RevId: e8536338b457e6eec34bdf29ec0684144bd13734
This commit is contained in:
1 parent
0042b00986
commit
acd540f158
50 files changed
+720
-181
No files matched your search
@@ -1,3 +1,5 @@
|
||||
use crate::JsonSchema;
|
||||
use crate::TS;
|
||||
use codex_experimental_api_macros::ExperimentalApi;
|
||||
use codex_protocol::config_types::ApprovalsReviewer as CoreApprovalsReviewer;
|
||||
use codex_protocol::config_types::SandboxMode as CoreSandboxMode;
|
||||
@@ -5,16 +7,20 @@ use codex_protocol::protocol::AskForApproval as CoreAskForApproval;
|
||||
use codex_protocol::protocol::CodexErrorInfo as CoreCodexErrorInfo;
|
||||
use codex_protocol::protocol::GranularApprovalConfig as CoreGranularApprovalConfig;
|
||||
use codex_protocol::protocol::NonSteerableTurnKind as CoreNonSteerableTurnKind;
|
||||
use schemars::JsonSchema;
|
||||
#[cfg(test)]
|
||||
use schemars::r#gen::SchemaGenerator;
|
||||
#[cfg(test)]
|
||||
use schemars::schema::InstanceType;
|
||||
#[cfg(test)]
|
||||
use schemars::schema::Metadata;
|
||||
#[cfg(test)]
|
||||
use schemars::schema::Schema;
|
||||
#[cfg(test)]
|
||||
use schemars::schema::SchemaObject;
|
||||
use serde::Deserialize;
|
||||
use serde::Serialize;
|
||||
#[cfg(test)]
|
||||
use serde_json::Value as JsonValue;
|
||||
use ts_rs::TS;
|
||||
|
||||
// Macro to declare a camelCased API v2 enum mirroring a core enum which
|
||||
// tends to use either snake_case or kebab-case.
|
||||
@@ -236,6 +242,7 @@ pub enum ApprovalsReviewer {
|
||||
AutoReview,
|
||||
}
|
||||
|
||||
#[cfg(test)]
|
||||
impl JsonSchema for ApprovalsReviewer {
|
||||
fn schema_name() -> String {
|
||||
"ApprovalsReviewer".to_string()
|
||||
@@ -249,6 +256,7 @@ impl JsonSchema for ApprovalsReviewer {
|
||||
}
|
||||
}
|
||||
|
||||
#[cfg(test)]
|
||||
fn string_enum_schema_with_description(values: &[&str], description: &str) -> Schema {
|
||||
let mut schema = SchemaObject {
|
||||
instance_type: Some(InstanceType::String.into()),
|
||||
|
||||
Reference in new issue
Block a user