@@ -1004,6 +1004,26 @@ impl From<RootsListChangedNotification> for NotificationFromClient {
1004
1004
Self :: ClientNotification ( value. into ( ) )
1005
1005
}
1006
1006
}
1007
+ impl From < CancelledNotification > for ClientJsonrpcNotification {
1008
+ fn from ( value : CancelledNotification ) -> Self {
1009
+ Self :: new ( value. into ( ) )
1010
+ }
1011
+ }
1012
+ impl From < InitializedNotification > for ClientJsonrpcNotification {
1013
+ fn from ( value : InitializedNotification ) -> Self {
1014
+ Self :: new ( value. into ( ) )
1015
+ }
1016
+ }
1017
+ impl From < ProgressNotification > for ClientJsonrpcNotification {
1018
+ fn from ( value : ProgressNotification ) -> Self {
1019
+ Self :: new ( value. into ( ) )
1020
+ }
1021
+ }
1022
+ impl From < RootsListChangedNotification > for ClientJsonrpcNotification {
1023
+ fn from ( value : RootsListChangedNotification ) -> Self {
1024
+ Self :: new ( value. into ( ) )
1025
+ }
1026
+ }
1007
1027
impl From < Result > for ResultFromClient {
1008
1028
fn from ( value : Result ) -> Self {
1009
1029
Self :: ClientResult ( value. into ( ) )
@@ -1093,6 +1113,41 @@ impl From<LoggingMessageNotification> for NotificationFromServer {
1093
1113
Self :: ServerNotification ( value. into ( ) )
1094
1114
}
1095
1115
}
1116
+ impl From < CancelledNotification > for ServerJsonrpcNotification {
1117
+ fn from ( value : CancelledNotification ) -> Self {
1118
+ Self :: new ( value. into ( ) )
1119
+ }
1120
+ }
1121
+ impl From < ProgressNotification > for ServerJsonrpcNotification {
1122
+ fn from ( value : ProgressNotification ) -> Self {
1123
+ Self :: new ( value. into ( ) )
1124
+ }
1125
+ }
1126
+ impl From < ResourceListChangedNotification > for ServerJsonrpcNotification {
1127
+ fn from ( value : ResourceListChangedNotification ) -> Self {
1128
+ Self :: new ( value. into ( ) )
1129
+ }
1130
+ }
1131
+ impl From < ResourceUpdatedNotification > for ServerJsonrpcNotification {
1132
+ fn from ( value : ResourceUpdatedNotification ) -> Self {
1133
+ Self :: new ( value. into ( ) )
1134
+ }
1135
+ }
1136
+ impl From < PromptListChangedNotification > for ServerJsonrpcNotification {
1137
+ fn from ( value : PromptListChangedNotification ) -> Self {
1138
+ Self :: new ( value. into ( ) )
1139
+ }
1140
+ }
1141
+ impl From < ToolListChangedNotification > for ServerJsonrpcNotification {
1142
+ fn from ( value : ToolListChangedNotification ) -> Self {
1143
+ Self :: new ( value. into ( ) )
1144
+ }
1145
+ }
1146
+ impl From < LoggingMessageNotification > for ServerJsonrpcNotification {
1147
+ fn from ( value : LoggingMessageNotification ) -> Self {
1148
+ Self :: new ( value. into ( ) )
1149
+ }
1150
+ }
1096
1151
impl From < PingRequest > for RequestFromServer {
1097
1152
fn from ( value : PingRequest ) -> Self {
1098
1153
Self :: ServerRequest ( value. into ( ) )
@@ -1223,9 +1278,5 @@ mod tests {
1223
1278
) ;
1224
1279
let result = detect_message_type ( & json ! ( message) ) ;
1225
1280
assert ! ( matches!( result, MessageTypes :: Error ) ) ;
1226
-
1227
- // default
1228
- let result = detect_message_type ( & json ! ( { } ) ) ;
1229
- assert ! ( matches!( result, MessageTypes :: Request ) ) ;
1230
1281
}
1231
1282
}
0 commit comments