@mailmodo/a2a 0.3.3 → 0.3.7
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.
- package/README.md +385 -173
- package/dist/a2a_request_handler-1Isk3l-0.d.mts +49 -0
- package/dist/a2a_request_handler-BuP9LgXH.d.ts +49 -0
- package/dist/chunk-7JFJW6P6.mjs +38 -0
- package/dist/chunk-AZGEDUZX.mjs +261 -0
- package/dist/chunk-BNBEZNW7.mjs +122 -0
- package/dist/chunk-PHP7LM4Y.mjs +8 -0
- package/dist/client/index.d.mts +666 -0
- package/dist/client/index.d.ts +666 -0
- package/dist/client/index.js +1605 -0
- package/dist/client/index.mjs +1448 -0
- package/dist/extensions-DvruCIzw.d.mts +2589 -0
- package/dist/extensions-DvruCIzw.d.ts +2589 -0
- package/dist/index.d.mts +5 -2758
- package/dist/index.d.ts +5 -2758
- package/dist/index.js +28 -1637
- package/dist/index.mjs +9 -1628
- package/dist/server/express/index.d.mts +97 -0
- package/dist/server/express/index.d.ts +97 -0
- package/dist/server/express/index.js +994 -0
- package/dist/server/express/index.mjs +646 -0
- package/dist/server/index.d.mts +316 -0
- package/dist/server/index.d.ts +316 -0
- package/dist/server/index.js +1386 -0
- package/dist/server/index.mjs +1070 -0
- package/package.json +51 -22
package/dist/index.d.mts
CHANGED
|
@@ -1,2293 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
/**
|
|
5
|
-
* A discriminated union representing all possible JSON-RPC 2.0 requests supported by the A2A specification.
|
|
6
|
-
*
|
|
7
|
-
* This interface was referenced by `MySchema`'s JSON-Schema
|
|
8
|
-
* via the `definition` "A2ARequest".
|
|
9
|
-
*/
|
|
10
|
-
type A2ARequest = SendMessageRequest | SendStreamingMessageRequest | GetTaskRequest | CancelTaskRequest | SetTaskPushNotificationConfigRequest | GetTaskPushNotificationConfigRequest | TaskResubscriptionRequest | ListTaskPushNotificationConfigRequest | DeleteTaskPushNotificationConfigRequest | GetAuthenticatedExtendedCardRequest;
|
|
11
|
-
/**
|
|
12
|
-
* A discriminated union representing a part of a message or artifact, which can
|
|
13
|
-
* be text, a file, or structured data.
|
|
14
|
-
*
|
|
15
|
-
* This interface was referenced by `MySchema`'s JSON-Schema
|
|
16
|
-
* via the `definition` "Part".
|
|
17
|
-
*/
|
|
18
|
-
type Part = TextPart | FilePart | DataPart;
|
|
19
|
-
/**
|
|
20
|
-
* Defines a security scheme that can be used to secure an agent's endpoints.
|
|
21
|
-
* This is a discriminated union type based on the OpenAPI 3.0 Security Scheme Object.
|
|
22
|
-
*
|
|
23
|
-
* This interface was referenced by `MySchema`'s JSON-Schema
|
|
24
|
-
* via the `definition` "SecurityScheme".
|
|
25
|
-
*/
|
|
26
|
-
type SecurityScheme = APIKeySecurityScheme | HTTPAuthSecurityScheme | OAuth2SecurityScheme | OpenIdConnectSecurityScheme | MutualTLSSecurityScheme;
|
|
27
|
-
/**
|
|
28
|
-
* Represents a JSON-RPC response for the `tasks/cancel` method.
|
|
29
|
-
*
|
|
30
|
-
* This interface was referenced by `MySchema`'s JSON-Schema
|
|
31
|
-
* via the `definition` "CancelTaskResponse".
|
|
32
|
-
*/
|
|
33
|
-
type CancelTaskResponse = JSONRPCErrorResponse | CancelTaskSuccessResponse;
|
|
34
|
-
/**
|
|
35
|
-
* Represents a JSON-RPC response for the `tasks/pushNotificationConfig/delete` method.
|
|
36
|
-
*
|
|
37
|
-
* This interface was referenced by `MySchema`'s JSON-Schema
|
|
38
|
-
* via the `definition` "DeleteTaskPushNotificationConfigResponse".
|
|
39
|
-
*/
|
|
40
|
-
type DeleteTaskPushNotificationConfigResponse = JSONRPCErrorResponse | DeleteTaskPushNotificationConfigSuccessResponse;
|
|
41
|
-
/**
|
|
42
|
-
* Represents a JSON-RPC response for the `agent/getAuthenticatedExtendedCard` method.
|
|
43
|
-
*
|
|
44
|
-
* This interface was referenced by `MySchema`'s JSON-Schema
|
|
45
|
-
* via the `definition` "GetAuthenticatedExtendedCardResponse".
|
|
46
|
-
*/
|
|
47
|
-
type GetAuthenticatedExtendedCardResponse = JSONRPCErrorResponse | GetAuthenticatedExtendedCardSuccessResponse;
|
|
48
|
-
/**
|
|
49
|
-
* Represents a JSON-RPC response for the `tasks/pushNotificationConfig/get` method.
|
|
50
|
-
*
|
|
51
|
-
* This interface was referenced by `MySchema`'s JSON-Schema
|
|
52
|
-
* via the `definition` "GetTaskPushNotificationConfigResponse".
|
|
53
|
-
*/
|
|
54
|
-
type GetTaskPushNotificationConfigResponse = JSONRPCErrorResponse | GetTaskPushNotificationConfigSuccessResponse;
|
|
55
|
-
/**
|
|
56
|
-
* Represents a JSON-RPC response for the `tasks/get` method.
|
|
57
|
-
*
|
|
58
|
-
* This interface was referenced by `MySchema`'s JSON-Schema
|
|
59
|
-
* via the `definition` "GetTaskResponse".
|
|
60
|
-
*/
|
|
61
|
-
type GetTaskResponse = JSONRPCErrorResponse | GetTaskSuccessResponse;
|
|
62
|
-
/**
|
|
63
|
-
* A discriminated union representing all possible JSON-RPC 2.0 responses
|
|
64
|
-
* for the A2A specification methods.
|
|
65
|
-
*
|
|
66
|
-
* This interface was referenced by `MySchema`'s JSON-Schema
|
|
67
|
-
* via the `definition` "JSONRPCResponse".
|
|
68
|
-
*/
|
|
69
|
-
type JSONRPCResponse = JSONRPCErrorResponse | SendMessageSuccessResponse | SendStreamingMessageSuccessResponse | GetTaskSuccessResponse | CancelTaskSuccessResponse | SetTaskPushNotificationConfigSuccessResponse | GetTaskPushNotificationConfigSuccessResponse | ListTaskPushNotificationConfigSuccessResponse | DeleteTaskPushNotificationConfigSuccessResponse | GetAuthenticatedExtendedCardSuccessResponse;
|
|
70
|
-
/**
|
|
71
|
-
* Represents a JSON-RPC response for the `tasks/pushNotificationConfig/list` method.
|
|
72
|
-
*
|
|
73
|
-
* This interface was referenced by `MySchema`'s JSON-Schema
|
|
74
|
-
* via the `definition` "ListTaskPushNotificationConfigResponse".
|
|
75
|
-
*/
|
|
76
|
-
type ListTaskPushNotificationConfigResponse = JSONRPCErrorResponse | ListTaskPushNotificationConfigSuccessResponse;
|
|
77
|
-
/**
|
|
78
|
-
* Represents a JSON-RPC response for the `message/send` method.
|
|
79
|
-
*
|
|
80
|
-
* This interface was referenced by `MySchema`'s JSON-Schema
|
|
81
|
-
* via the `definition` "SendMessageResponse".
|
|
82
|
-
*/
|
|
83
|
-
type SendMessageResponse = JSONRPCErrorResponse | SendMessageSuccessResponse;
|
|
84
|
-
/**
|
|
85
|
-
* Represents a JSON-RPC response for the `message/stream` method.
|
|
86
|
-
*
|
|
87
|
-
* This interface was referenced by `MySchema`'s JSON-Schema
|
|
88
|
-
* via the `definition` "SendStreamingMessageResponse".
|
|
89
|
-
*/
|
|
90
|
-
type SendStreamingMessageResponse = JSONRPCErrorResponse | SendStreamingMessageSuccessResponse;
|
|
91
|
-
/**
|
|
92
|
-
* Represents a JSON-RPC response for the `tasks/pushNotificationConfig/set` method.
|
|
93
|
-
*
|
|
94
|
-
* This interface was referenced by `MySchema`'s JSON-Schema
|
|
95
|
-
* via the `definition` "SetTaskPushNotificationConfigResponse".
|
|
96
|
-
*/
|
|
97
|
-
type SetTaskPushNotificationConfigResponse = JSONRPCErrorResponse | SetTaskPushNotificationConfigSuccessResponse;
|
|
98
|
-
/**
|
|
99
|
-
* Defines the lifecycle states of a Task.
|
|
100
|
-
*
|
|
101
|
-
* This interface was referenced by `MySchema`'s JSON-Schema
|
|
102
|
-
* via the `definition` "TaskState".
|
|
103
|
-
*/
|
|
104
|
-
type TaskState = "submitted" | "working" | "input-required" | "completed" | "canceled" | "failed" | "rejected" | "auth-required" | "unknown";
|
|
105
|
-
/**
|
|
106
|
-
* Supported A2A transport protocols.
|
|
107
|
-
*
|
|
108
|
-
* This interface was referenced by `MySchema`'s JSON-Schema
|
|
109
|
-
* via the `definition` "TransportProtocol".
|
|
110
|
-
*/
|
|
111
|
-
type TransportProtocol = "JSONRPC" | "GRPC" | "HTTP+JSON";
|
|
112
|
-
interface MySchema {
|
|
113
|
-
[k: string]: unknown;
|
|
114
|
-
}
|
|
115
|
-
/**
|
|
116
|
-
* An error indicating that the server received invalid JSON.
|
|
117
|
-
*
|
|
118
|
-
* This interface was referenced by `MySchema`'s JSON-Schema
|
|
119
|
-
* via the `definition` "JSONParseError".
|
|
120
|
-
*/
|
|
121
|
-
interface JSONParseError {
|
|
122
|
-
/**
|
|
123
|
-
* The error code for a JSON parse error.
|
|
124
|
-
*/
|
|
125
|
-
code: -32700;
|
|
126
|
-
/**
|
|
127
|
-
* A primitive or structured value containing additional information about the error.
|
|
128
|
-
* This may be omitted.
|
|
129
|
-
*/
|
|
130
|
-
data?: {
|
|
131
|
-
[k: string]: unknown;
|
|
132
|
-
};
|
|
133
|
-
/**
|
|
134
|
-
* The error message.
|
|
135
|
-
*/
|
|
136
|
-
message: string;
|
|
137
|
-
}
|
|
138
|
-
/**
|
|
139
|
-
* An error indicating that the JSON sent is not a valid Request object.
|
|
140
|
-
*
|
|
141
|
-
* This interface was referenced by `MySchema`'s JSON-Schema
|
|
142
|
-
* via the `definition` "InvalidRequestError".
|
|
143
|
-
*/
|
|
144
|
-
interface InvalidRequestError {
|
|
145
|
-
/**
|
|
146
|
-
* The error code for an invalid request.
|
|
147
|
-
*/
|
|
148
|
-
code: -32600;
|
|
149
|
-
/**
|
|
150
|
-
* A primitive or structured value containing additional information about the error.
|
|
151
|
-
* This may be omitted.
|
|
152
|
-
*/
|
|
153
|
-
data?: {
|
|
154
|
-
[k: string]: unknown;
|
|
155
|
-
};
|
|
156
|
-
/**
|
|
157
|
-
* The error message.
|
|
158
|
-
*/
|
|
159
|
-
message: string;
|
|
160
|
-
}
|
|
161
|
-
/**
|
|
162
|
-
* An error indicating that the requested method does not exist or is not available.
|
|
163
|
-
*
|
|
164
|
-
* This interface was referenced by `MySchema`'s JSON-Schema
|
|
165
|
-
* via the `definition` "MethodNotFoundError".
|
|
166
|
-
*/
|
|
167
|
-
interface MethodNotFoundError {
|
|
168
|
-
/**
|
|
169
|
-
* The error code for a method not found error.
|
|
170
|
-
*/
|
|
171
|
-
code: -32601;
|
|
172
|
-
/**
|
|
173
|
-
* A primitive or structured value containing additional information about the error.
|
|
174
|
-
* This may be omitted.
|
|
175
|
-
*/
|
|
176
|
-
data?: {
|
|
177
|
-
[k: string]: unknown;
|
|
178
|
-
};
|
|
179
|
-
/**
|
|
180
|
-
* The error message.
|
|
181
|
-
*/
|
|
182
|
-
message: string;
|
|
183
|
-
}
|
|
184
|
-
/**
|
|
185
|
-
* An error indicating that the method parameters are invalid.
|
|
186
|
-
*
|
|
187
|
-
* This interface was referenced by `MySchema`'s JSON-Schema
|
|
188
|
-
* via the `definition` "InvalidParamsError".
|
|
189
|
-
*/
|
|
190
|
-
interface InvalidParamsError {
|
|
191
|
-
/**
|
|
192
|
-
* The error code for an invalid parameters error.
|
|
193
|
-
*/
|
|
194
|
-
code: -32602;
|
|
195
|
-
/**
|
|
196
|
-
* A primitive or structured value containing additional information about the error.
|
|
197
|
-
* This may be omitted.
|
|
198
|
-
*/
|
|
199
|
-
data?: {
|
|
200
|
-
[k: string]: unknown;
|
|
201
|
-
};
|
|
202
|
-
/**
|
|
203
|
-
* The error message.
|
|
204
|
-
*/
|
|
205
|
-
message: string;
|
|
206
|
-
}
|
|
207
|
-
/**
|
|
208
|
-
* An error indicating an internal error on the server.
|
|
209
|
-
*
|
|
210
|
-
* This interface was referenced by `MySchema`'s JSON-Schema
|
|
211
|
-
* via the `definition` "InternalError".
|
|
212
|
-
*/
|
|
213
|
-
interface InternalError {
|
|
214
|
-
/**
|
|
215
|
-
* The error code for an internal server error.
|
|
216
|
-
*/
|
|
217
|
-
code: -32603;
|
|
218
|
-
/**
|
|
219
|
-
* A primitive or structured value containing additional information about the error.
|
|
220
|
-
* This may be omitted.
|
|
221
|
-
*/
|
|
222
|
-
data?: {
|
|
223
|
-
[k: string]: unknown;
|
|
224
|
-
};
|
|
225
|
-
/**
|
|
226
|
-
* The error message.
|
|
227
|
-
*/
|
|
228
|
-
message: string;
|
|
229
|
-
}
|
|
230
|
-
/**
|
|
231
|
-
* An A2A-specific error indicating that the requested task ID was not found.
|
|
232
|
-
*
|
|
233
|
-
* This interface was referenced by `MySchema`'s JSON-Schema
|
|
234
|
-
* via the `definition` "TaskNotFoundError".
|
|
235
|
-
*/
|
|
236
|
-
interface TaskNotFoundError {
|
|
237
|
-
/**
|
|
238
|
-
* The error code for a task not found error.
|
|
239
|
-
*/
|
|
240
|
-
code: -32001;
|
|
241
|
-
/**
|
|
242
|
-
* A primitive or structured value containing additional information about the error.
|
|
243
|
-
* This may be omitted.
|
|
244
|
-
*/
|
|
245
|
-
data?: {
|
|
246
|
-
[k: string]: unknown;
|
|
247
|
-
};
|
|
248
|
-
/**
|
|
249
|
-
* The error message.
|
|
250
|
-
*/
|
|
251
|
-
message: string;
|
|
252
|
-
}
|
|
253
|
-
/**
|
|
254
|
-
* An A2A-specific error indicating that the task is in a state where it cannot be canceled.
|
|
255
|
-
*
|
|
256
|
-
* This interface was referenced by `MySchema`'s JSON-Schema
|
|
257
|
-
* via the `definition` "TaskNotCancelableError".
|
|
258
|
-
*/
|
|
259
|
-
interface TaskNotCancelableError {
|
|
260
|
-
/**
|
|
261
|
-
* The error code for a task that cannot be canceled.
|
|
262
|
-
*/
|
|
263
|
-
code: -32002;
|
|
264
|
-
/**
|
|
265
|
-
* A primitive or structured value containing additional information about the error.
|
|
266
|
-
* This may be omitted.
|
|
267
|
-
*/
|
|
268
|
-
data?: {
|
|
269
|
-
[k: string]: unknown;
|
|
270
|
-
};
|
|
271
|
-
/**
|
|
272
|
-
* The error message.
|
|
273
|
-
*/
|
|
274
|
-
message: string;
|
|
275
|
-
}
|
|
276
|
-
/**
|
|
277
|
-
* An A2A-specific error indicating that the agent does not support push notifications.
|
|
278
|
-
*
|
|
279
|
-
* This interface was referenced by `MySchema`'s JSON-Schema
|
|
280
|
-
* via the `definition` "PushNotificationNotSupportedError".
|
|
281
|
-
*/
|
|
282
|
-
interface PushNotificationNotSupportedError {
|
|
283
|
-
/**
|
|
284
|
-
* The error code for when push notifications are not supported.
|
|
285
|
-
*/
|
|
286
|
-
code: -32003;
|
|
287
|
-
/**
|
|
288
|
-
* A primitive or structured value containing additional information about the error.
|
|
289
|
-
* This may be omitted.
|
|
290
|
-
*/
|
|
291
|
-
data?: {
|
|
292
|
-
[k: string]: unknown;
|
|
293
|
-
};
|
|
294
|
-
/**
|
|
295
|
-
* The error message.
|
|
296
|
-
*/
|
|
297
|
-
message: string;
|
|
298
|
-
}
|
|
299
|
-
/**
|
|
300
|
-
* An A2A-specific error indicating that the requested operation is not supported by the agent.
|
|
301
|
-
*
|
|
302
|
-
* This interface was referenced by `MySchema`'s JSON-Schema
|
|
303
|
-
* via the `definition` "UnsupportedOperationError".
|
|
304
|
-
*/
|
|
305
|
-
interface UnsupportedOperationError {
|
|
306
|
-
/**
|
|
307
|
-
* The error code for an unsupported operation.
|
|
308
|
-
*/
|
|
309
|
-
code: -32004;
|
|
310
|
-
/**
|
|
311
|
-
* A primitive or structured value containing additional information about the error.
|
|
312
|
-
* This may be omitted.
|
|
313
|
-
*/
|
|
314
|
-
data?: {
|
|
315
|
-
[k: string]: unknown;
|
|
316
|
-
};
|
|
317
|
-
/**
|
|
318
|
-
* The error message.
|
|
319
|
-
*/
|
|
320
|
-
message: string;
|
|
321
|
-
}
|
|
322
|
-
/**
|
|
323
|
-
* An A2A-specific error indicating an incompatibility between the requested
|
|
324
|
-
* content types and the agent's capabilities.
|
|
325
|
-
*
|
|
326
|
-
* This interface was referenced by `MySchema`'s JSON-Schema
|
|
327
|
-
* via the `definition` "ContentTypeNotSupportedError".
|
|
328
|
-
*/
|
|
329
|
-
interface ContentTypeNotSupportedError {
|
|
330
|
-
/**
|
|
331
|
-
* The error code for an unsupported content type.
|
|
332
|
-
*/
|
|
333
|
-
code: -32005;
|
|
334
|
-
/**
|
|
335
|
-
* A primitive or structured value containing additional information about the error.
|
|
336
|
-
* This may be omitted.
|
|
337
|
-
*/
|
|
338
|
-
data?: {
|
|
339
|
-
[k: string]: unknown;
|
|
340
|
-
};
|
|
341
|
-
/**
|
|
342
|
-
* The error message.
|
|
343
|
-
*/
|
|
344
|
-
message: string;
|
|
345
|
-
}
|
|
346
|
-
/**
|
|
347
|
-
* An A2A-specific error indicating that the agent returned a response that
|
|
348
|
-
* does not conform to the specification for the current method.
|
|
349
|
-
*
|
|
350
|
-
* This interface was referenced by `MySchema`'s JSON-Schema
|
|
351
|
-
* via the `definition` "InvalidAgentResponseError".
|
|
352
|
-
*/
|
|
353
|
-
interface InvalidAgentResponseError {
|
|
354
|
-
/**
|
|
355
|
-
* The error code for an invalid agent response.
|
|
356
|
-
*/
|
|
357
|
-
code: -32006;
|
|
358
|
-
/**
|
|
359
|
-
* A primitive or structured value containing additional information about the error.
|
|
360
|
-
* This may be omitted.
|
|
361
|
-
*/
|
|
362
|
-
data?: {
|
|
363
|
-
[k: string]: unknown;
|
|
364
|
-
};
|
|
365
|
-
/**
|
|
366
|
-
* The error message.
|
|
367
|
-
*/
|
|
368
|
-
message: string;
|
|
369
|
-
}
|
|
370
|
-
/**
|
|
371
|
-
* An A2A-specific error indicating that the agent does not have an Authenticated Extended Card configured
|
|
372
|
-
*
|
|
373
|
-
* This interface was referenced by `MySchema`'s JSON-Schema
|
|
374
|
-
* via the `definition` "AuthenticatedExtendedCardNotConfiguredError".
|
|
375
|
-
*/
|
|
376
|
-
interface AuthenticatedExtendedCardNotConfiguredError {
|
|
377
|
-
/**
|
|
378
|
-
* The error code for when an authenticated extended card is not configured.
|
|
379
|
-
*/
|
|
380
|
-
code: -32007;
|
|
381
|
-
/**
|
|
382
|
-
* A primitive or structured value containing additional information about the error.
|
|
383
|
-
* This may be omitted.
|
|
384
|
-
*/
|
|
385
|
-
data?: {
|
|
386
|
-
[k: string]: unknown;
|
|
387
|
-
};
|
|
388
|
-
/**
|
|
389
|
-
* The error message.
|
|
390
|
-
*/
|
|
391
|
-
message: string;
|
|
392
|
-
}
|
|
393
|
-
/**
|
|
394
|
-
* Represents a JSON-RPC request for the `message/send` method.
|
|
395
|
-
*
|
|
396
|
-
* This interface was referenced by `MySchema`'s JSON-Schema
|
|
397
|
-
* via the `definition` "SendMessageRequest".
|
|
398
|
-
*/
|
|
399
|
-
interface SendMessageRequest {
|
|
400
|
-
/**
|
|
401
|
-
* The identifier for this request.
|
|
402
|
-
*/
|
|
403
|
-
id: string | number;
|
|
404
|
-
/**
|
|
405
|
-
* The version of the JSON-RPC protocol. MUST be exactly "2.0".
|
|
406
|
-
*/
|
|
407
|
-
jsonrpc: "2.0";
|
|
408
|
-
/**
|
|
409
|
-
* The method name. Must be 'message/send'.
|
|
410
|
-
*/
|
|
411
|
-
method: "message/send";
|
|
412
|
-
params: MessageSendParams;
|
|
413
|
-
}
|
|
414
|
-
/**
|
|
415
|
-
* The parameters for sending a message.
|
|
416
|
-
*/
|
|
417
|
-
interface MessageSendParams {
|
|
418
|
-
configuration?: MessageSendConfiguration;
|
|
419
|
-
message: Message;
|
|
420
|
-
/**
|
|
421
|
-
* Optional metadata for extensions.
|
|
422
|
-
*/
|
|
423
|
-
metadata?: {
|
|
424
|
-
[k: string]: unknown;
|
|
425
|
-
};
|
|
426
|
-
}
|
|
427
|
-
/**
|
|
428
|
-
* Optional configuration for the send request.
|
|
429
|
-
*/
|
|
430
|
-
interface MessageSendConfiguration {
|
|
431
|
-
/**
|
|
432
|
-
* A list of output MIME types the client is prepared to accept in the response.
|
|
433
|
-
*/
|
|
434
|
-
acceptedOutputModes?: string[];
|
|
435
|
-
/**
|
|
436
|
-
* If true, the client will wait for the task to complete. The server may reject this if the task is long-running.
|
|
437
|
-
*/
|
|
438
|
-
blocking?: boolean;
|
|
439
|
-
/**
|
|
440
|
-
* The number of most recent messages from the task's history to retrieve in the response.
|
|
441
|
-
*/
|
|
442
|
-
historyLength?: number;
|
|
443
|
-
pushNotificationConfig?: PushNotificationConfig;
|
|
444
|
-
}
|
|
445
|
-
/**
|
|
446
|
-
* Configuration for the agent to send push notifications for updates after the initial response.
|
|
447
|
-
*/
|
|
448
|
-
interface PushNotificationConfig {
|
|
449
|
-
authentication?: PushNotificationAuthenticationInfo;
|
|
450
|
-
/**
|
|
451
|
-
* A unique ID for the push notification configuration, set by the client
|
|
452
|
-
* to support multiple notification callbacks.
|
|
453
|
-
*/
|
|
454
|
-
id?: string;
|
|
455
|
-
/**
|
|
456
|
-
* A unique token for this task or session to validate incoming push notifications.
|
|
457
|
-
*/
|
|
458
|
-
token?: string;
|
|
459
|
-
/**
|
|
460
|
-
* The callback URL where the agent should send push notifications.
|
|
461
|
-
*/
|
|
462
|
-
url: string;
|
|
463
|
-
}
|
|
464
|
-
/**
|
|
465
|
-
* Optional authentication details for the agent to use when calling the notification URL.
|
|
466
|
-
*/
|
|
467
|
-
interface PushNotificationAuthenticationInfo {
|
|
468
|
-
/**
|
|
469
|
-
* Optional credentials required by the push notification endpoint.
|
|
470
|
-
*/
|
|
471
|
-
credentials?: string;
|
|
472
|
-
/**
|
|
473
|
-
* A list of supported authentication schemes (e.g., 'Basic', 'Bearer').
|
|
474
|
-
*/
|
|
475
|
-
schemes: string[];
|
|
476
|
-
}
|
|
477
|
-
/**
|
|
478
|
-
* The message object being sent to the agent.
|
|
479
|
-
*/
|
|
480
|
-
interface Message {
|
|
481
|
-
/**
|
|
482
|
-
* The context identifier for this message, used to group related interactions.
|
|
483
|
-
*/
|
|
484
|
-
contextId?: string;
|
|
485
|
-
/**
|
|
486
|
-
* The URIs of extensions that are relevant to this message.
|
|
487
|
-
*/
|
|
488
|
-
extensions?: string[];
|
|
489
|
-
/**
|
|
490
|
-
* The type of this object, used as a discriminator. Always 'message' for a Message.
|
|
491
|
-
*/
|
|
492
|
-
kind: "message";
|
|
493
|
-
/**
|
|
494
|
-
* A unique identifier for the message, typically a UUID, generated by the sender.
|
|
495
|
-
*/
|
|
496
|
-
messageId: string;
|
|
497
|
-
/**
|
|
498
|
-
* Optional metadata for extensions. The key is an extension-specific identifier.
|
|
499
|
-
*/
|
|
500
|
-
metadata?: {
|
|
501
|
-
[k: string]: unknown;
|
|
502
|
-
};
|
|
503
|
-
/**
|
|
504
|
-
* An array of content parts that form the message body. A message can be
|
|
505
|
-
* composed of multiple parts of different types (e.g., text and files).
|
|
506
|
-
*/
|
|
507
|
-
parts: Part[];
|
|
508
|
-
/**
|
|
509
|
-
* A list of other task IDs that this message references for additional context.
|
|
510
|
-
*/
|
|
511
|
-
referenceTaskIds?: string[];
|
|
512
|
-
/**
|
|
513
|
-
* Identifies the sender of the message. `user` for the client, `agent` for the service.
|
|
514
|
-
*/
|
|
515
|
-
role: "agent" | "user";
|
|
516
|
-
/**
|
|
517
|
-
* The identifier of the task this message is part of. Can be omitted for the first message of a new task.
|
|
518
|
-
*/
|
|
519
|
-
taskId?: string;
|
|
520
|
-
}
|
|
521
|
-
/**
|
|
522
|
-
* Represents a text segment within a message or artifact.
|
|
523
|
-
*
|
|
524
|
-
* This interface was referenced by `MySchema`'s JSON-Schema
|
|
525
|
-
* via the `definition` "TextPart".
|
|
526
|
-
*/
|
|
527
|
-
interface TextPart {
|
|
528
|
-
/**
|
|
529
|
-
* The type of this part, used as a discriminator. Always 'text'.
|
|
530
|
-
*/
|
|
531
|
-
kind: "text";
|
|
532
|
-
/**
|
|
533
|
-
* Optional metadata associated with this part.
|
|
534
|
-
*/
|
|
535
|
-
metadata?: {
|
|
536
|
-
[k: string]: unknown;
|
|
537
|
-
};
|
|
538
|
-
/**
|
|
539
|
-
* The string content of the text part.
|
|
540
|
-
*/
|
|
541
|
-
text: string;
|
|
542
|
-
}
|
|
543
|
-
/**
|
|
544
|
-
* Represents a file segment within a message or artifact. The file content can be
|
|
545
|
-
* provided either directly as bytes or as a URI.
|
|
546
|
-
*
|
|
547
|
-
* This interface was referenced by `MySchema`'s JSON-Schema
|
|
548
|
-
* via the `definition` "FilePart".
|
|
549
|
-
*/
|
|
550
|
-
interface FilePart {
|
|
551
|
-
/**
|
|
552
|
-
* The file content, represented as either a URI or as base64-encoded bytes.
|
|
553
|
-
*/
|
|
554
|
-
file: FileWithBytes | FileWithUri;
|
|
555
|
-
/**
|
|
556
|
-
* The type of this part, used as a discriminator. Always 'file'.
|
|
557
|
-
*/
|
|
558
|
-
kind: "file";
|
|
559
|
-
/**
|
|
560
|
-
* Optional metadata associated with this part.
|
|
561
|
-
*/
|
|
562
|
-
metadata?: {
|
|
563
|
-
[k: string]: unknown;
|
|
564
|
-
};
|
|
565
|
-
}
|
|
566
|
-
/**
|
|
567
|
-
* Represents a file with its content provided directly as a base64-encoded string.
|
|
568
|
-
*
|
|
569
|
-
* This interface was referenced by `MySchema`'s JSON-Schema
|
|
570
|
-
* via the `definition` "FileWithBytes".
|
|
571
|
-
*/
|
|
572
|
-
interface FileWithBytes {
|
|
573
|
-
/**
|
|
574
|
-
* The base64-encoded content of the file.
|
|
575
|
-
*/
|
|
576
|
-
bytes: string;
|
|
577
|
-
/**
|
|
578
|
-
* The MIME type of the file (e.g., "application/pdf").
|
|
579
|
-
*/
|
|
580
|
-
mimeType?: string;
|
|
581
|
-
/**
|
|
582
|
-
* An optional name for the file (e.g., "document.pdf").
|
|
583
|
-
*/
|
|
584
|
-
name?: string;
|
|
585
|
-
}
|
|
586
|
-
/**
|
|
587
|
-
* Represents a file with its content located at a specific URI.
|
|
588
|
-
*
|
|
589
|
-
* This interface was referenced by `MySchema`'s JSON-Schema
|
|
590
|
-
* via the `definition` "FileWithUri".
|
|
591
|
-
*/
|
|
592
|
-
interface FileWithUri {
|
|
593
|
-
/**
|
|
594
|
-
* The MIME type of the file (e.g., "application/pdf").
|
|
595
|
-
*/
|
|
596
|
-
mimeType?: string;
|
|
597
|
-
/**
|
|
598
|
-
* An optional name for the file (e.g., "document.pdf").
|
|
599
|
-
*/
|
|
600
|
-
name?: string;
|
|
601
|
-
/**
|
|
602
|
-
* A URL pointing to the file's content.
|
|
603
|
-
*/
|
|
604
|
-
uri: string;
|
|
605
|
-
}
|
|
606
|
-
/**
|
|
607
|
-
* Represents a structured data segment (e.g., JSON) within a message or artifact.
|
|
608
|
-
*
|
|
609
|
-
* This interface was referenced by `MySchema`'s JSON-Schema
|
|
610
|
-
* via the `definition` "DataPart".
|
|
611
|
-
*/
|
|
612
|
-
interface DataPart {
|
|
613
|
-
/**
|
|
614
|
-
* The structured data content.
|
|
615
|
-
*/
|
|
616
|
-
data: {
|
|
617
|
-
[k: string]: unknown;
|
|
618
|
-
};
|
|
619
|
-
/**
|
|
620
|
-
* The type of this part, used as a discriminator. Always 'data'.
|
|
621
|
-
*/
|
|
622
|
-
kind: "data";
|
|
623
|
-
/**
|
|
624
|
-
* Optional metadata associated with this part.
|
|
625
|
-
*/
|
|
626
|
-
metadata?: {
|
|
627
|
-
[k: string]: unknown;
|
|
628
|
-
};
|
|
629
|
-
}
|
|
630
|
-
/**
|
|
631
|
-
* Represents a JSON-RPC request for the `message/stream` method.
|
|
632
|
-
*
|
|
633
|
-
* This interface was referenced by `MySchema`'s JSON-Schema
|
|
634
|
-
* via the `definition` "SendStreamingMessageRequest".
|
|
635
|
-
*/
|
|
636
|
-
interface SendStreamingMessageRequest {
|
|
637
|
-
/**
|
|
638
|
-
* The identifier for this request.
|
|
639
|
-
*/
|
|
640
|
-
id: string | number;
|
|
641
|
-
/**
|
|
642
|
-
* The version of the JSON-RPC protocol. MUST be exactly "2.0".
|
|
643
|
-
*/
|
|
644
|
-
jsonrpc: "2.0";
|
|
645
|
-
/**
|
|
646
|
-
* The method name. Must be 'message/stream'.
|
|
647
|
-
*/
|
|
648
|
-
method: "message/stream";
|
|
649
|
-
params: MessageSendParams1;
|
|
650
|
-
}
|
|
651
|
-
/**
|
|
652
|
-
* The parameters for sending a message.
|
|
653
|
-
*/
|
|
654
|
-
interface MessageSendParams1 {
|
|
655
|
-
configuration?: MessageSendConfiguration;
|
|
656
|
-
message: Message;
|
|
657
|
-
/**
|
|
658
|
-
* Optional metadata for extensions.
|
|
659
|
-
*/
|
|
660
|
-
metadata?: {
|
|
661
|
-
[k: string]: unknown;
|
|
662
|
-
};
|
|
663
|
-
}
|
|
664
|
-
/**
|
|
665
|
-
* Represents a JSON-RPC request for the `tasks/get` method.
|
|
666
|
-
*
|
|
667
|
-
* This interface was referenced by `MySchema`'s JSON-Schema
|
|
668
|
-
* via the `definition` "GetTaskRequest".
|
|
669
|
-
*/
|
|
670
|
-
interface GetTaskRequest {
|
|
671
|
-
/**
|
|
672
|
-
* The identifier for this request.
|
|
673
|
-
*/
|
|
674
|
-
id: string | number;
|
|
675
|
-
/**
|
|
676
|
-
* The version of the JSON-RPC protocol. MUST be exactly "2.0".
|
|
677
|
-
*/
|
|
678
|
-
jsonrpc: "2.0";
|
|
679
|
-
/**
|
|
680
|
-
* The method name. Must be 'tasks/get'.
|
|
681
|
-
*/
|
|
682
|
-
method: "tasks/get";
|
|
683
|
-
params: TaskQueryParams;
|
|
684
|
-
}
|
|
685
|
-
/**
|
|
686
|
-
* The parameters for querying a task.
|
|
687
|
-
*/
|
|
688
|
-
interface TaskQueryParams {
|
|
689
|
-
/**
|
|
690
|
-
* The number of most recent messages from the task's history to retrieve.
|
|
691
|
-
*/
|
|
692
|
-
historyLength?: number;
|
|
693
|
-
/**
|
|
694
|
-
* The unique identifier of the task.
|
|
695
|
-
*/
|
|
696
|
-
id: string;
|
|
697
|
-
/**
|
|
698
|
-
* Optional metadata associated with the request.
|
|
699
|
-
*/
|
|
700
|
-
metadata?: {
|
|
701
|
-
[k: string]: unknown;
|
|
702
|
-
};
|
|
703
|
-
}
|
|
704
|
-
/**
|
|
705
|
-
* Represents a JSON-RPC request for the `tasks/cancel` method.
|
|
706
|
-
*
|
|
707
|
-
* This interface was referenced by `MySchema`'s JSON-Schema
|
|
708
|
-
* via the `definition` "CancelTaskRequest".
|
|
709
|
-
*/
|
|
710
|
-
interface CancelTaskRequest {
|
|
711
|
-
/**
|
|
712
|
-
* The identifier for this request.
|
|
713
|
-
*/
|
|
714
|
-
id: string | number;
|
|
715
|
-
/**
|
|
716
|
-
* The version of the JSON-RPC protocol. MUST be exactly "2.0".
|
|
717
|
-
*/
|
|
718
|
-
jsonrpc: "2.0";
|
|
719
|
-
/**
|
|
720
|
-
* The method name. Must be 'tasks/cancel'.
|
|
721
|
-
*/
|
|
722
|
-
method: "tasks/cancel";
|
|
723
|
-
params: TaskIdParams;
|
|
724
|
-
}
|
|
725
|
-
/**
|
|
726
|
-
* The parameters identifying the task to cancel.
|
|
727
|
-
*/
|
|
728
|
-
interface TaskIdParams {
|
|
729
|
-
/**
|
|
730
|
-
* The unique identifier of the task.
|
|
731
|
-
*/
|
|
732
|
-
id: string;
|
|
733
|
-
/**
|
|
734
|
-
* Optional metadata associated with the request.
|
|
735
|
-
*/
|
|
736
|
-
metadata?: {
|
|
737
|
-
[k: string]: unknown;
|
|
738
|
-
};
|
|
739
|
-
}
|
|
740
|
-
/**
|
|
741
|
-
* Represents a JSON-RPC request for the `tasks/pushNotificationConfig/set` method.
|
|
742
|
-
*
|
|
743
|
-
* This interface was referenced by `MySchema`'s JSON-Schema
|
|
744
|
-
* via the `definition` "SetTaskPushNotificationConfigRequest".
|
|
745
|
-
*/
|
|
746
|
-
interface SetTaskPushNotificationConfigRequest {
|
|
747
|
-
/**
|
|
748
|
-
* The identifier for this request.
|
|
749
|
-
*/
|
|
750
|
-
id: string | number;
|
|
751
|
-
/**
|
|
752
|
-
* The version of the JSON-RPC protocol. MUST be exactly "2.0".
|
|
753
|
-
*/
|
|
754
|
-
jsonrpc: "2.0";
|
|
755
|
-
/**
|
|
756
|
-
* The method name. Must be 'tasks/pushNotificationConfig/set'.
|
|
757
|
-
*/
|
|
758
|
-
method: "tasks/pushNotificationConfig/set";
|
|
759
|
-
params: TaskPushNotificationConfig;
|
|
760
|
-
}
|
|
761
|
-
/**
|
|
762
|
-
* The parameters for setting the push notification configuration.
|
|
763
|
-
*/
|
|
764
|
-
interface TaskPushNotificationConfig {
|
|
765
|
-
pushNotificationConfig: PushNotificationConfig1;
|
|
766
|
-
/**
|
|
767
|
-
* The ID of the task.
|
|
768
|
-
*/
|
|
769
|
-
taskId: string;
|
|
770
|
-
}
|
|
771
|
-
/**
|
|
772
|
-
* The push notification configuration for this task.
|
|
773
|
-
*/
|
|
774
|
-
interface PushNotificationConfig1 {
|
|
775
|
-
authentication?: PushNotificationAuthenticationInfo;
|
|
776
|
-
/**
|
|
777
|
-
* A unique ID for the push notification configuration, set by the client
|
|
778
|
-
* to support multiple notification callbacks.
|
|
779
|
-
*/
|
|
780
|
-
id?: string;
|
|
781
|
-
/**
|
|
782
|
-
* A unique token for this task or session to validate incoming push notifications.
|
|
783
|
-
*/
|
|
784
|
-
token?: string;
|
|
785
|
-
/**
|
|
786
|
-
* The callback URL where the agent should send push notifications.
|
|
787
|
-
*/
|
|
788
|
-
url: string;
|
|
789
|
-
}
|
|
790
|
-
/**
|
|
791
|
-
* Represents a JSON-RPC request for the `tasks/pushNotificationConfig/get` method.
|
|
792
|
-
*
|
|
793
|
-
* This interface was referenced by `MySchema`'s JSON-Schema
|
|
794
|
-
* via the `definition` "GetTaskPushNotificationConfigRequest".
|
|
795
|
-
*/
|
|
796
|
-
interface GetTaskPushNotificationConfigRequest {
|
|
797
|
-
/**
|
|
798
|
-
* The identifier for this request.
|
|
799
|
-
*/
|
|
800
|
-
id: string | number;
|
|
801
|
-
/**
|
|
802
|
-
* The version of the JSON-RPC protocol. MUST be exactly "2.0".
|
|
803
|
-
*/
|
|
804
|
-
jsonrpc: "2.0";
|
|
805
|
-
/**
|
|
806
|
-
* The method name. Must be 'tasks/pushNotificationConfig/get'.
|
|
807
|
-
*/
|
|
808
|
-
method: "tasks/pushNotificationConfig/get";
|
|
809
|
-
/**
|
|
810
|
-
* The parameters for getting a push notification configuration.
|
|
811
|
-
*/
|
|
812
|
-
params: TaskIdParams1 | GetTaskPushNotificationConfigParams;
|
|
813
|
-
}
|
|
814
|
-
/**
|
|
815
|
-
* Defines parameters containing a task ID, used for simple task operations.
|
|
816
|
-
*
|
|
817
|
-
* This interface was referenced by `MySchema`'s JSON-Schema
|
|
818
|
-
* via the `definition` "TaskIdParams".
|
|
819
|
-
*/
|
|
820
|
-
interface TaskIdParams1 {
|
|
821
|
-
/**
|
|
822
|
-
* The unique identifier of the task.
|
|
823
|
-
*/
|
|
824
|
-
id: string;
|
|
825
|
-
/**
|
|
826
|
-
* Optional metadata associated with the request.
|
|
827
|
-
*/
|
|
828
|
-
metadata?: {
|
|
829
|
-
[k: string]: unknown;
|
|
830
|
-
};
|
|
831
|
-
}
|
|
832
|
-
/**
|
|
833
|
-
* Defines parameters for fetching a specific push notification configuration for a task.
|
|
834
|
-
*
|
|
835
|
-
* This interface was referenced by `MySchema`'s JSON-Schema
|
|
836
|
-
* via the `definition` "GetTaskPushNotificationConfigParams".
|
|
837
|
-
*/
|
|
838
|
-
interface GetTaskPushNotificationConfigParams {
|
|
839
|
-
/**
|
|
840
|
-
* The unique identifier of the task.
|
|
841
|
-
*/
|
|
842
|
-
id: string;
|
|
843
|
-
/**
|
|
844
|
-
* Optional metadata associated with the request.
|
|
845
|
-
*/
|
|
846
|
-
metadata?: {
|
|
847
|
-
[k: string]: unknown;
|
|
848
|
-
};
|
|
849
|
-
/**
|
|
850
|
-
* The ID of the push notification configuration to retrieve.
|
|
851
|
-
*/
|
|
852
|
-
pushNotificationConfigId?: string;
|
|
853
|
-
}
|
|
854
|
-
/**
|
|
855
|
-
* Represents a JSON-RPC request for the `tasks/resubscribe` method, used to resume a streaming connection.
|
|
856
|
-
*
|
|
857
|
-
* This interface was referenced by `MySchema`'s JSON-Schema
|
|
858
|
-
* via the `definition` "TaskResubscriptionRequest".
|
|
859
|
-
*/
|
|
860
|
-
interface TaskResubscriptionRequest {
|
|
861
|
-
/**
|
|
862
|
-
* The identifier for this request.
|
|
863
|
-
*/
|
|
864
|
-
id: string | number;
|
|
865
|
-
/**
|
|
866
|
-
* The version of the JSON-RPC protocol. MUST be exactly "2.0".
|
|
867
|
-
*/
|
|
868
|
-
jsonrpc: "2.0";
|
|
869
|
-
/**
|
|
870
|
-
* The method name. Must be 'tasks/resubscribe'.
|
|
871
|
-
*/
|
|
872
|
-
method: "tasks/resubscribe";
|
|
873
|
-
params: TaskIdParams2;
|
|
874
|
-
}
|
|
875
|
-
/**
|
|
876
|
-
* Defines parameters containing a task ID, used for simple task operations.
|
|
877
|
-
*/
|
|
878
|
-
interface TaskIdParams2 {
|
|
879
|
-
/**
|
|
880
|
-
* The unique identifier of the task.
|
|
881
|
-
*/
|
|
882
|
-
id: string;
|
|
883
|
-
/**
|
|
884
|
-
* Optional metadata associated with the request.
|
|
885
|
-
*/
|
|
886
|
-
metadata?: {
|
|
887
|
-
[k: string]: unknown;
|
|
888
|
-
};
|
|
889
|
-
}
|
|
890
|
-
/**
|
|
891
|
-
* Represents a JSON-RPC request for the `tasks/pushNotificationConfig/list` method.
|
|
892
|
-
*
|
|
893
|
-
* This interface was referenced by `MySchema`'s JSON-Schema
|
|
894
|
-
* via the `definition` "ListTaskPushNotificationConfigRequest".
|
|
895
|
-
*/
|
|
896
|
-
interface ListTaskPushNotificationConfigRequest {
|
|
897
|
-
/**
|
|
898
|
-
* The identifier for this request.
|
|
899
|
-
*/
|
|
900
|
-
id: string | number;
|
|
901
|
-
/**
|
|
902
|
-
* The version of the JSON-RPC protocol. MUST be exactly "2.0".
|
|
903
|
-
*/
|
|
904
|
-
jsonrpc: "2.0";
|
|
905
|
-
/**
|
|
906
|
-
* The method name. Must be 'tasks/pushNotificationConfig/list'.
|
|
907
|
-
*/
|
|
908
|
-
method: "tasks/pushNotificationConfig/list";
|
|
909
|
-
params: ListTaskPushNotificationConfigParams;
|
|
910
|
-
}
|
|
911
|
-
/**
|
|
912
|
-
* The parameters identifying the task whose configurations are to be listed.
|
|
913
|
-
*/
|
|
914
|
-
interface ListTaskPushNotificationConfigParams {
|
|
915
|
-
/**
|
|
916
|
-
* The unique identifier of the task.
|
|
917
|
-
*/
|
|
918
|
-
id: string;
|
|
919
|
-
/**
|
|
920
|
-
* Optional metadata associated with the request.
|
|
921
|
-
*/
|
|
922
|
-
metadata?: {
|
|
923
|
-
[k: string]: unknown;
|
|
924
|
-
};
|
|
925
|
-
}
|
|
926
|
-
/**
|
|
927
|
-
* Represents a JSON-RPC request for the `tasks/pushNotificationConfig/delete` method.
|
|
928
|
-
*
|
|
929
|
-
* This interface was referenced by `MySchema`'s JSON-Schema
|
|
930
|
-
* via the `definition` "DeleteTaskPushNotificationConfigRequest".
|
|
931
|
-
*/
|
|
932
|
-
interface DeleteTaskPushNotificationConfigRequest {
|
|
933
|
-
/**
|
|
934
|
-
* The identifier for this request.
|
|
935
|
-
*/
|
|
936
|
-
id: string | number;
|
|
937
|
-
/**
|
|
938
|
-
* The version of the JSON-RPC protocol. MUST be exactly "2.0".
|
|
939
|
-
*/
|
|
940
|
-
jsonrpc: "2.0";
|
|
941
|
-
/**
|
|
942
|
-
* The method name. Must be 'tasks/pushNotificationConfig/delete'.
|
|
943
|
-
*/
|
|
944
|
-
method: "tasks/pushNotificationConfig/delete";
|
|
945
|
-
params: DeleteTaskPushNotificationConfigParams;
|
|
946
|
-
}
|
|
947
|
-
/**
|
|
948
|
-
* The parameters identifying the push notification configuration to delete.
|
|
949
|
-
*/
|
|
950
|
-
interface DeleteTaskPushNotificationConfigParams {
|
|
951
|
-
/**
|
|
952
|
-
* The unique identifier of the task.
|
|
953
|
-
*/
|
|
954
|
-
id: string;
|
|
955
|
-
/**
|
|
956
|
-
* Optional metadata associated with the request.
|
|
957
|
-
*/
|
|
958
|
-
metadata?: {
|
|
959
|
-
[k: string]: unknown;
|
|
960
|
-
};
|
|
961
|
-
/**
|
|
962
|
-
* The ID of the push notification configuration to delete.
|
|
963
|
-
*/
|
|
964
|
-
pushNotificationConfigId: string;
|
|
965
|
-
}
|
|
966
|
-
/**
|
|
967
|
-
* Represents a JSON-RPC request for the `agent/getAuthenticatedExtendedCard` method.
|
|
968
|
-
*
|
|
969
|
-
* This interface was referenced by `MySchema`'s JSON-Schema
|
|
970
|
-
* via the `definition` "GetAuthenticatedExtendedCardRequest".
|
|
971
|
-
*/
|
|
972
|
-
interface GetAuthenticatedExtendedCardRequest {
|
|
973
|
-
/**
|
|
974
|
-
* The identifier for this request.
|
|
975
|
-
*/
|
|
976
|
-
id: string | number;
|
|
977
|
-
/**
|
|
978
|
-
* The version of the JSON-RPC protocol. MUST be exactly "2.0".
|
|
979
|
-
*/
|
|
980
|
-
jsonrpc: "2.0";
|
|
981
|
-
/**
|
|
982
|
-
* The method name. Must be 'agent/getAuthenticatedExtendedCard'.
|
|
983
|
-
*/
|
|
984
|
-
method: "agent/getAuthenticatedExtendedCard";
|
|
985
|
-
}
|
|
986
|
-
/**
|
|
987
|
-
* Defines a security scheme using an API key.
|
|
988
|
-
*
|
|
989
|
-
* This interface was referenced by `MySchema`'s JSON-Schema
|
|
990
|
-
* via the `definition` "APIKeySecurityScheme".
|
|
991
|
-
*/
|
|
992
|
-
interface APIKeySecurityScheme {
|
|
993
|
-
/**
|
|
994
|
-
* An optional description for the security scheme.
|
|
995
|
-
*/
|
|
996
|
-
description?: string;
|
|
997
|
-
/**
|
|
998
|
-
* The location of the API key.
|
|
999
|
-
*/
|
|
1000
|
-
in: "cookie" | "header" | "query";
|
|
1001
|
-
/**
|
|
1002
|
-
* The name of the header, query, or cookie parameter to be used.
|
|
1003
|
-
*/
|
|
1004
|
-
name: string;
|
|
1005
|
-
/**
|
|
1006
|
-
* The type of the security scheme. Must be 'apiKey'.
|
|
1007
|
-
*/
|
|
1008
|
-
type: "apiKey";
|
|
1009
|
-
}
|
|
1010
|
-
/**
|
|
1011
|
-
* Defines optional capabilities supported by an agent.
|
|
1012
|
-
*
|
|
1013
|
-
* This interface was referenced by `MySchema`'s JSON-Schema
|
|
1014
|
-
* via the `definition` "AgentCapabilities".
|
|
1015
|
-
*/
|
|
1016
|
-
interface AgentCapabilities {
|
|
1017
|
-
/**
|
|
1018
|
-
* A list of protocol extensions supported by the agent.
|
|
1019
|
-
*/
|
|
1020
|
-
extensions?: AgentExtension[];
|
|
1021
|
-
/**
|
|
1022
|
-
* Indicates if the agent supports sending push notifications for asynchronous task updates.
|
|
1023
|
-
*/
|
|
1024
|
-
pushNotifications?: boolean;
|
|
1025
|
-
/**
|
|
1026
|
-
* Indicates if the agent provides a history of state transitions for a task.
|
|
1027
|
-
*/
|
|
1028
|
-
stateTransitionHistory?: boolean;
|
|
1029
|
-
/**
|
|
1030
|
-
* Indicates if the agent supports Server-Sent Events (SSE) for streaming responses.
|
|
1031
|
-
*/
|
|
1032
|
-
streaming?: boolean;
|
|
1033
|
-
}
|
|
1034
|
-
/**
|
|
1035
|
-
* A declaration of a protocol extension supported by an Agent.
|
|
1036
|
-
*
|
|
1037
|
-
* This interface was referenced by `MySchema`'s JSON-Schema
|
|
1038
|
-
* via the `definition` "AgentExtension".
|
|
1039
|
-
*/
|
|
1040
|
-
interface AgentExtension {
|
|
1041
|
-
/**
|
|
1042
|
-
* A human-readable description of how this agent uses the extension.
|
|
1043
|
-
*/
|
|
1044
|
-
description?: string;
|
|
1045
|
-
/**
|
|
1046
|
-
* Optional, extension-specific configuration parameters.
|
|
1047
|
-
*/
|
|
1048
|
-
params?: {
|
|
1049
|
-
[k: string]: unknown;
|
|
1050
|
-
};
|
|
1051
|
-
/**
|
|
1052
|
-
* If true, the client must understand and comply with the extension's requirements
|
|
1053
|
-
* to interact with the agent.
|
|
1054
|
-
*/
|
|
1055
|
-
required?: boolean;
|
|
1056
|
-
/**
|
|
1057
|
-
* The unique URI identifying the extension.
|
|
1058
|
-
*/
|
|
1059
|
-
uri: string;
|
|
1060
|
-
}
|
|
1061
|
-
/**
|
|
1062
|
-
* The AgentCard is a self-describing manifest for an agent. It provides essential
|
|
1063
|
-
* metadata including the agent's identity, capabilities, skills, supported
|
|
1064
|
-
* communication methods, and security requirements.
|
|
1065
|
-
*
|
|
1066
|
-
* This interface was referenced by `MySchema`'s JSON-Schema
|
|
1067
|
-
* via the `definition` "AgentCard".
|
|
1068
|
-
*/
|
|
1069
|
-
interface AgentCard {
|
|
1070
|
-
/**
|
|
1071
|
-
* A list of additional supported interfaces (transport and URL combinations).
|
|
1072
|
-
* This allows agents to expose multiple transports, potentially at different URLs.
|
|
1073
|
-
*
|
|
1074
|
-
* Best practices:
|
|
1075
|
-
* - SHOULD include all supported transports for completeness
|
|
1076
|
-
* - SHOULD include an entry matching the main 'url' and 'preferredTransport'
|
|
1077
|
-
* - MAY reuse URLs if multiple transports are available at the same endpoint
|
|
1078
|
-
* - MUST accurately declare the transport available at each URL
|
|
1079
|
-
*
|
|
1080
|
-
* Clients can select any interface from this list based on their transport capabilities
|
|
1081
|
-
* and preferences. This enables transport negotiation and fallback scenarios.
|
|
1082
|
-
*/
|
|
1083
|
-
additionalInterfaces?: AgentInterface[];
|
|
1084
|
-
capabilities: AgentCapabilities1;
|
|
1085
|
-
/**
|
|
1086
|
-
* Default set of supported input MIME types for all skills, which can be
|
|
1087
|
-
* overridden on a per-skill basis.
|
|
1088
|
-
*/
|
|
1089
|
-
defaultInputModes: string[];
|
|
1090
|
-
/**
|
|
1091
|
-
* Default set of supported output MIME types for all skills, which can be
|
|
1092
|
-
* overridden on a per-skill basis.
|
|
1093
|
-
*/
|
|
1094
|
-
defaultOutputModes: string[];
|
|
1095
|
-
/**
|
|
1096
|
-
* A human-readable description of the agent, assisting users and other agents
|
|
1097
|
-
* in understanding its purpose.
|
|
1098
|
-
*/
|
|
1099
|
-
description: string;
|
|
1100
|
-
/**
|
|
1101
|
-
* An optional URL to the agent's documentation.
|
|
1102
|
-
*/
|
|
1103
|
-
documentationUrl?: string;
|
|
1104
|
-
/**
|
|
1105
|
-
* An optional URL to an icon for the agent.
|
|
1106
|
-
*/
|
|
1107
|
-
iconUrl?: string;
|
|
1108
|
-
/**
|
|
1109
|
-
* A human-readable name for the agent.
|
|
1110
|
-
*/
|
|
1111
|
-
name: string;
|
|
1112
|
-
/**
|
|
1113
|
-
* The transport protocol for the preferred endpoint (the main 'url' field).
|
|
1114
|
-
* If not specified, defaults to 'JSONRPC'.
|
|
1115
|
-
*
|
|
1116
|
-
* IMPORTANT: The transport specified here MUST be available at the main 'url'.
|
|
1117
|
-
* This creates a binding between the main URL and its supported transport protocol.
|
|
1118
|
-
* Clients should prefer this transport and URL combination when both are supported.
|
|
1119
|
-
*/
|
|
1120
|
-
preferredTransport?: string;
|
|
1121
|
-
/**
|
|
1122
|
-
* The version of the A2A protocol this agent supports.
|
|
1123
|
-
*/
|
|
1124
|
-
protocolVersion: string;
|
|
1125
|
-
provider?: AgentProvider;
|
|
1126
|
-
/**
|
|
1127
|
-
* A list of security requirement objects that apply to all agent interactions. Each object
|
|
1128
|
-
* lists security schemes that can be used. Follows the OpenAPI 3.0 Security Requirement Object.
|
|
1129
|
-
* This list can be seen as an OR of ANDs. Each object in the list describes one possible
|
|
1130
|
-
* set of security requirements that must be present on a request. This allows specifying,
|
|
1131
|
-
* for example, "callers must either use OAuth OR an API Key AND mTLS."
|
|
1132
|
-
*/
|
|
1133
|
-
security?: {
|
|
1134
|
-
[k: string]: string[];
|
|
1135
|
-
}[];
|
|
1136
|
-
/**
|
|
1137
|
-
* A declaration of the security schemes available to authorize requests. The key is the
|
|
1138
|
-
* scheme name. Follows the OpenAPI 3.0 Security Scheme Object.
|
|
1139
|
-
*/
|
|
1140
|
-
securitySchemes?: {
|
|
1141
|
-
[k: string]: SecurityScheme;
|
|
1142
|
-
};
|
|
1143
|
-
/**
|
|
1144
|
-
* JSON Web Signatures computed for this AgentCard.
|
|
1145
|
-
*/
|
|
1146
|
-
signatures?: AgentCardSignature[];
|
|
1147
|
-
/**
|
|
1148
|
-
* The set of skills, or distinct capabilities, that the agent can perform.
|
|
1149
|
-
*/
|
|
1150
|
-
skills: AgentSkill[];
|
|
1151
|
-
/**
|
|
1152
|
-
* If true, the agent can provide an extended agent card with additional details
|
|
1153
|
-
* to authenticated users. Defaults to false.
|
|
1154
|
-
*/
|
|
1155
|
-
supportsAuthenticatedExtendedCard?: boolean;
|
|
1156
|
-
/**
|
|
1157
|
-
* The preferred endpoint URL for interacting with the agent.
|
|
1158
|
-
* This URL MUST support the transport specified by 'preferredTransport'.
|
|
1159
|
-
*/
|
|
1160
|
-
url: string;
|
|
1161
|
-
/**
|
|
1162
|
-
* The agent's own version number. The format is defined by the provider.
|
|
1163
|
-
*/
|
|
1164
|
-
version: string;
|
|
1165
|
-
}
|
|
1166
|
-
/**
|
|
1167
|
-
* Declares a combination of a target URL and a transport protocol for interacting with the agent.
|
|
1168
|
-
* This allows agents to expose the same functionality over multiple transport mechanisms.
|
|
1169
|
-
*
|
|
1170
|
-
* This interface was referenced by `MySchema`'s JSON-Schema
|
|
1171
|
-
* via the `definition` "AgentInterface".
|
|
1172
|
-
*/
|
|
1173
|
-
interface AgentInterface {
|
|
1174
|
-
/**
|
|
1175
|
-
* The transport protocol supported at this URL.
|
|
1176
|
-
*/
|
|
1177
|
-
transport: string;
|
|
1178
|
-
/**
|
|
1179
|
-
* The URL where this interface is available. Must be a valid absolute HTTPS URL in production.
|
|
1180
|
-
*/
|
|
1181
|
-
url: string;
|
|
1182
|
-
}
|
|
1183
|
-
/**
|
|
1184
|
-
* A declaration of optional capabilities supported by the agent.
|
|
1185
|
-
*/
|
|
1186
|
-
interface AgentCapabilities1 {
|
|
1187
|
-
/**
|
|
1188
|
-
* A list of protocol extensions supported by the agent.
|
|
1189
|
-
*/
|
|
1190
|
-
extensions?: AgentExtension[];
|
|
1191
|
-
/**
|
|
1192
|
-
* Indicates if the agent supports sending push notifications for asynchronous task updates.
|
|
1193
|
-
*/
|
|
1194
|
-
pushNotifications?: boolean;
|
|
1195
|
-
/**
|
|
1196
|
-
* Indicates if the agent provides a history of state transitions for a task.
|
|
1197
|
-
*/
|
|
1198
|
-
stateTransitionHistory?: boolean;
|
|
1199
|
-
/**
|
|
1200
|
-
* Indicates if the agent supports Server-Sent Events (SSE) for streaming responses.
|
|
1201
|
-
*/
|
|
1202
|
-
streaming?: boolean;
|
|
1203
|
-
}
|
|
1204
|
-
/**
|
|
1205
|
-
* Information about the agent's service provider.
|
|
1206
|
-
*/
|
|
1207
|
-
interface AgentProvider {
|
|
1208
|
-
/**
|
|
1209
|
-
* The name of the agent provider's organization.
|
|
1210
|
-
*/
|
|
1211
|
-
organization: string;
|
|
1212
|
-
/**
|
|
1213
|
-
* A URL for the agent provider's website or relevant documentation.
|
|
1214
|
-
*/
|
|
1215
|
-
url: string;
|
|
1216
|
-
}
|
|
1217
|
-
/**
|
|
1218
|
-
* Defines a security scheme using HTTP authentication.
|
|
1219
|
-
*
|
|
1220
|
-
* This interface was referenced by `MySchema`'s JSON-Schema
|
|
1221
|
-
* via the `definition` "HTTPAuthSecurityScheme".
|
|
1222
|
-
*/
|
|
1223
|
-
interface HTTPAuthSecurityScheme {
|
|
1224
|
-
/**
|
|
1225
|
-
* A hint to the client to identify how the bearer token is formatted (e.g., "JWT").
|
|
1226
|
-
* This is primarily for documentation purposes.
|
|
1227
|
-
*/
|
|
1228
|
-
bearerFormat?: string;
|
|
1229
|
-
/**
|
|
1230
|
-
* An optional description for the security scheme.
|
|
1231
|
-
*/
|
|
1232
|
-
description?: string;
|
|
1233
|
-
/**
|
|
1234
|
-
* The name of the HTTP Authentication scheme to be used in the Authorization header,
|
|
1235
|
-
* as defined in RFC7235 (e.g., "Bearer").
|
|
1236
|
-
* This value should be registered in the IANA Authentication Scheme registry.
|
|
1237
|
-
*/
|
|
1238
|
-
scheme: string;
|
|
1239
|
-
/**
|
|
1240
|
-
* The type of the security scheme. Must be 'http'.
|
|
1241
|
-
*/
|
|
1242
|
-
type: "http";
|
|
1243
|
-
}
|
|
1244
|
-
/**
|
|
1245
|
-
* Defines a security scheme using OAuth 2.0.
|
|
1246
|
-
*
|
|
1247
|
-
* This interface was referenced by `MySchema`'s JSON-Schema
|
|
1248
|
-
* via the `definition` "OAuth2SecurityScheme".
|
|
1249
|
-
*/
|
|
1250
|
-
interface OAuth2SecurityScheme {
|
|
1251
|
-
/**
|
|
1252
|
-
* An optional description for the security scheme.
|
|
1253
|
-
*/
|
|
1254
|
-
description?: string;
|
|
1255
|
-
flows: OAuthFlows;
|
|
1256
|
-
/**
|
|
1257
|
-
* URL to the oauth2 authorization server metadata
|
|
1258
|
-
* [RFC8414](https://datatracker.ietf.org/doc/html/rfc8414). TLS is required.
|
|
1259
|
-
*/
|
|
1260
|
-
oauth2MetadataUrl?: string;
|
|
1261
|
-
/**
|
|
1262
|
-
* The type of the security scheme. Must be 'oauth2'.
|
|
1263
|
-
*/
|
|
1264
|
-
type: "oauth2";
|
|
1265
|
-
}
|
|
1266
|
-
/**
|
|
1267
|
-
* An object containing configuration information for the supported OAuth 2.0 flows.
|
|
1268
|
-
*/
|
|
1269
|
-
interface OAuthFlows {
|
|
1270
|
-
authorizationCode?: AuthorizationCodeOAuthFlow;
|
|
1271
|
-
clientCredentials?: ClientCredentialsOAuthFlow;
|
|
1272
|
-
implicit?: ImplicitOAuthFlow;
|
|
1273
|
-
password?: PasswordOAuthFlow;
|
|
1274
|
-
}
|
|
1275
|
-
/**
|
|
1276
|
-
* Configuration for the OAuth Authorization Code flow. Previously called accessCode in OpenAPI 2.0.
|
|
1277
|
-
*/
|
|
1278
|
-
interface AuthorizationCodeOAuthFlow {
|
|
1279
|
-
/**
|
|
1280
|
-
* The authorization URL to be used for this flow.
|
|
1281
|
-
* This MUST be a URL and use TLS.
|
|
1282
|
-
*/
|
|
1283
|
-
authorizationUrl: string;
|
|
1284
|
-
/**
|
|
1285
|
-
* The URL to be used for obtaining refresh tokens.
|
|
1286
|
-
* This MUST be a URL and use TLS.
|
|
1287
|
-
*/
|
|
1288
|
-
refreshUrl?: string;
|
|
1289
|
-
/**
|
|
1290
|
-
* The available scopes for the OAuth2 security scheme. A map between the scope
|
|
1291
|
-
* name and a short description for it.
|
|
1292
|
-
*/
|
|
1293
|
-
scopes: {
|
|
1294
|
-
[k: string]: string;
|
|
1295
|
-
};
|
|
1296
|
-
/**
|
|
1297
|
-
* The token URL to be used for this flow.
|
|
1298
|
-
* This MUST be a URL and use TLS.
|
|
1299
|
-
*/
|
|
1300
|
-
tokenUrl: string;
|
|
1301
|
-
}
|
|
1302
|
-
/**
|
|
1303
|
-
* Configuration for the OAuth Client Credentials flow. Previously called application in OpenAPI 2.0.
|
|
1304
|
-
*/
|
|
1305
|
-
interface ClientCredentialsOAuthFlow {
|
|
1306
|
-
/**
|
|
1307
|
-
* The URL to be used for obtaining refresh tokens. This MUST be a URL.
|
|
1308
|
-
*/
|
|
1309
|
-
refreshUrl?: string;
|
|
1310
|
-
/**
|
|
1311
|
-
* The available scopes for the OAuth2 security scheme. A map between the scope
|
|
1312
|
-
* name and a short description for it.
|
|
1313
|
-
*/
|
|
1314
|
-
scopes: {
|
|
1315
|
-
[k: string]: string;
|
|
1316
|
-
};
|
|
1317
|
-
/**
|
|
1318
|
-
* The token URL to be used for this flow. This MUST be a URL.
|
|
1319
|
-
*/
|
|
1320
|
-
tokenUrl: string;
|
|
1321
|
-
}
|
|
1322
|
-
/**
|
|
1323
|
-
* Configuration for the OAuth Implicit flow.
|
|
1324
|
-
*/
|
|
1325
|
-
interface ImplicitOAuthFlow {
|
|
1326
|
-
/**
|
|
1327
|
-
* The authorization URL to be used for this flow. This MUST be a URL.
|
|
1328
|
-
*/
|
|
1329
|
-
authorizationUrl: string;
|
|
1330
|
-
/**
|
|
1331
|
-
* The URL to be used for obtaining refresh tokens. This MUST be a URL.
|
|
1332
|
-
*/
|
|
1333
|
-
refreshUrl?: string;
|
|
1334
|
-
/**
|
|
1335
|
-
* The available scopes for the OAuth2 security scheme. A map between the scope
|
|
1336
|
-
* name and a short description for it.
|
|
1337
|
-
*/
|
|
1338
|
-
scopes: {
|
|
1339
|
-
[k: string]: string;
|
|
1340
|
-
};
|
|
1341
|
-
}
|
|
1342
|
-
/**
|
|
1343
|
-
* Configuration for the OAuth Resource Owner Password flow.
|
|
1344
|
-
*/
|
|
1345
|
-
interface PasswordOAuthFlow {
|
|
1346
|
-
/**
|
|
1347
|
-
* The URL to be used for obtaining refresh tokens. This MUST be a URL.
|
|
1348
|
-
*/
|
|
1349
|
-
refreshUrl?: string;
|
|
1350
|
-
/**
|
|
1351
|
-
* The available scopes for the OAuth2 security scheme. A map between the scope
|
|
1352
|
-
* name and a short description for it.
|
|
1353
|
-
*/
|
|
1354
|
-
scopes: {
|
|
1355
|
-
[k: string]: string;
|
|
1356
|
-
};
|
|
1357
|
-
/**
|
|
1358
|
-
* The token URL to be used for this flow. This MUST be a URL.
|
|
1359
|
-
*/
|
|
1360
|
-
tokenUrl: string;
|
|
1361
|
-
}
|
|
1362
|
-
/**
|
|
1363
|
-
* Defines a security scheme using OpenID Connect.
|
|
1364
|
-
*
|
|
1365
|
-
* This interface was referenced by `MySchema`'s JSON-Schema
|
|
1366
|
-
* via the `definition` "OpenIdConnectSecurityScheme".
|
|
1367
|
-
*/
|
|
1368
|
-
interface OpenIdConnectSecurityScheme {
|
|
1369
|
-
/**
|
|
1370
|
-
* An optional description for the security scheme.
|
|
1371
|
-
*/
|
|
1372
|
-
description?: string;
|
|
1373
|
-
/**
|
|
1374
|
-
* The OpenID Connect Discovery URL for the OIDC provider's metadata.
|
|
1375
|
-
*/
|
|
1376
|
-
openIdConnectUrl: string;
|
|
1377
|
-
/**
|
|
1378
|
-
* The type of the security scheme. Must be 'openIdConnect'.
|
|
1379
|
-
*/
|
|
1380
|
-
type: "openIdConnect";
|
|
1381
|
-
}
|
|
1382
|
-
/**
|
|
1383
|
-
* Defines a security scheme using mTLS authentication.
|
|
1384
|
-
*
|
|
1385
|
-
* This interface was referenced by `MySchema`'s JSON-Schema
|
|
1386
|
-
* via the `definition` "MutualTLSSecurityScheme".
|
|
1387
|
-
*/
|
|
1388
|
-
interface MutualTLSSecurityScheme {
|
|
1389
|
-
/**
|
|
1390
|
-
* An optional description for the security scheme.
|
|
1391
|
-
*/
|
|
1392
|
-
description?: string;
|
|
1393
|
-
/**
|
|
1394
|
-
* The type of the security scheme. Must be 'mutualTLS'.
|
|
1395
|
-
*/
|
|
1396
|
-
type: "mutualTLS";
|
|
1397
|
-
}
|
|
1398
|
-
/**
|
|
1399
|
-
* AgentCardSignature represents a JWS signature of an AgentCard.
|
|
1400
|
-
* This follows the JSON format of an RFC 7515 JSON Web Signature (JWS).
|
|
1401
|
-
*
|
|
1402
|
-
* This interface was referenced by `MySchema`'s JSON-Schema
|
|
1403
|
-
* via the `definition` "AgentCardSignature".
|
|
1404
|
-
*/
|
|
1405
|
-
interface AgentCardSignature {
|
|
1406
|
-
/**
|
|
1407
|
-
* The unprotected JWS header values.
|
|
1408
|
-
*/
|
|
1409
|
-
header?: {
|
|
1410
|
-
[k: string]: unknown;
|
|
1411
|
-
};
|
|
1412
|
-
/**
|
|
1413
|
-
* The protected JWS header for the signature. This is a Base64url-encoded
|
|
1414
|
-
* JSON object, as per RFC 7515.
|
|
1415
|
-
*/
|
|
1416
|
-
protected: string;
|
|
1417
|
-
/**
|
|
1418
|
-
* The computed signature, Base64url-encoded.
|
|
1419
|
-
*/
|
|
1420
|
-
signature: string;
|
|
1421
|
-
}
|
|
1422
|
-
/**
|
|
1423
|
-
* Represents a distinct capability or function that an agent can perform.
|
|
1424
|
-
*
|
|
1425
|
-
* This interface was referenced by `MySchema`'s JSON-Schema
|
|
1426
|
-
* via the `definition` "AgentSkill".
|
|
1427
|
-
*/
|
|
1428
|
-
interface AgentSkill {
|
|
1429
|
-
/**
|
|
1430
|
-
* A detailed description of the skill, intended to help clients or users
|
|
1431
|
-
* understand its purpose and functionality.
|
|
1432
|
-
*/
|
|
1433
|
-
description: string;
|
|
1434
|
-
/**
|
|
1435
|
-
* Example prompts or scenarios that this skill can handle. Provides a hint to
|
|
1436
|
-
* the client on how to use the skill.
|
|
1437
|
-
*/
|
|
1438
|
-
examples?: string[];
|
|
1439
|
-
/**
|
|
1440
|
-
* A unique identifier for the agent's skill.
|
|
1441
|
-
*/
|
|
1442
|
-
id: string;
|
|
1443
|
-
/**
|
|
1444
|
-
* The set of supported input MIME types for this skill, overriding the agent's defaults.
|
|
1445
|
-
*/
|
|
1446
|
-
inputModes?: string[];
|
|
1447
|
-
/**
|
|
1448
|
-
* A human-readable name for the skill.
|
|
1449
|
-
*/
|
|
1450
|
-
name: string;
|
|
1451
|
-
/**
|
|
1452
|
-
* The set of supported output MIME types for this skill, overriding the agent's defaults.
|
|
1453
|
-
*/
|
|
1454
|
-
outputModes?: string[];
|
|
1455
|
-
/**
|
|
1456
|
-
* Security schemes necessary for the agent to leverage this skill.
|
|
1457
|
-
* As in the overall AgentCard.security, this list represents a logical OR of security
|
|
1458
|
-
* requirement objects. Each object is a set of security schemes that must be used together
|
|
1459
|
-
* (a logical AND).
|
|
1460
|
-
*/
|
|
1461
|
-
security?: {
|
|
1462
|
-
[k: string]: string[];
|
|
1463
|
-
}[];
|
|
1464
|
-
/**
|
|
1465
|
-
* A set of keywords describing the skill's capabilities.
|
|
1466
|
-
*/
|
|
1467
|
-
tags: string[];
|
|
1468
|
-
}
|
|
1469
|
-
/**
|
|
1470
|
-
* Represents the service provider of an agent.
|
|
1471
|
-
*
|
|
1472
|
-
* This interface was referenced by `MySchema`'s JSON-Schema
|
|
1473
|
-
* via the `definition` "AgentProvider".
|
|
1474
|
-
*/
|
|
1475
|
-
interface AgentProvider1 {
|
|
1476
|
-
/**
|
|
1477
|
-
* The name of the agent provider's organization.
|
|
1478
|
-
*/
|
|
1479
|
-
organization: string;
|
|
1480
|
-
/**
|
|
1481
|
-
* A URL for the agent provider's website or relevant documentation.
|
|
1482
|
-
*/
|
|
1483
|
-
url: string;
|
|
1484
|
-
}
|
|
1485
|
-
/**
|
|
1486
|
-
* Represents a file, data structure, or other resource generated by an agent during a task.
|
|
1487
|
-
*
|
|
1488
|
-
* This interface was referenced by `MySchema`'s JSON-Schema
|
|
1489
|
-
* via the `definition` "Artifact".
|
|
1490
|
-
*/
|
|
1491
|
-
interface Artifact {
|
|
1492
|
-
/**
|
|
1493
|
-
* A unique identifier for the artifact within the scope of the task.
|
|
1494
|
-
*/
|
|
1495
|
-
artifactId: string;
|
|
1496
|
-
/**
|
|
1497
|
-
* An optional, human-readable description of the artifact.
|
|
1498
|
-
*/
|
|
1499
|
-
description?: string;
|
|
1500
|
-
/**
|
|
1501
|
-
* The URIs of extensions that are relevant to this artifact.
|
|
1502
|
-
*/
|
|
1503
|
-
extensions?: string[];
|
|
1504
|
-
/**
|
|
1505
|
-
* Optional metadata for extensions. The key is an extension-specific identifier.
|
|
1506
|
-
*/
|
|
1507
|
-
metadata?: {
|
|
1508
|
-
[k: string]: unknown;
|
|
1509
|
-
};
|
|
1510
|
-
/**
|
|
1511
|
-
* An optional, human-readable name for the artifact.
|
|
1512
|
-
*/
|
|
1513
|
-
name?: string;
|
|
1514
|
-
/**
|
|
1515
|
-
* An array of content parts that make up the artifact.
|
|
1516
|
-
*/
|
|
1517
|
-
parts: Part[];
|
|
1518
|
-
}
|
|
1519
|
-
/**
|
|
1520
|
-
* Defines configuration details for the OAuth 2.0 Authorization Code flow.
|
|
1521
|
-
*
|
|
1522
|
-
* This interface was referenced by `MySchema`'s JSON-Schema
|
|
1523
|
-
* via the `definition` "AuthorizationCodeOAuthFlow".
|
|
1524
|
-
*/
|
|
1525
|
-
interface AuthorizationCodeOAuthFlow1 {
|
|
1526
|
-
/**
|
|
1527
|
-
* The authorization URL to be used for this flow.
|
|
1528
|
-
* This MUST be a URL and use TLS.
|
|
1529
|
-
*/
|
|
1530
|
-
authorizationUrl: string;
|
|
1531
|
-
/**
|
|
1532
|
-
* The URL to be used for obtaining refresh tokens.
|
|
1533
|
-
* This MUST be a URL and use TLS.
|
|
1534
|
-
*/
|
|
1535
|
-
refreshUrl?: string;
|
|
1536
|
-
/**
|
|
1537
|
-
* The available scopes for the OAuth2 security scheme. A map between the scope
|
|
1538
|
-
* name and a short description for it.
|
|
1539
|
-
*/
|
|
1540
|
-
scopes: {
|
|
1541
|
-
[k: string]: string;
|
|
1542
|
-
};
|
|
1543
|
-
/**
|
|
1544
|
-
* The token URL to be used for this flow.
|
|
1545
|
-
* This MUST be a URL and use TLS.
|
|
1546
|
-
*/
|
|
1547
|
-
tokenUrl: string;
|
|
1548
|
-
}
|
|
1549
|
-
/**
|
|
1550
|
-
* Represents a JSON-RPC 2.0 Error Response object.
|
|
1551
|
-
*
|
|
1552
|
-
* This interface was referenced by `MySchema`'s JSON-Schema
|
|
1553
|
-
* via the `definition` "JSONRPCErrorResponse".
|
|
1554
|
-
*/
|
|
1555
|
-
interface JSONRPCErrorResponse {
|
|
1556
|
-
/**
|
|
1557
|
-
* An object describing the error that occurred.
|
|
1558
|
-
*/
|
|
1559
|
-
error: JSONRPCError | JSONParseError | InvalidRequestError | MethodNotFoundError | InvalidParamsError | InternalError | TaskNotFoundError | TaskNotCancelableError | PushNotificationNotSupportedError | UnsupportedOperationError | ContentTypeNotSupportedError | InvalidAgentResponseError | AuthenticatedExtendedCardNotConfiguredError;
|
|
1560
|
-
/**
|
|
1561
|
-
* The identifier established by the client.
|
|
1562
|
-
*/
|
|
1563
|
-
id: string | number | null;
|
|
1564
|
-
/**
|
|
1565
|
-
* The version of the JSON-RPC protocol. MUST be exactly "2.0".
|
|
1566
|
-
*/
|
|
1567
|
-
jsonrpc: "2.0";
|
|
1568
|
-
}
|
|
1569
|
-
/**
|
|
1570
|
-
* Represents a JSON-RPC 2.0 Error object, included in an error response.
|
|
1571
|
-
*
|
|
1572
|
-
* This interface was referenced by `MySchema`'s JSON-Schema
|
|
1573
|
-
* via the `definition` "JSONRPCError".
|
|
1574
|
-
*/
|
|
1575
|
-
interface JSONRPCError {
|
|
1576
|
-
/**
|
|
1577
|
-
* A number that indicates the error type that occurred.
|
|
1578
|
-
*/
|
|
1579
|
-
code: number;
|
|
1580
|
-
/**
|
|
1581
|
-
* A primitive or structured value containing additional information about the error.
|
|
1582
|
-
* This may be omitted.
|
|
1583
|
-
*/
|
|
1584
|
-
data?: {
|
|
1585
|
-
[k: string]: unknown;
|
|
1586
|
-
};
|
|
1587
|
-
/**
|
|
1588
|
-
* A string providing a short description of the error.
|
|
1589
|
-
*/
|
|
1590
|
-
message: string;
|
|
1591
|
-
}
|
|
1592
|
-
/**
|
|
1593
|
-
* Represents a successful JSON-RPC response for the `tasks/cancel` method.
|
|
1594
|
-
*
|
|
1595
|
-
* This interface was referenced by `MySchema`'s JSON-Schema
|
|
1596
|
-
* via the `definition` "CancelTaskSuccessResponse".
|
|
1597
|
-
*/
|
|
1598
|
-
interface CancelTaskSuccessResponse {
|
|
1599
|
-
/**
|
|
1600
|
-
* The identifier established by the client.
|
|
1601
|
-
*/
|
|
1602
|
-
id: string | number | null;
|
|
1603
|
-
/**
|
|
1604
|
-
* The version of the JSON-RPC protocol. MUST be exactly "2.0".
|
|
1605
|
-
*/
|
|
1606
|
-
jsonrpc: "2.0";
|
|
1607
|
-
result: Task;
|
|
1608
|
-
}
|
|
1609
|
-
/**
|
|
1610
|
-
* The result, containing the final state of the canceled Task object.
|
|
1611
|
-
*/
|
|
1612
|
-
interface Task {
|
|
1613
|
-
/**
|
|
1614
|
-
* A collection of artifacts generated by the agent during the execution of the task.
|
|
1615
|
-
*/
|
|
1616
|
-
artifacts?: Artifact[];
|
|
1617
|
-
/**
|
|
1618
|
-
* A server-generated identifier for maintaining context across multiple related tasks or interactions.
|
|
1619
|
-
*/
|
|
1620
|
-
contextId: string;
|
|
1621
|
-
/**
|
|
1622
|
-
* An array of messages exchanged during the task, representing the conversation history.
|
|
1623
|
-
*/
|
|
1624
|
-
history?: Message1[];
|
|
1625
|
-
/**
|
|
1626
|
-
* A unique identifier for the task, generated by the server for a new task.
|
|
1627
|
-
*/
|
|
1628
|
-
id: string;
|
|
1629
|
-
/**
|
|
1630
|
-
* The type of this object, used as a discriminator. Always 'task' for a Task.
|
|
1631
|
-
*/
|
|
1632
|
-
kind: "task";
|
|
1633
|
-
/**
|
|
1634
|
-
* Optional metadata for extensions. The key is an extension-specific identifier.
|
|
1635
|
-
*/
|
|
1636
|
-
metadata?: {
|
|
1637
|
-
[k: string]: unknown;
|
|
1638
|
-
};
|
|
1639
|
-
status: TaskStatus;
|
|
1640
|
-
}
|
|
1641
|
-
/**
|
|
1642
|
-
* Represents a single message in the conversation between a user and an agent.
|
|
1643
|
-
*
|
|
1644
|
-
* This interface was referenced by `MySchema`'s JSON-Schema
|
|
1645
|
-
* via the `definition` "Message".
|
|
1646
|
-
*/
|
|
1647
|
-
interface Message1 {
|
|
1648
|
-
/**
|
|
1649
|
-
* The context identifier for this message, used to group related interactions.
|
|
1650
|
-
*/
|
|
1651
|
-
contextId?: string;
|
|
1652
|
-
/**
|
|
1653
|
-
* The URIs of extensions that are relevant to this message.
|
|
1654
|
-
*/
|
|
1655
|
-
extensions?: string[];
|
|
1656
|
-
/**
|
|
1657
|
-
* The type of this object, used as a discriminator. Always 'message' for a Message.
|
|
1658
|
-
*/
|
|
1659
|
-
kind: "message";
|
|
1660
|
-
/**
|
|
1661
|
-
* A unique identifier for the message, typically a UUID, generated by the sender.
|
|
1662
|
-
*/
|
|
1663
|
-
messageId: string;
|
|
1664
|
-
/**
|
|
1665
|
-
* Optional metadata for extensions. The key is an extension-specific identifier.
|
|
1666
|
-
*/
|
|
1667
|
-
metadata?: {
|
|
1668
|
-
[k: string]: unknown;
|
|
1669
|
-
};
|
|
1670
|
-
/**
|
|
1671
|
-
* An array of content parts that form the message body. A message can be
|
|
1672
|
-
* composed of multiple parts of different types (e.g., text and files).
|
|
1673
|
-
*/
|
|
1674
|
-
parts: Part[];
|
|
1675
|
-
/**
|
|
1676
|
-
* A list of other task IDs that this message references for additional context.
|
|
1677
|
-
*/
|
|
1678
|
-
referenceTaskIds?: string[];
|
|
1679
|
-
/**
|
|
1680
|
-
* Identifies the sender of the message. `user` for the client, `agent` for the service.
|
|
1681
|
-
*/
|
|
1682
|
-
role: "agent" | "user";
|
|
1683
|
-
/**
|
|
1684
|
-
* The identifier of the task this message is part of. Can be omitted for the first message of a new task.
|
|
1685
|
-
*/
|
|
1686
|
-
taskId?: string;
|
|
1687
|
-
}
|
|
1688
|
-
/**
|
|
1689
|
-
* The current status of the task, including its state and a descriptive message.
|
|
1690
|
-
*/
|
|
1691
|
-
interface TaskStatus {
|
|
1692
|
-
message?: Message2;
|
|
1693
|
-
/**
|
|
1694
|
-
* The current state of the task's lifecycle.
|
|
1695
|
-
*/
|
|
1696
|
-
state: "submitted" | "working" | "input-required" | "completed" | "canceled" | "failed" | "rejected" | "auth-required" | "unknown";
|
|
1697
|
-
/**
|
|
1698
|
-
* An ISO 8601 datetime string indicating when this status was recorded.
|
|
1699
|
-
*/
|
|
1700
|
-
timestamp?: string;
|
|
1701
|
-
}
|
|
1702
|
-
/**
|
|
1703
|
-
* Represents a single message in the conversation between a user and an agent.
|
|
1704
|
-
*/
|
|
1705
|
-
interface Message2 {
|
|
1706
|
-
/**
|
|
1707
|
-
* The context identifier for this message, used to group related interactions.
|
|
1708
|
-
*/
|
|
1709
|
-
contextId?: string;
|
|
1710
|
-
/**
|
|
1711
|
-
* The URIs of extensions that are relevant to this message.
|
|
1712
|
-
*/
|
|
1713
|
-
extensions?: string[];
|
|
1714
|
-
/**
|
|
1715
|
-
* The type of this object, used as a discriminator. Always 'message' for a Message.
|
|
1716
|
-
*/
|
|
1717
|
-
kind: "message";
|
|
1718
|
-
/**
|
|
1719
|
-
* A unique identifier for the message, typically a UUID, generated by the sender.
|
|
1720
|
-
*/
|
|
1721
|
-
messageId: string;
|
|
1722
|
-
/**
|
|
1723
|
-
* Optional metadata for extensions. The key is an extension-specific identifier.
|
|
1724
|
-
*/
|
|
1725
|
-
metadata?: {
|
|
1726
|
-
[k: string]: unknown;
|
|
1727
|
-
};
|
|
1728
|
-
/**
|
|
1729
|
-
* An array of content parts that form the message body. A message can be
|
|
1730
|
-
* composed of multiple parts of different types (e.g., text and files).
|
|
1731
|
-
*/
|
|
1732
|
-
parts: Part[];
|
|
1733
|
-
/**
|
|
1734
|
-
* A list of other task IDs that this message references for additional context.
|
|
1735
|
-
*/
|
|
1736
|
-
referenceTaskIds?: string[];
|
|
1737
|
-
/**
|
|
1738
|
-
* Identifies the sender of the message. `user` for the client, `agent` for the service.
|
|
1739
|
-
*/
|
|
1740
|
-
role: "agent" | "user";
|
|
1741
|
-
/**
|
|
1742
|
-
* The identifier of the task this message is part of. Can be omitted for the first message of a new task.
|
|
1743
|
-
*/
|
|
1744
|
-
taskId?: string;
|
|
1745
|
-
}
|
|
1746
|
-
/**
|
|
1747
|
-
* Defines configuration details for the OAuth 2.0 Client Credentials flow.
|
|
1748
|
-
*
|
|
1749
|
-
* This interface was referenced by `MySchema`'s JSON-Schema
|
|
1750
|
-
* via the `definition` "ClientCredentialsOAuthFlow".
|
|
1751
|
-
*/
|
|
1752
|
-
interface ClientCredentialsOAuthFlow1 {
|
|
1753
|
-
/**
|
|
1754
|
-
* The URL to be used for obtaining refresh tokens. This MUST be a URL.
|
|
1755
|
-
*/
|
|
1756
|
-
refreshUrl?: string;
|
|
1757
|
-
/**
|
|
1758
|
-
* The available scopes for the OAuth2 security scheme. A map between the scope
|
|
1759
|
-
* name and a short description for it.
|
|
1760
|
-
*/
|
|
1761
|
-
scopes: {
|
|
1762
|
-
[k: string]: string;
|
|
1763
|
-
};
|
|
1764
|
-
/**
|
|
1765
|
-
* The token URL to be used for this flow. This MUST be a URL.
|
|
1766
|
-
*/
|
|
1767
|
-
tokenUrl: string;
|
|
1768
|
-
}
|
|
1769
|
-
/**
|
|
1770
|
-
* Defines parameters for deleting a specific push notification configuration for a task.
|
|
1771
|
-
*
|
|
1772
|
-
* This interface was referenced by `MySchema`'s JSON-Schema
|
|
1773
|
-
* via the `definition` "DeleteTaskPushNotificationConfigParams".
|
|
1774
|
-
*/
|
|
1775
|
-
interface DeleteTaskPushNotificationConfigParams1 {
|
|
1776
|
-
/**
|
|
1777
|
-
* The unique identifier of the task.
|
|
1778
|
-
*/
|
|
1779
|
-
id: string;
|
|
1780
|
-
/**
|
|
1781
|
-
* Optional metadata associated with the request.
|
|
1782
|
-
*/
|
|
1783
|
-
metadata?: {
|
|
1784
|
-
[k: string]: unknown;
|
|
1785
|
-
};
|
|
1786
|
-
/**
|
|
1787
|
-
* The ID of the push notification configuration to delete.
|
|
1788
|
-
*/
|
|
1789
|
-
pushNotificationConfigId: string;
|
|
1790
|
-
}
|
|
1791
|
-
/**
|
|
1792
|
-
* Represents a successful JSON-RPC response for the `tasks/pushNotificationConfig/delete` method.
|
|
1793
|
-
*
|
|
1794
|
-
* This interface was referenced by `MySchema`'s JSON-Schema
|
|
1795
|
-
* via the `definition` "DeleteTaskPushNotificationConfigSuccessResponse".
|
|
1796
|
-
*/
|
|
1797
|
-
interface DeleteTaskPushNotificationConfigSuccessResponse {
|
|
1798
|
-
/**
|
|
1799
|
-
* The identifier established by the client.
|
|
1800
|
-
*/
|
|
1801
|
-
id: string | number | null;
|
|
1802
|
-
/**
|
|
1803
|
-
* The version of the JSON-RPC protocol. MUST be exactly "2.0".
|
|
1804
|
-
*/
|
|
1805
|
-
jsonrpc: "2.0";
|
|
1806
|
-
/**
|
|
1807
|
-
* The result is null on successful deletion.
|
|
1808
|
-
*/
|
|
1809
|
-
result: null;
|
|
1810
|
-
}
|
|
1811
|
-
/**
|
|
1812
|
-
* Defines base properties for a file.
|
|
1813
|
-
*
|
|
1814
|
-
* This interface was referenced by `MySchema`'s JSON-Schema
|
|
1815
|
-
* via the `definition` "FileBase".
|
|
1816
|
-
*/
|
|
1817
|
-
interface FileBase {
|
|
1818
|
-
/**
|
|
1819
|
-
* The MIME type of the file (e.g., "application/pdf").
|
|
1820
|
-
*/
|
|
1821
|
-
mimeType?: string;
|
|
1822
|
-
/**
|
|
1823
|
-
* An optional name for the file (e.g., "document.pdf").
|
|
1824
|
-
*/
|
|
1825
|
-
name?: string;
|
|
1826
|
-
}
|
|
1827
|
-
/**
|
|
1828
|
-
* Represents a successful JSON-RPC response for the `agent/getAuthenticatedExtendedCard` method.
|
|
1829
|
-
*
|
|
1830
|
-
* This interface was referenced by `MySchema`'s JSON-Schema
|
|
1831
|
-
* via the `definition` "GetAuthenticatedExtendedCardSuccessResponse".
|
|
1832
|
-
*/
|
|
1833
|
-
interface GetAuthenticatedExtendedCardSuccessResponse {
|
|
1834
|
-
/**
|
|
1835
|
-
* The identifier established by the client.
|
|
1836
|
-
*/
|
|
1837
|
-
id: string | number | null;
|
|
1838
|
-
/**
|
|
1839
|
-
* The version of the JSON-RPC protocol. MUST be exactly "2.0".
|
|
1840
|
-
*/
|
|
1841
|
-
jsonrpc: "2.0";
|
|
1842
|
-
result: AgentCard1;
|
|
1843
|
-
}
|
|
1844
|
-
/**
|
|
1845
|
-
* The result is an Agent Card object.
|
|
1846
|
-
*/
|
|
1847
|
-
interface AgentCard1 {
|
|
1848
|
-
/**
|
|
1849
|
-
* A list of additional supported interfaces (transport and URL combinations).
|
|
1850
|
-
* This allows agents to expose multiple transports, potentially at different URLs.
|
|
1851
|
-
*
|
|
1852
|
-
* Best practices:
|
|
1853
|
-
* - SHOULD include all supported transports for completeness
|
|
1854
|
-
* - SHOULD include an entry matching the main 'url' and 'preferredTransport'
|
|
1855
|
-
* - MAY reuse URLs if multiple transports are available at the same endpoint
|
|
1856
|
-
* - MUST accurately declare the transport available at each URL
|
|
1857
|
-
*
|
|
1858
|
-
* Clients can select any interface from this list based on their transport capabilities
|
|
1859
|
-
* and preferences. This enables transport negotiation and fallback scenarios.
|
|
1860
|
-
*/
|
|
1861
|
-
additionalInterfaces?: AgentInterface[];
|
|
1862
|
-
capabilities: AgentCapabilities1;
|
|
1863
|
-
/**
|
|
1864
|
-
* Default set of supported input MIME types for all skills, which can be
|
|
1865
|
-
* overridden on a per-skill basis.
|
|
1866
|
-
*/
|
|
1867
|
-
defaultInputModes: string[];
|
|
1868
|
-
/**
|
|
1869
|
-
* Default set of supported output MIME types for all skills, which can be
|
|
1870
|
-
* overridden on a per-skill basis.
|
|
1871
|
-
*/
|
|
1872
|
-
defaultOutputModes: string[];
|
|
1873
|
-
/**
|
|
1874
|
-
* A human-readable description of the agent, assisting users and other agents
|
|
1875
|
-
* in understanding its purpose.
|
|
1876
|
-
*/
|
|
1877
|
-
description: string;
|
|
1878
|
-
/**
|
|
1879
|
-
* An optional URL to the agent's documentation.
|
|
1880
|
-
*/
|
|
1881
|
-
documentationUrl?: string;
|
|
1882
|
-
/**
|
|
1883
|
-
* An optional URL to an icon for the agent.
|
|
1884
|
-
*/
|
|
1885
|
-
iconUrl?: string;
|
|
1886
|
-
/**
|
|
1887
|
-
* A human-readable name for the agent.
|
|
1888
|
-
*/
|
|
1889
|
-
name: string;
|
|
1890
|
-
/**
|
|
1891
|
-
* The transport protocol for the preferred endpoint (the main 'url' field).
|
|
1892
|
-
* If not specified, defaults to 'JSONRPC'.
|
|
1893
|
-
*
|
|
1894
|
-
* IMPORTANT: The transport specified here MUST be available at the main 'url'.
|
|
1895
|
-
* This creates a binding between the main URL and its supported transport protocol.
|
|
1896
|
-
* Clients should prefer this transport and URL combination when both are supported.
|
|
1897
|
-
*/
|
|
1898
|
-
preferredTransport?: string;
|
|
1899
|
-
/**
|
|
1900
|
-
* The version of the A2A protocol this agent supports.
|
|
1901
|
-
*/
|
|
1902
|
-
protocolVersion: string;
|
|
1903
|
-
provider?: AgentProvider;
|
|
1904
|
-
/**
|
|
1905
|
-
* A list of security requirement objects that apply to all agent interactions. Each object
|
|
1906
|
-
* lists security schemes that can be used. Follows the OpenAPI 3.0 Security Requirement Object.
|
|
1907
|
-
* This list can be seen as an OR of ANDs. Each object in the list describes one possible
|
|
1908
|
-
* set of security requirements that must be present on a request. This allows specifying,
|
|
1909
|
-
* for example, "callers must either use OAuth OR an API Key AND mTLS."
|
|
1910
|
-
*/
|
|
1911
|
-
security?: {
|
|
1912
|
-
[k: string]: string[];
|
|
1913
|
-
}[];
|
|
1914
|
-
/**
|
|
1915
|
-
* A declaration of the security schemes available to authorize requests. The key is the
|
|
1916
|
-
* scheme name. Follows the OpenAPI 3.0 Security Scheme Object.
|
|
1917
|
-
*/
|
|
1918
|
-
securitySchemes?: {
|
|
1919
|
-
[k: string]: SecurityScheme;
|
|
1920
|
-
};
|
|
1921
|
-
/**
|
|
1922
|
-
* JSON Web Signatures computed for this AgentCard.
|
|
1923
|
-
*/
|
|
1924
|
-
signatures?: AgentCardSignature[];
|
|
1925
|
-
/**
|
|
1926
|
-
* The set of skills, or distinct capabilities, that the agent can perform.
|
|
1927
|
-
*/
|
|
1928
|
-
skills: AgentSkill[];
|
|
1929
|
-
/**
|
|
1930
|
-
* If true, the agent can provide an extended agent card with additional details
|
|
1931
|
-
* to authenticated users. Defaults to false.
|
|
1932
|
-
*/
|
|
1933
|
-
supportsAuthenticatedExtendedCard?: boolean;
|
|
1934
|
-
/**
|
|
1935
|
-
* The preferred endpoint URL for interacting with the agent.
|
|
1936
|
-
* This URL MUST support the transport specified by 'preferredTransport'.
|
|
1937
|
-
*/
|
|
1938
|
-
url: string;
|
|
1939
|
-
/**
|
|
1940
|
-
* The agent's own version number. The format is defined by the provider.
|
|
1941
|
-
*/
|
|
1942
|
-
version: string;
|
|
1943
|
-
}
|
|
1944
|
-
/**
|
|
1945
|
-
* Represents a successful JSON-RPC response for the `tasks/pushNotificationConfig/get` method.
|
|
1946
|
-
*
|
|
1947
|
-
* This interface was referenced by `MySchema`'s JSON-Schema
|
|
1948
|
-
* via the `definition` "GetTaskPushNotificationConfigSuccessResponse".
|
|
1949
|
-
*/
|
|
1950
|
-
interface GetTaskPushNotificationConfigSuccessResponse {
|
|
1951
|
-
/**
|
|
1952
|
-
* The identifier established by the client.
|
|
1953
|
-
*/
|
|
1954
|
-
id: string | number | null;
|
|
1955
|
-
/**
|
|
1956
|
-
* The version of the JSON-RPC protocol. MUST be exactly "2.0".
|
|
1957
|
-
*/
|
|
1958
|
-
jsonrpc: "2.0";
|
|
1959
|
-
result: TaskPushNotificationConfig1;
|
|
1960
|
-
}
|
|
1961
|
-
/**
|
|
1962
|
-
* The result, containing the requested push notification configuration.
|
|
1963
|
-
*/
|
|
1964
|
-
interface TaskPushNotificationConfig1 {
|
|
1965
|
-
pushNotificationConfig: PushNotificationConfig1;
|
|
1966
|
-
/**
|
|
1967
|
-
* The ID of the task.
|
|
1968
|
-
*/
|
|
1969
|
-
taskId: string;
|
|
1970
|
-
}
|
|
1971
|
-
/**
|
|
1972
|
-
* Represents a successful JSON-RPC response for the `tasks/get` method.
|
|
1973
|
-
*
|
|
1974
|
-
* This interface was referenced by `MySchema`'s JSON-Schema
|
|
1975
|
-
* via the `definition` "GetTaskSuccessResponse".
|
|
1976
|
-
*/
|
|
1977
|
-
interface GetTaskSuccessResponse {
|
|
1978
|
-
/**
|
|
1979
|
-
* The identifier established by the client.
|
|
1980
|
-
*/
|
|
1981
|
-
id: string | number | null;
|
|
1982
|
-
/**
|
|
1983
|
-
* The version of the JSON-RPC protocol. MUST be exactly "2.0".
|
|
1984
|
-
*/
|
|
1985
|
-
jsonrpc: "2.0";
|
|
1986
|
-
result: Task1;
|
|
1987
|
-
}
|
|
1988
|
-
/**
|
|
1989
|
-
* The result, containing the requested Task object.
|
|
1990
|
-
*/
|
|
1991
|
-
interface Task1 {
|
|
1992
|
-
/**
|
|
1993
|
-
* A collection of artifacts generated by the agent during the execution of the task.
|
|
1994
|
-
*/
|
|
1995
|
-
artifacts?: Artifact[];
|
|
1996
|
-
/**
|
|
1997
|
-
* A server-generated identifier for maintaining context across multiple related tasks or interactions.
|
|
1998
|
-
*/
|
|
1999
|
-
contextId: string;
|
|
2000
|
-
/**
|
|
2001
|
-
* An array of messages exchanged during the task, representing the conversation history.
|
|
2002
|
-
*/
|
|
2003
|
-
history?: Message1[];
|
|
2004
|
-
/**
|
|
2005
|
-
* A unique identifier for the task, generated by the server for a new task.
|
|
2006
|
-
*/
|
|
2007
|
-
id: string;
|
|
2008
|
-
/**
|
|
2009
|
-
* The type of this object, used as a discriminator. Always 'task' for a Task.
|
|
2010
|
-
*/
|
|
2011
|
-
kind: "task";
|
|
2012
|
-
/**
|
|
2013
|
-
* Optional metadata for extensions. The key is an extension-specific identifier.
|
|
2014
|
-
*/
|
|
2015
|
-
metadata?: {
|
|
2016
|
-
[k: string]: unknown;
|
|
2017
|
-
};
|
|
2018
|
-
status: TaskStatus;
|
|
2019
|
-
}
|
|
2020
|
-
/**
|
|
2021
|
-
* Represents a successful JSON-RPC response for the `message/send` method.
|
|
2022
|
-
*
|
|
2023
|
-
* This interface was referenced by `MySchema`'s JSON-Schema
|
|
2024
|
-
* via the `definition` "SendMessageSuccessResponse".
|
|
2025
|
-
*/
|
|
2026
|
-
interface SendMessageSuccessResponse {
|
|
2027
|
-
/**
|
|
2028
|
-
* The identifier established by the client.
|
|
2029
|
-
*/
|
|
2030
|
-
id: string | number | null;
|
|
2031
|
-
/**
|
|
2032
|
-
* The version of the JSON-RPC protocol. MUST be exactly "2.0".
|
|
2033
|
-
*/
|
|
2034
|
-
jsonrpc: "2.0";
|
|
2035
|
-
/**
|
|
2036
|
-
* The result, which can be a direct reply Message or the initial Task object.
|
|
2037
|
-
*/
|
|
2038
|
-
result: Task2 | Message1;
|
|
2039
|
-
}
|
|
2040
|
-
/**
|
|
2041
|
-
* Represents a single, stateful operation or conversation between a client and an agent.
|
|
2042
|
-
*
|
|
2043
|
-
* This interface was referenced by `MySchema`'s JSON-Schema
|
|
2044
|
-
* via the `definition` "Task".
|
|
2045
|
-
*/
|
|
2046
|
-
interface Task2 {
|
|
2047
|
-
/**
|
|
2048
|
-
* A collection of artifacts generated by the agent during the execution of the task.
|
|
2049
|
-
*/
|
|
2050
|
-
artifacts?: Artifact[];
|
|
2051
|
-
/**
|
|
2052
|
-
* A server-generated identifier for maintaining context across multiple related tasks or interactions.
|
|
2053
|
-
*/
|
|
2054
|
-
contextId: string;
|
|
2055
|
-
/**
|
|
2056
|
-
* An array of messages exchanged during the task, representing the conversation history.
|
|
2057
|
-
*/
|
|
2058
|
-
history?: Message1[];
|
|
2059
|
-
/**
|
|
2060
|
-
* A unique identifier for the task, generated by the server for a new task.
|
|
2061
|
-
*/
|
|
2062
|
-
id: string;
|
|
2063
|
-
/**
|
|
2064
|
-
* The type of this object, used as a discriminator. Always 'task' for a Task.
|
|
2065
|
-
*/
|
|
2066
|
-
kind: "task";
|
|
2067
|
-
/**
|
|
2068
|
-
* Optional metadata for extensions. The key is an extension-specific identifier.
|
|
2069
|
-
*/
|
|
2070
|
-
metadata?: {
|
|
2071
|
-
[k: string]: unknown;
|
|
2072
|
-
};
|
|
2073
|
-
status: TaskStatus;
|
|
2074
|
-
}
|
|
2075
|
-
/**
|
|
2076
|
-
* Represents a successful JSON-RPC response for the `message/stream` method.
|
|
2077
|
-
* The server may send multiple response objects for a single request.
|
|
2078
|
-
*
|
|
2079
|
-
* This interface was referenced by `MySchema`'s JSON-Schema
|
|
2080
|
-
* via the `definition` "SendStreamingMessageSuccessResponse".
|
|
2081
|
-
*/
|
|
2082
|
-
interface SendStreamingMessageSuccessResponse {
|
|
2083
|
-
/**
|
|
2084
|
-
* The identifier established by the client.
|
|
2085
|
-
*/
|
|
2086
|
-
id: string | number | null;
|
|
2087
|
-
/**
|
|
2088
|
-
* The version of the JSON-RPC protocol. MUST be exactly "2.0".
|
|
2089
|
-
*/
|
|
2090
|
-
jsonrpc: "2.0";
|
|
2091
|
-
/**
|
|
2092
|
-
* The result, which can be a Message, Task, or a streaming update event.
|
|
2093
|
-
*/
|
|
2094
|
-
result: Task2 | Message1 | TaskStatusUpdateEvent | TaskArtifactUpdateEvent;
|
|
2095
|
-
}
|
|
2096
|
-
/**
|
|
2097
|
-
* An event sent by the agent to notify the client of a change in a task's status.
|
|
2098
|
-
* This is typically used in streaming or subscription models.
|
|
2099
|
-
*
|
|
2100
|
-
* This interface was referenced by `MySchema`'s JSON-Schema
|
|
2101
|
-
* via the `definition` "TaskStatusUpdateEvent".
|
|
2102
|
-
*/
|
|
2103
|
-
interface TaskStatusUpdateEvent {
|
|
2104
|
-
/**
|
|
2105
|
-
* The context ID associated with the task.
|
|
2106
|
-
*/
|
|
2107
|
-
contextId: string;
|
|
2108
|
-
/**
|
|
2109
|
-
* If true, this is the final event in the stream for this interaction.
|
|
2110
|
-
*/
|
|
2111
|
-
final: boolean;
|
|
2112
|
-
/**
|
|
2113
|
-
* The type of this event, used as a discriminator. Always 'status-update'.
|
|
2114
|
-
*/
|
|
2115
|
-
kind: "status-update";
|
|
2116
|
-
/**
|
|
2117
|
-
* Optional metadata for extensions.
|
|
2118
|
-
*/
|
|
2119
|
-
metadata?: {
|
|
2120
|
-
[k: string]: unknown;
|
|
2121
|
-
};
|
|
2122
|
-
status: TaskStatus1;
|
|
2123
|
-
/**
|
|
2124
|
-
* The ID of the task that was updated.
|
|
2125
|
-
*/
|
|
2126
|
-
taskId: string;
|
|
2127
|
-
}
|
|
2128
|
-
/**
|
|
2129
|
-
* The new status of the task.
|
|
2130
|
-
*/
|
|
2131
|
-
interface TaskStatus1 {
|
|
2132
|
-
message?: Message2;
|
|
2133
|
-
/**
|
|
2134
|
-
* The current state of the task's lifecycle.
|
|
2135
|
-
*/
|
|
2136
|
-
state: "submitted" | "working" | "input-required" | "completed" | "canceled" | "failed" | "rejected" | "auth-required" | "unknown";
|
|
2137
|
-
/**
|
|
2138
|
-
* An ISO 8601 datetime string indicating when this status was recorded.
|
|
2139
|
-
*/
|
|
2140
|
-
timestamp?: string;
|
|
2141
|
-
}
|
|
2142
|
-
/**
|
|
2143
|
-
* An event sent by the agent to notify the client that an artifact has been
|
|
2144
|
-
* generated or updated. This is typically used in streaming models.
|
|
2145
|
-
*
|
|
2146
|
-
* This interface was referenced by `MySchema`'s JSON-Schema
|
|
2147
|
-
* via the `definition` "TaskArtifactUpdateEvent".
|
|
2148
|
-
*/
|
|
2149
|
-
interface TaskArtifactUpdateEvent {
|
|
2150
|
-
/**
|
|
2151
|
-
* If true, the content of this artifact should be appended to a previously sent artifact with the same ID.
|
|
2152
|
-
*/
|
|
2153
|
-
append?: boolean;
|
|
2154
|
-
artifact: Artifact1;
|
|
2155
|
-
/**
|
|
2156
|
-
* The context ID associated with the task.
|
|
2157
|
-
*/
|
|
2158
|
-
contextId: string;
|
|
2159
|
-
/**
|
|
2160
|
-
* The type of this event, used as a discriminator. Always 'artifact-update'.
|
|
2161
|
-
*/
|
|
2162
|
-
kind: "artifact-update";
|
|
2163
|
-
/**
|
|
2164
|
-
* If true, this is the final chunk of the artifact.
|
|
2165
|
-
*/
|
|
2166
|
-
lastChunk?: boolean;
|
|
2167
|
-
/**
|
|
2168
|
-
* Optional metadata for extensions.
|
|
2169
|
-
*/
|
|
2170
|
-
metadata?: {
|
|
2171
|
-
[k: string]: unknown;
|
|
2172
|
-
};
|
|
2173
|
-
/**
|
|
2174
|
-
* The ID of the task this artifact belongs to.
|
|
2175
|
-
*/
|
|
2176
|
-
taskId: string;
|
|
2177
|
-
}
|
|
2178
|
-
/**
|
|
2179
|
-
* Represents a file, data structure, or other resource generated by an agent during a task.
|
|
2180
|
-
*/
|
|
2181
|
-
interface Artifact1 {
|
|
2182
|
-
/**
|
|
2183
|
-
* A unique identifier for the artifact within the scope of the task.
|
|
2184
|
-
*/
|
|
2185
|
-
artifactId: string;
|
|
2186
|
-
/**
|
|
2187
|
-
* An optional, human-readable description of the artifact.
|
|
2188
|
-
*/
|
|
2189
|
-
description?: string;
|
|
2190
|
-
/**
|
|
2191
|
-
* The URIs of extensions that are relevant to this artifact.
|
|
2192
|
-
*/
|
|
2193
|
-
extensions?: string[];
|
|
2194
|
-
/**
|
|
2195
|
-
* Optional metadata for extensions. The key is an extension-specific identifier.
|
|
2196
|
-
*/
|
|
2197
|
-
metadata?: {
|
|
2198
|
-
[k: string]: unknown;
|
|
2199
|
-
};
|
|
2200
|
-
/**
|
|
2201
|
-
* An optional, human-readable name for the artifact.
|
|
2202
|
-
*/
|
|
2203
|
-
name?: string;
|
|
2204
|
-
/**
|
|
2205
|
-
* An array of content parts that make up the artifact.
|
|
2206
|
-
*/
|
|
2207
|
-
parts: Part[];
|
|
2208
|
-
}
|
|
2209
|
-
/**
|
|
2210
|
-
* Represents a successful JSON-RPC response for the `tasks/pushNotificationConfig/set` method.
|
|
2211
|
-
*
|
|
2212
|
-
* This interface was referenced by `MySchema`'s JSON-Schema
|
|
2213
|
-
* via the `definition` "SetTaskPushNotificationConfigSuccessResponse".
|
|
2214
|
-
*/
|
|
2215
|
-
interface SetTaskPushNotificationConfigSuccessResponse {
|
|
2216
|
-
/**
|
|
2217
|
-
* The identifier established by the client.
|
|
2218
|
-
*/
|
|
2219
|
-
id: string | number | null;
|
|
2220
|
-
/**
|
|
2221
|
-
* The version of the JSON-RPC protocol. MUST be exactly "2.0".
|
|
2222
|
-
*/
|
|
2223
|
-
jsonrpc: "2.0";
|
|
2224
|
-
result: TaskPushNotificationConfig2;
|
|
2225
|
-
}
|
|
2226
|
-
/**
|
|
2227
|
-
* The result, containing the configured push notification settings.
|
|
2228
|
-
*/
|
|
2229
|
-
interface TaskPushNotificationConfig2 {
|
|
2230
|
-
pushNotificationConfig: PushNotificationConfig1;
|
|
2231
|
-
/**
|
|
2232
|
-
* The ID of the task.
|
|
2233
|
-
*/
|
|
2234
|
-
taskId: string;
|
|
2235
|
-
}
|
|
2236
|
-
/**
|
|
2237
|
-
* Represents a successful JSON-RPC response for the `tasks/pushNotificationConfig/list` method.
|
|
2238
|
-
*
|
|
2239
|
-
* This interface was referenced by `MySchema`'s JSON-Schema
|
|
2240
|
-
* via the `definition` "ListTaskPushNotificationConfigSuccessResponse".
|
|
2241
|
-
*/
|
|
2242
|
-
interface ListTaskPushNotificationConfigSuccessResponse {
|
|
2243
|
-
/**
|
|
2244
|
-
* The identifier established by the client.
|
|
2245
|
-
*/
|
|
2246
|
-
id: string | number | null;
|
|
2247
|
-
/**
|
|
2248
|
-
* The version of the JSON-RPC protocol. MUST be exactly "2.0".
|
|
2249
|
-
*/
|
|
2250
|
-
jsonrpc: "2.0";
|
|
2251
|
-
/**
|
|
2252
|
-
* The result, containing an array of all push notification configurations for the task.
|
|
2253
|
-
*/
|
|
2254
|
-
result: TaskPushNotificationConfig3[];
|
|
2255
|
-
}
|
|
2256
|
-
/**
|
|
2257
|
-
* A container associating a push notification configuration with a specific task.
|
|
2258
|
-
*
|
|
2259
|
-
* This interface was referenced by `MySchema`'s JSON-Schema
|
|
2260
|
-
* via the `definition` "TaskPushNotificationConfig".
|
|
2261
|
-
*/
|
|
2262
|
-
interface TaskPushNotificationConfig3 {
|
|
2263
|
-
pushNotificationConfig: PushNotificationConfig1;
|
|
2264
|
-
/**
|
|
2265
|
-
* The ID of the task.
|
|
2266
|
-
*/
|
|
2267
|
-
taskId: string;
|
|
2268
|
-
}
|
|
2269
|
-
/**
|
|
2270
|
-
* Represents a successful JSON-RPC 2.0 Response object.
|
|
2271
|
-
*
|
|
2272
|
-
* This interface was referenced by `MySchema`'s JSON-Schema
|
|
2273
|
-
* via the `definition` "JSONRPCSuccessResponse".
|
|
2274
|
-
*/
|
|
2275
|
-
interface JSONRPCSuccessResponse {
|
|
2276
|
-
/**
|
|
2277
|
-
* The identifier established by the client.
|
|
2278
|
-
*/
|
|
2279
|
-
id: string | number | null;
|
|
2280
|
-
/**
|
|
2281
|
-
* The version of the JSON-RPC protocol. MUST be exactly "2.0".
|
|
2282
|
-
*/
|
|
2283
|
-
jsonrpc: "2.0";
|
|
2284
|
-
/**
|
|
2285
|
-
* The value of this member is determined by the method invoked on the Server.
|
|
2286
|
-
*/
|
|
2287
|
-
result: {
|
|
2288
|
-
[k: string]: unknown;
|
|
2289
|
-
};
|
|
2290
|
-
}
|
|
1
|
+
import { S as SendMessageResponse, a as SendStreamingMessageResponse, G as GetTaskResponse, C as CancelTaskResponse, b as SetTaskPushNotificationConfigResponse, c as GetTaskPushNotificationConfigResponse, L as ListTaskPushNotificationConfigSuccessResponse, D as DeleteTaskPushNotificationConfigSuccessResponse, d as GetAuthenticatedExtendedCardSuccessResponse, J as JSONRPCErrorResponse } from './extensions-DvruCIzw.mjs';
|
|
2
|
+
export { A as A2AError, f as A2ARequest, ab as APIKeySecurityScheme, ac as AgentCapabilities, ag as AgentCapabilities1, ae as AgentCard, aF as AgentCard1, ar as AgentCardSignature, ad as AgentExtension, af as AgentInterface, ah as AgentProvider, at as AgentProvider1, as as AgentSkill, au as Artifact, aT as Artifact1, v as AuthenticatedExtendedCardNotConfiguredError, al as AuthorizationCodeOAuthFlow, av as AuthorizationCodeOAuthFlow1, Y as CancelTaskRequest, ax as CancelTaskSuccessResponse, am as ClientCredentialsOAuthFlow, aC as ClientCredentialsOAuthFlow1, t as ContentTypeNotSupportedError, Q as DataPart, a9 as DeleteTaskPushNotificationConfigParams, aD as DeleteTaskPushNotificationConfigParams1, a8 as DeleteTaskPushNotificationConfigRequest, h as DeleteTaskPushNotificationConfigResponse, e as ExtensionURI, E as Extensions, aE as FileBase, K as FilePart, N as FileWithBytes, O as FileWithUri, aa as GetAuthenticatedExtendedCardRequest, i as GetAuthenticatedExtendedCardResponse, a3 as GetTaskPushNotificationConfigParams, a1 as GetTaskPushNotificationConfigRequest, aG as GetTaskPushNotificationConfigSuccessResponse, W as GetTaskRequest, aI as GetTaskSuccessResponse, ai as HTTPAuthSecurityScheme, an as ImplicitOAuthFlow, aK as ImplicitOAuthFlow1, p as InternalError, u as InvalidAgentResponseError, o as InvalidParamsError, I as InvalidRequestError, m as JSONParseError, aw as JSONRPCError, aL as JSONRPCMessage, aM as JSONRPCRequest, j as JSONRPCResponse, aX as JSONRPCSuccessResponse, a7 as ListTaskPushNotificationConfigParams, aY as ListTaskPushNotificationConfigParams1, a6 as ListTaskPushNotificationConfigRequest, k as ListTaskPushNotificationConfigResponse, F as Message, az as Message1, aB as Message2, y as MessageSendConfiguration, aZ as MessageSendConfiguration1, x as MessageSendParams, V as MessageSendParams1, a_ as MessageSendParams2, n as MethodNotFoundError, aq as MutualTLSSecurityScheme, M as MySchema, aj as OAuth2SecurityScheme, ak as OAuthFlows, a$ as OAuthFlows1, ap as OpenIdConnectSecurityScheme, P as Part, b0 as PartBase, ao as PasswordOAuthFlow, b1 as PasswordOAuthFlow1, B as PushNotificationAuthenticationInfo, b2 as PushNotificationAuthenticationInfo1, z as PushNotificationConfig, a0 as PushNotificationConfig1, b3 as PushNotificationConfig2, s as PushNotificationNotSupportedError, g as SecurityScheme, b4 as SecuritySchemeBase, w as SendMessageRequest, aN as SendMessageSuccessResponse, R as SendStreamingMessageRequest, aP as SendStreamingMessageSuccessResponse, _ as SetTaskPushNotificationConfigRequest, aU as SetTaskPushNotificationConfigSuccessResponse, ay as Task, aJ as Task1, aO as Task2, aS as TaskArtifactUpdateEvent, Z as TaskIdParams, a2 as TaskIdParams1, a5 as TaskIdParams2, r as TaskNotCancelableError, q as TaskNotFoundError, $ as TaskPushNotificationConfig, aH as TaskPushNotificationConfig1, aV as TaskPushNotificationConfig2, aW as TaskPushNotificationConfig3, X as TaskQueryParams, b5 as TaskQueryParams1, a4 as TaskResubscriptionRequest, T as TaskState, aA as TaskStatus, aR as TaskStatus1, b6 as TaskStatus2, aQ as TaskStatusUpdateEvent, H as TextPart, l as TransportProtocol, U as UnsupportedOperationError } from './extensions-DvruCIzw.mjs';
|
|
2291
3
|
|
|
2292
4
|
/**
|
|
2293
5
|
* Represents any valid JSON-RPC response defined in the A2A protocol.
|
|
@@ -2301,474 +13,9 @@ type A2AResponse = SendMessageResponse | SendStreamingMessageResponse | GetTaskR
|
|
|
2301
13
|
* The well-known path for the agent card
|
|
2302
14
|
*/
|
|
2303
15
|
declare const AGENT_CARD_PATH = ".well-known/agent-card.json";
|
|
2304
|
-
|
|
2305
|
-
type AgentExecutionEvent = Message | Task | TaskStatusUpdateEvent | TaskArtifactUpdateEvent;
|
|
2306
|
-
interface ExecutionEventBus {
|
|
2307
|
-
publish(event: AgentExecutionEvent): void;
|
|
2308
|
-
on(eventName: 'event' | 'finished', listener: (event: AgentExecutionEvent) => void): this;
|
|
2309
|
-
off(eventName: 'event' | 'finished', listener: (event: AgentExecutionEvent) => void): this;
|
|
2310
|
-
once(eventName: 'event' | 'finished', listener: (event: AgentExecutionEvent) => void): this;
|
|
2311
|
-
removeAllListeners(eventName?: 'event' | 'finished'): this;
|
|
2312
|
-
finished(): void;
|
|
2313
|
-
}
|
|
2314
|
-
declare class DefaultExecutionEventBus extends EventEmitter implements ExecutionEventBus {
|
|
2315
|
-
constructor();
|
|
2316
|
-
publish(event: AgentExecutionEvent): void;
|
|
2317
|
-
finished(): void;
|
|
2318
|
-
}
|
|
2319
|
-
|
|
2320
|
-
declare class RequestContext {
|
|
2321
|
-
readonly userMessage: Message;
|
|
2322
|
-
readonly task?: Task;
|
|
2323
|
-
readonly referenceTasks?: Task[];
|
|
2324
|
-
readonly taskId: string;
|
|
2325
|
-
readonly contextId: string;
|
|
2326
|
-
constructor(userMessage: Message, taskId: string, contextId: string, task?: Task, referenceTasks?: Task[]);
|
|
2327
|
-
}
|
|
2328
|
-
|
|
2329
|
-
interface AgentExecutor {
|
|
2330
|
-
/**
|
|
2331
|
-
* Executes the agent logic based on the request context and publishes events.
|
|
2332
|
-
* @param requestContext The context of the current request.
|
|
2333
|
-
* @param eventBus The bus to publish execution events to.
|
|
2334
|
-
*/
|
|
2335
|
-
execute: (requestContext: RequestContext, eventBus: ExecutionEventBus) => Promise<void>;
|
|
2336
|
-
/**
|
|
2337
|
-
* Method to explicitly cancel a running task.
|
|
2338
|
-
* The implementation should handle the logic of stopping the execution
|
|
2339
|
-
* and publishing the final 'canceled' status event on the provided event bus.
|
|
2340
|
-
* @param taskId The ID of the task to cancel.
|
|
2341
|
-
* @param eventBus The event bus associated with the task's execution.
|
|
2342
|
-
*/
|
|
2343
|
-
cancelTask: (taskId: string, eventBus: ExecutionEventBus) => Promise<void>;
|
|
2344
|
-
}
|
|
2345
|
-
|
|
2346
|
-
interface ExecutionEventBusManager {
|
|
2347
|
-
createOrGetByTaskId(taskId: string): ExecutionEventBus;
|
|
2348
|
-
getByTaskId(taskId: string): ExecutionEventBus | undefined;
|
|
2349
|
-
cleanupByTaskId(taskId: string): void;
|
|
2350
|
-
}
|
|
2351
|
-
declare class DefaultExecutionEventBusManager implements ExecutionEventBusManager {
|
|
2352
|
-
private taskIdToBus;
|
|
2353
|
-
/**
|
|
2354
|
-
* Creates or retrieves an existing ExecutionEventBus based on the taskId.
|
|
2355
|
-
* @param taskId The ID of the task.
|
|
2356
|
-
* @returns An instance of IExecutionEventBus.
|
|
2357
|
-
*/
|
|
2358
|
-
createOrGetByTaskId(taskId: string): ExecutionEventBus;
|
|
2359
|
-
/**
|
|
2360
|
-
* Retrieves an existing ExecutionEventBus based on the taskId.
|
|
2361
|
-
* @param taskId The ID of the task.
|
|
2362
|
-
* @returns An instance of IExecutionEventBus or undefined if not found.
|
|
2363
|
-
*/
|
|
2364
|
-
getByTaskId(taskId: string): ExecutionEventBus | undefined;
|
|
2365
|
-
/**
|
|
2366
|
-
* Removes the event bus for a given taskId.
|
|
2367
|
-
* This should be called when an execution flow is complete to free resources.
|
|
2368
|
-
* @param taskId The ID of the task.
|
|
2369
|
-
*/
|
|
2370
|
-
cleanupByTaskId(taskId: string): void;
|
|
2371
|
-
}
|
|
2372
|
-
|
|
2373
|
-
/**
|
|
2374
|
-
* An async queue that subscribes to an ExecutionEventBus for events
|
|
2375
|
-
* and provides an async generator to consume them.
|
|
2376
|
-
*/
|
|
2377
|
-
declare class ExecutionEventQueue {
|
|
2378
|
-
private eventBus;
|
|
2379
|
-
private eventQueue;
|
|
2380
|
-
private resolvePromise?;
|
|
2381
|
-
private stopped;
|
|
2382
|
-
private boundHandleEvent;
|
|
2383
|
-
constructor(eventBus: ExecutionEventBus);
|
|
2384
|
-
private handleEvent;
|
|
2385
|
-
private handleFinished;
|
|
2386
|
-
/**
|
|
2387
|
-
* Provides an async generator that yields events from the event bus.
|
|
2388
|
-
* Stops when a Message event is received or a TaskStatusUpdateEvent with final=true is received.
|
|
2389
|
-
*/
|
|
2390
|
-
events(): AsyncGenerator<AgentExecutionEvent, void, undefined>;
|
|
2391
|
-
/**
|
|
2392
|
-
* Stops the event queue from processing further events.
|
|
2393
|
-
*/
|
|
2394
|
-
stop(): void;
|
|
2395
|
-
}
|
|
2396
|
-
|
|
2397
|
-
/**
|
|
2398
|
-
* Generates a timestamp in ISO 8601 format.
|
|
2399
|
-
* @returns The current timestamp as a string.
|
|
2400
|
-
*/
|
|
2401
|
-
declare function getCurrentTimestamp(): string;
|
|
2402
|
-
/**
|
|
2403
|
-
* Checks if a value is a plain object (excluding arrays and null).
|
|
2404
|
-
* @param value The value to check.
|
|
2405
|
-
* @returns True if the value is a plain object, false otherwise.
|
|
2406
|
-
*/
|
|
2407
|
-
declare function isObject(value: unknown): value is Record<string, any>;
|
|
2408
16
|
/**
|
|
2409
|
-
*
|
|
2410
|
-
* Used to differentiate yielded updates from the handler.
|
|
17
|
+
* The name of the extension header used in http
|
|
2411
18
|
*/
|
|
2412
|
-
declare
|
|
2413
|
-
/**
|
|
2414
|
-
* Type guard to check if an object is an Artifact update (has 'parts').
|
|
2415
|
-
* Used to differentiate yielded updates from the handler.
|
|
2416
|
-
*/
|
|
2417
|
-
declare function isArtifactUpdate(update: any): update is Artifact;
|
|
2418
|
-
|
|
2419
|
-
interface A2ARequestHandler {
|
|
2420
|
-
getAgentCard(): Promise<AgentCard>;
|
|
2421
|
-
getAuthenticatedExtendedAgentCard(): Promise<AgentCard>;
|
|
2422
|
-
sendMessage(params: MessageSendParams): Promise<Message | Task>;
|
|
2423
|
-
sendMessageStream(params: MessageSendParams): AsyncGenerator<Message | Task | TaskStatusUpdateEvent | TaskArtifactUpdateEvent, void, undefined>;
|
|
2424
|
-
getTask(params: TaskQueryParams): Promise<Task>;
|
|
2425
|
-
cancelTask(params: TaskIdParams): Promise<Task>;
|
|
2426
|
-
setTaskPushNotificationConfig(params: TaskPushNotificationConfig): Promise<TaskPushNotificationConfig>;
|
|
2427
|
-
getTaskPushNotificationConfig(params: TaskIdParams | GetTaskPushNotificationConfigParams): Promise<TaskPushNotificationConfig>;
|
|
2428
|
-
listTaskPushNotificationConfigs(params: ListTaskPushNotificationConfigParams): Promise<TaskPushNotificationConfig[]>;
|
|
2429
|
-
deleteTaskPushNotificationConfig(params: DeleteTaskPushNotificationConfigParams): Promise<void>;
|
|
2430
|
-
resubscribe(params: TaskIdParams): AsyncGenerator<Task | TaskStatusUpdateEvent | TaskArtifactUpdateEvent, void, undefined>;
|
|
2431
|
-
}
|
|
2432
|
-
|
|
2433
|
-
/**
|
|
2434
|
-
* Simplified interface for task storage providers.
|
|
2435
|
-
* Stores and retrieves the task.
|
|
2436
|
-
*/
|
|
2437
|
-
interface TaskStore {
|
|
2438
|
-
/**
|
|
2439
|
-
* Saves a task.
|
|
2440
|
-
* Overwrites existing data if the task ID exists.
|
|
2441
|
-
* @param data An object containing the task.
|
|
2442
|
-
* @returns A promise resolving when the save operation is complete.
|
|
2443
|
-
*/
|
|
2444
|
-
save(task: Task): Promise<void>;
|
|
2445
|
-
/**
|
|
2446
|
-
* Loads a task by task ID.
|
|
2447
|
-
* @param taskId The ID of the task to load.
|
|
2448
|
-
* @returns A promise resolving to an object containing the Task, or undefined if not found.
|
|
2449
|
-
*/
|
|
2450
|
-
load(taskId: string): Promise<Task | undefined>;
|
|
2451
|
-
}
|
|
2452
|
-
declare class InMemoryTaskStore implements TaskStore {
|
|
2453
|
-
private store;
|
|
2454
|
-
load(taskId: string): Promise<Task | undefined>;
|
|
2455
|
-
save(task: Task): Promise<void>;
|
|
2456
|
-
}
|
|
2457
|
-
|
|
2458
|
-
declare class DefaultRequestHandler implements A2ARequestHandler {
|
|
2459
|
-
private readonly agentCard;
|
|
2460
|
-
private readonly extendedAgentCard?;
|
|
2461
|
-
private readonly taskStore;
|
|
2462
|
-
private readonly agentExecutor;
|
|
2463
|
-
private readonly eventBusManager;
|
|
2464
|
-
private readonly pushNotificationConfigs;
|
|
2465
|
-
constructor(agentCard: AgentCard, taskStore: TaskStore, agentExecutor: AgentExecutor, eventBusManager?: ExecutionEventBusManager, extendedAgentCard?: AgentCard);
|
|
2466
|
-
getAgentCard(): Promise<AgentCard>;
|
|
2467
|
-
getAuthenticatedExtendedAgentCard(): Promise<AgentCard>;
|
|
2468
|
-
private _createRequestContext;
|
|
2469
|
-
private _processEvents;
|
|
2470
|
-
sendMessage(params: MessageSendParams): Promise<Message | Task>;
|
|
2471
|
-
sendMessageStream(params: MessageSendParams): AsyncGenerator<Message | Task | TaskStatusUpdateEvent | TaskArtifactUpdateEvent, void, undefined>;
|
|
2472
|
-
getTask(params: TaskQueryParams): Promise<Task>;
|
|
2473
|
-
cancelTask(params: TaskIdParams): Promise<Task>;
|
|
2474
|
-
setTaskPushNotificationConfig(params: TaskPushNotificationConfig): Promise<TaskPushNotificationConfig>;
|
|
2475
|
-
getTaskPushNotificationConfig(params: TaskIdParams | GetTaskPushNotificationConfigParams): Promise<TaskPushNotificationConfig>;
|
|
2476
|
-
listTaskPushNotificationConfigs(params: ListTaskPushNotificationConfigParams): Promise<TaskPushNotificationConfig[]>;
|
|
2477
|
-
deleteTaskPushNotificationConfig(params: DeleteTaskPushNotificationConfigParams): Promise<void>;
|
|
2478
|
-
resubscribe(params: TaskIdParams): AsyncGenerator<Task | TaskStatusUpdateEvent | TaskArtifactUpdateEvent, void, undefined>;
|
|
2479
|
-
}
|
|
2480
|
-
|
|
2481
|
-
declare class ResultManager {
|
|
2482
|
-
private taskStore;
|
|
2483
|
-
private currentTask?;
|
|
2484
|
-
private latestUserMessage?;
|
|
2485
|
-
private finalMessageResult?;
|
|
2486
|
-
constructor(taskStore: TaskStore);
|
|
2487
|
-
setContext(latestUserMessage: Message): void;
|
|
2488
|
-
/**
|
|
2489
|
-
* Processes an agent execution event and updates the task store.
|
|
2490
|
-
* @param event The agent execution event.
|
|
2491
|
-
*/
|
|
2492
|
-
processEvent(event: AgentExecutionEvent): Promise<void>;
|
|
2493
|
-
private saveCurrentTask;
|
|
2494
|
-
/**
|
|
2495
|
-
* Gets the final result, which could be a Message or a Task.
|
|
2496
|
-
* This should be called after the event stream has been fully processed.
|
|
2497
|
-
* @returns The final Message or the current Task.
|
|
2498
|
-
*/
|
|
2499
|
-
getFinalResult(): Message | Task | undefined;
|
|
2500
|
-
/**
|
|
2501
|
-
* Gets the task currently being managed by this ResultManager instance.
|
|
2502
|
-
* This task could be one that was started with or one created during agent execution.
|
|
2503
|
-
* @returns The current Task or undefined if no task is active.
|
|
2504
|
-
*/
|
|
2505
|
-
getCurrentTask(): Task | undefined;
|
|
2506
|
-
}
|
|
2507
|
-
|
|
2508
|
-
/**
|
|
2509
|
-
* Handles JSON-RPC transport layer, routing requests to A2ARequestHandler.
|
|
2510
|
-
*/
|
|
2511
|
-
declare class JsonRpcTransportHandler {
|
|
2512
|
-
private requestHandler;
|
|
2513
|
-
constructor(requestHandler: A2ARequestHandler);
|
|
2514
|
-
/**
|
|
2515
|
-
* Handles an incoming JSON-RPC request.
|
|
2516
|
-
* For streaming methods, it returns an AsyncGenerator of JSONRPCResult.
|
|
2517
|
-
* For non-streaming methods, it returns a Promise of a single JSONRPCMessage (Result or ErrorResponse).
|
|
2518
|
-
*/
|
|
2519
|
-
handle(requestBody: any): Promise<JSONRPCResponse | AsyncGenerator<JSONRPCResponse, void, undefined>>;
|
|
2520
|
-
}
|
|
2521
|
-
|
|
2522
|
-
/**
|
|
2523
|
-
* Custom error class for A2A server operations, incorporating JSON-RPC error codes.
|
|
2524
|
-
*/
|
|
2525
|
-
declare class A2AError extends Error {
|
|
2526
|
-
code: number;
|
|
2527
|
-
data?: Record<string, unknown>;
|
|
2528
|
-
taskId?: string;
|
|
2529
|
-
constructor(code: number, message: string, data?: Record<string, unknown>, taskId?: string);
|
|
2530
|
-
/**
|
|
2531
|
-
* Formats the error into a standard JSON-RPC error object structure.
|
|
2532
|
-
*/
|
|
2533
|
-
toJSONRPCError(): JSONRPCError;
|
|
2534
|
-
static parseError(message: string, data?: Record<string, unknown>): A2AError;
|
|
2535
|
-
static invalidRequest(message: string, data?: Record<string, unknown>): A2AError;
|
|
2536
|
-
static methodNotFound(method: string): A2AError;
|
|
2537
|
-
static invalidParams(message: string, data?: Record<string, unknown>): A2AError;
|
|
2538
|
-
static internalError(message: string, data?: Record<string, unknown>): A2AError;
|
|
2539
|
-
static taskNotFound(taskId: string): A2AError;
|
|
2540
|
-
static taskNotCancelable(taskId: string): A2AError;
|
|
2541
|
-
static pushNotificationNotSupported(): A2AError;
|
|
2542
|
-
static unsupportedOperation(operation: string): A2AError;
|
|
2543
|
-
static authenticatedExtendedCardNotConfigured(): A2AError;
|
|
2544
|
-
}
|
|
2545
|
-
|
|
2546
|
-
type A2AStreamEventData = Message | Task | TaskStatusUpdateEvent | TaskArtifactUpdateEvent;
|
|
2547
|
-
interface A2AClientOptions {
|
|
2548
|
-
agentCardPath?: string;
|
|
2549
|
-
fetchImpl?: typeof fetch;
|
|
2550
|
-
}
|
|
2551
|
-
/**
|
|
2552
|
-
* A2AClient is a TypeScript HTTP client for interacting with A2A-compliant agents.
|
|
2553
|
-
*/
|
|
2554
|
-
declare class A2AClient {
|
|
2555
|
-
private agentCardPromise;
|
|
2556
|
-
private requestIdCounter;
|
|
2557
|
-
private serviceEndpointUrl?;
|
|
2558
|
-
private customFetchImpl?;
|
|
2559
|
-
/**
|
|
2560
|
-
* Constructs an A2AClient instance from an AgentCard.
|
|
2561
|
-
* @param agentCard The AgentCard object.
|
|
2562
|
-
* @param options Optional. The options for the A2AClient including the fetch/auth implementation.
|
|
2563
|
-
*/
|
|
2564
|
-
constructor(agentCard: AgentCard | string, options?: A2AClientOptions);
|
|
2565
|
-
/**
|
|
2566
|
-
* Dynamically resolves the fetch implementation to use for requests.
|
|
2567
|
-
* Prefers a custom implementation if provided, otherwise falls back to the global fetch.
|
|
2568
|
-
* @returns The fetch implementation.
|
|
2569
|
-
* @param args Arguments to pass to the fetch implementation.
|
|
2570
|
-
* @throws If no fetch implementation is available.
|
|
2571
|
-
*/
|
|
2572
|
-
private _fetch;
|
|
2573
|
-
/**
|
|
2574
|
-
* Creates an A2AClient instance by fetching the AgentCard from a URL then constructing the A2AClient.
|
|
2575
|
-
* @param agentCardUrl The URL of the agent card.
|
|
2576
|
-
* @param options Optional. The options for the A2AClient including the fetch/auth implementation.
|
|
2577
|
-
* @returns A Promise that resolves to a new A2AClient instance.
|
|
2578
|
-
*/
|
|
2579
|
-
static fromCardUrl(agentCardUrl: string, options?: A2AClientOptions): Promise<A2AClient>;
|
|
2580
|
-
/**
|
|
2581
|
-
* Helper method to make a generic JSON-RPC POST request.
|
|
2582
|
-
* @param method The RPC method name.
|
|
2583
|
-
* @param params The parameters for the RPC method.
|
|
2584
|
-
* @returns A Promise that resolves to the RPC response.
|
|
2585
|
-
*/
|
|
2586
|
-
private _postRpcRequest;
|
|
2587
|
-
/**
|
|
2588
|
-
* Internal helper method to fetch the RPC service endpoint.
|
|
2589
|
-
* @param url The URL to fetch.
|
|
2590
|
-
* @param rpcRequest The JSON-RPC request to send.
|
|
2591
|
-
* @param acceptHeader The Accept header to use. Defaults to "application/json".
|
|
2592
|
-
* @returns A Promise that resolves to the fetch HTTP response.
|
|
2593
|
-
*/
|
|
2594
|
-
private _fetchRpc;
|
|
2595
|
-
/**
|
|
2596
|
-
* Sends a message to the agent.
|
|
2597
|
-
* The behavior (blocking/non-blocking) and push notification configuration
|
|
2598
|
-
* are specified within the `params.configuration` object.
|
|
2599
|
-
* Optionally, `params.message.contextId` or `params.message.taskId` can be provided.
|
|
2600
|
-
* @param params The parameters for sending the message, including the message content and configuration.
|
|
2601
|
-
* @returns A Promise resolving to SendMessageResponse, which can be a Message, Task, or an error.
|
|
2602
|
-
*/
|
|
2603
|
-
sendMessage(params: MessageSendParams): Promise<SendMessageResponse>;
|
|
2604
|
-
/**
|
|
2605
|
-
* Sends a message to the agent and streams back responses using Server-Sent Events (SSE).
|
|
2606
|
-
* Push notification configuration can be specified in `params.configuration`.
|
|
2607
|
-
* Optionally, `params.message.contextId` or `params.message.taskId` can be provided.
|
|
2608
|
-
* Requires the agent to support streaming (`capabilities.streaming: true` in AgentCard).
|
|
2609
|
-
* @param params The parameters for sending the message.
|
|
2610
|
-
* @returns An AsyncGenerator yielding A2AStreamEventData (Message, Task, TaskStatusUpdateEvent, or TaskArtifactUpdateEvent).
|
|
2611
|
-
* The generator throws an error if streaming is not supported or if an HTTP/SSE error occurs.
|
|
2612
|
-
*/
|
|
2613
|
-
sendMessageStream(params: MessageSendParams): AsyncGenerator<A2AStreamEventData, void, undefined>;
|
|
2614
|
-
/**
|
|
2615
|
-
* Sets or updates the push notification configuration for a given task.
|
|
2616
|
-
* Requires the agent to support push notifications (`capabilities.pushNotifications: true` in AgentCard).
|
|
2617
|
-
* @param params Parameters containing the taskId and the TaskPushNotificationConfig.
|
|
2618
|
-
* @returns A Promise resolving to SetTaskPushNotificationConfigResponse.
|
|
2619
|
-
*/
|
|
2620
|
-
setTaskPushNotificationConfig(params: TaskPushNotificationConfig): Promise<SetTaskPushNotificationConfigResponse>;
|
|
2621
|
-
/**
|
|
2622
|
-
* Gets the push notification configuration for a given task.
|
|
2623
|
-
* @param params Parameters containing the taskId.
|
|
2624
|
-
* @returns A Promise resolving to GetTaskPushNotificationConfigResponse.
|
|
2625
|
-
*/
|
|
2626
|
-
getTaskPushNotificationConfig(params: TaskIdParams): Promise<GetTaskPushNotificationConfigResponse>;
|
|
2627
|
-
/**
|
|
2628
|
-
* Retrieves a task by its ID.
|
|
2629
|
-
* @param params Parameters containing the taskId and optional historyLength.
|
|
2630
|
-
* @returns A Promise resolving to GetTaskResponse, which contains the Task object or an error.
|
|
2631
|
-
*/
|
|
2632
|
-
getTask(params: TaskQueryParams): Promise<GetTaskResponse>;
|
|
2633
|
-
/**
|
|
2634
|
-
* Cancels a task by its ID.
|
|
2635
|
-
* @param params Parameters containing the taskId.
|
|
2636
|
-
* @returns A Promise resolving to CancelTaskResponse, which contains the updated Task object or an error.
|
|
2637
|
-
*/
|
|
2638
|
-
cancelTask(params: TaskIdParams): Promise<CancelTaskResponse>;
|
|
2639
|
-
/**
|
|
2640
|
-
* Resubscribes to a task's event stream using Server-Sent Events (SSE).
|
|
2641
|
-
* This is used if a previous SSE connection for an active task was broken.
|
|
2642
|
-
* Requires the agent to support streaming (`capabilities.streaming: true` in AgentCard).
|
|
2643
|
-
* @param params Parameters containing the taskId.
|
|
2644
|
-
* @returns An AsyncGenerator yielding A2AStreamEventData (Message, Task, TaskStatusUpdateEvent, or TaskArtifactUpdateEvent).
|
|
2645
|
-
*/
|
|
2646
|
-
resubscribeTask(params: TaskIdParams): AsyncGenerator<A2AStreamEventData, void, undefined>;
|
|
2647
|
-
/**
|
|
2648
|
-
* Parses an HTTP response body as an A2A Server-Sent Event stream.
|
|
2649
|
-
* Each 'data' field of an SSE event is expected to be a JSON-RPC 2.0 Response object,
|
|
2650
|
-
* specifically a SendStreamingMessageResponse (or similar structure for resubscribe).
|
|
2651
|
-
* @param response The HTTP Response object whose body is the SSE stream.
|
|
2652
|
-
* @param originalRequestId The ID of the client's JSON-RPC request that initiated this stream.
|
|
2653
|
-
* Used to validate the `id` in the streamed JSON-RPC responses.
|
|
2654
|
-
* @returns An AsyncGenerator yielding the `result` field of each valid JSON-RPC success response from the stream.
|
|
2655
|
-
*/
|
|
2656
|
-
private _parseA2ASseStream;
|
|
2657
|
-
/**
|
|
2658
|
-
* Processes a single SSE event's data string, expecting it to be a JSON-RPC response.
|
|
2659
|
-
* @param jsonData The string content from one or more 'data:' lines of an SSE event.
|
|
2660
|
-
* @param originalRequestId The ID of the client's request that initiated the stream.
|
|
2661
|
-
* @returns The `result` field of the parsed JSON-RPC success response.
|
|
2662
|
-
* @throws Error if data is not valid JSON, not a valid JSON-RPC response, an error response, or ID mismatch.
|
|
2663
|
-
*/
|
|
2664
|
-
private _processSseEventData;
|
|
2665
|
-
isErrorResponse(response: JSONRPCResponse): response is JSONRPCErrorResponse;
|
|
2666
|
-
/**
|
|
2667
|
-
* Fetches the Agent Card from the agent's well-known URI and caches its service endpoint URL.
|
|
2668
|
-
* This method is called by the constructor.
|
|
2669
|
-
* @param agentBaseUrl The base URL of the A2A agent (e.g., https://agent.example.com)
|
|
2670
|
-
* @param agentCardPath path to the agent card, defaults to .well-known/agent-card.json
|
|
2671
|
-
* @returns A Promise that resolves to the AgentCard.
|
|
2672
|
-
*/
|
|
2673
|
-
private _fetchAndCacheAgentCard;
|
|
2674
|
-
/**
|
|
2675
|
-
* Retrieves the Agent Card.
|
|
2676
|
-
* If an `agentBaseUrl` is provided, it fetches the card from that specific URL.
|
|
2677
|
-
* Otherwise, it returns the card fetched and cached during client construction.
|
|
2678
|
-
* @param agentBaseUrl Optional. The base URL of the agent to fetch the card from.
|
|
2679
|
-
* @param agentCardPath path to the agent card, defaults to .well-known/agent-card.json
|
|
2680
|
-
* If provided, this will fetch a new card, not use the cached one from the constructor's URL.
|
|
2681
|
-
* @returns A Promise that resolves to the AgentCard.
|
|
2682
|
-
*/
|
|
2683
|
-
getAgentCard(agentBaseUrl?: string, agentCardPath?: string): Promise<AgentCard>;
|
|
2684
|
-
/**
|
|
2685
|
-
* Determines the agent card URL based on the agent URL.
|
|
2686
|
-
* @param agentBaseUrl The agent URL.
|
|
2687
|
-
* @param agentCardPath Optional relative path to the agent card, defaults to .well-known/agent-card.json
|
|
2688
|
-
*/
|
|
2689
|
-
private resolveAgentCardUrl;
|
|
2690
|
-
/**
|
|
2691
|
-
* Gets the RPC service endpoint URL. Ensures the agent card has been fetched first.
|
|
2692
|
-
* @returns A Promise that resolves to the service endpoint URL string.
|
|
2693
|
-
*/
|
|
2694
|
-
private _getServiceEndpoint;
|
|
2695
|
-
}
|
|
2696
|
-
|
|
2697
|
-
interface HttpHeaders {
|
|
2698
|
-
[key: string]: string;
|
|
2699
|
-
}
|
|
2700
|
-
/**
|
|
2701
|
-
* Generic interface for handling authentication for HTTP requests.
|
|
2702
|
-
*
|
|
2703
|
-
* - For each HTTP request, this handler is called to provide additional headers to the request through
|
|
2704
|
-
* the headers() function.
|
|
2705
|
-
* - After the server returns a response, the shouldRetryWithHeaders() function is called. Usually this
|
|
2706
|
-
* function responds to a 401 or 403 response or JSON-RPC codes, but can respond to any other signal -
|
|
2707
|
-
* that is an implementation detail of the AuthenticationHandler.
|
|
2708
|
-
* - If the shouldRetryWithHeaders() function returns new headers, then the request should retried with the provided
|
|
2709
|
-
* revised headers. These provisional headers may, or may not, be optimistically stored for subsequent requests -
|
|
2710
|
-
* that is an implementation detail of the AuthenticationHandler.
|
|
2711
|
-
* - If the request is successful and the onSuccessfulRetry() is defined, then the onSuccessfulRetry() function is
|
|
2712
|
-
* called with the headers that were used to successfully complete the request. This callback provides an
|
|
2713
|
-
* opportunity to save the headers for subsequent requests if they were not already saved.
|
|
2714
|
-
*
|
|
2715
|
-
*/
|
|
2716
|
-
interface AuthenticationHandler {
|
|
2717
|
-
/**
|
|
2718
|
-
* Provides additional HTTP request headers.
|
|
2719
|
-
* @returns HTTP headers which may include Authorization if available.
|
|
2720
|
-
*/
|
|
2721
|
-
headers: () => Promise<HttpHeaders>;
|
|
2722
|
-
/**
|
|
2723
|
-
* For every HTTP response (even 200s) the shouldRetryWithHeaders() method is called.
|
|
2724
|
-
* This method is supposed to check if the request needs to be retried and if, yes,
|
|
2725
|
-
* return a set of headers. An A2A server might indicate auth failures in its response
|
|
2726
|
-
* by JSON-rpc codes, HTTP codes like 401, 403 or headers like WWW-Authenticate.
|
|
2727
|
-
*
|
|
2728
|
-
* @param req The RequestInit object used to invoke fetch()
|
|
2729
|
-
* @param res The fetch Response object
|
|
2730
|
-
* @returns If the HTTP request should be retried then returns the HTTP headers to use,
|
|
2731
|
-
* or returns undefined if no retry should be made.
|
|
2732
|
-
*/
|
|
2733
|
-
shouldRetryWithHeaders: (req: RequestInit, res: Response) => Promise<HttpHeaders | undefined>;
|
|
2734
|
-
/**
|
|
2735
|
-
* If the last HTTP request using the headers from shouldRetryWithHeaders() was successful, and
|
|
2736
|
-
* this function is implemented, then it will be called with the headers provided from
|
|
2737
|
-
* shouldRetryWithHeaders().
|
|
2738
|
-
*
|
|
2739
|
-
* This callback allows transient headers to be saved for subsequent requests only when they
|
|
2740
|
-
* are validated by the server.
|
|
2741
|
-
*/
|
|
2742
|
-
onSuccessfulRetry?: (headers: HttpHeaders) => Promise<void>;
|
|
2743
|
-
}
|
|
2744
|
-
/**
|
|
2745
|
-
* Higher-order function that wraps fetch with authentication handling logic.
|
|
2746
|
-
* Returns a new fetch function that automatically handles authentication retries for 401/403 responses.
|
|
2747
|
-
*
|
|
2748
|
-
* @param fetchImpl The underlying fetch implementation to wrap
|
|
2749
|
-
* @param authHandler Authentication handler for managing auth headers and retries
|
|
2750
|
-
* @returns A new fetch function with authentication handling capabilities
|
|
2751
|
-
*
|
|
2752
|
-
* Usage examples:
|
|
2753
|
-
* - const authFetch = createAuthHandlingFetch(fetch, authHandler);
|
|
2754
|
-
* - const response = await authFetch(url, options);
|
|
2755
|
-
* - const response = await authFetch(url); // Direct function call
|
|
2756
|
-
*/
|
|
2757
|
-
declare function createAuthenticatingFetchWithRetry(fetchImpl: typeof fetch, authHandler: AuthenticationHandler): typeof fetch;
|
|
2758
|
-
|
|
2759
|
-
declare class A2AExpressApp {
|
|
2760
|
-
private requestHandler;
|
|
2761
|
-
private jsonRpcTransportHandler;
|
|
2762
|
-
constructor(requestHandler: A2ARequestHandler);
|
|
2763
|
-
/**
|
|
2764
|
-
* Adds A2A routes to an existing Express app.
|
|
2765
|
-
* @param app Optional existing Express app.
|
|
2766
|
-
* @param baseUrl The base URL for A2A endpoints (e.g., "/a2a/api").
|
|
2767
|
-
* @param middlewares Optional array of Express middlewares to apply to the A2A routes.
|
|
2768
|
-
* @param agentCardPath Optional custom path for the agent card endpoint (defaults to /.well-known/agent-card.json).
|
|
2769
|
-
* @returns The Express app with A2A routes.
|
|
2770
|
-
*/
|
|
2771
|
-
setupRoutes(app: Express, baseUrl?: string, middlewares?: Array<RequestHandler | ErrorRequestHandler>, agentCardPath?: string): Express;
|
|
2772
|
-
}
|
|
19
|
+
declare const HTTP_EXTENSION_HEADER = "X-A2A-Extensions";
|
|
2773
20
|
|
|
2774
|
-
export {
|
|
21
|
+
export { type A2AResponse, AGENT_CARD_PATH, CancelTaskResponse, DeleteTaskPushNotificationConfigSuccessResponse, GetAuthenticatedExtendedCardSuccessResponse, GetTaskPushNotificationConfigResponse, GetTaskResponse, HTTP_EXTENSION_HEADER, JSONRPCErrorResponse, ListTaskPushNotificationConfigSuccessResponse, SendMessageResponse, SendStreamingMessageResponse, SetTaskPushNotificationConfigResponse };
|