@@ -131,7 +131,7 @@ export class Server<
131
131
* The new capabilities will be merged with any existing capabilities previously given (e.g., at initialization).
132
132
*/
133
133
public registerCapabilities ( capabilities : ServerCapabilities ) : void {
134
- if ( this . transport ) {
134
+ if ( this . transportMap . size > 0 ) {
135
135
throw new Error ( 'Cannot register capabilities after connecting to transport' ) ;
136
136
}
137
137
this . _capabilities = mergeCapabilities ( this . _capabilities , capabilities ) ;
@@ -277,8 +277,8 @@ export class Server<
277
277
return this . _capabilities ;
278
278
}
279
279
280
- async ping ( ) {
281
- return this . request ( { method : 'ping' } , EmptyResultSchema ) ;
280
+ async ping ( sessionId ?: string ) {
281
+ return this . request ( { method : 'ping' } , EmptyResultSchema , { sessionId } ) ;
282
282
}
283
283
284
284
async createMessage ( params : CreateMessageRequest [ 'params' ] , options ?: RequestOptions ) {
@@ -327,7 +327,7 @@ export class Server<
327
327
async sendLoggingMessage ( params : LoggingMessageNotification [ 'params' ] , sessionId ?: string ) {
328
328
if ( this . _capabilities . logging ) {
329
329
if ( ! this . isMessageIgnored ( params . level , sessionId ) ) {
330
- return this . notification ( { method : 'notifications/message' , params } ) ;
330
+ return this . notification ( { method : 'notifications/message' , params } , { sessionId } ) ;
331
331
}
332
332
}
333
333
}
0 commit comments