@a2a-js/sdk 0.3.1 → 0.3.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,3 +1,6 @@
1
+ import {
2
+ AGENT_CARD_PATH
3
+ } from "../../chunk-67JNQ6TZ.js";
1
4
  import {
2
5
  A2AError,
3
6
  JsonRpcTransportHandler
@@ -18,12 +21,13 @@ var A2AExpressApp = class {
18
21
  * @param app Optional existing Express app.
19
22
  * @param baseUrl The base URL for A2A endpoints (e.g., "/a2a/api").
20
23
  * @param middlewares Optional array of Express middlewares to apply to the A2A routes.
24
+ * @param agentCardPath Optional custom path for the agent card endpoint (defaults to /.well-known/agent-card.json).
21
25
  * @returns The Express app with A2A routes.
22
26
  */
23
- setupRoutes(app, baseUrl = "", middlewares) {
27
+ setupRoutes(app, baseUrl = "", middlewares, agentCardPath = AGENT_CARD_PATH) {
24
28
  const router = express.Router();
25
29
  router.use(express.json(), ...middlewares ?? []);
26
- router.get("/.well-known/agent.json", async (req, res) => {
30
+ router.get(`/${agentCardPath}`, async (req, res) => {
27
31
  try {
28
32
  const agentCard = await this.requestHandler.getAgentCard();
29
33
  res.json(agentCard);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@a2a-js/sdk",
3
- "version": "0.3.1",
3
+ "version": "0.3.3",
4
4
  "description": "Server & Client SDK for Agent2Agent protocol",
5
5
  "repository": {
6
6
  "type": "git",
@@ -43,13 +43,13 @@
43
43
  "@genkit-ai/googleai": "^1.8.0",
44
44
  "@genkit-ai/vertexai": "^1.8.0",
45
45
  "@types/chai": "^5.2.2",
46
- "@types/express": "^4.17.23",
46
+ "@types/express": "^5.0.3",
47
47
  "@types/mocha": "^10.0.10",
48
48
  "@types/node": "^22.13.14",
49
49
  "@types/sinon": "^17.0.4",
50
50
  "c8": "^10.1.3",
51
51
  "chai": "^5.2.0",
52
- "express": "^4.21.2",
52
+ "express": "^5.1.0",
53
53
  "genkit": "^1.8.0",
54
54
  "gts": "^6.0.2",
55
55
  "json-schema-to-typescript": "^15.0.4",
@@ -73,7 +73,7 @@
73
73
  "uuid": "^11.1.0"
74
74
  },
75
75
  "peerDependencies": {
76
- "express": "^4.21.2"
76
+ "express": "^4.21.2 || ^5.1.0"
77
77
  },
78
78
  "peerDependenciesMeta": {
79
79
  "express": {