@a2a-js/sdk 0.3.5 → 0.3.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,18 +1,23 @@
1
- import { ac as AgentCard, w as MessageSendParams, S as SendMessageResponse, B as Message, aw as Task, aO as TaskStatusUpdateEvent, aQ as TaskArtifactUpdateEvent, Z as TaskPushNotificationConfig, b as SetTaskPushNotificationConfigResponse, X as TaskIdParams, c as GetTaskPushNotificationConfigResponse, a5 as ListTaskPushNotificationConfigParams, j as ListTaskPushNotificationConfigResponse, a7 as DeleteTaskPushNotificationConfigParams, g as DeleteTaskPushNotificationConfigResponse, V as TaskQueryParams, G as GetTaskResponse, C as CancelTaskResponse, i as JSONRPCResponse, J as JSONRPCErrorResponse } from '../types-DNKcmF0f.js';
1
+ import { ae as AgentCard, x as MessageSendParams, S as SendMessageResponse, F as Message, ay as Task, aQ as TaskStatusUpdateEvent, aS as TaskArtifactUpdateEvent, $ as TaskPushNotificationConfig, b as SetTaskPushNotificationConfigResponse, Z as TaskIdParams, c as GetTaskPushNotificationConfigResponse, a7 as ListTaskPushNotificationConfigParams, k as ListTaskPushNotificationConfigResponse, a9 as DeleteTaskPushNotificationConfigParams, h as DeleteTaskPushNotificationConfigResponse, X as TaskQueryParams, G as GetTaskResponse, C as CancelTaskResponse, j as JSONRPCResponse, E as Extensions, a3 as GetTaskPushNotificationConfigParams, z as PushNotificationConfig } from '../extensions-DvruCIzw.js';
2
2
 
3
3
  type A2AStreamEventData = Message | Task | TaskStatusUpdateEvent | TaskArtifactUpdateEvent;
4
+ type SendMessageResult = Message | Task;
4
5
  interface A2AClientOptions {
5
6
  agentCardPath?: string;
6
7
  fetchImpl?: typeof fetch;
7
8
  }
8
9
  /**
9
10
  * A2AClient is a TypeScript HTTP client for interacting with A2A-compliant agents.
11
+ * Only JSON-RPC transport is supported.
12
+ * @deprecated Use {@link ClientFactory}
10
13
  */
11
14
  declare class A2AClient {
12
- private agentCardPromise;
13
- private requestIdCounter;
15
+ private static emptyOptions?;
16
+ private readonly agentCardPromise;
17
+ private readonly customFetchImpl?;
14
18
  private serviceEndpointUrl?;
15
- private customFetchImpl?;
19
+ private transport?;
20
+ private requestIdCounter;
16
21
  /**
17
22
  * Constructs an A2AClient instance from an AgentCard.
18
23
  * @param agentCard The AgentCard object.
@@ -34,21 +39,6 @@ declare class A2AClient {
34
39
  * @returns A Promise that resolves to a new A2AClient instance.
35
40
  */
36
41
  static fromCardUrl(agentCardUrl: string, options?: A2AClientOptions): Promise<A2AClient>;
37
- /**
38
- * Helper method to make a generic JSON-RPC POST request.
39
- * @param method The RPC method name.
40
- * @param params The parameters for the RPC method.
41
- * @returns A Promise that resolves to the RPC response.
42
- */
43
- private _postRpcRequest;
44
- /**
45
- * Internal helper method to fetch the RPC service endpoint.
46
- * @param url The URL to fetch.
47
- * @param rpcRequest The JSON-RPC request to send.
48
- * @param acceptHeader The Accept header to use. Defaults to "application/json".
49
- * @returns A Promise that resolves to the fetch HTTP response.
50
- */
51
- private _fetchRpc;
52
42
  /**
53
43
  * Sends a message to the agent.
54
44
  * The behavior (blocking/non-blocking) and push notification configuration
@@ -122,25 +112,7 @@ declare class A2AClient {
122
112
  * @returns An AsyncGenerator yielding A2AStreamEventData (Message, Task, TaskStatusUpdateEvent, or TaskArtifactUpdateEvent).
123
113
  */
124
114
  resubscribeTask(params: TaskIdParams): AsyncGenerator<A2AStreamEventData, void, undefined>;
125
- /**
126
- * Parses an HTTP response body as an A2A Server-Sent Event stream.
127
- * Each 'data' field of an SSE event is expected to be a JSON-RPC 2.0 Response object,
128
- * specifically a SendStreamingMessageResponse (or similar structure for resubscribe).
129
- * @param response The HTTP Response object whose body is the SSE stream.
130
- * @param originalRequestId The ID of the client's JSON-RPC request that initiated this stream.
131
- * Used to validate the `id` in the streamed JSON-RPC responses.
132
- * @returns An AsyncGenerator yielding the `result` field of each valid JSON-RPC success response from the stream.
133
- */
134
- private _parseA2ASseStream;
135
- /**
136
- * Processes a single SSE event's data string, expecting it to be a JSON-RPC response.
137
- * @param jsonData The string content from one or more 'data:' lines of an SSE event.
138
- * @param originalRequestId The ID of the client's request that initiated the stream.
139
- * @returns The `result` field of the parsed JSON-RPC success response.
140
- * @throws Error if data is not valid JSON, not a valid JSON-RPC response, an error response, or ID mismatch.
141
- */
142
- private _processSseEventData;
143
- isErrorResponse(response: JSONRPCResponse): response is JSONRPCErrorResponse;
115
+ private _getOrCreateTransport;
144
116
  /**
145
117
  * Fetches the Agent Card from the agent's well-known URI and caches its service endpoint URL.
146
118
  * This method is called by the constructor.
@@ -150,14 +122,14 @@ declare class A2AClient {
150
122
  */
151
123
  private _fetchAndCacheAgentCard;
152
124
  /**
153
- * Retrieves the Agent Card.
154
- * If an `agentBaseUrl` is provided, it fetches the card from that specific URL.
155
- * Otherwise, it returns the card fetched and cached during client construction.
156
- * @param agentBaseUrl Optional. The base URL of the agent to fetch the card from.
157
- * @param agentCardPath path to the agent card, defaults to .well-known/agent-card.json
158
- * If provided, this will fetch a new card, not use the cached one from the constructor's URL.
159
- * @returns A Promise that resolves to the AgentCard.
160
- */
125
+ * Retrieves the Agent Card.
126
+ * If an `agentBaseUrl` is provided, it fetches the card from that specific URL.
127
+ * Otherwise, it returns the card fetched and cached during client construction.
128
+ * @param agentBaseUrl Optional. The base URL of the agent to fetch the card from.
129
+ * @param agentCardPath path to the agent card, defaults to .well-known/agent-card.json
130
+ * If provided, this will fetch a new card, not use the cached one from the constructor's URL.
131
+ * @returns A Promise that resolves to the AgentCard.
132
+ */
161
133
  getAgentCard(agentBaseUrl?: string, agentCardPath?: string): Promise<AgentCard>;
162
134
  /**
163
135
  * Determines the agent card URL based on the agent URL.
@@ -170,6 +142,7 @@ declare class A2AClient {
170
142
  * @returns A Promise that resolves to the service endpoint URL string.
171
143
  */
172
144
  private _getServiceEndpoint;
145
+ private invokeJsonRpc;
173
146
  }
174
147
 
175
148
  interface HttpHeaders {
@@ -216,7 +189,7 @@ interface AuthenticationHandler {
216
189
  *
217
190
  * This callback allows transient headers to be saved for subsequent requests only when they
218
191
  * are validated by the server.
219
- */
192
+ */
220
193
  onSuccessfulRetry?: (headers: HttpHeaders) => Promise<void>;
221
194
  }
222
195
  /**
@@ -234,4 +207,402 @@ interface AuthenticationHandler {
234
207
  */
235
208
  declare function createAuthenticatingFetchWithRetry(fetchImpl: typeof fetch, authHandler: AuthenticationHandler): typeof fetch;
236
209
 
237
- export { A2AClient, type A2AClientOptions, type AuthenticationHandler, type HttpHeaders, createAuthenticatingFetchWithRetry };
210
+ interface AgentCardResolverOptions {
211
+ path?: string;
212
+ fetchImpl?: typeof fetch;
213
+ }
214
+ declare class DefaultAgentCardResolver implements AgentCardResolver {
215
+ readonly options?: AgentCardResolverOptions;
216
+ constructor(options?: AgentCardResolverOptions);
217
+ /**
218
+ * Fetches the agent card based on provided base URL and path.
219
+ * Path is selected in the following order:
220
+ * 1) path parameter
221
+ * 2) path from options
222
+ * 3) .well-known/agent-card.json
223
+ */
224
+ resolve(baseUrl: string, path?: string): Promise<AgentCard>;
225
+ private fetchImpl;
226
+ }
227
+ interface AgentCardResolver {
228
+ /**
229
+ * Fetches the agent card based on provided base URL and path,
230
+ */
231
+ resolve(baseUrl: string, path?: string): Promise<AgentCard>;
232
+ }
233
+ declare const AgentCardResolver: {
234
+ default: DefaultAgentCardResolver;
235
+ };
236
+
237
+ /**
238
+ * Function that applies an update to a {@link ClientCallContext}.
239
+ */
240
+ type ContextUpdate = (context: ClientCallContext) => void;
241
+ /**
242
+ * Opaque context object to carry per-call context data.
243
+ * Use {@link ClientCallContextKey} to create typed keys for storing and retrieving values.
244
+ */
245
+ type ClientCallContext = Record<symbol, unknown>;
246
+ declare const ClientCallContext: {
247
+ /**
248
+ * Create a new {@link ClientCallContext} with optional updates applied.
249
+ */
250
+ create: (...updates: ContextUpdate[]) => ClientCallContext;
251
+ /**
252
+ * Create a new {@link ClientCallContext} based on an existing one with updates applied.
253
+ */
254
+ createFrom: (context: ClientCallContext | undefined, ...updates: ContextUpdate[]) => ClientCallContext;
255
+ };
256
+ /**
257
+ * Each instance represents a unique key for storing
258
+ * and retrieving typed values in a {@link ClientCallContext}.
259
+ *
260
+ * @example
261
+ * ```ts
262
+ * const key = new ClientCallContextKey<string>('My key');
263
+ * const context = ClientCallContext.create(key.set('example-value'));
264
+ * const value = key.get(context); // 'example-value'
265
+ * ```
266
+ */
267
+ declare class ClientCallContextKey<T> {
268
+ readonly symbol: symbol;
269
+ constructor(description: string);
270
+ set(value: T): ContextUpdate;
271
+ get(context: ClientCallContext): T | undefined;
272
+ }
273
+
274
+ interface CallInterceptor {
275
+ /**
276
+ * Invoked before transport method.
277
+ */
278
+ before(args: BeforeArgs): Promise<void>;
279
+ /**
280
+ * Invoked after transport method.
281
+ */
282
+ after(args: AfterArgs): Promise<void>;
283
+ }
284
+ interface BeforeArgs<K extends keyof Client = keyof Client> {
285
+ /**
286
+ * Identifies the client method invoked and its payload.
287
+ * Payload inside the input object can be modified.
288
+ */
289
+ readonly input: ClientCallInput<K>;
290
+ /**
291
+ * Identifies the agent card cached on the client
292
+ */
293
+ readonly agentCard: AgentCard;
294
+ /**
295
+ * If set by the interceptor, stops execution, invokes "after"
296
+ * for executed interceptors and returns the result. Transport is not called.
297
+ */
298
+ earlyReturn?: ClientCallResult<K>;
299
+ /**
300
+ * Options passed to the client.
301
+ */
302
+ options?: RequestOptions;
303
+ }
304
+ interface AfterArgs<K extends keyof Client = keyof Client> {
305
+ /**
306
+ * Identifies the client method invoked and its result.
307
+ * Payload inside the result object can be modified.
308
+ */
309
+ readonly result: ClientCallResult<K>;
310
+ /**
311
+ * Identifies the agent card cached on the client
312
+ */
313
+ readonly agentCard: AgentCard;
314
+ /**
315
+ * If set by the interceptor, stops execution and returns result value,
316
+ * remaining interceptors are not executed.
317
+ */
318
+ earlyReturn?: boolean;
319
+ /**
320
+ * Options passed to the client.
321
+ */
322
+ options?: RequestOptions;
323
+ }
324
+ type ClientCallInput<K extends keyof Client = keyof Client> = MethodInput<Client, K>;
325
+ type ClientCallResult<K extends keyof Client = keyof Client> = MethodResult<Client, K, ResultsOverrides>;
326
+ /**
327
+ * For
328
+ *
329
+ * interface Foo {
330
+ * f1(arg: string): Promise<Result1>;
331
+ * f2(arg: number): Promise<Result2>;
332
+ * }
333
+ *
334
+ * MethodInputs<Foo> resolves to
335
+ *
336
+ * {
337
+ * readonly method: "f1";
338
+ * value: string;
339
+ * } | {
340
+ * readonly method: "f2";
341
+ * value: number;
342
+ * }
343
+ */
344
+ type MethodInput<T, TMembers extends keyof T = keyof T> = {
345
+ [M in TMembers]: T[M] extends (options: RequestOptions | undefined) => unknown ? {
346
+ readonly method: M;
347
+ value?: never;
348
+ } : T[M] extends (payload: infer P) => unknown ? {
349
+ readonly method: M;
350
+ value: P;
351
+ } : never;
352
+ }[TMembers];
353
+ /**
354
+ * For
355
+ *
356
+ * interface Foo {
357
+ * f1(): Promise<Result1>;
358
+ * f2(): Promise<Result2>;
359
+ * }
360
+ *
361
+ * MethodsResults<Foo> resolves to
362
+ *
363
+ * {
364
+ * readonly method: "f1";
365
+ * value: Result1;
366
+ * } | {
367
+ * readonly method: "f2";
368
+ * value: Result2;
369
+ * }
370
+ */
371
+ type MethodResult<T, TMembers extends keyof T = keyof T, TOverrides = object> = {
372
+ [M in TMembers]: M extends keyof TOverrides ? {
373
+ readonly method: M;
374
+ value: TOverrides[M];
375
+ } : T[M] extends (payload: unknown) => infer R ? {
376
+ readonly method: M;
377
+ value: Awaited<R>;
378
+ } : never;
379
+ }[TMembers];
380
+ interface ResultsOverrides {
381
+ sendMessageStream: A2AStreamEventData;
382
+ resubscribeTask: A2AStreamEventData;
383
+ }
384
+
385
+ type ServiceParametersUpdate = (parameters: ServiceParameters) => void;
386
+ type ServiceParameters = Record<string, string>;
387
+ declare const ServiceParameters: {
388
+ create(...updates: ServiceParametersUpdate[]): ServiceParameters;
389
+ createFrom: (serviceParameters: ServiceParameters | undefined, ...updates: ServiceParametersUpdate[]) => ServiceParameters;
390
+ };
391
+ declare function withA2AExtensions(...extensions: Extensions): ServiceParametersUpdate;
392
+
393
+ interface Transport {
394
+ getExtendedAgentCard(options?: RequestOptions): Promise<AgentCard>;
395
+ sendMessage(params: MessageSendParams, options?: RequestOptions): Promise<SendMessageResult>;
396
+ sendMessageStream(params: MessageSendParams, options?: RequestOptions): AsyncGenerator<A2AStreamEventData, void, undefined>;
397
+ setTaskPushNotificationConfig(params: TaskPushNotificationConfig, options?: RequestOptions): Promise<TaskPushNotificationConfig>;
398
+ getTaskPushNotificationConfig(params: GetTaskPushNotificationConfigParams, options?: RequestOptions): Promise<TaskPushNotificationConfig>;
399
+ listTaskPushNotificationConfig(params: ListTaskPushNotificationConfigParams, options?: RequestOptions): Promise<TaskPushNotificationConfig[]>;
400
+ deleteTaskPushNotificationConfig(params: DeleteTaskPushNotificationConfigParams, options?: RequestOptions): Promise<void>;
401
+ getTask(params: TaskQueryParams, options?: RequestOptions): Promise<Task>;
402
+ cancelTask(params: TaskIdParams, options?: RequestOptions): Promise<Task>;
403
+ resubscribeTask(params: TaskIdParams, options?: RequestOptions): AsyncGenerator<A2AStreamEventData, void, undefined>;
404
+ }
405
+ interface TransportFactory {
406
+ get protocolName(): string;
407
+ create(url: string, agentCard: AgentCard): Promise<Transport>;
408
+ }
409
+
410
+ interface ClientConfig {
411
+ /**
412
+ * Whether client prefers to poll for task updates instead of blocking until a terminal state is reached.
413
+ * If set to true, non-streaming send message result might be a Message or a Task in any (including non-terminal) state.
414
+ * Callers are responsible for running the polling loop. This configuration does not apply to streaming requests.
415
+ */
416
+ polling?: boolean;
417
+ /**
418
+ * Specifies the default list of accepted media types to apply for all "send message" calls.
419
+ */
420
+ acceptedOutputModes?: string[];
421
+ /**
422
+ * Specifies the default push notification configuration to apply for every Task.
423
+ */
424
+ pushNotificationConfig?: PushNotificationConfig;
425
+ /**
426
+ * Interceptors invoked for each request.
427
+ */
428
+ interceptors?: CallInterceptor[];
429
+ }
430
+ interface RequestOptions {
431
+ /**
432
+ * Signal to abort request execution.
433
+ */
434
+ signal?: AbortSignal;
435
+ /**
436
+ * A key-value map for passing horizontally applicable context or parameters.
437
+ * All parameters are passed to the server via underlying transports (e.g. In JsonRPC via Headers).
438
+ */
439
+ serviceParameters?: ServiceParameters;
440
+ /**
441
+ * Arbitrary data available to interceptors and transport implementation.
442
+ */
443
+ context?: ClientCallContext;
444
+ }
445
+ declare class Client {
446
+ readonly transport: Transport;
447
+ private agentCard;
448
+ readonly config?: ClientConfig;
449
+ constructor(transport: Transport, agentCard: AgentCard, config?: ClientConfig);
450
+ /**
451
+ * If the current agent card supports the extended feature, it will try to fetch the extended agent card from the server,
452
+ * Otherwise it will return the current agent card value.
453
+ */
454
+ getAgentCard(options?: RequestOptions): Promise<AgentCard>;
455
+ /**
456
+ * Sends a message to an agent to initiate a new interaction or to continue an existing one.
457
+ * Uses blocking mode by default.
458
+ */
459
+ sendMessage(params: MessageSendParams, options?: RequestOptions): Promise<SendMessageResult>;
460
+ /**
461
+ * Sends a message to an agent to initiate/continue a task AND subscribes the client to real-time updates for that task.
462
+ * Performs fallback to non-streaming if not supported by the agent.
463
+ */
464
+ sendMessageStream(params: MessageSendParams, options?: RequestOptions): AsyncGenerator<A2AStreamEventData, void, undefined>;
465
+ /**
466
+ * Sets or updates the push notification configuration for a specified task.
467
+ * Requires the server to have AgentCard.capabilities.pushNotifications: true.
468
+ */
469
+ setTaskPushNotificationConfig(params: TaskPushNotificationConfig, options?: RequestOptions): Promise<TaskPushNotificationConfig>;
470
+ /**
471
+ * Retrieves the current push notification configuration for a specified task.
472
+ * Requires the server to have AgentCard.capabilities.pushNotifications: true.
473
+ */
474
+ getTaskPushNotificationConfig(params: TaskIdParams, options?: RequestOptions): Promise<TaskPushNotificationConfig>;
475
+ /**
476
+ * Retrieves the associated push notification configurations for a specified task.
477
+ * Requires the server to have AgentCard.capabilities.pushNotifications: true.
478
+ */
479
+ listTaskPushNotificationConfig(params: ListTaskPushNotificationConfigParams, options?: RequestOptions): Promise<TaskPushNotificationConfig[]>;
480
+ /**
481
+ * Deletes an associated push notification configuration for a task.
482
+ */
483
+ deleteTaskPushNotificationConfig(params: DeleteTaskPushNotificationConfigParams, options?: RequestOptions): Promise<void>;
484
+ /**
485
+ * Retrieves the current state (including status, artifacts, and optionally history) of a previously initiated task.
486
+ */
487
+ getTask(params: TaskQueryParams, options?: RequestOptions): Promise<Task>;
488
+ /**
489
+ * Requests the cancellation of an ongoing task. The server will attempt to cancel the task,
490
+ * but success is not guaranteed (e.g., the task might have already completed or failed, or cancellation might not be supported at its current stage).
491
+ */
492
+ cancelTask(params: TaskIdParams, options?: RequestOptions): Promise<Task>;
493
+ /**
494
+ * Allows a client to reconnect to an updates stream for an ongoing task after a previous connection was interrupted.
495
+ */
496
+ resubscribeTask(params: TaskIdParams, options?: RequestOptions): AsyncGenerator<A2AStreamEventData, void, undefined>;
497
+ private applyClientConfig;
498
+ private executeWithInterceptors;
499
+ private interceptBefore;
500
+ private interceptAfter;
501
+ }
502
+
503
+ type TransportProtocolName = 'JSONRPC' | 'HTTP+JSON' | 'GRPC' | (string & {});
504
+
505
+ interface ClientFactoryOptions {
506
+ /**
507
+ * Transport factories to use.
508
+ * Effectively defines transports supported by this client factory.
509
+ */
510
+ transports: TransportFactory[];
511
+ /**
512
+ * Client config to be used for clients created by this factory.
513
+ */
514
+ clientConfig?: ClientConfig;
515
+ /**
516
+ * Transport preferences to override ones defined by the agent card.
517
+ * If no matches are found among preferred transports, agent card values are used next.
518
+ */
519
+ preferredTransports?: TransportProtocolName[];
520
+ /**
521
+ * Used for createFromAgentCardUrl to download agent card.
522
+ */
523
+ cardResolver?: AgentCardResolver;
524
+ }
525
+ declare const ClientFactoryOptions: {
526
+ /**
527
+ * SDK default options for {@link ClientFactory}.
528
+ */
529
+ default: Readonly<ClientFactoryOptions>;
530
+ /**
531
+ * Creates new options by merging an original and an override object.
532
+ * Transports are merged based on `TransportFactory.protocolName`,
533
+ * interceptors are concatenated, other fields are overriden.
534
+ *
535
+ * @example
536
+ * ```ts
537
+ * const options = ClientFactoryOptions.createFrom(ClientFactoryOptions.default, {
538
+ * transports: [new MyCustomTransportFactory()], // adds a custom transport
539
+ * clientConfig: { interceptors: [new MyInterceptor()] }, // adds a custom interceptor
540
+ * });
541
+ * ```
542
+ */
543
+ createFrom(original: ClientFactoryOptions, overrides: Partial<ClientFactoryOptions>): ClientFactoryOptions;
544
+ };
545
+ declare class ClientFactory {
546
+ readonly options: ClientFactoryOptions;
547
+ private readonly transportsByName;
548
+ private readonly agentCardResolver;
549
+ constructor(options?: ClientFactoryOptions);
550
+ /**
551
+ * Creates a new client from the provided agent card.
552
+ */
553
+ createFromAgentCard(agentCard: AgentCard): Promise<Client>;
554
+ /**
555
+ * Downloads agent card using AgentCardResolver from options
556
+ * and creates a new client from the downloaded card.
557
+ *
558
+ * @example
559
+ * ```ts
560
+ * const factory = new ClientFactory(); // use default options and default {@link AgentCardResolver}.
561
+ * const client1 = await factory.createFromUrl('https://example.com'); // /.well-known/agent-card.json is used by default
562
+ * const client2 = await factory.createFromUrl('https://example.com', '/my-agent-card.json'); // specify custom path
563
+ * const client3 = await factory.createFromUrl('https://example.com/my-agent-card.json', ''); // specify full URL and set path to empty
564
+ * ```
565
+ */
566
+ createFromUrl(baseUrl: string, path?: string): Promise<Client>;
567
+ }
568
+
569
+ interface JsonRpcTransportOptions {
570
+ endpoint: string;
571
+ fetchImpl?: typeof fetch;
572
+ }
573
+ declare class JsonRpcTransport implements Transport {
574
+ private readonly customFetchImpl?;
575
+ private readonly endpoint;
576
+ private requestIdCounter;
577
+ constructor(options: JsonRpcTransportOptions);
578
+ getExtendedAgentCard(options?: RequestOptions, idOverride?: number): Promise<AgentCard>;
579
+ sendMessage(params: MessageSendParams, options?: RequestOptions, idOverride?: number): Promise<SendMessageResult>;
580
+ sendMessageStream(params: MessageSendParams, options?: RequestOptions): AsyncGenerator<A2AStreamEventData, void, undefined>;
581
+ setTaskPushNotificationConfig(params: TaskPushNotificationConfig, options?: RequestOptions, idOverride?: number): Promise<TaskPushNotificationConfig>;
582
+ getTaskPushNotificationConfig(params: GetTaskPushNotificationConfigParams, options?: RequestOptions, idOverride?: number): Promise<TaskPushNotificationConfig>;
583
+ listTaskPushNotificationConfig(params: ListTaskPushNotificationConfigParams, options?: RequestOptions, idOverride?: number): Promise<TaskPushNotificationConfig[]>;
584
+ deleteTaskPushNotificationConfig(params: DeleteTaskPushNotificationConfigParams, options?: RequestOptions, idOverride?: number): Promise<void>;
585
+ getTask(params: TaskQueryParams, options?: RequestOptions, idOverride?: number): Promise<Task>;
586
+ cancelTask(params: TaskIdParams, options?: RequestOptions, idOverride?: number): Promise<Task>;
587
+ resubscribeTask(params: TaskIdParams, options?: RequestOptions): AsyncGenerator<A2AStreamEventData, void, undefined>;
588
+ callExtensionMethod<TExtensionParams, TExtensionResponse extends JSONRPCResponse>(method: string, params: TExtensionParams, idOverride: number, options?: RequestOptions): Promise<TExtensionResponse>;
589
+ private _fetch;
590
+ private _sendRpcRequest;
591
+ private _fetchRpc;
592
+ private _sendStreamingRequest;
593
+ private _parseA2ASseStream;
594
+ private _processSseEventData;
595
+ private static mapToError;
596
+ }
597
+ declare class JsonRpcTransportFactoryOptions {
598
+ fetchImpl?: typeof fetch;
599
+ }
600
+ declare class JsonRpcTransportFactory implements TransportFactory {
601
+ private readonly options?;
602
+ static readonly name: TransportProtocolName;
603
+ constructor(options?: JsonRpcTransportFactoryOptions);
604
+ get protocolName(): string;
605
+ create(url: string, _agentCard: AgentCard): Promise<Transport>;
606
+ }
607
+
608
+ export { A2AClient, type A2AClientOptions, type AfterArgs, AgentCardResolver, type AgentCardResolverOptions, type AuthenticationHandler, type BeforeArgs, type CallInterceptor, Client, ClientCallContext, ClientCallContextKey, type ClientCallInput, type ClientCallResult, type ClientConfig, ClientFactory, ClientFactoryOptions, type ContextUpdate, DefaultAgentCardResolver, type HttpHeaders, JsonRpcTransport, JsonRpcTransportFactory, type JsonRpcTransportOptions, type RequestOptions, ServiceParameters, type ServiceParametersUpdate, type Transport, type TransportFactory, createAuthenticatingFetchWithRetry, withA2AExtensions };