A2A SDK for JavaScript 1.1.0

Last reviewed Sep 19, 2026

Export as PDF

Prompt Details

Prompt Composition

4prompts
  1. JavaScript ES2026102 lines · 3.1K tokens
  2. Node.js 24101 lines · 5.3K tokens
  3. TypeScript 5.940 lines · 1.2K tokens
  4. A2A SDK for JavaScript 1.1.062 lines · 3.4K tokens
Total305 lines · 13.1K tokens

CWE Coverage

  • 20
  • 22
  • 59
  • 73
  • 78
  • 79
  • 88
  • 89
  • 95
  • 113
  • 117
  • 200
  • 208
  • 209
  • 214
  • 250
  • 287
  • 295
  • 297
  • 306
  • 319
  • 323
  • 330
  • 338
  • 346
  • 347
  • 352
  • 354
  • 362
  • 367
  • 377
  • 426
  • 444
  • 459
  • 471
  • 488
  • 494
  • 502
  • 522
  • 524
  • 532
  • 602
  • 639
  • 653
  • 732
  • 770
  • 807
  • 829
  • 838
  • 841
  • 862
  • 863
  • 908
  • 915
  • 916
  • 918
  • 922
  • 942
  • 943
  • 1004
  • 1321
  • 1333

Prompt Preview

Apply the Node.js 24 and TypeScript 5.9 prompts first. These rules target @a2a-js/sdk 1.1.0 implementing A2A Protocol 1.0. The package declares Node.js >=20; use the supported Node.js 24 baseline.

Discovery and transport selection

  • Supply a constrained fetchImpl in the DefaultAgentCardResolver options or use a custom AgentCardResolver for discovery. Validate the final URL after resolving baseUrl and path, and enforce the outbound destination policy, redirects, response-size limit, and deadline; the default resolver fetches and parses JSON without these application controls.
  • Validate supportedInterfaces URLs, protocol versions, and tenant claims before ClientFactory.createFromUrl or createFromAgentCard selects a transport. Scope credentials injected through serviceParameters, interceptors, or transport fetchImpl to the approved agent and destination; discovery at a trusted origin does not authorize every advertised endpoint.
  • Use createAuthenticatingFetchWithRetry only with agent/session-scoped AuthenticationHandler state. Restrict shouldRetryWithHeaders to expected authentication failures and replay-safe requests: it runs after every response and can repeat successful writes. Reject untrusted init.headers, which override both initial and refreshed authentication headers.
  • Set ClientFactoryOptions.transports to the allowed factories explicitly. preferredTransports falls back to card preferences, and ClientFactoryOptions.createFrom merges transport factories with the originals; neither option removes an unwanted transport.
  • Pass