From da231e54abcad58d6b5a50d1e4adf612a417c659 Mon Sep 17 00:00:00 2001 From: Michael Bolin Date: Tue, 30 Sep 2025 12:55:45 -0700 Subject: [PATCH] fix: clean up TypeScript exports --- codex-rs/protocol-ts/src/lib.rs | 30 ++++++++++++++---------------- 1 file changed, 14 insertions(+), 16 deletions(-) diff --git a/codex-rs/protocol-ts/src/lib.rs b/codex-rs/protocol-ts/src/lib.rs index 848aeb25c7..eebcbcc194 100644 --- a/codex-rs/protocol-ts/src/lib.rs +++ b/codex-rs/protocol-ts/src/lib.rs @@ -15,43 +15,41 @@ const HEADER: &str = "// GENERATED CODE! DO NOT MODIFY BY HAND!\n\n"; pub fn generate_ts(out_dir: &Path, prettier: Option<&Path>) -> Result<()> { ensure_dir(out_dir)?; - // Generate TS bindings - mcp_types::InitializeResult::export_all_to(out_dir)?; - codex_protocol::mcp_protocol::ConversationId::export_all_to(out_dir)?; - codex_protocol::mcp_protocol::InputItem::export_all_to(out_dir)?; + // Generating the TS bindings for these top-level enums ensures all types + // reachable from them will be generated by induction, so they do not need + // to be listed individually. codex_protocol::mcp_protocol::ClientRequest::export_all_to(out_dir)?; codex_protocol::mcp_protocol::ServerRequest::export_all_to(out_dir)?; + codex_protocol::mcp_protocol::ServerNotification::export_all_to(out_dir)?; + codex_protocol::mcp_protocol::ClientNotification::export_all_to(out_dir)?; + + // Response types for ClientRequest (mirror enum order). codex_protocol::mcp_protocol::InitializeResponse::export_all_to(out_dir)?; codex_protocol::mcp_protocol::NewConversationResponse::export_all_to(out_dir)?; codex_protocol::mcp_protocol::ListConversationsResponse::export_all_to(out_dir)?; codex_protocol::mcp_protocol::ResumeConversationResponse::export_all_to(out_dir)?; codex_protocol::mcp_protocol::ArchiveConversationResponse::export_all_to(out_dir)?; - codex_protocol::mcp_protocol::AddConversationSubscriptionResponse::export_all_to(out_dir)?; - codex_protocol::mcp_protocol::RemoveConversationSubscriptionResponse::export_all_to(out_dir)?; codex_protocol::mcp_protocol::SendUserMessageResponse::export_all_to(out_dir)?; codex_protocol::mcp_protocol::SendUserTurnResponse::export_all_to(out_dir)?; codex_protocol::mcp_protocol::InterruptConversationResponse::export_all_to(out_dir)?; + codex_protocol::mcp_protocol::AddConversationSubscriptionResponse::export_all_to(out_dir)?; + codex_protocol::mcp_protocol::RemoveConversationSubscriptionResponse::export_all_to(out_dir)?; codex_protocol::mcp_protocol::GitDiffToRemoteResponse::export_all_to(out_dir)?; - codex_protocol::mcp_protocol::LoginApiKeyParams::export_all_to(out_dir)?; codex_protocol::mcp_protocol::LoginApiKeyResponse::export_all_to(out_dir)?; codex_protocol::mcp_protocol::LoginChatGptResponse::export_all_to(out_dir)?; codex_protocol::mcp_protocol::CancelLoginChatGptResponse::export_all_to(out_dir)?; codex_protocol::mcp_protocol::LogoutChatGptResponse::export_all_to(out_dir)?; codex_protocol::mcp_protocol::GetAuthStatusResponse::export_all_to(out_dir)?; - codex_protocol::mcp_protocol::ApplyPatchApprovalResponse::export_all_to(out_dir)?; - codex_protocol::mcp_protocol::ExecCommandApprovalResponse::export_all_to(out_dir)?; - codex_protocol::mcp_protocol::FuzzyFileSearchParams::export_all_to(out_dir)?; - codex_protocol::mcp_protocol::FuzzyFileSearchResult::export_all_to(out_dir)?; - codex_protocol::mcp_protocol::FuzzyFileSearchResponse::export_all_to(out_dir)?; codex_protocol::mcp_protocol::GetUserSavedConfigResponse::export_all_to(out_dir)?; codex_protocol::mcp_protocol::SetDefaultModelResponse::export_all_to(out_dir)?; codex_protocol::mcp_protocol::GetUserAgentResponse::export_all_to(out_dir)?; codex_protocol::mcp_protocol::UserInfoResponse::export_all_to(out_dir)?; + codex_protocol::mcp_protocol::FuzzyFileSearchResponse::export_all_to(out_dir)?; + codex_protocol::mcp_protocol::ExecArbitraryCommandResponse::export_all_to(out_dir)?; - // All notification types reachable from this enum will be generated by - // induction, so they do not need to be listed individually. - codex_protocol::mcp_protocol::ServerNotification::export_all_to(out_dir)?; - codex_protocol::mcp_protocol::ClientNotification::export_all_to(out_dir)?; + // Response types for ServerRequest (mirror enum order). + codex_protocol::mcp_protocol::ApplyPatchApprovalResponse::export_all_to(out_dir)?; + codex_protocol::mcp_protocol::ExecCommandApprovalResponse::export_all_to(out_dir)?; generate_index_ts(out_dir)?;