File tree Expand file tree Collapse file tree 2 files changed +9
-18
lines changed Expand file tree Collapse file tree 2 files changed +9
-18
lines changed Original file line number Diff line number Diff line change 8
8
ClientRequest ,
9
9
CreateMessageRequestSchema ,
10
10
ListRootsRequestSchema ,
11
- ProgressNotificationSchema ,
12
- ResourceUpdatedNotificationSchema ,
13
- LoggingMessageNotificationSchema ,
14
11
Request ,
15
12
Result ,
16
13
ServerCapabilities ,
@@ -250,20 +247,12 @@ export function useConnection({
250
247
} ) ;
251
248
252
249
if ( onNotification ) {
253
- client . setNotificationHandler (
254
- ProgressNotificationSchema ,
255
- onNotification ,
256
- ) ;
257
-
258
- client . setNotificationHandler (
259
- ResourceUpdatedNotificationSchema ,
260
- onNotification ,
261
- ) ;
262
-
263
- client . setNotificationHandler (
264
- LoggingMessageNotificationSchema ,
265
- onNotification ,
266
- ) ;
250
+ client . fallbackNotificationHandler = (
251
+ notification : Notification ,
252
+ ) : Promise < void > => {
253
+ onNotification ( notification ) ;
254
+ return Promise . resolve ( ) ;
255
+ } ;
267
256
}
268
257
269
258
if ( onStdErrNotification ) {
Original file line number Diff line number Diff line change @@ -14,7 +14,9 @@ export const StdErrNotificationSchema = BaseNotificationSchema.extend({
14
14
15
15
export const NotificationSchema = ClientNotificationSchema . or (
16
16
StdErrNotificationSchema ,
17
- ) . or ( ServerNotificationSchema ) ;
17
+ )
18
+ . or ( ServerNotificationSchema )
19
+ . or ( BaseNotificationSchema ) ;
18
20
19
21
export type StdErrNotification = z . infer < typeof StdErrNotificationSchema > ;
20
22
export type Notification = z . infer < typeof NotificationSchema > ;
You can’t perform that action at this time.
0 commit comments