@@ -29,7 +29,11 @@ import {
29
29
GetTaskPushNotificationConfigSuccessResponse ,
30
30
TaskResubscriptionRequest ,
31
31
A2AError ,
32
- SendMessageSuccessResponse
32
+ SendMessageSuccessResponse ,
33
+ ListTaskPushNotificationConfigParams ,
34
+ ListTaskPushNotificationConfigResponse ,
35
+ DeleteTaskPushNotificationConfigResponse ,
36
+ DeleteTaskPushNotificationConfigParams
33
37
} from '../types.js' ; // Assuming schema.ts is in the same directory or appropriately pathed
34
38
import { AGENT_CARD_PATH } from "../constants.js" ;
35
39
@@ -300,6 +304,30 @@ export class A2AClient {
300
304
) ;
301
305
}
302
306
307
+ /**
308
+ * Lists the push notification configurations for a given task.
309
+ * @param params Parameters containing the taskId.
310
+ * @returns A Promise resolving to ListTaskPushNotificationConfigResponse.
311
+ */
312
+ public async listTaskPushNotificationConfig ( params : ListTaskPushNotificationConfigParams ) : Promise < ListTaskPushNotificationConfigResponse > {
313
+ return this . _postRpcRequest < ListTaskPushNotificationConfigParams , ListTaskPushNotificationConfigResponse > (
314
+ "tasks/pushNotificationConfig/list" ,
315
+ params
316
+ ) ;
317
+ }
318
+
319
+ /**
320
+ * Deletes the push notification configuration for a given task.
321
+ * @param params Parameters containing the taskId and push notification configuration ID.
322
+ * @returns A Promise resolving to DeleteTaskPushNotificationConfigResponse.
323
+ */
324
+ public async deleteTaskPushNotificationConfig ( params : DeleteTaskPushNotificationConfigParams ) : Promise < DeleteTaskPushNotificationConfigResponse > {
325
+ return this . _postRpcRequest < DeleteTaskPushNotificationConfigParams , DeleteTaskPushNotificationConfigResponse > (
326
+ "tasks/pushNotificationConfig/delete" ,
327
+ params
328
+ ) ;
329
+ }
330
+
303
331
304
332
/**
305
333
* Retrieves a task by its ID.
@@ -319,6 +347,19 @@ export class A2AClient {
319
347
return this . _postRpcRequest < TaskIdParams , CancelTaskResponse > ( "tasks/cancel" , params ) ;
320
348
}
321
349
350
+ /**
351
+ * @template TExtensionParams The type of parameters for the custom extension method.
352
+ * @template TExtensionResponse The type of response expected from the custom extension method.
353
+ * This should extend JSONRPCResponse. This ensures the extension response is still a valid A2A response.
354
+ * @param method Custom JSON-RPC method defined in the AgentCard's extensions.
355
+ * @param params Extension paramters defined in the AgentCard's extensions.
356
+ * @returns A Promise that resolves to the RPC response.
357
+ */
358
+ public async callExtensionMethod < TExtensionParams , TExtensionResponse extends JSONRPCResponse > ( method : string , params : TExtensionParams ) {
359
+ return this . _postRpcRequest < TExtensionParams , TExtensionResponse > ( method , params ) ;
360
+ }
361
+
362
+
322
363
/**
323
364
* Resubscribes to a task's event stream using Server-Sent Events (SSE).
324
365
* This is used if a previous SSE connection for an active task was broken.
0 commit comments