@crewai-ts/core 0.1.13 → 0.2.0

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.
Files changed (55) hide show
  1. package/dist/agent.d.ts +16 -18
  2. package/dist/auth.cjs +598 -0
  3. package/dist/auth.js +40 -0
  4. package/dist/{chunk-3PVW4JKT.js → chunk-C43UEMCX.js} +6712 -7268
  5. package/dist/chunk-CCOE6MLE.js +896 -0
  6. package/dist/chunk-HFQTF332.js +4455 -0
  7. package/dist/{chunk-BE4JYKSG.js → chunk-MM4ROIFG.js} +12 -1490
  8. package/dist/chunk-RH43TNKN.js +238 -0
  9. package/dist/chunk-S477WFUT.js +565 -0
  10. package/dist/chunk-SB7ADUQA.js +110 -0
  11. package/dist/chunk-T32G6KDW.js +40 -0
  12. package/dist/crew.d.ts +24 -26
  13. package/dist/events.cjs +7513 -0
  14. package/dist/events.js +406 -0
  15. package/dist/experimental-conversational.cjs +272 -0
  16. package/dist/experimental-conversational.js +26 -0
  17. package/dist/feature-hooks.cjs +149 -0
  18. package/dist/feature-hooks.d.ts +94 -0
  19. package/dist/feature-hooks.js +36 -0
  20. package/dist/index.cjs +33923 -64381
  21. package/dist/index.d.ts +2 -15
  22. package/dist/index.js +16720 -49562
  23. package/dist/input-provider.d.ts +3 -4
  24. package/dist/lite-agent.d.ts +4 -4
  25. package/dist/llm.cjs +7467 -0
  26. package/dist/llm.d.ts +0 -4
  27. package/dist/llm.js +225 -0
  28. package/dist/optional-yaml.d.ts +8 -0
  29. package/dist/project.d.ts +1 -1
  30. package/dist/schema-utils.cjs +968 -0
  31. package/dist/schema-utils.d.ts +1 -1
  32. package/dist/schema-utils.js +102 -0
  33. package/dist/state-provider-core.js +3 -2
  34. package/dist/task.d.ts +3 -4
  35. package/dist/tools.cjs +6872 -0
  36. package/dist/tools.d.ts +0 -60
  37. package/dist/tools.js +114 -0
  38. package/dist/types.cjs +68 -0
  39. package/dist/types.js +14 -0
  40. package/package.json +52 -111
  41. package/dist/a2a.d.ts +0 -1684
  42. package/dist/a2ui-schemas.d.ts +0 -3312
  43. package/dist/a2ui.d.ts +0 -379
  44. package/dist/flow-conversation.d.ts +0 -90
  45. package/dist/flow-definition.d.ts +0 -195
  46. package/dist/flow-persistence.d.ts +0 -107
  47. package/dist/flow-visualization.d.ts +0 -77
  48. package/dist/flow.d.ts +0 -927
  49. package/dist/knowledge.d.ts +0 -353
  50. package/dist/mcp-DS7UMYAM.js +0 -62
  51. package/dist/mcp.d.ts +0 -315
  52. package/dist/memory.d.ts +0 -915
  53. package/dist/openai-completion.d.ts +0 -327
  54. package/dist/provider-completions.d.ts +0 -596
  55. package/dist/rag.d.ts +0 -1074
package/dist/a2a.d.ts DELETED
@@ -1,1684 +0,0 @@
1
- import { type KeyObject } from "node:crypto";
2
- import { ConversationState } from "./experimental-conversational.js";
3
- export type LogContextFields = Record<string, unknown>;
4
- export declare const A2ATransport: {
5
- readonly JSONRPC: "JSONRPC";
6
- readonly GRPC: "GRPC";
7
- readonly HTTP_JSON: "HTTP+JSON";
8
- };
9
- export type A2ATransportProtocol = typeof A2ATransport[keyof typeof A2ATransport];
10
- export type TransportProtocol = A2ATransportProtocol;
11
- export type NegotiationSource = A2ANegotiationSource;
12
- export type A2AProtocolVersion = "0.2.0" | "0.2.1" | "0.2.2" | "0.2.3" | "0.2.4" | "0.2.5" | "0.2.6" | "0.3.0" | "0.4.0";
13
- export type A2ANegotiationSource = "client_preferred" | "server_preferred" | "fallback";
14
- export type A2AAgentInterface = {
15
- transport: string;
16
- url: string;
17
- };
18
- export type A2AAgentCard = {
19
- name?: string;
20
- url: string;
21
- preferredTransport?: string | null;
22
- preferred_transport?: string | null;
23
- additionalInterfaces?: readonly A2AAgentInterface[] | null;
24
- additional_interfaces?: readonly A2AAgentInterface[] | null;
25
- };
26
- export declare const TransportProtocol: Readonly<{
27
- kind: "TransportProtocol";
28
- }>;
29
- export declare const NegotiationSource: Readonly<{
30
- kind: "NegotiationSource";
31
- }>;
32
- export type A2APartsMetadataDict = {
33
- mimeType?: "application/json";
34
- schema?: Record<string, unknown>;
35
- };
36
- export type A2APartsDict = {
37
- text: string;
38
- metadata?: A2APartsMetadataDict;
39
- };
40
- export type A2AAgentResponseProtocol = {
41
- a2a_ids?: readonly string[];
42
- message: string;
43
- is_a2a: boolean;
44
- };
45
- export type A2AConfigTypes = A2AConfig | A2AServerConfig | A2AClientConfig;
46
- export type A2AClientConfigTypes = A2AConfig | A2AClientConfig;
47
- export declare const ProtocolVersion: readonly ["0.2.0", "0.2.1", "0.2.2", "0.2.3", "0.2.4", "0.2.5", "0.2.6", "0.3.0", "0.4.0"];
48
- export declare const Url: Readonly<{
49
- kind: "Url";
50
- }>;
51
- export declare const AgentResponseProtocol: Readonly<{
52
- kind: "AgentResponseProtocol";
53
- }>;
54
- export declare const A2AConfigTypes: Readonly<{
55
- kind: "A2AConfigTypes";
56
- }>;
57
- export declare const A2AClientConfigTypes: Readonly<{
58
- kind: "A2AClientConfigTypes";
59
- }>;
60
- export declare const PartsMetadataDict: Readonly<{
61
- kind: "PartsMetadataDict";
62
- }>;
63
- export declare const PartsDict: Readonly<{
64
- kind: "PartsDict";
65
- }>;
66
- export type AgentResponseProtocol = A2AAgentResponseProtocol;
67
- export type PartsMetadataDict = A2APartsMetadataDict;
68
- export type PartsDict = A2APartsDict;
69
- export type ProtocolVersion = A2AProtocolVersion;
70
- export type Url = string;
71
- export declare const PollingHandlerType: Readonly<{
72
- kind: "PollingHandlerType";
73
- }>;
74
- export declare const StreamingHandlerType: Readonly<{
75
- kind: "StreamingHandlerType";
76
- }>;
77
- export declare const PushNotificationHandlerType: Readonly<{
78
- kind: "PushNotificationHandlerType";
79
- }>;
80
- export declare const HandlerType: Readonly<{
81
- kind: "HandlerType";
82
- }>;
83
- export type PollingHandlerType = typeof PollingHandlerType;
84
- export type StreamingHandlerType = typeof StreamingHandlerType;
85
- export type PushNotificationHandlerType = typeof PushNotificationHandlerType;
86
- export type HandlerType = PollingHandlerType | StreamingHandlerType | PushNotificationHandlerType;
87
- export declare const HANDLER_REGISTRY: Map<unknown, unknown>;
88
- export declare const BaseHandlerKwargs: Readonly<{
89
- kind: "BaseHandlerKwargs";
90
- }>;
91
- export type BaseHandlerKwargs = {
92
- turn_number?: number;
93
- turnNumber?: number;
94
- is_multiturn?: boolean;
95
- isMultiturn?: boolean;
96
- agent_role?: string | null;
97
- agentRole?: string | null;
98
- context_id?: string | null;
99
- contextId?: string | null;
100
- task_id?: string | null;
101
- taskId?: string | null;
102
- endpoint?: string | null;
103
- agent_branch?: unknown;
104
- agentBranch?: unknown;
105
- a2a_agent_name?: string | null;
106
- a2aAgentName?: string | null;
107
- from_task?: unknown;
108
- fromTask?: unknown;
109
- from_agent?: unknown;
110
- fromAgent?: unknown;
111
- };
112
- export declare const PollingHandlerKwargs: Readonly<{
113
- kind: "PollingHandlerKwargs";
114
- }>;
115
- export type PollingHandlerKwargs = BaseHandlerKwargs & {
116
- polling_interval?: number;
117
- pollingInterval?: number;
118
- polling_timeout?: number;
119
- pollingTimeout?: number;
120
- history_length?: number;
121
- historyLength?: number;
122
- max_polls?: number | null;
123
- maxPolls?: number | null;
124
- };
125
- export declare const StreamingHandlerKwargs: Readonly<{
126
- kind: "StreamingHandlerKwargs";
127
- }>;
128
- export type StreamingHandlerKwargs = BaseHandlerKwargs;
129
- export declare const PushNotificationHandlerKwargs: Readonly<{
130
- kind: "PushNotificationHandlerKwargs";
131
- }>;
132
- export type PushNotificationHandlerKwargs = BaseHandlerKwargs & {
133
- config?: unknown;
134
- result_store?: PushNotificationResultStore;
135
- resultStore?: PushNotificationResultStore;
136
- polling_timeout?: number;
137
- pollingTimeout?: number;
138
- polling_interval?: number;
139
- pollingInterval?: number;
140
- };
141
- export type UpdateConfig = PollingConfig | StreamingConfig | PushNotificationConfig;
142
- export declare const UpdateConfig: Readonly<{
143
- kind: "UpdateConfig";
144
- }>;
145
- export declare function _get_default_update_config(): StreamingConfig;
146
- export declare class CommonParams {
147
- readonly turn_number: number;
148
- readonly turnNumber: number;
149
- readonly is_multiturn: boolean;
150
- readonly isMultiturn: boolean;
151
- readonly agent_role: string | null;
152
- readonly agentRole: string | null;
153
- readonly endpoint: string;
154
- readonly a2a_agent_name: string | null;
155
- readonly a2aAgentName: string | null;
156
- readonly context_id: string | null;
157
- readonly contextId: string | null;
158
- readonly from_task: unknown;
159
- readonly fromTask: unknown;
160
- readonly from_agent: unknown;
161
- readonly fromAgent: unknown;
162
- constructor(options: {
163
- turn_number?: number;
164
- is_multiturn?: boolean;
165
- agent_role?: string | null;
166
- endpoint: string;
167
- a2a_agent_name?: string | null;
168
- context_id?: string | null;
169
- from_task?: unknown;
170
- from_agent?: unknown;
171
- });
172
- [Symbol.iterator](): IterableIterator<unknown>;
173
- }
174
- export declare const PushNotificationResultStore: Readonly<{
175
- kind: "PushNotificationResultStore";
176
- }>;
177
- export interface PushNotificationResultStore {
178
- waitForResult?(taskId: string, timeout: number, pollInterval?: number): Promise<unknown>;
179
- wait_for_result?(task_id: string, timeout: number, poll_interval?: number): Promise<unknown>;
180
- getResult?(taskId: string): Promise<unknown>;
181
- get_result?(task_id: string): Promise<unknown>;
182
- storeResult?(task: unknown): Promise<void>;
183
- store_result?(task: unknown): Promise<void>;
184
- }
185
- export declare class StreamingConfig {
186
- readonly timeout: number | null;
187
- constructor(timeout?: number | null);
188
- }
189
- export declare enum WebhookSignatureMode {
190
- NONE = "none",
191
- HMAC_SHA256 = "hmac_sha256"
192
- }
193
- export declare class WebhookSignatureConfig {
194
- readonly mode: WebhookSignatureMode;
195
- readonly secret: string | null;
196
- readonly timestampToleranceSeconds: number;
197
- readonly timestamp_tolerance_seconds: number;
198
- readonly headerName: string;
199
- readonly header_name: string;
200
- readonly timestampHeaderName: string;
201
- readonly timestamp_header_name: string;
202
- constructor(options?: {
203
- mode?: WebhookSignatureMode | `${WebhookSignatureMode}`;
204
- secret?: string | null;
205
- timestampToleranceSeconds?: number;
206
- timestamp_tolerance_seconds?: number;
207
- headerName?: string;
208
- header_name?: string;
209
- timestampHeaderName?: string;
210
- timestamp_header_name?: string;
211
- });
212
- static generateSecret(length?: number): string;
213
- static generate_secret(length?: number): string;
214
- static hmacSha256(secret: string, timestampToleranceSeconds?: number): WebhookSignatureConfig;
215
- static hmac_sha256(secret: string, timestamp_tolerance_seconds?: number): WebhookSignatureConfig;
216
- }
217
- export type SignatureInput = WebhookSignatureConfig | string | null;
218
- export declare const SignatureInput: Readonly<{
219
- kind: "SignatureInput";
220
- }>;
221
- declare function coerceSignature(value: SignatureInput | undefined): WebhookSignatureConfig | null;
222
- export declare const _coerce_signature: typeof coerceSignature;
223
- export declare class PushNotificationConfig {
224
- readonly url: string;
225
- readonly id: string | null;
226
- readonly token: string | null;
227
- readonly authentication: unknown;
228
- readonly timeout: number | null;
229
- readonly interval: number;
230
- readonly resultStore: PushNotificationResultStore | null;
231
- readonly result_store: PushNotificationResultStore | null;
232
- readonly signature: WebhookSignatureConfig | null;
233
- constructor(options: {
234
- url: string | URL;
235
- id?: string | null;
236
- token?: string | null;
237
- authentication?: unknown;
238
- timeout?: number | null;
239
- interval?: number;
240
- resultStore?: PushNotificationResultStore | null;
241
- result_store?: PushNotificationResultStore | null;
242
- signature?: SignatureInput;
243
- });
244
- }
245
- export declare const UpdateHandler: Readonly<{
246
- kind: "UpdateHandler";
247
- }>;
248
- export interface UpdateHandler {
249
- execute(client: unknown, message: unknown, newMessages: unknown[], agentCard: unknown, kwargs?: Record<string, unknown>): Promise<A2ATaskStateResult>;
250
- }
251
- export declare function extractCommonParams(kwargs: BaseHandlerKwargs): CommonParams;
252
- export declare const extract_common_params: typeof extractCommonParams;
253
- export declare const A2ATaskState: {
254
- readonly submitted: "submitted";
255
- readonly working: "working";
256
- readonly input_required: "input_required";
257
- readonly auth_required: "auth_required";
258
- readonly completed: "completed";
259
- readonly failed: "failed";
260
- readonly rejected: "rejected";
261
- readonly canceled: "canceled";
262
- };
263
- export type A2ATaskState = typeof A2ATaskState[keyof typeof A2ATaskState];
264
- export declare const TERMINAL_STATES: ReadonlySet<A2ATaskState>;
265
- export declare const ACTIONABLE_STATES: ReadonlySet<A2ATaskState>;
266
- export declare const PENDING_STATES: ReadonlySet<A2ATaskState>;
267
- export type A2ATextPartLike = {
268
- text?: string;
269
- kind?: string;
270
- data?: Record<string, unknown>;
271
- file?: A2AFileWithBytesLike | A2AFileWithUriLike;
272
- metadata?: Record<string, unknown>;
273
- root?: {
274
- text?: string;
275
- kind?: string;
276
- data?: Record<string, unknown>;
277
- file?: A2AFileWithBytesLike | A2AFileWithUriLike;
278
- metadata?: Record<string, unknown>;
279
- };
280
- };
281
- export type A2AFileWithBytesLike = {
282
- bytes: string;
283
- name?: string | null;
284
- mimeType?: string | null;
285
- mime_type?: string | null;
286
- };
287
- export type A2AFileWithUriLike = {
288
- uri: string;
289
- name?: string | null;
290
- mimeType?: string | null;
291
- mime_type?: string | null;
292
- };
293
- export type A2AFileInputLike = {
294
- source: Buffer | string;
295
- filename?: string | null;
296
- mimeType?: string | null;
297
- mime_type?: string | null;
298
- };
299
- export type A2AMessageLike = {
300
- role?: string;
301
- messageId?: string | null;
302
- message_id?: string | null;
303
- parts?: readonly A2ATextPartLike[];
304
- contextId?: string | null;
305
- context_id?: string | null;
306
- taskId?: string | null;
307
- task_id?: string | null;
308
- metadata?: Record<string, unknown> | null;
309
- };
310
- export type A2AArtifactLike = {
311
- parts?: readonly A2ATextPartLike[];
312
- };
313
- export type A2ATaskLike = {
314
- id?: string;
315
- contextId?: string | null;
316
- context_id?: string | null;
317
- status?: {
318
- state?: A2ATaskState;
319
- message?: A2AMessageLike | null;
320
- timestamp?: string | null;
321
- } | null;
322
- history?: readonly A2AMessageLike[] | null;
323
- artifacts?: readonly A2AArtifactLike[] | null;
324
- };
325
- export type A2AExecutionContext = {
326
- taskId?: string | null;
327
- task_id?: string | null;
328
- contextId?: string | null;
329
- context_id?: string | null;
330
- currentTask?: A2ATaskLike | null;
331
- current_task?: A2ATaskLike | null;
332
- message?: A2AMessageLike | null;
333
- getUserInput?: () => string;
334
- get_user_input?: () => string;
335
- };
336
- export type A2AEventQueue = {
337
- enqueueEvent?: (event: unknown) => Promise<void> | void;
338
- enqueue_event?: (event: unknown) => Promise<void> | void;
339
- };
340
- export type A2ACancelCache = {
341
- get?: (key: string) => PromiseLike<boolean | string | null | undefined> | boolean | string | null | undefined;
342
- delete?: (key: string) => PromiseLike<void> | void;
343
- client?: {
344
- pubsub?: () => {
345
- subscribe?: (channel: string) => PromiseLike<void> | void;
346
- listen?: () => AsyncIterable<Record<string, unknown>>;
347
- };
348
- };
349
- };
350
- export type A2AExtensionRegistry = {
351
- invokeOnRequest?: (context: unknown) => Promise<void> | void;
352
- invoke_on_request?: (context: unknown) => Promise<void> | void;
353
- invokeOnResponse?: (context: unknown, result: unknown) => Promise<unknown>;
354
- invoke_on_response?: (context: unknown, result: unknown) => Promise<unknown>;
355
- };
356
- export { ConversationState };
357
- export type A2AExtension = {
358
- injectTools?: (agent: unknown) => void;
359
- inject_tools?: (agent: unknown) => void;
360
- extractStateFromHistory?: (conversationHistory: readonly unknown[]) => ConversationState | null;
361
- extract_state_from_history?: (conversation_history: readonly unknown[]) => ConversationState | null;
362
- augmentPrompt?: (basePrompt: string, conversationState: ConversationState | null) => string;
363
- augment_prompt?: (base_prompt: string, conversation_state: ConversationState | null) => string;
364
- processResponse?: (agentResponse: unknown, conversationState: ConversationState | null) => unknown;
365
- process_response?: (agent_response: unknown, conversation_state: ConversationState | null) => unknown;
366
- prepareMessageMetadata?: (conversationState: ConversationState | null) => Record<string, unknown>;
367
- prepare_message_metadata?: (conversation_state: ConversationState | null) => Record<string, unknown>;
368
- };
369
- export declare const A2AExtension: Readonly<{
370
- kind: "A2AExtension";
371
- }>;
372
- export declare const ValidatedA2AExtension: Readonly<{
373
- kind: "ValidatedA2AExtension";
374
- }>;
375
- export declare class ExtensionRegistry {
376
- private readonly extensions;
377
- register(extension: A2AExtension): void;
378
- inject_all_tools(agent: unknown): void;
379
- extract_all_states(conversation_history: readonly unknown[]): Map<unknown, ConversationState>;
380
- augment_prompt_with_all(base_prompt: string, extension_states: Map<unknown, ConversationState>): string;
381
- process_response_with_all(agent_response: unknown, extension_states: Map<unknown, ConversationState>): unknown;
382
- prepare_all_metadata(extension_states: Map<unknown, ConversationState>): Record<string, unknown>;
383
- }
384
- export declare class ExtensionsMiddleware {
385
- private readonly extensions;
386
- constructor(extensions: readonly string[]);
387
- intercept(_method_name: string, request_payload: Record<string, unknown>, http_kwargs: {
388
- headers?: Record<string, string>;
389
- }): Promise<[Record<string, unknown>, {
390
- headers?: Record<string, string>;
391
- }]>;
392
- }
393
- export declare class ExtensionContext {
394
- readonly metadata: Record<string, unknown>;
395
- readonly client_extensions: Set<string>;
396
- readonly state: Record<string, unknown>;
397
- constructor(metadata?: Record<string, unknown>, client_extensions?: Set<string>, options?: {
398
- state?: Record<string, unknown>;
399
- server_context?: unknown;
400
- });
401
- readonly server_context: unknown;
402
- get_extension_metadata(uri: string, key: string): unknown;
403
- set_extension_metadata(uri: string, key: string, value: unknown): void;
404
- }
405
- export declare abstract class ServerExtension {
406
- abstract readonly uri: string;
407
- readonly required: boolean;
408
- readonly description: string | null;
409
- get params(): Record<string, unknown> | null;
410
- agent_extension(): Record<string, unknown>;
411
- is_active(context: ExtensionContext): boolean;
412
- abstract on_request(context: ExtensionContext): Promise<void>;
413
- abstract on_response(context: ExtensionContext, result: unknown): Promise<unknown>;
414
- }
415
- export declare class ServerExtensionRegistry {
416
- private readonly extensions;
417
- constructor(extensions?: readonly ServerExtension[]);
418
- register(extension: ServerExtension): void;
419
- get_agent_extensions(): Record<string, unknown>[];
420
- get_extension(uri: string): ServerExtension | null;
421
- static create_context(metadata: Record<string, unknown>, client_extensions: Set<string>, server_context?: unknown): ExtensionContext;
422
- invoke_on_request(context: ExtensionContext): Promise<void>;
423
- invoke_on_response(context: ExtensionContext, result: unknown): Promise<unknown>;
424
- }
425
- export type A2ATaskStateResult = {
426
- status: A2ATaskState;
427
- history: A2AMessageLike[];
428
- result?: string;
429
- error?: string;
430
- agent_card?: Record<string, unknown>;
431
- a2a_agent_name?: string | null;
432
- };
433
- export declare const TaskStateResult: Readonly<{
434
- kind: "TaskStateResult";
435
- }>;
436
- export type TaskStateResult = A2ATaskStateResult;
437
- export declare const SendMessageEvent: Readonly<{
438
- kind: "SendMessageEvent";
439
- }>;
440
- export type SendMessageEvent = A2AMessageLike | readonly [A2ATaskLike, unknown];
441
- export declare class DelegationContext {
442
- readonly a2a_agents: readonly A2AClientConfigTypes[];
443
- readonly agent_response_model: unknown;
444
- readonly current_request: string;
445
- readonly agent_id: string;
446
- readonly agent_config: A2AClientConfigTypes | null;
447
- readonly context_id: string | null;
448
- readonly task_id: string | null;
449
- readonly metadata: Record<string, unknown> | null;
450
- readonly extensions: Record<string, unknown> | null;
451
- readonly reference_task_ids: readonly string[];
452
- readonly original_task_description: string;
453
- readonly max_turns: number;
454
- constructor(options?: {
455
- a2a_agents?: readonly A2AClientConfigTypes[];
456
- agent_response_model?: unknown;
457
- current_request?: string;
458
- agent_id?: string;
459
- agent_config?: A2AClientConfigTypes | null;
460
- context_id?: string | null;
461
- task_id?: string | null;
462
- metadata?: Record<string, unknown> | null;
463
- extensions?: Record<string, unknown> | null;
464
- reference_task_ids?: readonly string[];
465
- original_task_description?: string;
466
- max_turns?: number;
467
- });
468
- }
469
- export declare class DelegationState {
470
- readonly current_request: string;
471
- readonly context_id: string | null;
472
- readonly task_id: string | null;
473
- readonly reference_task_ids: readonly string[];
474
- readonly conversation_history: readonly A2AMessageLike[];
475
- readonly agent_card: A2AAgentCard | null;
476
- readonly agent_card_dict: Record<string, unknown> | null;
477
- readonly agent_name: string | null;
478
- constructor(options?: {
479
- current_request?: string;
480
- context_id?: string | null;
481
- task_id?: string | null;
482
- reference_task_ids?: readonly string[];
483
- conversation_history?: readonly A2AMessageLike[];
484
- agent_card?: A2AAgentCard | null;
485
- agent_card_dict?: Record<string, unknown> | null;
486
- agent_name?: string | null;
487
- });
488
- }
489
- export declare const MAX_RESUBSCRIBE_ATTEMPTS = 3;
490
- export declare const RESUBSCRIBE_BACKOFF_BASE = 1;
491
- export declare class StreamingHandler {
492
- readonly maxResubscribeAttempts = 3;
493
- readonly resubscribeBackoffBase = 1;
494
- static handle(client: A2AStreamingClient, options?: {
495
- eventStream?: AsyncIterable<SendMessageEvent>;
496
- event_stream?: AsyncIterable<SendMessageEvent>;
497
- newMessages?: A2AMessageLike[];
498
- new_messages?: A2AMessageLike[];
499
- agentCard?: A2AAgentCard;
500
- agent_card?: A2AAgentCard;
501
- }): Promise<string | A2ATaskStateResult>;
502
- static execute(client: A2AUpdateClient, message: A2AMessageLike, newMessages: A2AMessageLike[], agentCard: A2AAgentCard, kwargs?: StreamingHandlerKwargs): Promise<A2ATaskStateResult>;
503
- static _try_recover_from_interruption(): Promise<A2ATaskStateResult | null>;
504
- }
505
- export type A2AUpdateClient = {
506
- sendMessage?: (message: A2AMessageLike) => AsyncIterable<SendMessageEvent>;
507
- send_message?: (message: A2AMessageLike) => AsyncIterable<SendMessageEvent>;
508
- getTask?: (params: {
509
- id: string;
510
- historyLength?: number;
511
- history_length?: number;
512
- }) => Promise<A2ATaskLike>;
513
- get_task?: (params: {
514
- id: string;
515
- historyLength?: number;
516
- history_length?: number;
517
- }) => Promise<A2ATaskLike>;
518
- };
519
- export declare class PollingHandler {
520
- readonly kind = "PollingHandler";
521
- static execute(client: A2AUpdateClient, message: A2AMessageLike, newMessages: A2AMessageLike[], agentCard: A2AAgentCard, kwargs?: PollingHandlerKwargs): Promise<A2ATaskStateResult>;
522
- }
523
- export declare class PushNotificationHandler {
524
- readonly kind = "PushNotificationHandler";
525
- static execute(client: A2AUpdateClient, message: A2AMessageLike, newMessages: A2AMessageLike[], agentCard: A2AAgentCard, kwargs?: PushNotificationHandlerKwargs): Promise<A2ATaskStateResult>;
526
- }
527
- export declare class PollingConfig {
528
- readonly interval: number;
529
- constructor(interval?: number);
530
- }
531
- export type A2AStreamingClient = {
532
- get_task?: (...args: readonly unknown[]) => Promise<A2ATaskLike>;
533
- resubscribe?: (...args: readonly unknown[]) => AsyncIterable<SendMessageEvent>;
534
- };
535
- export declare function _poll_task_until_complete(client: A2AUpdateClient, task_id: string, polling_interval: number, polling_timeout: number, agent_branch?: unknown, history_length?: number, max_polls?: number | null, from_task?: unknown, from_agent?: unknown, context_id?: string | null, endpoint?: string | null, a2a_agent_name?: string | null): Promise<A2ATaskLike>;
536
- export type A2AHeaders = Record<string, string>;
537
- export type APIKeyLocation = "header" | "query" | "cookie";
538
- type SecretStringLike = {
539
- get_secret_value?: () => string;
540
- getSecretValue?: () => string;
541
- };
542
- export type JWTAlgorithm = "RS256" | "RS384" | "RS512" | "ES256" | "ES384" | "ES512" | "PS256" | "PS384" | "PS512";
543
- export declare const JWTAlgorithm: readonly ["RS256", "RS384", "RS512", "ES256", "ES384", "ES512", "PS256", "PS384", "PS512"];
544
- export declare class SecretStr {
545
- readonly value: string;
546
- constructor(value: string);
547
- get_secret_value(): string;
548
- getSecretValue(): string;
549
- toString(): string;
550
- }
551
- export declare function _coerce_secret_str(value: string | SecretStr | null | undefined): SecretStr | null;
552
- export declare const CoercedSecretStr: Readonly<{
553
- kind: "CoercedSecretStr";
554
- coerce: typeof _coerce_secret_str;
555
- }>;
556
- export type RedisCacheConfig = {
557
- cache?: string;
558
- endpoint?: string;
559
- port?: number;
560
- db?: number;
561
- password?: string;
562
- };
563
- export declare const RedisCacheConfig: Readonly<{
564
- kind: "RedisCacheConfig";
565
- }>;
566
- export declare const SigningAlgorithm: readonly ["RS256", "RS384", "RS512", "ES256", "ES384", "ES512", "PS256", "PS384", "PS512"];
567
- export declare class JSONFormatter {
568
- format(record: {
569
- levelname?: string;
570
- level?: string;
571
- name?: string;
572
- msg?: unknown;
573
- message?: unknown;
574
- [key: string]: unknown;
575
- }): string;
576
- }
577
- export declare class LogContext {
578
- private readonly fields;
579
- private readonly previous;
580
- constructor(fields?: LogContextFields);
581
- enter(): this;
582
- exit(): void;
583
- }
584
- export declare function configure_json_logging(_logger_name?: string): void;
585
- export declare function get_logger(name: string): {
586
- debug: (...args: unknown[]) => void;
587
- info: (...args: unknown[]) => void;
588
- warn: (...args: unknown[]) => void;
589
- warning: (...args: unknown[]) => void;
590
- error: (...args: unknown[]) => void;
591
- };
592
- export declare function parse_www_authenticate(header_value: string): Record<string, Record<string, string>>;
593
- export declare class _AuthStore<TAuth = unknown> {
594
- private readonly store;
595
- static compute_key(auth_type: string, auth_data: string): string;
596
- compute_key(auth_type: string, auth_data: string): string;
597
- set(key: string, auth: TAuth | null): void;
598
- get(key: string): TAuth | null;
599
- __setitem__(key: string, value: TAuth | null): void;
600
- __getitem__(key: string): TAuth | null;
601
- }
602
- export declare const _auth_store: _AuthStore<ClientAuthScheme>;
603
- type AuthConstructor = {
604
- readonly name: string;
605
- };
606
- export declare function _raise_auth_mismatch(expected_classes: AuthConstructor | readonly AuthConstructor[], provided_auth: unknown): never;
607
- export declare function validate_auth_against_agent_card(agent_card: {
608
- security?: readonly Record<string, unknown>[] | null;
609
- }, auth: unknown): void;
610
- export declare function retry_on_401<TResponse extends {
611
- status?: number;
612
- status_code?: number;
613
- headers?: {
614
- get?: (name: string) => string | null;
615
- } | Record<string, string>;
616
- raise_for_status?: () => void;
617
- }>(request_func: () => Promise<TResponse>, auth_scheme: {
618
- apply_auth?: (client: unknown, headers: Record<string, string>) => Promise<Record<string, string>>;
619
- applyAuth?: (headers: Record<string, string>) => Promise<Record<string, string>>;
620
- } | null, client: unknown, headers: Record<string, string>, max_retries?: number): Promise<TResponse>;
621
- export declare function configure_auth_client(auth: {
622
- configureClient?: (client: unknown) => void;
623
- configure_client?: (client: unknown) => void;
624
- }, client: unknown): void;
625
- export declare class A2AHTTPException extends Error {
626
- readonly statusCode: number;
627
- readonly status_code: number;
628
- readonly detail: string | null;
629
- readonly headers: Record<string, string> | null;
630
- constructor(options?: {
631
- statusCode?: number;
632
- status_code?: number;
633
- detail?: string | null;
634
- headers?: Record<string, string> | null;
635
- });
636
- }
637
- export declare class TLSConfig {
638
- readonly clientCertPath: string | null;
639
- readonly client_cert_path: string | null;
640
- readonly clientKeyPath: string | null;
641
- readonly client_key_path: string | null;
642
- readonly caCertPath: string | null;
643
- readonly ca_cert_path: string | null;
644
- readonly verify: boolean;
645
- constructor(options?: {
646
- clientCertPath?: string | null;
647
- client_cert_path?: string | null;
648
- clientKeyPath?: string | null;
649
- client_key_path?: string | null;
650
- caCertPath?: string | null;
651
- ca_cert_path?: string | null;
652
- verify?: boolean;
653
- });
654
- getHttpxSslContext(): boolean | string | {
655
- clientCertPath: string;
656
- clientKeyPath: string;
657
- caCertPath: string | null;
658
- };
659
- get_httpx_ssl_context(): boolean | string | {
660
- clientCertPath: string;
661
- clientKeyPath: string;
662
- caCertPath: string | null;
663
- };
664
- getGrpcCredentials(): {
665
- rootCertificates: Buffer | null;
666
- privateKey: Buffer | null;
667
- certificateChain: Buffer | null;
668
- } | null;
669
- get_grpc_credentials(): {
670
- rootCertificates: Buffer | null;
671
- privateKey: Buffer | null;
672
- certificateChain: Buffer | null;
673
- } | null;
674
- }
675
- export declare abstract class ClientAuthScheme {
676
- readonly tls: TLSConfig | null;
677
- constructor(options?: {
678
- tls?: TLSConfig | null;
679
- });
680
- abstract applyAuth(headers?: A2AHeaders): Promise<A2AHeaders>;
681
- apply_auth(_client: unknown, headers?: A2AHeaders): Promise<A2AHeaders>;
682
- }
683
- export declare abstract class AuthScheme extends ClientAuthScheme {
684
- }
685
- export declare class BearerTokenAuth extends ClientAuthScheme {
686
- readonly token: string;
687
- constructor(options: {
688
- token: string;
689
- tls?: TLSConfig | null;
690
- });
691
- applyAuth(headers?: A2AHeaders): Promise<A2AHeaders>;
692
- }
693
- export declare class HTTPBasicAuth extends ClientAuthScheme {
694
- readonly username: string;
695
- readonly password: string;
696
- constructor(options: {
697
- username: string;
698
- password: string;
699
- tls?: TLSConfig | null;
700
- });
701
- applyAuth(headers?: A2AHeaders): Promise<A2AHeaders>;
702
- apply_auth(_client: unknown, headers?: A2AHeaders): Promise<A2AHeaders>;
703
- }
704
- export declare class HTTPDigestAuth extends ClientAuthScheme {
705
- readonly username: string;
706
- readonly password: string;
707
- private readonly configuredClients;
708
- constructor(options: {
709
- username: string;
710
- password: string;
711
- tls?: TLSConfig | null;
712
- });
713
- applyAuth(headers?: A2AHeaders): Promise<A2AHeaders>;
714
- apply_auth(_client: unknown, headers?: A2AHeaders): Promise<A2AHeaders>;
715
- configureClient(client: unknown): void;
716
- configure_client(client: unknown): void;
717
- }
718
- export declare class APIKeyAuth extends ClientAuthScheme {
719
- readonly apiKey: string;
720
- readonly api_key: string;
721
- readonly location: APIKeyLocation;
722
- readonly name: string;
723
- private readonly configuredClients;
724
- constructor(options: {
725
- apiKey?: string;
726
- api_key?: string;
727
- location?: APIKeyLocation;
728
- name?: string;
729
- tls?: TLSConfig | null;
730
- });
731
- applyAuth(headers?: A2AHeaders): Promise<A2AHeaders>;
732
- apply_auth(_client: unknown, headers?: A2AHeaders): Promise<A2AHeaders>;
733
- configureClient(client: unknown): void;
734
- configure_client(client: unknown): void;
735
- applyToUrl(url: string): string;
736
- apply_to_url(url: string): string;
737
- }
738
- export declare class OAuth2ClientCredentials extends ClientAuthScheme {
739
- readonly tokenUrl: string;
740
- readonly token_url: string;
741
- readonly clientId: string;
742
- readonly client_id: string;
743
- readonly clientSecret: string;
744
- readonly client_secret: string;
745
- readonly scopes: readonly string[];
746
- protected accessToken: string | null;
747
- protected tokenExpiresAt: number | null;
748
- private tokenPromise;
749
- protected readonly fetchImpl: typeof fetch;
750
- constructor(options: {
751
- tokenUrl?: string;
752
- token_url?: string;
753
- clientId?: string;
754
- client_id?: string;
755
- clientSecret?: string;
756
- client_secret?: string;
757
- scopes?: readonly string[];
758
- tls?: TLSConfig | null;
759
- fetch?: typeof fetch;
760
- });
761
- setAccessToken(token: string | null, expiresInSeconds?: number | null): void;
762
- set_access_token(token: string | null, expiresInSeconds?: number | null): void;
763
- applyAuth(headers?: A2AHeaders): Promise<A2AHeaders>;
764
- apply_auth(client: unknown, headers?: A2AHeaders): Promise<A2AHeaders>;
765
- private ensureAccessToken;
766
- protected fetchToken(client?: unknown): Promise<void>;
767
- protected requestToken(params: Record<string, string>, client?: unknown): Promise<Record<string, unknown>>;
768
- }
769
- export declare class OAuth2AuthorizationCode extends OAuth2ClientCredentials {
770
- readonly authorizationUrl: string;
771
- readonly authorization_url: string;
772
- readonly redirectUri: string;
773
- readonly redirect_uri: string;
774
- private refreshToken;
775
- private authorizationCallback;
776
- private authorizationPromise;
777
- constructor(options: ConstructorParameters<typeof OAuth2ClientCredentials>[0] & {
778
- authorizationUrl?: string;
779
- authorization_url?: string;
780
- redirectUri?: string;
781
- redirect_uri?: string;
782
- });
783
- setAuthorizationCallback(callback: ((authorizationUrl: string) => Promise<string>) | null): void;
784
- set_authorization_callback(callback: ((authorizationUrl: string) => Promise<string>) | null): void;
785
- applyAuth(headers?: A2AHeaders): Promise<A2AHeaders>;
786
- apply_auth(client: unknown, headers?: A2AHeaders): Promise<A2AHeaders>;
787
- private applyAuthWithClient;
788
- private fetchInitialToken;
789
- private refreshAccessToken;
790
- private applyTokenData;
791
- }
792
- export declare class AuthenticatedUser {
793
- readonly token: string;
794
- readonly scheme: string;
795
- readonly claims: Record<string, unknown> | null;
796
- constructor(options: {
797
- token: string;
798
- scheme: string;
799
- claims?: Record<string, unknown> | null;
800
- });
801
- }
802
- export declare abstract class ServerAuthScheme {
803
- abstract authenticate(token: string): Promise<AuthenticatedUser>;
804
- }
805
- export declare class SimpleTokenAuth extends ServerAuthScheme {
806
- readonly token: string | null;
807
- constructor(options?: {
808
- token?: string | null;
809
- });
810
- getExpectedToken(): string | null;
811
- get_expected_token(): string | null;
812
- _get_expected_token(): string | null;
813
- authenticate(token: string): Promise<AuthenticatedUser>;
814
- }
815
- export declare class EnterpriseTokenAuth extends ServerAuthScheme {
816
- authenticate(_token: string): Promise<AuthenticatedUser>;
817
- }
818
- export declare class APIKeyServerAuth extends ServerAuthScheme {
819
- readonly key: string | null;
820
- readonly keyName: string;
821
- readonly key_name: string;
822
- constructor(options?: {
823
- key?: string | null;
824
- keyName?: string;
825
- key_name?: string;
826
- });
827
- authenticate(token: string): Promise<AuthenticatedUser>;
828
- }
829
- export declare class OIDCAuth extends ServerAuthScheme {
830
- readonly issuer: string;
831
- readonly audience: string;
832
- readonly jwksUrl: string;
833
- readonly jwks_url: string;
834
- readonly algorithms: readonly string[];
835
- readonly requiredClaims: readonly string[];
836
- readonly required_claims: readonly string[];
837
- readonly jwksCacheTtl: number;
838
- readonly jwks_cache_ttl: number;
839
- readonly clockSkewSeconds: number;
840
- readonly clock_skew_seconds: number;
841
- protected readonly fetchImpl: typeof fetch;
842
- private jwkClient;
843
- constructor(options: {
844
- issuer: string;
845
- audience: string;
846
- jwksUrl?: string | null;
847
- jwks_url?: string | null;
848
- algorithms?: readonly string[];
849
- requiredClaims?: readonly string[];
850
- required_claims?: readonly string[];
851
- jwksCacheTtl?: number;
852
- jwks_cache_ttl?: number;
853
- clockSkewSeconds?: number;
854
- clock_skew_seconds?: number;
855
- fetch?: typeof fetch;
856
- });
857
- _init_jwk_client(): this;
858
- authenticate(token: string): Promise<AuthenticatedUser>;
859
- }
860
- type OAuth2Scopes = readonly string[] | Record<string, string>;
861
- export declare class OAuth2ServerAuth extends OIDCAuth {
862
- readonly tokenUrl: string;
863
- readonly token_url: string;
864
- readonly authorizationUrl: string | null;
865
- readonly authorization_url: string | null;
866
- readonly refreshUrl: string | null;
867
- readonly refresh_url: string | null;
868
- readonly scopes: Record<string, string>;
869
- readonly introspectionEndpoint: string | null;
870
- readonly introspection_endpoint: string | null;
871
- readonly introspectionUrl: string | null;
872
- readonly introspection_url: string | null;
873
- readonly introspectionClientId: string | null;
874
- readonly introspection_client_id: string | null;
875
- readonly introspectionClientSecret: SecretStr | null;
876
- readonly introspection_client_secret: SecretStr | null;
877
- private readonly oauthJwksConfigured;
878
- constructor(options: ConstructorParameters<typeof OIDCAuth>[0] & {
879
- tokenUrl?: string;
880
- token_url?: string;
881
- authorizationUrl?: string | null;
882
- authorization_url?: string | null;
883
- refreshUrl?: string | null;
884
- refresh_url?: string | null;
885
- scopes?: OAuth2Scopes;
886
- introspectionEndpoint?: string | null;
887
- introspection_endpoint?: string | null;
888
- introspectionUrl?: string | null;
889
- introspection_url?: string | null;
890
- introspectionClientId?: string | null;
891
- introspection_client_id?: string | null;
892
- introspectionClientSecret?: SecretStr | string | null;
893
- introspection_client_secret?: SecretStr | string | null;
894
- });
895
- authenticate(token: string): Promise<AuthenticatedUser>;
896
- _validate_and_init(): this;
897
- _authenticate_jwt(token: string): Promise<AuthenticatedUser>;
898
- _authenticate_introspection(token: string): Promise<AuthenticatedUser>;
899
- toSecurityScheme(): Record<string, unknown>;
900
- to_security_scheme(): Record<string, unknown>;
901
- }
902
- export declare class MTLSServerAuth extends ServerAuthScheme {
903
- readonly required = true;
904
- authenticate(token: string): Promise<AuthenticatedUser>;
905
- }
906
- export declare function sign_agent_card(agent_card: Record<string, unknown>, private_key: string | Uint8Array | KeyObject | SecretStringLike, key_id?: string | null, algorithm?: JWTAlgorithm): {
907
- protected: string;
908
- signature: string;
909
- header: Record<string, string> | null;
910
- };
911
- export declare function verify_agent_card_signature(agent_card: Record<string, unknown>, signature: {
912
- protected: string;
913
- signature: string;
914
- }, public_key: string | Uint8Array | KeyObject, algorithms?: readonly string[] | null): boolean;
915
- export declare function get_key_id_from_signature(signature: {
916
- protected: string;
917
- header?: Record<string, unknown> | null;
918
- }): string | null;
919
- export declare const JSONRPC_TRANSPORT: "JSONRPC";
920
- export declare const GRPC_TRANSPORT: "GRPC";
921
- export declare const HTTP_JSON_TRANSPORT: "HTTP+JSON";
922
- export declare const DEFAULT_TRANSPORT_PREFERENCE: readonly A2ATransportProtocol[];
923
- export declare const AVAILABLE_AGENTS_TEMPLATE = "\n<AVAILABLE_A2A_AGENTS>\n $available_a2a_agents\n</AVAILABLE_A2A_AGENTS>\n";
924
- export declare const PREVIOUS_A2A_CONVERSATION_TEMPLATE = "\n<PREVIOUS_A2A_CONVERSATION>\n $previous_a2a_conversation\n</PREVIOUS_A2A_CONVERSATION>\n";
925
- export declare const CONVERSATION_TURN_INFO_TEMPLATE = "\n<CONVERSATION_PROGRESS>\n turn=\"$turn_count\"\n max_turns=\"$max_turns\"\n $warning\n</CONVERSATION_PROGRESS>\n";
926
- export declare const UNAVAILABLE_AGENTS_NOTICE_TEMPLATE = "\n<A2A_AGENTS_STATUS>\n NOTE: A2A agents were configured but are currently unavailable.\n You cannot delegate to remote agents for this task.\n\n Unavailable Agents:\n $unavailable_agents\n</A2A_AGENTS_STATUS>\n";
927
- export declare const REMOTE_AGENT_COMPLETED_NOTICE = "\n<REMOTE_AGENT_STATUS>\nSTATUS: COMPLETED\nThe remote agent has finished processing your request. Their response is in the conversation history above.\nYou MUST now:\n1. Extract the answer from the conversation history\n2. Set is_a2a=false\n3. Return the answer as your final message\nDO NOT send another request - the task is already done.\n</REMOTE_AGENT_STATUS>\n";
928
- export declare const REMOTE_AGENT_RESPONSE_NOTICE = "\n<REMOTE_AGENT_STATUS>\nSTATUS: RESPONSE_RECEIVED\nThe remote agent has responded. Their response is in the conversation history above.\n\nYou MUST now:\n1. Set is_a2a=false (the remote task is complete and cannot receive more messages)\n2. Provide YOUR OWN response to the original task based on the information received\n\nIMPORTANT: Your response should be addressed to the USER who gave you the original task.\nReport what the remote agent told you in THIRD PERSON (e.g., \"The remote agent said...\" or \"I learned that...\").\nDo NOT address the remote agent directly or use \"you\" to refer to them.\n</REMOTE_AGENT_STATUS>\n";
929
- export declare function renderA2ATemplate(template: string, values: Record<string, unknown>): string;
930
- export declare const render_a2a_template: typeof renderA2ATemplate;
931
- export declare const A2AErrorCode: {
932
- readonly JSON_PARSE_ERROR: -32700;
933
- readonly INVALID_REQUEST: -32600;
934
- readonly METHOD_NOT_FOUND: -32601;
935
- readonly INVALID_PARAMS: -32602;
936
- readonly INTERNAL_ERROR: -32603;
937
- readonly TASK_NOT_FOUND: -32001;
938
- readonly TASK_NOT_CANCELABLE: -32002;
939
- readonly PUSH_NOTIFICATION_NOT_SUPPORTED: -32003;
940
- readonly UNSUPPORTED_OPERATION: -32004;
941
- readonly CONTENT_TYPE_NOT_SUPPORTED: -32005;
942
- readonly INVALID_AGENT_RESPONSE: -32006;
943
- readonly AUTHENTICATED_EXTENDED_CARD_NOT_CONFIGURED: -32007;
944
- readonly UNSUPPORTED_VERSION: -32009;
945
- readonly UNSUPPORTED_EXTENSION: -32010;
946
- readonly AUTHENTICATION_REQUIRED: -32011;
947
- readonly AUTHORIZATION_FAILED: -32012;
948
- readonly RATE_LIMIT_EXCEEDED: -32013;
949
- readonly TASK_TIMEOUT: -32014;
950
- readonly TRANSPORT_NEGOTIATION_FAILED: -32015;
951
- readonly CONTEXT_NOT_FOUND: -32016;
952
- readonly SKILL_NOT_FOUND: -32017;
953
- readonly ARTIFACT_NOT_FOUND: -32018;
954
- };
955
- export type A2AErrorCode = typeof A2AErrorCode[keyof typeof A2AErrorCode];
956
- export declare const A2A_ERROR_MESSAGES: Record<number, string>;
957
- export declare const ERROR_MESSAGES: Record<number, string>;
958
- export declare class A2AError extends Error {
959
- readonly code: number;
960
- readonly data: unknown;
961
- constructor(options: {
962
- code: number;
963
- message?: string | null;
964
- data?: unknown;
965
- });
966
- toDict(): Record<string, unknown>;
967
- to_dict(): Record<string, unknown>;
968
- toResponse(requestId?: string | number | null): Record<string, unknown>;
969
- to_response(request_id?: string | number | null): Record<string, unknown>;
970
- }
971
- export declare class JSONParseError extends A2AError {
972
- constructor(message?: string | null, data?: unknown);
973
- }
974
- export declare class InvalidRequestError extends A2AError {
975
- constructor(message?: string | null, data?: unknown);
976
- }
977
- export declare class MethodNotFoundError extends A2AError {
978
- constructor(method?: string | null);
979
- }
980
- export declare class InvalidParamsError extends A2AError {
981
- constructor(options?: {
982
- param?: string | null;
983
- reason?: string | null;
984
- message?: string | null;
985
- });
986
- }
987
- export declare class InternalError extends A2AError {
988
- constructor(message?: string | null, data?: unknown);
989
- }
990
- export declare class TaskNotFoundError extends A2AError {
991
- constructor(taskId?: string | null);
992
- }
993
- export declare class TaskNotCancelableError extends A2AError {
994
- constructor(options?: {
995
- taskId?: string | null;
996
- task_id?: string | null;
997
- reason?: string | null;
998
- message?: string | null;
999
- });
1000
- }
1001
- export declare class PushNotificationNotSupportedError extends A2AError {
1002
- constructor(message?: string | null);
1003
- }
1004
- export declare class UnsupportedOperationError extends A2AError {
1005
- constructor(operation?: string | null);
1006
- }
1007
- export declare class ContentTypeNotSupportedError extends A2AError {
1008
- constructor(options?: {
1009
- requestedTypes?: readonly string[] | null;
1010
- requested_types?: readonly string[] | null;
1011
- supportedTypes?: readonly string[] | null;
1012
- supported_types?: readonly string[] | null;
1013
- message?: string | null;
1014
- });
1015
- }
1016
- export declare class InvalidAgentResponseError extends A2AError {
1017
- constructor(message?: string | null);
1018
- }
1019
- export declare class AuthenticatedExtendedCardNotConfiguredError extends A2AError {
1020
- constructor(message?: string | null);
1021
- }
1022
- export declare class UnsupportedVersionError extends A2AError {
1023
- constructor(options?: {
1024
- requestedVersion?: string | null;
1025
- requested_version?: string | null;
1026
- supportedVersions?: readonly string[] | null;
1027
- supported_versions?: readonly string[] | null;
1028
- message?: string | null;
1029
- });
1030
- }
1031
- export declare class UnsupportedExtensionError extends A2AError {
1032
- constructor(requiredExtensions?: readonly string[] | null);
1033
- }
1034
- export declare class AuthenticationRequiredError extends A2AError {
1035
- constructor(message?: string | null);
1036
- }
1037
- export declare class AuthorizationFailedError extends A2AError {
1038
- constructor(requiredScope?: string | null);
1039
- }
1040
- export declare class RateLimitExceededError extends A2AError {
1041
- constructor(retryAfter?: number | null);
1042
- }
1043
- export declare class TaskTimeoutError extends A2AError {
1044
- constructor(options?: {
1045
- taskId?: string | null;
1046
- task_id?: string | null;
1047
- timeoutSeconds?: number | null;
1048
- timeout_seconds?: number | null;
1049
- message?: string | null;
1050
- });
1051
- }
1052
- export declare class TransportNegotiationFailedError extends A2AError {
1053
- constructor(clientTransports?: readonly string[] | null, serverTransports?: readonly string[] | null);
1054
- }
1055
- export declare class ContextNotFoundError extends A2AError {
1056
- constructor(contextId?: string | null);
1057
- }
1058
- export declare class SkillNotFoundError extends A2AError {
1059
- constructor(skillId?: string | null);
1060
- }
1061
- export declare class ArtifactNotFoundError extends A2AError {
1062
- constructor(artifactId?: string | null);
1063
- }
1064
- export declare class A2APollingTimeoutError extends Error {
1065
- constructor(message?: string);
1066
- }
1067
- export declare function createErrorResponse(code: number, message?: string | null, data?: unknown, requestId?: string | number | null): Record<string, unknown>;
1068
- export declare const create_error_response: typeof createErrorResponse;
1069
- export declare const TEXT_PLAIN = "text/plain";
1070
- export declare const APPLICATION_JSON = "application/json";
1071
- export declare const IMAGE_PNG = "image/png";
1072
- export declare const IMAGE_JPEG = "image/jpeg";
1073
- export declare const IMAGE_WILDCARD = "image/*";
1074
- export declare const APPLICATION_PDF = "application/pdf";
1075
- export declare const APPLICATION_OCTET_STREAM = "application/octet-stream";
1076
- export declare const APPLICATION_A2UI_JSON = "application/json+a2ui";
1077
- export declare const DEFAULT_CLIENT_INPUT_MODES: readonly string[];
1078
- export declare const DEFAULT_CLIENT_OUTPUT_MODES: readonly string[];
1079
- export declare class NegotiatedContentTypes {
1080
- readonly inputModes: readonly string[];
1081
- readonly input_modes: readonly string[];
1082
- readonly outputModes: readonly string[];
1083
- readonly output_modes: readonly string[];
1084
- readonly effectiveInputModes: readonly string[];
1085
- readonly effective_input_modes: readonly string[];
1086
- readonly effectiveOutputModes: readonly string[];
1087
- readonly effective_output_modes: readonly string[];
1088
- readonly skillName: string | null;
1089
- readonly skill_name: string | null;
1090
- constructor(options?: {
1091
- inputModes?: readonly string[];
1092
- input_modes?: readonly string[];
1093
- outputModes?: readonly string[];
1094
- output_modes?: readonly string[];
1095
- effectiveInputModes?: readonly string[];
1096
- effective_input_modes?: readonly string[];
1097
- effectiveOutputModes?: readonly string[];
1098
- effective_output_modes?: readonly string[];
1099
- skillName?: string | null;
1100
- skill_name?: string | null;
1101
- });
1102
- }
1103
- export declare class ContentTypeNegotiationError extends Error {
1104
- readonly clientInputModes: readonly string[];
1105
- readonly client_input_modes: readonly string[];
1106
- readonly clientOutputModes: readonly string[];
1107
- readonly client_output_modes: readonly string[];
1108
- readonly serverInputModes: readonly string[];
1109
- readonly server_input_modes: readonly string[];
1110
- readonly serverOutputModes: readonly string[];
1111
- readonly server_output_modes: readonly string[];
1112
- readonly direction: string;
1113
- constructor(options?: {
1114
- clientInputModes?: readonly string[];
1115
- client_input_modes?: readonly string[];
1116
- clientOutputModes?: readonly string[];
1117
- client_output_modes?: readonly string[];
1118
- serverInputModes?: readonly string[];
1119
- server_input_modes?: readonly string[];
1120
- serverOutputModes?: readonly string[];
1121
- server_output_modes?: readonly string[];
1122
- direction?: string;
1123
- message?: string | null;
1124
- });
1125
- }
1126
- export declare function negotiateContentTypes(agentCard: {
1127
- name?: string | null;
1128
- url?: string;
1129
- defaultInputModes?: readonly string[];
1130
- default_input_modes?: readonly string[];
1131
- defaultOutputModes?: readonly string[];
1132
- default_output_modes?: readonly string[];
1133
- skills?: readonly {
1134
- id?: string;
1135
- name?: string;
1136
- inputModes?: readonly string[];
1137
- input_modes?: readonly string[];
1138
- outputModes?: readonly string[];
1139
- output_modes?: readonly string[];
1140
- }[];
1141
- }, clientInputModes?: readonly string[], clientOutputModes?: readonly string[], skillName?: string | null, emitEvent?: boolean, endpoint?: string | null, a2aAgentName?: string | null, strict?: boolean): NegotiatedContentTypes;
1142
- export declare const negotiate_content_types: typeof negotiateContentTypes;
1143
- export declare function _get_effective_modes(agentCard: {
1144
- defaultInputModes?: readonly string[];
1145
- default_input_modes?: readonly string[];
1146
- defaultOutputModes?: readonly string[];
1147
- default_output_modes?: readonly string[];
1148
- skills?: readonly {
1149
- id?: string;
1150
- name?: string;
1151
- inputModes?: readonly string[];
1152
- input_modes?: readonly string[];
1153
- outputModes?: readonly string[];
1154
- output_modes?: readonly string[];
1155
- }[];
1156
- }, skillName?: string | null): [
1157
- readonly string[],
1158
- readonly string[],
1159
- {
1160
- id?: string;
1161
- name?: string;
1162
- inputModes?: readonly string[];
1163
- input_modes?: readonly string[];
1164
- outputModes?: readonly string[];
1165
- output_modes?: readonly string[];
1166
- } | null
1167
- ];
1168
- export declare function validateContentType(contentType: string, allowedModes: readonly string[]): boolean;
1169
- export declare const validate_content_type: typeof validateContentType;
1170
- export declare function getPartContentType(part: {
1171
- root?: {
1172
- kind?: string;
1173
- metadata?: Record<string, unknown> | null;
1174
- file?: {
1175
- mimeType?: string | null;
1176
- mime_type?: string | null;
1177
- } | null;
1178
- };
1179
- }): string;
1180
- export declare const get_part_content_type: typeof getPartContentType;
1181
- export declare function validateMessageParts(parts: readonly Parameters<typeof getPartContentType>[0][], allowedModes: readonly string[]): string[];
1182
- export declare const validate_message_parts: typeof validateMessageParts;
1183
- export declare function normalizeMimeType(mimeType: string): string;
1184
- export declare const _normalize_mime_type: typeof normalizeMimeType;
1185
- export declare function mimeTypesCompatible(clientType: string, serverType: string): boolean;
1186
- export declare const _mime_types_compatible: typeof mimeTypesCompatible;
1187
- export declare function findCompatibleModes(clientModes: readonly string[], serverModes: readonly string[]): string[];
1188
- export declare const _find_compatible_modes: typeof findCompatibleModes;
1189
- export declare function isRetryableError(code: number): boolean;
1190
- export declare const is_retryable_error: typeof isRetryableError;
1191
- export declare function isClientError(code: number): boolean;
1192
- export declare const is_client_error: typeof isClientError;
1193
- export declare class JSONRPCServerConfig {
1194
- readonly rpcPath: string;
1195
- readonly rpc_path: string;
1196
- readonly agentCardPath: string;
1197
- readonly agent_card_path: string;
1198
- constructor(options?: {
1199
- rpcPath?: string;
1200
- rpc_path?: string;
1201
- agentCardPath?: string;
1202
- agent_card_path?: string;
1203
- });
1204
- }
1205
- export declare class JSONRPCClientConfig {
1206
- readonly maxRequestSize: number | null;
1207
- readonly max_request_size: number | null;
1208
- constructor(options?: {
1209
- maxRequestSize?: number | null;
1210
- max_request_size?: number | null;
1211
- });
1212
- }
1213
- export declare class GRPCServerConfig {
1214
- readonly host: string;
1215
- readonly port: number;
1216
- readonly tlsCertPath: string | null;
1217
- readonly tls_cert_path: string | null;
1218
- readonly tlsKeyPath: string | null;
1219
- readonly tls_key_path: string | null;
1220
- readonly maxWorkers: number;
1221
- readonly max_workers: number;
1222
- readonly reflectionEnabled: boolean;
1223
- readonly reflection_enabled: boolean;
1224
- constructor(options?: {
1225
- host?: string;
1226
- port?: number;
1227
- tlsCertPath?: string | null;
1228
- tls_cert_path?: string | null;
1229
- tlsKeyPath?: string | null;
1230
- tls_key_path?: string | null;
1231
- maxWorkers?: number;
1232
- max_workers?: number;
1233
- reflectionEnabled?: boolean;
1234
- reflection_enabled?: boolean;
1235
- });
1236
- }
1237
- export declare class GRPCClientConfig {
1238
- readonly maxSendMessageLength: number | null;
1239
- readonly max_send_message_length: number | null;
1240
- readonly maxReceiveMessageLength: number | null;
1241
- readonly max_receive_message_length: number | null;
1242
- readonly keepaliveTimeMs: number | null;
1243
- readonly keepalive_time_ms: number | null;
1244
- readonly keepaliveTimeoutMs: number | null;
1245
- readonly keepalive_timeout_ms: number | null;
1246
- constructor(options?: {
1247
- maxSendMessageLength?: number | null;
1248
- max_send_message_length?: number | null;
1249
- maxReceiveMessageLength?: number | null;
1250
- max_receive_message_length?: number | null;
1251
- keepaliveTimeMs?: number | null;
1252
- keepalive_time_ms?: number | null;
1253
- keepaliveTimeoutMs?: number | null;
1254
- keepalive_timeout_ms?: number | null;
1255
- });
1256
- }
1257
- export declare class HTTPJSONConfig {
1258
- readonly enabled: boolean;
1259
- constructor(options?: {
1260
- enabled?: boolean;
1261
- });
1262
- }
1263
- export declare class ServerPushNotificationConfig {
1264
- readonly signatureSecret: string | null;
1265
- readonly signature_secret: string | null;
1266
- constructor(options?: {
1267
- signatureSecret?: string | null;
1268
- signature_secret?: string | null;
1269
- });
1270
- }
1271
- export declare class ServerTransportConfig {
1272
- readonly preferred: A2ATransportProtocol;
1273
- readonly jsonrpc: JSONRPCServerConfig;
1274
- readonly grpc: GRPCServerConfig | null;
1275
- readonly httpJson: HTTPJSONConfig | null;
1276
- readonly http_json: HTTPJSONConfig | null;
1277
- constructor(options?: {
1278
- preferred?: A2ATransportProtocol;
1279
- jsonrpc?: JSONRPCServerConfig;
1280
- grpc?: GRPCServerConfig | null;
1281
- httpJson?: HTTPJSONConfig | null;
1282
- http_json?: HTTPJSONConfig | null;
1283
- });
1284
- }
1285
- export declare class ClientTransportConfig {
1286
- readonly preferred: A2ATransportProtocol | null;
1287
- readonly supported: readonly A2ATransportProtocol[];
1288
- readonly jsonrpc: JSONRPCClientConfig;
1289
- readonly grpc: GRPCClientConfig;
1290
- constructor(options?: {
1291
- preferred?: A2ATransportProtocol | null;
1292
- supported?: readonly A2ATransportProtocol[];
1293
- jsonrpc?: JSONRPCClientConfig;
1294
- grpc?: GRPCClientConfig;
1295
- });
1296
- }
1297
- export type GrpcMetadata = ReadonlyArray<readonly [string, string]>;
1298
- export declare function _normalize_grpc_metadata(metadata: GrpcMetadata | null | undefined): Array<readonly [string, string]> | null;
1299
- export declare function _merge_metadata(existing: GrpcMetadata | null | undefined, auth: GrpcMetadata | null | undefined): Array<readonly [string, string]> | null;
1300
- export declare function _inject_metadata(clientCallDetails: {
1301
- metadata?: GrpcMetadata | null;
1302
- _replace?: (updates: {
1303
- metadata: Array<readonly [string, string]> | null;
1304
- }) => unknown;
1305
- }, authMetadata?: GrpcMetadata | null): unknown;
1306
- export declare class MetadataUnaryUnary {
1307
- readonly authMetadata: GrpcMetadata | null;
1308
- constructor(authMetadata?: GrpcMetadata | null);
1309
- intercept_unary_unary<TRequest, TResponse>(continuation: (details: unknown, request: TRequest) => Promise<TResponse> | TResponse, clientCallDetails: {
1310
- metadata?: GrpcMetadata | null;
1311
- }, request: TRequest): Promise<TResponse>;
1312
- }
1313
- export declare class MetadataUnaryStream {
1314
- readonly authMetadata: GrpcMetadata | null;
1315
- constructor(authMetadata?: GrpcMetadata | null);
1316
- intercept_unary_stream<TRequest, TResponse>(continuation: (details: unknown, request: TRequest) => Promise<TResponse> | TResponse, clientCallDetails: {
1317
- metadata?: GrpcMetadata | null;
1318
- }, request: TRequest): Promise<TResponse>;
1319
- }
1320
- export declare class MetadataStreamUnary {
1321
- readonly authMetadata: GrpcMetadata | null;
1322
- constructor(authMetadata?: GrpcMetadata | null);
1323
- intercept_stream_unary<TRequest, TResponse>(continuation: (details: unknown, requestIterator: TRequest) => Promise<TResponse> | TResponse, clientCallDetails: {
1324
- metadata?: GrpcMetadata | null;
1325
- }, requestIterator: TRequest): Promise<TResponse>;
1326
- }
1327
- export declare class MetadataStreamStream {
1328
- readonly authMetadata: GrpcMetadata | null;
1329
- constructor(authMetadata?: GrpcMetadata | null);
1330
- intercept_stream_stream<TRequest, TResponse>(continuation: (details: unknown, requestIterator: TRequest) => Promise<TResponse> | TResponse, clientCallDetails: {
1331
- metadata?: GrpcMetadata | null;
1332
- }, requestIterator: TRequest): Promise<TResponse>;
1333
- }
1334
- export declare function _create_grpc_interceptors(auth_metadata?: GrpcMetadata | null): [MetadataUnaryUnary, MetadataUnaryStream, MetadataStreamUnary, MetadataStreamStream];
1335
- export declare class AuthMetadataPlugin {
1336
- readonly metadata: Array<readonly [string, string]>;
1337
- constructor(metadata: GrpcMetadata);
1338
- call(_context: unknown, callback: (metadata: Array<readonly [string, string]>, error: Error | null) => void): void;
1339
- }
1340
- export declare function _create_grpc_channel_factory(grpc_config: GRPCClientConfig, auth?: {
1341
- applyAuth?: () => Promise<Record<string, string>> | Record<string, string>;
1342
- apply_auth?: (client: unknown, headers: Record<string, string>) => Promise<Record<string, string>> | Record<string, string>;
1343
- } | null): (target: string) => Record<string, unknown>;
1344
- export type A2AClientConfigOptions = {
1345
- endpoint: string;
1346
- auth?: unknown;
1347
- timeout?: number;
1348
- maxTurns?: number;
1349
- max_turns?: number;
1350
- responseModel?: unknown;
1351
- response_model?: unknown;
1352
- failFast?: boolean;
1353
- fail_fast?: boolean;
1354
- trustRemoteCompletionStatus?: boolean;
1355
- trust_remote_completion_status?: boolean;
1356
- updates?: unknown;
1357
- acceptedOutputModes?: readonly string[];
1358
- accepted_output_modes?: readonly string[];
1359
- extensions?: readonly string[];
1360
- clientExtensions?: readonly unknown[];
1361
- client_extensions?: readonly unknown[];
1362
- transport?: ClientTransportConfig;
1363
- transportProtocol?: A2ATransportProtocol | null;
1364
- transport_protocol?: A2ATransportProtocol | null;
1365
- supportedTransports?: readonly A2ATransportProtocol[] | null;
1366
- supported_transports?: readonly A2ATransportProtocol[] | null;
1367
- };
1368
- export declare class A2AClientConfig {
1369
- readonly endpoint: string;
1370
- readonly auth: unknown;
1371
- readonly timeout: number;
1372
- readonly maxTurns: number;
1373
- readonly max_turns: number;
1374
- readonly responseModel: unknown;
1375
- readonly response_model: unknown;
1376
- readonly failFast: boolean;
1377
- readonly fail_fast: boolean;
1378
- readonly trustRemoteCompletionStatus: boolean;
1379
- readonly trust_remote_completion_status: boolean;
1380
- readonly updates: unknown;
1381
- readonly acceptedOutputModes: readonly string[];
1382
- readonly accepted_output_modes: readonly string[];
1383
- readonly extensions: readonly string[];
1384
- readonly clientExtensions: readonly unknown[];
1385
- readonly client_extensions: readonly unknown[];
1386
- readonly transport: ClientTransportConfig;
1387
- constructor(options: A2AClientConfigOptions);
1388
- migrateDeprecatedTransportFields(): this;
1389
- _migrate_deprecated_transport_fields(): this;
1390
- serializeResponseModel(value: unknown): unknown;
1391
- _serialize_response_model(value: unknown): unknown;
1392
- }
1393
- export declare class A2AConfig extends A2AClientConfig {
1394
- migrateDeprecatedTransportFields(): this;
1395
- _migrate_deprecated_transport_fields(): this;
1396
- serializeResponseModel(value: unknown): unknown;
1397
- _serialize_response_model(value: unknown): unknown;
1398
- }
1399
- export type A2AServerConfigOptions = {
1400
- name?: string | null;
1401
- description?: string | null;
1402
- version?: string;
1403
- skills?: readonly unknown[];
1404
- defaultInputModes?: readonly string[];
1405
- default_input_modes?: readonly string[];
1406
- defaultOutputModes?: readonly string[];
1407
- default_output_modes?: readonly string[];
1408
- capabilities?: Record<string, unknown>;
1409
- provider?: unknown;
1410
- documentationUrl?: string | null;
1411
- documentation_url?: string | null;
1412
- iconUrl?: string | null;
1413
- icon_url?: string | null;
1414
- additionalInterfaces?: readonly A2AAgentInterface[];
1415
- additional_interfaces?: readonly A2AAgentInterface[];
1416
- security?: readonly Record<string, readonly string[]>[];
1417
- securitySchemes?: Record<string, unknown>;
1418
- security_schemes?: Record<string, unknown>;
1419
- supportsAuthenticatedExtendedCard?: boolean;
1420
- supports_authenticated_extended_card?: boolean;
1421
- extendedSkills?: readonly unknown[];
1422
- extended_skills?: readonly unknown[];
1423
- url?: string | null;
1424
- signingConfig?: unknown;
1425
- signing_config?: unknown;
1426
- signatures?: readonly unknown[] | null;
1427
- serverExtensions?: readonly unknown[];
1428
- server_extensions?: readonly unknown[];
1429
- pushNotifications?: ServerPushNotificationConfig | null;
1430
- push_notifications?: ServerPushNotificationConfig | null;
1431
- host?: string;
1432
- port?: number;
1433
- endpoint?: string;
1434
- protocolVersion?: A2AProtocolVersion;
1435
- protocol_version?: A2AProtocolVersion;
1436
- transport?: ServerTransportConfig;
1437
- preferredTransport?: A2ATransportProtocol | null;
1438
- preferred_transport?: A2ATransportProtocol | null;
1439
- auth?: unknown;
1440
- };
1441
- export declare class A2AServerConfig {
1442
- readonly name: string | null;
1443
- readonly description: string | null;
1444
- readonly version: string;
1445
- readonly skills: readonly unknown[];
1446
- readonly defaultInputModes: readonly string[];
1447
- readonly default_input_modes: readonly string[];
1448
- readonly defaultOutputModes: readonly string[];
1449
- readonly default_output_modes: readonly string[];
1450
- readonly capabilities: Record<string, unknown>;
1451
- readonly provider: unknown;
1452
- readonly documentationUrl: string | null;
1453
- readonly documentation_url: string | null;
1454
- readonly iconUrl: string | null;
1455
- readonly icon_url: string | null;
1456
- readonly additionalInterfaces: readonly A2AAgentInterface[];
1457
- readonly additional_interfaces: readonly A2AAgentInterface[];
1458
- readonly security: readonly Record<string, readonly string[]>[];
1459
- readonly securitySchemes: Record<string, unknown>;
1460
- readonly security_schemes: Record<string, unknown>;
1461
- readonly supportsAuthenticatedExtendedCard: boolean;
1462
- readonly supports_authenticated_extended_card: boolean;
1463
- readonly extendedSkills: readonly unknown[];
1464
- readonly extended_skills: readonly unknown[];
1465
- readonly url: string | null;
1466
- readonly signingConfig: unknown;
1467
- readonly signing_config: unknown;
1468
- readonly signatures: readonly unknown[] | null;
1469
- readonly serverExtensions: readonly unknown[];
1470
- readonly server_extensions: readonly unknown[];
1471
- readonly pushNotifications: ServerPushNotificationConfig | null;
1472
- readonly push_notifications: ServerPushNotificationConfig | null;
1473
- readonly host: string;
1474
- readonly port: number;
1475
- readonly endpoint: string;
1476
- readonly protocolVersion: A2AProtocolVersion;
1477
- readonly protocol_version: A2AProtocolVersion;
1478
- readonly transport: ServerTransportConfig;
1479
- readonly preferredTransport: A2ATransportProtocol | null;
1480
- readonly preferred_transport: A2ATransportProtocol | null;
1481
- readonly auth: unknown;
1482
- constructor(options?: A2AServerConfigOptions);
1483
- migrateDeprecatedFields(): this;
1484
- _migrate_deprecated_fields(): this;
1485
- }
1486
- export declare class AgentResponseModel {
1487
- readonly a2a_ids: readonly string[];
1488
- readonly message: string;
1489
- readonly is_a2a: boolean;
1490
- readonly allowedAgentIds: readonly string[];
1491
- readonly allowed_agent_ids: readonly string[];
1492
- constructor(options: A2AAgentResponseProtocol & {
1493
- allowedAgentIds?: readonly string[];
1494
- allowed_agent_ids?: readonly string[];
1495
- });
1496
- }
1497
- export declare function create_agent_response_model(agent_ids: readonly string[]): typeof AgentResponseModel | null;
1498
- export declare function extract_a2a_agent_ids_from_config(a2a_config: readonly A2AConfigTypes[] | A2AConfigTypes | null | undefined): [A2AClientConfigTypes[], string[]];
1499
- export declare function get_a2a_agents_and_response_model(a2a_config: readonly A2AConfigTypes[] | A2AConfigTypes | null | undefined): [A2AClientConfigTypes[], typeof AgentResponseModel | null];
1500
- export declare function get_extensions_from_config(a2a_config: readonly A2AClientConfigTypes[] | A2AClientConfigTypes): string[];
1501
- export declare function create_extension_registry_from_config(a2a_config: readonly A2AClientConfigTypes[] | A2AClientConfigTypes): ExtensionRegistry;
1502
- export declare function validate_required_extensions(agent_card: {
1503
- capabilities?: {
1504
- extensions?: readonly {
1505
- uri?: string;
1506
- required?: boolean;
1507
- }[];
1508
- } | null;
1509
- }, client_extensions?: readonly string[] | null): {
1510
- uri?: string;
1511
- required?: boolean;
1512
- }[];
1513
- export declare class NegotiatedTransport {
1514
- readonly transport: string;
1515
- readonly url: string;
1516
- readonly source: A2ANegotiationSource;
1517
- constructor(options: {
1518
- transport: string;
1519
- url: string;
1520
- source: A2ANegotiationSource;
1521
- });
1522
- }
1523
- export declare class TransportNegotiationError extends Error {
1524
- readonly clientTransports: readonly string[];
1525
- readonly client_transports: readonly string[];
1526
- readonly serverTransports: readonly string[];
1527
- readonly server_transports: readonly string[];
1528
- constructor(clientTransports: readonly string[], serverTransports: readonly string[], message?: string | null);
1529
- }
1530
- export declare function getServerInterfaces(agentCard: A2AAgentCard): A2AAgentInterface[];
1531
- export declare const get_server_interfaces: typeof getServerInterfaces;
1532
- export declare const _get_server_interfaces: typeof getServerInterfaces;
1533
- export declare function negotiateTransport(agentCard: A2AAgentCard, options?: {
1534
- clientSupportedTransports?: readonly string[] | null;
1535
- client_supported_transports?: readonly string[] | null;
1536
- clientPreferredTransport?: string | null;
1537
- client_preferred_transport?: string | null;
1538
- emitEvent?: boolean;
1539
- emit_event?: boolean;
1540
- endpoint?: string | null;
1541
- a2aAgentName?: string | null;
1542
- a2a_agent_name?: string | null;
1543
- }): NegotiatedTransport;
1544
- export declare const negotiate_transport: typeof negotiateTransport;
1545
- export declare function build_a2ui_system_prompt(catalog_id?: string | null, allowed_components?: readonly string[] | null): string;
1546
- export declare function build_a2ui_v09_system_prompt(catalog_id?: string | null, allowed_components?: readonly string[] | null): string;
1547
- export declare function extractTaskResultParts(a2aTask: A2ATaskLike): string[];
1548
- export declare const extract_task_result_parts: typeof extractTaskResultParts;
1549
- export declare function extractErrorMessage(a2aTask: A2ATaskLike, defaultMessage: string): string;
1550
- export declare const extract_error_message: typeof extractErrorMessage;
1551
- export declare function processTaskState(options: {
1552
- a2aTask?: A2ATaskLike;
1553
- a2a_task?: A2ATaskLike;
1554
- newMessages?: A2AMessageLike[];
1555
- new_messages?: A2AMessageLike[];
1556
- agentCard?: A2AAgentCard | Record<string, unknown>;
1557
- agent_card?: A2AAgentCard | Record<string, unknown>;
1558
- turnNumber?: number;
1559
- turn_number?: number;
1560
- isMultiturn?: boolean;
1561
- is_multiturn?: boolean;
1562
- agentRole?: string | null;
1563
- agent_role?: string | null;
1564
- resultParts?: string[] | null;
1565
- result_parts?: string[] | null;
1566
- endpoint?: string | null;
1567
- a2aAgentName?: string | null;
1568
- a2a_agent_name?: string | null;
1569
- isFinal?: boolean;
1570
- is_final?: boolean;
1571
- }): A2ATaskStateResult | null;
1572
- export declare const process_task_state: typeof processTaskState;
1573
- export declare function sendMessageAndGetTaskId(options: {
1574
- eventStream?: AsyncIterable<A2AMessageLike | readonly [A2ATaskLike, unknown]>;
1575
- event_stream?: AsyncIterable<A2AMessageLike | readonly [A2ATaskLike, unknown]>;
1576
- newMessages?: A2AMessageLike[];
1577
- new_messages?: A2AMessageLike[];
1578
- agentCard?: A2AAgentCard;
1579
- agent_card?: A2AAgentCard;
1580
- turnNumber?: number;
1581
- turn_number?: number;
1582
- isMultiturn?: boolean;
1583
- is_multiturn?: boolean;
1584
- agentRole?: string | null;
1585
- agent_role?: string | null;
1586
- }): Promise<string | A2ATaskStateResult>;
1587
- export declare const send_message_and_get_task_id: typeof sendMessageAndGetTaskId;
1588
- export declare function cancellable<TArgs extends unknown[], TResult>(fn: (...args: TArgs) => Promise<TResult>): (...args: TArgs) => Promise<TResult>;
1589
- export declare function poll_for_cancel(taskId: string, cache?: A2ACancelCache, intervalMs?: number, signal?: AbortSignal): Promise<boolean>;
1590
- export declare function watch_for_cancel(taskId: string, cache?: A2ACancelCache, intervalMs?: number, signal?: AbortSignal): Promise<boolean>;
1591
- export declare function execute(agent: unknown, context: A2AExecutionContext, eventQueue: A2AEventQueue): Promise<void>;
1592
- export declare const _execute_impl: (agent: unknown, context: A2AExecutionContext, eventQueue: A2AEventQueue, extensionRegistry?: A2AExtensionRegistry | null | undefined, extensionContext?: unknown) => Promise<void>;
1593
- export declare function execute_with_extensions(agent: unknown, context: A2AExecutionContext, eventQueue: A2AEventQueue, extensionRegistry?: A2AExtensionRegistry | null, extensionContext?: unknown): Promise<void>;
1594
- export declare function cancel(context: A2AExecutionContext, eventQueue: A2AEventQueue): Promise<A2ATaskLike | null>;
1595
- export declare function get_handler(config: unknown): unknown;
1596
- export declare function execute_a2a_delegation(options: Record<string, unknown> | string, ..._args: unknown[]): A2ATaskStateResult;
1597
- export declare function aexecute_a2a_delegation(options: Record<string, unknown> | string, ...args: unknown[]): Promise<A2ATaskStateResult>;
1598
- export declare function _aexecute_a2a_delegation_impl(options: Record<string, unknown>): Promise<A2ATaskStateResult>;
1599
- export declare function _create_a2a_client(options: {
1600
- agent_card?: Record<string, unknown>;
1601
- agentCard?: Record<string, unknown>;
1602
- transport_protocol?: string;
1603
- transportProtocol?: string;
1604
- timeout?: number;
1605
- headers?: Record<string, string>;
1606
- streaming?: boolean;
1607
- auth?: unknown;
1608
- use_polling?: boolean;
1609
- usePolling?: boolean;
1610
- push_notification_config?: PushNotificationConfig | null;
1611
- pushNotificationConfig?: PushNotificationConfig | null;
1612
- client_extensions?: readonly string[] | null;
1613
- clientExtensions?: readonly string[] | null;
1614
- accepted_output_modes?: readonly string[] | null;
1615
- acceptedOutputModes?: readonly string[] | null;
1616
- grpc_config?: GRPCClientConfig | null;
1617
- grpcConfig?: GRPCClientConfig | null;
1618
- client?: unknown;
1619
- }): Promise<Record<string, unknown>>;
1620
- export declare function fetch_agent_card(endpoint: string, auth?: unknown, timeout?: number, use_cache?: boolean, cache_ttl?: number): Promise<Record<string, unknown>>;
1621
- export declare function _fetch_agent_card_cached(endpoint: string, authHash: string, timeout: number, _ttlHash: number, auth?: unknown, cacheTtl?: number): Promise<Record<string, unknown>>;
1622
- export declare function _afetch_agent_card_cached(endpoint: string, authHash: string, timeout: number, auth?: unknown): Promise<Record<string, unknown>>;
1623
- export declare function _afetch_agent_card_impl(endpoint: string, auth?: unknown, timeout?: number): Promise<Record<string, unknown>>;
1624
- export declare function _get_tls_verify(auth: unknown): unknown;
1625
- export declare function _prepare_auth_headers(auth: unknown, timeout?: number): Promise<[Record<string, string>, unknown]>;
1626
- export declare function afetch_agent_card(endpoint: string, auth?: unknown, timeout?: number, use_cache?: boolean): Promise<Record<string, unknown>>;
1627
- export type A2AAgentSkill = {
1628
- id: string;
1629
- name: string;
1630
- description: string;
1631
- tags: string[];
1632
- examples?: string[];
1633
- };
1634
- export declare function task_to_skill(task: {
1635
- name?: string | null;
1636
- description: string;
1637
- expected_output?: string | null;
1638
- agent?: {
1639
- role?: string | null;
1640
- } | null;
1641
- }): A2AAgentSkill;
1642
- export declare function tool_to_skill(toolName: string, toolDescription: string): A2AAgentSkill;
1643
- export declare const _task_to_skill: typeof task_to_skill;
1644
- export declare const _tool_to_skill: typeof tool_to_skill;
1645
- export declare function inject_a2a_server_methods(agent: unknown): unknown;
1646
- export declare function agent_to_agent_card(agent: unknown, url: string): Record<string, unknown>;
1647
- export declare const _agent_to_agent_card: typeof agent_to_agent_card;
1648
- export declare function _fetch_card_from_config(config: A2AClientConfigTypes): Promise<[A2AClientConfigTypes, Record<string, unknown> | Error]>;
1649
- export declare function _fetch_agent_cards_concurrently(a2a_agents: readonly A2AClientConfigTypes[]): Promise<[Record<string, Record<string, unknown>>, Record<string, string>]>;
1650
- export declare function _parse_agent_response(raw_result: unknown, agent_response_model?: typeof AgentResponseModel | null): unknown;
1651
- export declare function _augment_prompt_with_a2a(options: {
1652
- a2a_agents: readonly A2AClientConfigTypes[];
1653
- task_description: string;
1654
- agent_cards: Record<string, Record<string, unknown>>;
1655
- failed_agents?: Record<string, string>;
1656
- extension_registry?: ExtensionRegistry | null;
1657
- }): [string, string, Map<unknown, ConversationState>];
1658
- export declare function _execute_task_with_a2a(options: {
1659
- self: unknown;
1660
- a2a_agents: readonly A2AClientConfigTypes[];
1661
- original_fn: (...args: unknown[]) => unknown;
1662
- task: unknown;
1663
- agent_response_model?: typeof AgentResponseModel | null;
1664
- context?: string | null;
1665
- tools?: readonly unknown[] | null;
1666
- extension_registry?: ExtensionRegistry | null;
1667
- }): Promise<string>;
1668
- export declare function wrap_agent_with_a2a_instance(agent: unknown, extension_registry?: ExtensionRegistry | null): void;
1669
- export declare function list_tasks(tasks: A2ATaskLike[], context_id?: string | null, status?: A2ATaskState | null, status_timestamp_after?: Date | null, page_size?: number, page_token?: string | null, history_length?: number | null, include_artifacts?: boolean): [A2ATaskLike[], string | null, number];
1670
- export declare function _parse_redis_url(url: string): RedisCacheConfig;
1671
- export declare function _extract_response_schema(parts: readonly unknown[]): Record<string, unknown> | null;
1672
- export declare function _create_file_parts(input_files: Record<string, {
1673
- read?: () => Uint8Array | Buffer | string;
1674
- content_type?: string | null;
1675
- contentType?: string | null;
1676
- filename?: string | null;
1677
- } | Uint8Array | Buffer | string> | null | undefined): Array<Record<string, unknown>>;
1678
- export declare function _convert_a2a_files_to_file_inputs(a2a_files: readonly (A2AFileWithBytesLike | A2AFileWithUriLike)[]): Record<string, A2AFileInputLike>;
1679
- export declare function _create_result_artifact(result: unknown, task_id: string): Record<string, unknown>;
1680
- export declare function _build_task_description(user_message: string, structured_inputs: readonly Record<string, unknown>[]): string;
1681
- export declare function get_timestamp(task: A2ATaskLike): Date;
1682
- declare function validateA2AExtension(value: unknown): A2AExtension;
1683
- export declare const _validate_a2a_extension: typeof validateA2AExtension;
1684
- export declare function _migrate_client_transport_fields(transport: ClientTransportConfig, transport_protocol: A2ATransportProtocol | null, supported_transports: readonly A2ATransportProtocol[] | null): ClientTransportConfig;