From a763aff107776d8c204d2595d2560918fe8c9393 Mon Sep 17 00:00:00 2001 From: canvrno-oai Date: Mon, 23 Feb 2026 11:55:31 -0800 Subject: [PATCH] TS optionality for MCP elicitation event fields --- .../schema/json/EventMsg.json | 26 +++++++++---------- .../codex_app_server_protocol.schemas.json | 14 +++++----- .../typescript/ElicitationRequestEvent.ts | 2 +- codex-rs/protocol/src/approvals.rs | 3 +++ 4 files changed, 24 insertions(+), 21 deletions(-) diff --git a/codex-rs/app-server-protocol/schema/json/EventMsg.json b/codex-rs/app-server-protocol/schema/json/EventMsg.json index d8946bf976..de93058be6 100644 --- a/codex-rs/app-server-protocol/schema/json/EventMsg.json +++ b/codex-rs/app-server-protocol/schema/json/EventMsg.json @@ -1757,6 +1757,12 @@ }, { "properties": { + "elicitation_id": { + "type": [ + "string", + "null" + ] + }, "id": { "$ref": "#/definitions/RequestId" }, @@ -1779,12 +1785,6 @@ "string", "null" ] - }, - "elicitation_id": { - "type": [ - "string", - "null" - ] } }, "required": [ @@ -7015,6 +7015,12 @@ }, { "properties": { + "elicitation_id": { + "type": [ + "string", + "null" + ] + }, "id": { "$ref": "#/definitions/RequestId" }, @@ -7037,12 +7043,6 @@ "string", "null" ] - }, - "elicitation_id": { - "type": [ - "string", - "null" - ] } }, "required": [ @@ -8445,4 +8445,4 @@ } ], "title": "EventMsg" -} +} \ No newline at end of file diff --git a/codex-rs/app-server-protocol/schema/json/codex_app_server_protocol.schemas.json b/codex-rs/app-server-protocol/schema/json/codex_app_server_protocol.schemas.json index 665c14e42f..81b33ebe39 100644 --- a/codex-rs/app-server-protocol/schema/json/codex_app_server_protocol.schemas.json +++ b/codex-rs/app-server-protocol/schema/json/codex_app_server_protocol.schemas.json @@ -2818,6 +2818,12 @@ }, { "properties": { + "elicitation_id": { + "type": [ + "string", + "null" + ] + }, "id": { "$ref": "#/definitions/RequestId" }, @@ -2840,12 +2846,6 @@ "string", "null" ] - }, - "elicitation_id": { - "type": [ - "string", - "null" - ] } }, "required": [ @@ -13945,4 +13945,4 @@ }, "title": "CodexAppServerProtocol", "type": "object" -} +} \ No newline at end of file diff --git a/codex-rs/app-server-protocol/schema/typescript/ElicitationRequestEvent.ts b/codex-rs/app-server-protocol/schema/typescript/ElicitationRequestEvent.ts index 5c7eaf7d75..b666ba9fb9 100644 --- a/codex-rs/app-server-protocol/schema/typescript/ElicitationRequestEvent.ts +++ b/codex-rs/app-server-protocol/schema/typescript/ElicitationRequestEvent.ts @@ -3,4 +3,4 @@ // This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. import type { JsonValue } from "./serde_json/JsonValue"; -export type ElicitationRequestEvent = { server_name: string, id: string | number, message: string, requested_schema: JsonValue | null, url: string | null, elicitation_id: string | null, }; +export type ElicitationRequestEvent = { server_name: string, id: string | number, message: string, requested_schema?: JsonValue, url?: string, elicitation_id?: string, }; diff --git a/codex-rs/protocol/src/approvals.rs b/codex-rs/protocol/src/approvals.rs index 4f90f3c1a4..c6c3659232 100644 --- a/codex-rs/protocol/src/approvals.rs +++ b/codex-rs/protocol/src/approvals.rs @@ -104,10 +104,13 @@ pub struct ElicitationRequestEvent { pub id: RequestId, pub message: String, #[serde(skip_serializing_if = "Option::is_none")] + #[ts(optional)] pub requested_schema: Option, #[serde(skip_serializing_if = "Option::is_none")] + #[ts(optional)] pub url: Option, #[serde(skip_serializing_if = "Option::is_none")] + #[ts(optional)] pub elicitation_id: Option, }