@@ -152,18 +152,23 @@ impl std::fmt::Display for ProtocolVersion {
152152}
153153
154154impl ProtocolVersion {
155+ pub const V_2026_07_28 : Self = Self ( Cow :: Borrowed ( "2026-07-28" ) ) ;
155156 pub const V_2025_11_25 : Self = Self ( Cow :: Borrowed ( "2025-11-25" ) ) ;
156157 pub const V_2025_06_18 : Self = Self ( Cow :: Borrowed ( "2025-06-18" ) ) ;
157158 pub const V_2025_03_26 : Self = Self ( Cow :: Borrowed ( "2025-03-26" ) ) ;
158159 pub const V_2024_11_05 : Self = Self ( Cow :: Borrowed ( "2024-11-05" ) ) ;
159160 pub const LATEST : Self = Self :: V_2025_11_25 ;
160161
162+ /// First protocol version that requires SEP-2243 standard HTTP headers.
163+ pub const STANDARD_HEADERS : Self = Self :: V_2026_07_28 ;
164+
161165 /// All protocol versions known to this SDK.
162166 pub const KNOWN_VERSIONS : & [ Self ] = & [
163167 Self :: V_2024_11_05 ,
164168 Self :: V_2025_03_26 ,
165169 Self :: V_2025_06_18 ,
166170 Self :: V_2025_11_25 ,
171+ Self :: V_2026_07_28 ,
167172 ] ;
168173
169174 /// Returns the string representation of this protocol version.
@@ -193,6 +198,7 @@ impl<'de> Deserialize<'de> for ProtocolVersion {
193198 "2025-03-26" => return Ok ( ProtocolVersion :: V_2025_03_26 ) ,
194199 "2025-06-18" => return Ok ( ProtocolVersion :: V_2025_06_18 ) ,
195200 "2025-11-25" => return Ok ( ProtocolVersion :: V_2025_11_25 ) ,
201+ "2026-07-28" => return Ok ( ProtocolVersion :: V_2026_07_28 ) ,
196202 _ => { }
197203 }
198204 Ok ( ProtocolVersion ( Cow :: Owned ( s) ) )
@@ -500,6 +506,7 @@ pub struct JsonRpcNotification<N = Notification> {
500506pub struct ErrorCode ( pub i32 ) ;
501507
502508impl ErrorCode {
509+ pub const HEADER_MISMATCH : Self = Self ( -32001 ) ;
503510 pub const RESOURCE_NOT_FOUND : Self = Self ( -32002 ) ;
504511 pub const INVALID_REQUEST : Self = Self ( -32600 ) ;
505512 pub const METHOD_NOT_FOUND : Self = Self ( -32601 ) ;
@@ -544,6 +551,9 @@ impl ErrorData {
544551 pub fn resource_not_found ( message : impl Into < Cow < ' static , str > > , data : Option < Value > ) -> Self {
545552 Self :: new ( ErrorCode :: RESOURCE_NOT_FOUND , message, data)
546553 }
554+ pub fn header_mismatch ( message : impl Into < Cow < ' static , str > > , data : Option < Value > ) -> Self {
555+ Self :: new ( ErrorCode :: HEADER_MISMATCH , message, data)
556+ }
547557 pub fn parse_error ( message : impl Into < Cow < ' static , str > > , data : Option < Value > ) -> Self {
548558 Self :: new ( ErrorCode :: PARSE_ERROR , message, data)
549559 }
0 commit comments