Merge pull request #98 from modelcontextprotocol/jerome/fix/propagate-notification-params

fix: propagate notification params
This commit is contained in:
Jerome 2024-12-16 17:56:31 +00:00 • committed by GitHub
commit 422a5359ee
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 3 additions and 3 deletions

View file

@ -1,6 +1,6 @@
{
"name": "@modelcontextprotocol/sdk",
"version": "1.0.3",
"version": "1.0.4",
"description": "Model Context Protocol implementation for TypeScript",
"license": "MIT",
"author": "Anthropic, PBC (https://anthropic.com)",

View file

@ -278,7 +278,7 @@ export abstract class Protocol<
}
private _onprogress(notification: ProgressNotification): void {
const { progress, total, progressToken } = notification.params;
const { progressToken, ...params } = notification.params;
const handler = this._progressHandlers.get(Number(progressToken));
if (handler === undefined) {
this._onerror(
@ -289,7 +289,7 @@ export abstract class Protocol<
return;
}
handler({ progress, total });
handler(params);
}
private _onresponse(response: JSONRPCResponse | JSONRPCError): void {