A2A SDK for JavaScript 1.1.0
Last reviewed Sep 19, 2026
Prompt Details
Prompt Composition
4prompts
- JavaScript ES2026102 lines · 3.1K tokens
- Node.js 24101 lines · 5.3K tokens
- TypeScript 5.940 lines · 1.2K tokens
- 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
fetchImplin theDefaultAgentCardResolveroptions or use a customAgentCardResolverfor discovery. Validate the final URL after resolvingbaseUrlandpath, and enforce the outbound destination policy, redirects, response-size limit, and deadline; the default resolver fetches and parses JSON without these application controls. - Validate
supportedInterfacesURLs, protocol versions, and tenant claims beforeClientFactory.createFromUrlorcreateFromAgentCardselects a transport. Scope credentials injected throughserviceParameters, interceptors, or transportfetchImplto the approved agent and destination; discovery at a trusted origin does not authorize every advertised endpoint. - Use
createAuthenticatingFetchWithRetryonly with agent/session-scopedAuthenticationHandlerstate. RestrictshouldRetryWithHeadersto expected authentication failures and replay-safe requests: it runs after every response and can repeat successful writes. Reject untrustedinit.headers, which override both initial and refreshed authentication headers. - Set
ClientFactoryOptions.transportsto the allowed factories explicitly.preferredTransportsfalls back to card preferences, andClientFactoryOptions.createFrommerges transport factories with the originals; neither option removes an unwanted transport. - Pass