[codex-app-server] expose generic per-surface HTTP state bridge [ci changed_files]

This commit is contained in:
Cooper Gamble
2026-06-03 09:58:07 +00:00
parent bf1b28e1c1
commit 81ccd4cbf2
25 changed files with 323 additions and 336 deletions
@@ -861,20 +861,20 @@ client_request_definitions! {
serialization: global("remote-control-clients"),
response: v2::RemoteControlClientsRevokeResponse,
},
NativeIntegrityStateRead => "nativeIntegrityState/read" {
HttpStateGet => "httpState/get" {
params: #[ts(type = "undefined")] #[serde(skip_serializing_if = "Option::is_none")] Option<()>,
serialization: global_shared_read("native-integrity-state"),
response: v2::NativeIntegrityStateReadResponse,
serialization: global_shared_read("http-state"),
response: v2::HttpStateGetResponse,
},
NativeIntegrityStateWrite => "nativeIntegrityState/write" {
params: v2::NativeIntegrityStateWriteParams,
serialization: global("native-integrity-state"),
response: v2::NativeIntegrityStateWriteResponse,
HttpStateSet => "httpState/set" {
params: v2::HttpStateSetParams,
serialization: global("http-state"),
response: v2::HttpStateSetResponse,
},
NativeIntegrityStateClear => "nativeIntegrityState/clear" {
HttpStateClear => "httpState/clear" {
params: #[ts(type = "undefined")] #[serde(skip_serializing_if = "Option::is_none")] Option<()>,
serialization: global("native-integrity-state"),
response: v2::NativeIntegrityStateClearResponse,
serialization: global("http-state"),
response: v2::HttpStateClearResponse,
},
#[experimental("collaborationMode/list")]
/// Lists collaboration mode presets.
@@ -6,14 +6,14 @@ use ts_rs::TS;
#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, JsonSchema, TS)]
#[serde(rename_all = "camelCase")]
#[ts(export_to = "v2/")]
pub struct NativeIntegrityStateReadResponse {
pub struct HttpStateGetResponse {
pub state: Option<String>,
}
#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, JsonSchema, TS)]
#[serde(rename_all = "camelCase")]
#[ts(export_to = "v2/")]
pub struct NativeIntegrityStateWriteParams {
pub struct HttpStateSetParams {
pub state: String,
/// When present, write only if the calling surface still stores this state.
#[ts(optional = nullable)]
@@ -23,11 +23,11 @@ pub struct NativeIntegrityStateWriteParams {
#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, JsonSchema, TS)]
#[serde(rename_all = "camelCase")]
#[ts(export_to = "v2/")]
pub struct NativeIntegrityStateWriteResponse {
pub struct HttpStateSetResponse {
pub written: bool,
}
#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, JsonSchema, TS)]
#[serde(rename_all = "camelCase")]
#[ts(export_to = "v2/")]
pub struct NativeIntegrityStateClearResponse {}
pub struct HttpStateClearResponse {}
@@ -11,10 +11,10 @@ mod experimental_feature;
mod feedback;
mod fs;
mod hook;
mod http_state;
mod item;
mod mcp;
mod model;
mod native_integrity_state;
mod notification;
mod permissions;
mod plugin;
@@ -38,10 +38,10 @@ pub use experimental_feature::*;
pub use feedback::*;
pub use fs::*;
pub use hook::*;
pub use http_state::*;
pub use item::*;
pub use mcp::*;
pub use model::*;
pub use native_integrity_state::*;
pub use notification::*;
pub use permissions::*;
pub use plugin::*;