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

This commit is contained in:
Cooper Gamble
2026-06-03 11:37:25 +00:00
parent 73b27cf05e
commit 44afe34b77
25 changed files with 752 additions and 1 deletions
@@ -861,6 +861,21 @@ client_request_definitions! {
serialization: global("remote-control-clients"),
response: v2::RemoteControlClientsRevokeResponse,
},
HttpStateGet => "httpState/get" {
params: #[ts(type = "undefined")] #[serde(skip_serializing_if = "Option::is_none")] Option<()>,
serialization: global_shared_read("http-state"),
response: v2::HttpStateGetResponse,
},
HttpStateSet => "httpState/set" {
params: v2::HttpStateSetParams,
serialization: global("http-state"),
response: v2::HttpStateSetResponse,
},
HttpStateClear => "httpState/clear" {
params: #[ts(type = "undefined")] #[serde(skip_serializing_if = "Option::is_none")] Option<()>,
serialization: global("http-state"),
response: v2::HttpStateClearResponse,
},
#[experimental("collaborationMode/list")]
/// Lists collaboration mode presets.
CollaborationModeList => "collaborationMode/list" {
@@ -0,0 +1,34 @@
use schemars::JsonSchema;
use serde::Deserialize;
use serde::Serialize;
use ts_rs::TS;
#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, JsonSchema, TS)]
#[serde(rename_all = "camelCase")]
#[ts(export_to = "v2/")]
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 HttpStateSetParams {
pub state: String,
/// Write only if the calling surface still stores this state. Omit or set
/// to null for an unconditional replacement.
#[ts(optional = nullable)]
pub expected_state: Option<String>,
}
#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, JsonSchema, TS)]
#[serde(rename_all = "camelCase")]
#[ts(export_to = "v2/")]
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 HttpStateClearResponse {}
@@ -11,6 +11,7 @@ mod experimental_feature;
mod feedback;
mod fs;
mod hook;
mod http_state;
mod item;
mod mcp;
mod model;
@@ -37,6 +38,7 @@ 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::*;