Skip to content

Commit 44c751a

Browse files
Fix TaskStatusNotificationParams to spread task fields per spec
1 parent 7c07f38 commit 44c751a

File tree

2 files changed

+4
-9
lines changed

2 files changed

+4
-9
lines changed

src/shared/protocol.ts

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1497,9 +1497,7 @@ export abstract class Protocol<SendRequestT extends Request, SendNotificationT e
14971497
if (task) {
14981498
const notification: TaskStatusNotification = TaskStatusNotificationSchema.parse({
14991499
method: 'notifications/tasks/status',
1500-
params: {
1501-
task
1502-
}
1500+
params: task
15031501
});
15041502
await this.notification(notification as SendNotificationT);
15051503

@@ -1537,9 +1535,7 @@ export abstract class Protocol<SendRequestT extends Request, SendNotificationT e
15371535
if (updatedTask) {
15381536
const notification: TaskStatusNotification = TaskStatusNotificationSchema.parse({
15391537
method: 'notifications/tasks/status',
1540-
params: {
1541-
task: updatedTask
1542-
}
1538+
params: updatedTask
15431539
});
15441540
await this.notification(notification as SendNotificationT);
15451541

src/types.ts

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -672,10 +672,9 @@ export const CreateTaskResultSchema = ResultSchema.extend({
672672

673673
/**
674674
* Parameters for task status notification.
675+
* Task fields are spread directly into params per the spec (NotificationParams & Task).
675676
*/
676-
export const TaskStatusNotificationParamsSchema = z.object({
677-
task: TaskSchema
678-
});
677+
export const TaskStatusNotificationParamsSchema = NotificationsParamsSchema.merge(TaskSchema);
679678

680679
/**
681680
* A notification sent when a task's status changes.

0 commit comments

Comments
 (0)