{"_id":"@a2a-js/sdk","_rev":"4101658","name":"@a2a-js/sdk","description":"Server & Client SDK for Agent2Agent protocol","dist-tags":{"latest":"0.3.7"},"maintainers":[{"name":"google-wombot","email":""},{"name":"kcthota-g","email":""},{"name":"swapydapy","email":""}],"time":{"modified":"2026-01-11T18:41:15.000Z","created":"2025-06-14T01:39:02.251Z","0.3.7":"2025-12-17T15:02:32.521Z","0.3.6":"2025-12-10T16:03:16.001Z","0.3.5":"2025-11-05T14:39:43.164Z","0.3.4":"2025-09-04T18:25:52.083Z","0.3.3":"2025-08-27T20:11:34.060Z","0.3.2":"2025-08-17T22:27:59.641Z","0.3.1":"2025-08-06T21:13:56.301Z","0.3.0":"2025-08-05T18:19:15.307Z","0.2.5":"2025-07-30T22:46:26.741Z","0.2.4":"2025-07-14T21:18:28.629Z","0.2.3":"2025-07-14T20:01:01.364Z","0.2.2":"2025-06-20T04:09:27.937Z","0.2.1":"2025-06-14T01:39:02.251Z"},"users":{},"repository":{"type":"git","url":"git+https://github.com/a2aproject/a2a-js.git"},"versions":{"0.3.7":{"name":"@a2a-js/sdk","version":"0.3.7","description":"Server & Client SDK for Agent2Agent protocol","license":"Apache-2.0","repository":{"type":"git","url":"git+https://github.com/a2aproject/a2a-js.git"},"engines":{"node":">=18"},"main":"dist/index.js","types":"dist/index.d.ts","type":"module","exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js","require":"./dist/index.cjs"},"./server":{"types":"./dist/server/index.d.ts","import":"./dist/server/index.js","require":"./dist/server/index.cjs"},"./server/express":{"types":"./dist/server/express/index.d.ts","import":"./dist/server/express/index.js","require":"./dist/server/express/index.cjs"},"./client":{"types":"./dist/client/index.d.ts","import":"./dist/client/index.js","require":"./dist/client/index.cjs"}},"devDependencies":{"@cloudflare/vitest-pool-workers":"^0.10.15","@eslint/js":"^9.39.1","@types/express":"^5.0.3","@types/node":"^22.13.14","@types/supertest":"^6.0.3","@vitest/coverage-v8":"^3.2.4","esbuild":"^0.27.0","eslint":"^9.39.1","eslint-config-prettier":"^10.1.8","eslint-plugin-prettier":"^5.5.4","express":"^5.1.0","gts":"^6.0.2","json-schema-to-typescript":"^15.0.4","prettier":"^3.6.2","supertest":"^7.1.4","tsup":"^8.5.0","tsx":"^4.19.3","typescript":"^5.9.3","typescript-eslint":"^8.46.4","vitest":"^3.2.4"},"scripts":{"clean":"gts clean","build":"tsup","test":"vitest run","test:edge":"vitest run --config vitest.edge.config.ts","lint":"tsc --noEmit && npx eslint .","format:readme":"prettier --write ./README.md","lint:fix":"npx eslint . --fix","coverage":"vitest run --coverage","generate":"curl https://raw.githubusercontent.com/google-a2a/A2A/refs/heads/main/specification/json/a2a.json > spec.json && node scripts/generateTypes.js && rm spec.json","test-build":"esbuild ./dist/client/index.js ./dist/server/index.js ./dist/index.js --bundle --platform=neutral --outdir=dist/tmp-checks --outbase=./dist"},"dependencies":{"uuid":"^11.1.0"},"peerDependencies":{"express":"^4.21.2 || ^5.1.0"},"peerDependenciesMeta":{"express":{"optional":true}},"_id":"@a2a-js/sdk@0.3.7","gitHead":"5046f3a5461935194bef40ae4910d6035e1dcf27","bugs":{"url":"https://github.com/a2aproject/a2a-js/issues"},"homepage":"https://github.com/a2aproject/a2a-js#readme","_nodeVersion":"18.20.8","_npmVersion":"10.8.2","dist":{"shasum":"3e7f65ba29cda90d81a70001f5391cace8431d4c","size":106854,"noattachment":false,"key":"/@a2a-js/sdk/-/@a2a-js/sdk-0.3.7.tgz","tarball":"http://registry.cnpm.dingdandao.com/@a2a-js/sdk/download/@a2a-js/sdk-0.3.7.tgz"},"_npmUser":{"name":"google-wombot","email":"node-team-npm+wombot@google.com"},"directories":{},"maintainers":[{"name":"google-wombot","email":""},{"name":"kcthota-g","email":""},{"name":"swapydapy","email":""}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/sdk_0.3.7_1765983752386_0.4013167115059748"},"_hasShrinkwrap":false,"_cnpmcore_publish_time":"2025-12-17T15:02:32.521Z","publish_time":1765983752521,"_source_registry_name":"default","_cnpm_publish_time":1765983752521},"0.3.6":{"name":"@a2a-js/sdk","version":"0.3.6","description":"Server & Client SDK for Agent2Agent protocol","license":"Apache-2.0","repository":{"type":"git","url":"git+https://github.com/a2aproject/a2a-js.git"},"engines":{"node":">=18"},"main":"dist/index.js","types":"dist/index.d.ts","type":"module","exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js","require":"./dist/index.cjs"},"./server":{"types":"./dist/server/index.d.ts","import":"./dist/server/index.js","require":"./dist/server/index.cjs"},"./server/express":{"types":"./dist/server/express/index.d.ts","import":"./dist/server/express/index.js","require":"./dist/server/express/index.cjs"},"./client":{"types":"./dist/client/index.d.ts","import":"./dist/client/index.js","require":"./dist/client/index.cjs"}},"devDependencies":{"@eslint/js":"^9.39.1","@types/chai":"^5.2.2","@types/express":"^5.0.3","@types/mocha":"^10.0.10","@types/node":"^22.13.14","@types/sinon":"^17.0.4","@types/supertest":"^6.0.3","c8":"^10.1.3","chai":"^5.2.0","esbuild":"^0.27.0","eslint":"^9.39.1","eslint-config-prettier":"^10.1.8","eslint-plugin-prettier":"^5.5.4","express":"^5.1.0","gts":"^6.0.2","json-schema-to-typescript":"^15.0.4","mocha":"^11.6.0","prettier":"^3.6.2","sinon":"^20.0.0","supertest":"^7.1.4","tsup":"^8.5.0","tsx":"^4.19.3","typescript":"^5.9.3","typescript-eslint":"^8.46.4"},"scripts":{"clean":"gts clean","build":"tsup","test":"mocha \"test/**/*.spec.ts\"","lint":"tsc --noEmit && npx eslint .","format:readme":"prettier --write ./README.md","lint:fix":"npx eslint . --fix","coverage":"c8 npm run test","generate":"curl https://raw.githubusercontent.com/google-a2a/A2A/refs/heads/main/specification/json/a2a.json > spec.json && node scripts/generateTypes.js && rm spec.json","test-build:browser":"esbuild ./dist/client/index.js ./dist/index.js --bundle --platform=browser --outdir=dist/tmp-checks --outbase=./dist"},"dependencies":{"uuid":"^11.1.0"},"peerDependencies":{"express":"^4.21.2 || ^5.1.0"},"peerDependenciesMeta":{"express":{"optional":true}},"mocha":{"require":"tsx"},"_id":"@a2a-js/sdk@0.3.6","gitHead":"a206d13c512e0239406e2c96a8746935b63437aa","bugs":{"url":"https://github.com/a2aproject/a2a-js/issues"},"homepage":"https://github.com/a2aproject/a2a-js#readme","_nodeVersion":"18.20.8","_npmVersion":"10.8.2","dist":{"shasum":"ea29fcae122c8a6c7240d4fc08b1825856160eb9","size":99265,"noattachment":false,"key":"/@a2a-js/sdk/-/@a2a-js/sdk-0.3.6.tgz","tarball":"http://registry.cnpm.dingdandao.com/@a2a-js/sdk/download/@a2a-js/sdk-0.3.6.tgz"},"_npmUser":{"name":"google-wombot","email":"node-team-npm+wombot@google.com"},"directories":{},"maintainers":[{"name":"google-wombot","email":""},{"name":"kcthota-g","email":""},{"name":"swapydapy","email":""}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/sdk_0.3.6_1765382595825_0.618481042845562"},"_hasShrinkwrap":false,"_cnpmcore_publish_time":"2025-12-10T16:03:16.001Z","publish_time":1765382596001,"_source_registry_name":"default","_cnpm_publish_time":1765382596001},"0.3.5":{"name":"@a2a-js/sdk","version":"0.3.5","description":"Server & Client SDK for Agent2Agent protocol","repository":{"type":"git","url":"git+https://github.com/a2aproject/a2a-js.git"},"engines":{"node":">=18"},"main":"dist/index.js","types":"dist/index.d.ts","type":"module","exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js","require":"./dist/index.cjs"},"./server":{"types":"./dist/server/index.d.ts","import":"./dist/server/index.js","require":"./dist/server/index.cjs"},"./server/express":{"types":"./dist/server/express/index.d.ts","import":"./dist/server/express/index.js","require":"./dist/server/express/index.cjs"},"./client":{"types":"./dist/client/index.d.ts","import":"./dist/client/index.js","require":"./dist/client/index.cjs"}},"devDependencies":{"@genkit-ai/googleai":"^1.8.0","@genkit-ai/vertexai":"^1.8.0","@types/chai":"^5.2.2","@types/express":"^5.0.3","@types/mocha":"^10.0.10","@types/node":"^22.13.14","@types/sinon":"^17.0.4","@types/supertest":"^6.0.3","c8":"^10.1.3","chai":"^5.2.0","express":"^5.1.0","genkit":"^1.8.0","gts":"^6.0.2","json-schema-to-typescript":"^15.0.4","mocha":"^11.6.0","sinon":"^20.0.0","supertest":"^7.1.4","tsup":"^8.5.0","tsx":"^4.19.3","typescript":"^5.8.2"},"scripts":{"clean":"gts clean","build":"tsup","pretest":"npm run build","test":"mocha test/**/*.spec.ts","coverage":"c8 npm run test","generate":"curl https://raw.githubusercontent.com/google-a2a/A2A/refs/heads/main/specification/json/a2a.json > spec.json && node scripts/generateTypes.js && rm spec.json","a2a:cli":"tsx src/samples/cli.ts","agents:movie-agent":"tsx src/samples/agents/movie-agent/index.ts","agents:sample-agent":"tsx src/samples/agents/sample-agent/index.ts"},"dependencies":{"uuid":"^11.1.0"},"peerDependencies":{"express":"^4.21.2 || ^5.1.0"},"peerDependenciesMeta":{"express":{"optional":true}},"mocha":{"require":"tsx"},"_id":"@a2a-js/sdk@0.3.5","gitHead":"9a633164e8d57eeba335a967d425f9bbcd0a1779","bugs":{"url":"https://github.com/a2aproject/a2a-js/issues"},"homepage":"https://github.com/a2aproject/a2a-js#readme","_nodeVersion":"18.20.8","_npmVersion":"10.8.2","dist":{"shasum":"56eb7fb64e5da69ee3e5301a0857b6b92bc92e1f","size":70840,"noattachment":false,"key":"/@a2a-js/sdk/-/@a2a-js/sdk-0.3.5.tgz","tarball":"http://registry.cnpm.dingdandao.com/@a2a-js/sdk/download/@a2a-js/sdk-0.3.5.tgz"},"_npmUser":{"name":"google-wombot","email":"node-team-npm+wombot@google.com"},"directories":{},"maintainers":[{"name":"google-wombot","email":""},{"name":"kcthota-g","email":""},{"name":"swapydapy","email":""}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/sdk_0.3.5_1762353582961_0.4581225888143343"},"_hasShrinkwrap":false,"_cnpmcore_publish_time":"2025-11-05T14:39:43.164Z","publish_time":1762353583164,"_source_registry_name":"default","_cnpm_publish_time":1762353583164},"0.3.4":{"name":"@a2a-js/sdk","version":"0.3.4","description":"Server & Client SDK for Agent2Agent protocol","repository":{"type":"git","url":"git+https://github.com/a2aproject/a2a-js.git"},"engines":{"node":">=18"},"main":"dist/index.js","types":"dist/index.d.ts","type":"module","exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js","require":"./dist/index.cjs"},"./server":{"types":"./dist/server/index.d.ts","import":"./dist/server/index.js","require":"./dist/server/index.cjs"},"./server/express":{"types":"./dist/server/express/index.d.ts","import":"./dist/server/express/index.js","require":"./dist/server/express/index.cjs"},"./client":{"types":"./dist/client/index.d.ts","import":"./dist/client/index.js","require":"./dist/client/index.cjs"}},"devDependencies":{"@genkit-ai/googleai":"^1.8.0","@genkit-ai/vertexai":"^1.8.0","@types/chai":"^5.2.2","@types/express":"^5.0.3","@types/mocha":"^10.0.10","@types/node":"^22.13.14","@types/sinon":"^17.0.4","c8":"^10.1.3","chai":"^5.2.0","express":"^5.1.0","genkit":"^1.8.0","gts":"^6.0.2","json-schema-to-typescript":"^15.0.4","mocha":"^11.6.0","sinon":"^20.0.0","tsup":"^8.5.0","tsx":"^4.19.3","typescript":"^5.8.2"},"scripts":{"clean":"gts clean","build":"tsup","pretest":"npm run build","test":"mocha test/**/*.spec.ts","coverage":"c8 npm run test","generate":"curl https://raw.githubusercontent.com/google-a2a/A2A/refs/heads/main/specification/json/a2a.json > spec.json && node scripts/generateTypes.js && rm spec.json","sample:cli":"tsx src/samples/cli.ts","sample:movie-agent":"tsx src/samples/agents/movie-agent/index.ts"},"dependencies":{"uuid":"^11.1.0"},"peerDependencies":{"express":"^4.21.2 || ^5.1.0"},"peerDependenciesMeta":{"express":{"optional":true}},"mocha":{"require":"tsx"},"_id":"@a2a-js/sdk@0.3.4","gitHead":"c055b769d96cd197dfb89748c4708277de66684c","bugs":{"url":"https://github.com/a2aproject/a2a-js/issues"},"homepage":"https://github.com/a2aproject/a2a-js#readme","_nodeVersion":"18.20.8","_npmVersion":"10.8.2","dist":{"shasum":"4b46a1b966d67e35d300cf28e2925a7283ad0bfd","size":69348,"noattachment":false,"key":"/@a2a-js/sdk/-/@a2a-js/sdk-0.3.4.tgz","tarball":"http://registry.cnpm.dingdandao.com/@a2a-js/sdk/download/@a2a-js/sdk-0.3.4.tgz"},"_npmUser":{"name":"google-wombot","email":"node-team-npm+wombot@google.com"},"directories":{},"maintainers":[{"name":"google-wombot","email":""},{"name":"kcthota-g","email":""},{"name":"swapydapy","email":""}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/sdk_0.3.4_1757010351917_0.47369598224648946"},"_hasShrinkwrap":false,"_cnpmcore_publish_time":"2025-09-04T18:25:52.083Z","publish_time":1757010352083,"_source_registry_name":"default","_cnpm_publish_time":1757010352083},"0.3.3":{"name":"@a2a-js/sdk","version":"0.3.3","description":"Server & Client SDK for Agent2Agent protocol","repository":{"type":"git","url":"git+https://github.com/a2aproject/a2a-js.git"},"engines":{"node":">=18"},"main":"dist/index.js","types":"dist/index.d.ts","type":"module","exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js","require":"./dist/index.cjs"},"./server":{"types":"./dist/server/index.d.ts","import":"./dist/server/index.js","require":"./dist/server/index.cjs"},"./server/express":{"types":"./dist/server/express/index.d.ts","import":"./dist/server/express/index.js","require":"./dist/server/express/index.cjs"},"./client":{"types":"./dist/client/index.d.ts","import":"./dist/client/index.js","require":"./dist/client/index.cjs"}},"devDependencies":{"@genkit-ai/googleai":"^1.8.0","@genkit-ai/vertexai":"^1.8.0","@types/chai":"^5.2.2","@types/express":"^5.0.3","@types/mocha":"^10.0.10","@types/node":"^22.13.14","@types/sinon":"^17.0.4","c8":"^10.1.3","chai":"^5.2.0","express":"^5.1.0","genkit":"^1.8.0","gts":"^6.0.2","json-schema-to-typescript":"^15.0.4","mocha":"^11.6.0","sinon":"^20.0.0","tsup":"^8.5.0","tsx":"^4.19.3","typescript":"^5.8.2"},"scripts":{"clean":"gts clean","build":"tsup","pretest":"npm run build","test":"mocha test/**/*.spec.ts","coverage":"c8 npm run test","generate":"curl https://raw.githubusercontent.com/google-a2a/A2A/refs/heads/main/specification/json/a2a.json > spec.json && node scripts/generateTypes.js && rm spec.json","sample:cli":"tsx src/samples/cli.ts","sample:movie-agent":"tsx src/samples/agents/movie-agent/index.ts"},"dependencies":{"uuid":"^11.1.0"},"peerDependencies":{"express":"^4.21.2 || ^5.1.0"},"peerDependenciesMeta":{"express":{"optional":true}},"mocha":{"require":"tsx"},"_id":"@a2a-js/sdk@0.3.3","gitHead":"caeefecddeb3a5eb7d444097563a35c1c3de1b2c","bugs":{"url":"https://github.com/a2aproject/a2a-js/issues"},"homepage":"https://github.com/a2aproject/a2a-js#readme","_nodeVersion":"18.20.8","_npmVersion":"10.8.2","dist":{"shasum":"71dcd71769a66ed3cebefc80674cca0bd2eb4667","size":65610,"noattachment":false,"key":"/@a2a-js/sdk/-/@a2a-js/sdk-0.3.3.tgz","tarball":"http://registry.cnpm.dingdandao.com/@a2a-js/sdk/download/@a2a-js/sdk-0.3.3.tgz"},"_npmUser":{"name":"google-wombot","email":"node-team-npm+wombot@google.com"},"directories":{},"maintainers":[{"name":"google-wombot","email":""},{"name":"kcthota-g","email":""},{"name":"swapydapy","email":""}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/sdk_0.3.3_1756325493827_0.8444245261489678"},"_hasShrinkwrap":false,"_cnpmcore_publish_time":"2025-08-27T20:11:34.060Z","publish_time":1756325494060,"_source_registry_name":"default","_cnpm_publish_time":1756325494060},"0.3.2":{"name":"@a2a-js/sdk","version":"0.3.2","description":"Server & Client SDK for Agent2Agent protocol","repository":{"type":"git","url":"git+https://github.com/a2aproject/a2a-js.git"},"engines":{"node":">=18"},"main":"dist/index.js","types":"dist/index.d.ts","type":"module","exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js","require":"./dist/index.cjs"},"./server":{"types":"./dist/server/index.d.ts","import":"./dist/server/index.js","require":"./dist/server/index.cjs"},"./server/express":{"types":"./dist/server/express/index.d.ts","import":"./dist/server/express/index.js","require":"./dist/server/express/index.cjs"},"./client":{"types":"./dist/client/index.d.ts","import":"./dist/client/index.js","require":"./dist/client/index.cjs"}},"devDependencies":{"@genkit-ai/googleai":"^1.8.0","@genkit-ai/vertexai":"^1.8.0","@types/chai":"^5.2.2","@types/express":"^4.17.23","@types/mocha":"^10.0.10","@types/node":"^22.13.14","@types/sinon":"^17.0.4","c8":"^10.1.3","chai":"^5.2.0","express":"^4.21.2","genkit":"^1.8.0","gts":"^6.0.2","json-schema-to-typescript":"^15.0.4","mocha":"^11.6.0","sinon":"^20.0.0","tsup":"^8.5.0","tsx":"^4.19.3","typescript":"^5.8.2"},"scripts":{"clean":"gts clean","build":"tsup","pretest":"npm run build","test":"mocha test/**/*.spec.ts","coverage":"c8 npm run test","generate":"curl https://raw.githubusercontent.com/google-a2a/A2A/refs/heads/main/specification/json/a2a.json > spec.json && node scripts/generateTypes.js && rm spec.json","sample:cli":"tsx src/samples/cli.ts","sample:movie-agent":"tsx src/samples/agents/movie-agent/index.ts"},"dependencies":{"uuid":"^11.1.0"},"peerDependencies":{"express":"^4.21.2"},"peerDependenciesMeta":{"express":{"optional":true}},"mocha":{"require":"tsx"},"_id":"@a2a-js/sdk@0.3.2","gitHead":"1168117482c150d3d13ce9eb076f38db1e3cffa8","bugs":{"url":"https://github.com/a2aproject/a2a-js/issues"},"homepage":"https://github.com/a2aproject/a2a-js#readme","_nodeVersion":"18.20.8","_npmVersion":"10.8.2","dist":{"shasum":"f006409c842c8f0a51c0d7c95ae6face88026c03","size":63793,"noattachment":false,"key":"/@a2a-js/sdk/-/@a2a-js/sdk-0.3.2.tgz","tarball":"http://registry.cnpm.dingdandao.com/@a2a-js/sdk/download/@a2a-js/sdk-0.3.2.tgz"},"_npmUser":{"name":"google-wombot","email":"node-team-npm+wombot@google.com"},"directories":{},"maintainers":[{"name":"google-wombot","email":""},{"name":"kcthota-g","email":""},{"name":"swapydapy","email":""}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/sdk_0.3.2_1755469679455_0.860454681990436"},"_hasShrinkwrap":false,"_cnpmcore_publish_time":"2025-08-17T22:27:59.641Z","publish_time":1755469679641,"_source_registry_name":"default","_cnpm_publish_time":1755469679641},"0.3.1":{"name":"@a2a-js/sdk","version":"0.3.1","description":"Server & Client SDK for Agent2Agent protocol","repository":{"type":"git","url":"git+https://github.com/a2aproject/a2a-js.git"},"engines":{"node":">=18"},"main":"dist/index.js","types":"dist/index.d.ts","type":"module","exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js","require":"./dist/index.cjs"},"./server":{"types":"./dist/server/index.d.ts","import":"./dist/server/index.js","require":"./dist/server/index.cjs"},"./server/express":{"types":"./dist/server/express/index.d.ts","import":"./dist/server/express/index.js","require":"./dist/server/express/index.cjs"},"./client":{"types":"./dist/client/index.d.ts","import":"./dist/client/index.js","require":"./dist/client/index.cjs"}},"devDependencies":{"@genkit-ai/googleai":"^1.8.0","@genkit-ai/vertexai":"^1.8.0","@types/chai":"^5.2.2","@types/express":"^4.17.23","@types/mocha":"^10.0.10","@types/node":"^22.13.14","@types/sinon":"^17.0.4","c8":"^10.1.3","chai":"^5.2.0","express":"^4.21.2","genkit":"^1.8.0","gts":"^6.0.2","json-schema-to-typescript":"^15.0.4","mocha":"^11.6.0","sinon":"^20.0.0","tsup":"^8.5.0","tsx":"^4.19.3","typescript":"^5.8.2"},"scripts":{"clean":"gts clean","build":"tsup","pretest":"npm run build","test":"mocha test/**/*.spec.ts","coverage":"c8 npm run test","generate":"curl https://raw.githubusercontent.com/google-a2a/A2A/refs/heads/main/specification/json/a2a.json > spec.json && node scripts/generateTypes.js && rm spec.json","sample:cli":"tsx src/samples/cli.ts","sample:movie-agent":"tsx src/samples/agents/movie-agent/index.ts"},"dependencies":{"uuid":"^11.1.0"},"peerDependencies":{"express":"^4.21.2"},"peerDependenciesMeta":{"express":{"optional":true}},"mocha":{"require":"tsx"},"_id":"@a2a-js/sdk@0.3.1","gitHead":"118abae80f9ed7eb82dc3f7db966637fc95f63a0","bugs":{"url":"https://github.com/a2aproject/a2a-js/issues"},"homepage":"https://github.com/a2aproject/a2a-js#readme","_nodeVersion":"22.17.1","_npmVersion":"10.9.2","dist":{"shasum":"f2248acdb0e0a315036ce09126457e19ed7f87be","size":60002,"noattachment":false,"key":"/@a2a-js/sdk/-/@a2a-js/sdk-0.3.1.tgz","tarball":"http://registry.cnpm.dingdandao.com/@a2a-js/sdk/download/@a2a-js/sdk-0.3.1.tgz"},"_npmUser":{"name":"google-wombot","email":"node-team-npm+wombot@google.com"},"directories":{},"maintainers":[{"name":"google-wombot","email":""},{"name":"kcthota-g","email":""},{"name":"swapydapy","email":""}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/sdk_0.3.1_1754514836116_0.3340352874162327"},"_hasShrinkwrap":false,"_cnpmcore_publish_time":"2025-08-06T21:13:56.301Z","publish_time":1754514836301,"_source_registry_name":"default","_cnpm_publish_time":1754514836301},"0.3.0":{"name":"@a2a-js/sdk","version":"0.3.0","description":"Server & Client SDK for Agent2Agent protocol","repository":{"type":"git","url":"git+https://github.com/google-a2a/a2a-js.git"},"engines":{"node":">=18"},"main":"dist/index.js","types":"dist/index.d.ts","type":"module","exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js","require":"./dist/index.cjs"},"./server":{"types":"./dist/server/index.d.ts","import":"./dist/server/index.js","require":"./dist/server/index.cjs"},"./server/express":{"types":"./dist/server/express/index.d.ts","import":"./dist/server/express/index.js","require":"./dist/server/express/index.cjs"},"./client":{"types":"./dist/client/index.d.ts","import":"./dist/client/index.js","require":"./dist/client/index.cjs"}},"devDependencies":{"@genkit-ai/googleai":"^1.8.0","@genkit-ai/vertexai":"^1.8.0","@types/chai":"^5.2.2","@types/express":"^4.17.23","@types/mocha":"^10.0.10","@types/node":"^22.13.14","@types/sinon":"^17.0.4","c8":"^10.1.3","chai":"^5.2.0","express":"^4.21.2","genkit":"^1.8.0","gts":"^6.0.2","json-schema-to-typescript":"^15.0.4","mocha":"^11.6.0","sinon":"^20.0.0","tsup":"^8.5.0","tsx":"^4.19.3","typescript":"^5.8.2"},"scripts":{"clean":"gts clean","build":"tsup","pretest":"npm run build","test":"mocha test/**/*.spec.ts","coverage":"c8 npm run test","generate":"curl https://raw.githubusercontent.com/google-a2a/A2A/refs/heads/main/specification/json/a2a.json > spec.json && node scripts/generateTypes.js && rm spec.json","sample:cli":"tsx src/samples/cli.ts","sample:movie-agent":"tsx src/samples/agents/movie-agent/index.ts"},"dependencies":{"uuid":"^11.1.0"},"peerDependencies":{"express":"^4.21.2"},"peerDependenciesMeta":{"express":{"optional":true}},"mocha":{"require":"tsx"},"_id":"@a2a-js/sdk@0.3.0","gitHead":"19e0d750386ef55ae306726dfca91f4c2b334e70","bugs":{"url":"https://github.com/google-a2a/a2a-js/issues"},"homepage":"https://github.com/google-a2a/a2a-js#readme","_nodeVersion":"22.17.1","_npmVersion":"10.9.2","dist":{"shasum":"b8c5b93c63ebdd97b3e04e9a6917ef62189d005c","size":56671,"noattachment":false,"key":"/@a2a-js/sdk/-/@a2a-js/sdk-0.3.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/@a2a-js/sdk/download/@a2a-js/sdk-0.3.0.tgz"},"_npmUser":{"name":"google-wombot","email":"node-team-npm+wombot@google.com"},"directories":{},"maintainers":[{"name":"google-wombot","email":""},{"name":"kcthota-g","email":""},{"name":"swapydapy","email":""}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/sdk_0.3.0_1754417955105_0.973081965283803"},"_hasShrinkwrap":false,"_cnpmcore_publish_time":"2025-08-05T18:19:15.307Z","publish_time":1754417955307,"_source_registry_name":"default","_cnpm_publish_time":1754417955307},"0.2.5":{"name":"@a2a-js/sdk","version":"0.2.5","description":"Server & Client SDK for Agent2Agent protocol","repository":{"type":"git","url":"git+https://github.com/google-a2a/a2a-js.git"},"engines":{"node":">=18"},"main":"dist/index.js","types":"dist/index.d.ts","type":"module","exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js","require":"./dist/index.cjs"},"./server":{"types":"./dist/server/index.d.ts","import":"./dist/server/index.js","require":"./dist/server/index.cjs"},"./client":{"types":"./dist/client/index.d.ts","import":"./dist/client/index.js","require":"./dist/client/index.cjs"}},"devDependencies":{"@genkit-ai/googleai":"^1.8.0","@genkit-ai/vertexai":"^1.8.0","@types/chai":"^5.2.2","@types/mocha":"^10.0.10","@types/node":"^22.13.14","@types/sinon":"^17.0.4","c8":"^10.1.3","chai":"^5.2.0","genkit":"^1.8.0","gts":"^6.0.2","json-schema-to-typescript":"^15.0.4","mocha":"^11.6.0","sinon":"^20.0.0","tsup":"^8.5.0","tsx":"^4.19.3","typescript":"^5.8.2"},"scripts":{"clean":"gts clean","build":"tsup","pretest":"npm run build","test":"mocha test/**/*.spec.ts","coverage":"c8 npm run test","generate":"curl https://raw.githubusercontent.com/google-a2a/A2A/refs/heads/main/specification/json/a2a.json > spec.json && node scripts/generateTypes.js && rm spec.json","sample:cli":"tsx src/samples/cli.ts","sample:movie-agent":"tsx src/samples/agents/movie-agent/index.ts"},"dependencies":{"@types/cors":"^2.8.17","@types/express":"^4.17.23","body-parser":"^2.2.0","cors":"^2.8.5","express":"^4.21.2","uuid":"^11.1.0"},"mocha":{"require":"tsx"},"_id":"@a2a-js/sdk@0.2.5","gitHead":"3bda04b0097c852552a5a307b89a280733f9b587","bugs":{"url":"https://github.com/google-a2a/a2a-js/issues"},"homepage":"https://github.com/google-a2a/a2a-js#readme","_nodeVersion":"18.20.8","_npmVersion":"10.8.2","dist":{"shasum":"dd6b7fd5ab91792367406f4d0a3d7af7b7e61d6c","size":49944,"noattachment":false,"key":"/@a2a-js/sdk/-/@a2a-js/sdk-0.2.5.tgz","tarball":"http://registry.cnpm.dingdandao.com/@a2a-js/sdk/download/@a2a-js/sdk-0.2.5.tgz"},"_npmUser":{"name":"google-wombot","email":"node-team-npm+wombot@google.com"},"directories":{},"maintainers":[{"name":"google-wombot","email":""},{"name":"kcthota-g","email":""},{"name":"swapydapy","email":""}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/sdk_0.2.5_1753915586477_0.6450749366029098"},"_hasShrinkwrap":false,"_cnpmcore_publish_time":"2025-07-30T22:46:26.741Z","publish_time":1753915586741,"_source_registry_name":"default","_cnpm_publish_time":1753915586741},"0.2.4":{"name":"@a2a-js/sdk","version":"0.2.4","description":"Server & Client SDK for Agent2Agent protocol","repository":{"type":"git","url":"git+https://github.com/google-a2a/a2a-js.git"},"engines":{"node":">=18"},"main":"dist/index.js","types":"dist/index.d.ts","type":"module","exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js","require":"./dist/index.cjs"},"./server":{"types":"./dist/server/index.d.ts","import":"./dist/server/index.js","require":"./dist/server/index.cjs"},"./client":{"types":"./dist/client/index.d.ts","import":"./dist/client/index.js","require":"./dist/client/index.cjs"}},"devDependencies":{"@genkit-ai/googleai":"^1.8.0","@genkit-ai/vertexai":"^1.8.0","@types/chai":"^5.2.2","@types/mocha":"^10.0.10","@types/node":"^22.13.14","@types/sinon":"^17.0.4","c8":"^10.1.3","chai":"^5.2.0","genkit":"^1.8.0","gts":"^6.0.2","json-schema-to-typescript":"^15.0.4","mocha":"^11.6.0","sinon":"^20.0.0","tsup":"^8.5.0","tsx":"^4.19.3","typescript":"^5.8.2"},"scripts":{"clean":"gts clean","build":"tsup","pretest":"npm run build","test":"mocha build/test/**/*.js","coverage":"c8 npm run test","generate":"curl https://raw.githubusercontent.com/google-a2a/A2A/refs/heads/main/specification/json/a2a.json > spec.json && node scripts/generateTypes.js && rm spec.json","sample:cli":"tsx src/samples/cli.ts","sample:movie-agent":"tsx src/samples/agents/movie-agent/index.ts"},"dependencies":{"@types/cors":"^2.8.17","@types/express":"^4.17.23","body-parser":"^2.2.0","cors":"^2.8.5","express":"^4.21.2","uuid":"^11.1.0"},"_id":"@a2a-js/sdk@0.2.4","gitHead":"e35a33f419c5975a5c6c349518f5129eea879765","bugs":{"url":"https://github.com/google-a2a/a2a-js/issues"},"homepage":"https://github.com/google-a2a/a2a-js#readme","_nodeVersion":"22.16.0","_npmVersion":"10.9.2","dist":{"shasum":"5eb892f7615b0391464c360f1c00c80c16127cb2","size":49173,"noattachment":false,"key":"/@a2a-js/sdk/-/@a2a-js/sdk-0.2.4.tgz","tarball":"http://registry.cnpm.dingdandao.com/@a2a-js/sdk/download/@a2a-js/sdk-0.2.4.tgz"},"_npmUser":{"name":"google-wombot","email":"node-team-npm+wombot@google.com"},"directories":{},"maintainers":[{"name":"google-wombot","email":""},{"name":"kcthota-g","email":""},{"name":"swapydapy","email":""}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/sdk_0.2.4_1752527908456_0.24504378423786966"},"_hasShrinkwrap":false,"_cnpmcore_publish_time":"2025-07-14T21:18:28.629Z","publish_time":1752527908629,"_source_registry_name":"default","_cnpm_publish_time":1752527908629},"0.2.3":{"name":"@a2a-js/sdk","version":"0.2.3","description":"Server & Client SDK for Agent2Agent protocol","repository":{"type":"git","url":"git+https://github.com/google-a2a/a2a-js.git"},"engines":{"node":">=18"},"main":"dist/index.js","types":"dist/index.d.ts","type":"module","exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js","require":"./dist/index.cjs"},"./server":{"types":"./dist/server/index.d.ts","import":"./dist/server/index.js","require":"./dist/server/index.cjs"},"./client":{"types":"./dist/client/index.d.ts","import":"./dist/client/index.js","require":"./dist/client/index.cjs"}},"devDependencies":{"@genkit-ai/googleai":"^1.8.0","@genkit-ai/vertexai":"^1.8.0","@types/chai":"^5.2.2","@types/mocha":"^10.0.10","@types/node":"^22.13.14","@types/sinon":"^17.0.4","c8":"^10.1.3","chai":"^5.2.0","genkit":"^1.8.0","gts":"^6.0.2","json-schema-to-typescript":"^15.0.4","mocha":"^11.6.0","sinon":"^20.0.0","tsup":"^8.5.0","tsx":"^4.19.3","typescript":"^5.8.2"},"scripts":{"clean":"gts clean","build":"tsup","pretest":"npm run build","test":"mocha build/test/**/*.js","coverage":"c8 npm run test","generate":"curl https://raw.githubusercontent.com/google-a2a/A2A/refs/heads/main/specification/json/a2a.json > spec.json && node scripts/generateTypes.js && rm spec.json","sample:cli":"tsx src/samples/cli.ts","sample:movie-agent":"tsx src/samples/agents/movie-agent/index.ts"},"dependencies":{"@types/cors":"^2.8.17","@types/express":"^4.17.23","body-parser":"^2.2.0","cors":"^2.8.5","express":"^4.21.2","uuid":"^11.1.0"},"_id":"@a2a-js/sdk@0.2.3","gitHead":"f3230c168ae677df8f06a57494c80e8420b1217a","bugs":{"url":"https://github.com/google-a2a/a2a-js/issues"},"homepage":"https://github.com/google-a2a/a2a-js#readme","_nodeVersion":"22.16.0","_npmVersion":"10.9.2","dist":{"shasum":"d482caa8a62beb885f75afc02c16430ea7f59818","size":9174,"noattachment":false,"key":"/@a2a-js/sdk/-/@a2a-js/sdk-0.2.3.tgz","tarball":"http://registry.cnpm.dingdandao.com/@a2a-js/sdk/download/@a2a-js/sdk-0.2.3.tgz"},"_npmUser":{"name":"google-wombot","email":"node-team-npm+wombot@google.com"},"directories":{},"maintainers":[{"name":"google-wombot","email":""},{"name":"kcthota-g","email":""},{"name":"swapydapy","email":""}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/sdk_0.2.3_1752523261175_0.1287788526473439"},"_hasShrinkwrap":false,"_cnpmcore_publish_time":"2025-07-14T20:01:01.364Z","publish_time":1752523261364,"_source_registry_name":"default","_cnpm_publish_time":1752523261364},"0.2.2":{"name":"@a2a-js/sdk","version":"0.2.2","description":"Server & Client SDK for Agent2Agent protocol","repository":{"type":"git","url":"git+https://github.com/google-a2a/a2a-js.git"},"engines":{"node":">=18"},"main":"build/src/index.js","types":"build/src/index.d.ts","type":"module","devDependencies":{"@genkit-ai/googleai":"^1.8.0","@genkit-ai/vertexai":"^1.8.0","@types/chai":"^5.2.2","@types/mocha":"^10.0.10","@types/node":"^22.13.14","@types/sinon":"^17.0.4","c8":"^10.1.3","chai":"^5.2.0","genkit":"^1.8.0","gts":"^6.0.2","json-schema-to-typescript":"^15.0.4","mocha":"^11.6.0","sinon":"^20.0.0","tsx":"^4.19.3","typescript":"^5.8.2"},"scripts":{"clean":"gts clean","build":"tsc -p .","pretest":"npm run build","test":"mocha build/test/**/*.js","coverage":"c8 npm run test","generate":"curl https://raw.githubusercontent.com/google-a2a/A2A/refs/heads/main/specification/json/a2a.json > spec.json && node scripts/generateTypes.js && rm spec.json","sample:cli":"tsx src/samples/cli.ts","sample:movie-agent":"tsx src/samples/agents/movie-agent/index.ts"},"dependencies":{"@types/cors":"^2.8.17","@types/express":"^5.0.1","body-parser":"^2.2.0","cors":"^2.8.5","express":"^4.21.2","uuid":"^11.1.0"},"_id":"@a2a-js/sdk@0.2.2","gitHead":"a997e4b9ff86412dda78d2c32e372f1dee3cc752","bugs":{"url":"https://github.com/google-a2a/a2a-js/issues"},"homepage":"https://github.com/google-a2a/a2a-js#readme","_nodeVersion":"22.16.0","_npmVersion":"10.9.2","dist":{"shasum":"102692f0fce930c63f2beab72443154b037cc7e3","size":45735,"noattachment":false,"key":"/@a2a-js/sdk/-/@a2a-js/sdk-0.2.2.tgz","tarball":"http://registry.cnpm.dingdandao.com/@a2a-js/sdk/download/@a2a-js/sdk-0.2.2.tgz"},"_npmUser":{"name":"google-wombot","email":"node-team-npm+wombot@google.com","actor":{"name":"google-wombot","email":"node-team-npm+wombot@google.com","type":"user"}},"directories":{},"maintainers":[{"name":"google-wombot","email":""},{"name":"kcthota-g","email":""},{"name":"swapydapy","email":""}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/sdk_0.2.2_1750392567752_0.02432256752061801"},"_hasShrinkwrap":false,"_cnpmcore_publish_time":"2025-06-20T04:09:27.937Z","publish_time":1750392567937,"_source_registry_name":"default","_cnpm_publish_time":1750392567937},"0.2.1":{"name":"@a2a-js/sdk","version":"0.2.1","description":"Server & Client SDK for Agent2Agent protocol","repository":{"type":"git","url":"git+https://github.com/google-a2a/a2a-js.git"},"engines":{"node":">=18"},"main":"build/src/index.js","types":"build/src/index.d.ts","type":"module","devDependencies":{"@genkit-ai/googleai":"^1.8.0","@genkit-ai/vertexai":"^1.8.0","@types/chai":"^5.2.2","@types/mocha":"^10.0.10","@types/node":"^22.13.14","@types/sinon":"^17.0.4","c8":"^10.1.3","chai":"^5.2.0","genkit":"^1.8.0","gts":"^6.0.2","json-schema-to-typescript":"^15.0.4","mocha":"^11.6.0","sinon":"^20.0.0","tsx":"^4.19.3","typescript":"^5.8.2"},"scripts":{"clean":"gts clean","build":"tsc -p .","pretest":"npm run build","test":"mocha build/test/**/*.js","coverage":"c8 npm run test","generate":"curl https://raw.githubusercontent.com/google-a2a/A2A/refs/heads/main/specification/json/a2a.json > spec.json && node scripts/generateTypes.js && rm spec.json","sample:cli":"tsx src/samples/cli.ts","sample:movie-agent":"tsx src/samples/agents/movie-agent/index.ts"},"dependencies":{"@types/cors":"^2.8.17","@types/express":"^5.0.1","body-parser":"^2.2.0","cors":"^2.8.5","express":"^4.21.2","uuid":"^11.1.0"},"_id":"@a2a-js/sdk@0.2.1","gitHead":"ea5a71e019d0bab8b5377bd5694589474c1c44f6","bugs":{"url":"https://github.com/google-a2a/a2a-js/issues"},"homepage":"https://github.com/google-a2a/a2a-js#readme","_nodeVersion":"22.16.0","_npmVersion":"10.9.2","dist":{"shasum":"a4908ce910927ef3f06cb46a7e6be56a88a72adf","size":45347,"noattachment":false,"key":"/@a2a-js/sdk/-/@a2a-js/sdk-0.2.1.tgz","tarball":"http://registry.cnpm.dingdandao.com/@a2a-js/sdk/download/@a2a-js/sdk-0.2.1.tgz"},"_npmUser":{"name":"google-wombot","email":"node-team-npm+wombot@google.com"},"directories":{},"maintainers":[{"name":"google-wombot","email":""},{"name":"kcthota-g","email":""},{"name":"swapydapy","email":""}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/sdk_0.2.1_1749865142075_0.1352704661059041"},"_hasShrinkwrap":false,"_cnpmcore_publish_time":"2025-06-14T01:39:02.251Z","publish_time":1749865142251,"_source_registry_name":"default","_cnpm_publish_time":1749865142251}},"readme":"# A2A JavaScript SDK\n\n[![License](https://img.shields.io/badge/License-Apache_2.0-blue.svg)](LICENSE)\n\n<!-- markdownlint-disable no-inline-html -->\n\n<html>\n   <h2 align=\"center\">\n   <img src=\"https://raw.githubusercontent.com/google-a2a/A2A/refs/heads/main/docs/assets/a2a-logo-black.svg\" width=\"256\" alt=\"A2A Logo\"/>\n   </h2>\n   <h3 align=\"center\">A JavaScript library that helps run agentic applications as A2AServers following the <a href=\"https://google-a2a.github.io/A2A\">Agent2Agent (A2A) Protocol</a>.</h3>\n</html>\n\n<!-- markdownlint-enable no-inline-html -->\n\n## Installation\n\nYou can install the A2A SDK using `npm`.\n\n```bash\nnpm install @a2a-js/sdk\n```\n\n### For Server Usage\n\nIf you plan to use the Express integration (imports from `@a2a-js/sdk/server/express`) for A2A server, you'll also need to install Express as it's a peer dependency:\n\n```bash\nnpm install express\n```\n\nYou can also find some samples [here](https://github.com/a2aproject/a2a-js/tree/main/src/samples).\n\n---\n\n## Quickstart\n\nThis example shows how to create a simple \"Hello World\" agent server and a client to interact with it.\n\n### Server: Hello World Agent\n\nThe core of an A2A server is the `AgentExecutor`, which contains your agent's logic.\n\n```typescript\n// server.ts\nimport express from 'express';\nimport { v4 as uuidv4 } from 'uuid';\nimport { AgentCard, Message, AGENT_CARD_PATH } from '@a2a-js/sdk';\nimport {\n  AgentExecutor,\n  RequestContext,\n  ExecutionEventBus,\n  DefaultRequestHandler,\n  InMemoryTaskStore,\n} from '@a2a-js/sdk/server';\nimport { agentCardHandler, jsonRpcHandler, restHandler, UserBuilder } from '@a2a-js/sdk/server/express';\n\n// 1. Define your agent's identity card.\nconst helloAgentCard: AgentCard = {\n  name: 'Hello Agent',\n  description: 'A simple agent that says hello.',\n  protocolVersion: '0.3.0',\n  version: '0.1.0',\n  url: 'http://localhost:4000/a2a/jsonrpc', // The public URL of your agent server\n  skills: [{ id: 'chat', name: 'Chat', description: 'Say hello', tags: ['chat'] }],\n  capabilities: {\n    pushNotifications: false,\n  },\n  defaultInputModes: ['text'],\n  defaultOutputModes: ['text'],\n  additionalInterfaces: [\n    { url: 'http://localhost:4000/a2a/jsonrpc', transport: 'JSONRPC' }, // Default JSON-RPC transport\n    { url: 'http://localhost:4000/a2a/rest', transport: 'HTTP+JSON' }, // HTTP+JSON/REST transport\n  ],\n};\n\n// 2. Implement the agent's logic.\nclass HelloExecutor implements AgentExecutor {\n  async execute(requestContext: RequestContext, eventBus: ExecutionEventBus): Promise<void> {\n    // Create a direct message response.\n    const responseMessage: Message = {\n      kind: 'message',\n      messageId: uuidv4(),\n      role: 'agent',\n      parts: [{ kind: 'text', text: 'Hello, world!' }],\n      // Associate the response with the incoming request's context.\n      contextId: requestContext.contextId,\n    };\n\n    // Publish the message and signal that the interaction is finished.\n    eventBus.publish(responseMessage);\n    eventBus.finished();\n  }\n\n  // cancelTask is not needed for this simple, non-stateful agent.\n  cancelTask = async (): Promise<void> => {};\n}\n\n// 3. Set up and run the server.\nconst agentExecutor = new HelloExecutor();\nconst requestHandler = new DefaultRequestHandler(\n  helloAgentCard,\n  new InMemoryTaskStore(),\n  agentExecutor\n);\n\nconst app = express();\n\napp.use(`/${AGENT_CARD_PATH}`, agentCardHandler({ agentCardProvider: requestHandler }));\napp.use('/a2a/jsonrpc', jsonRpcHandler({ requestHandler, userBuilder: UserBuilder.noAuthentication }));\napp.use('/a2a/rest', restHandler({ requestHandler, userBuilder: UserBuilder.noAuthentication }));\n\napp.listen(4000, () => {\n  console.log(`???? Server started on http://localhost:4000`);\n});\n```\n\n### Client: Sending a Message\n\nThe [`ClientFactory`](src/client/factory.ts) makes it easy to communicate with any A2A-compliant agent.\n\n```typescript\n// client.ts\nimport { ClientFactory } from '@a2a-js/sdk/client';\nimport { Message, MessageSendParams, SendMessageSuccessResponse } from '@a2a-js/sdk';\nimport { v4 as uuidv4 } from 'uuid';\n\nasync function run() {\n  const factory = new ClientFactory();\n\n  // createFromUrl accepts baseUrl and optional path,\n  // (the default path is /.well-known/agent-card.json)\n  const client = await factory.createFromUrl('http://localhost:4000');\n\n  const sendParams: MessageSendParams = {\n    message: {\n      messageId: uuidv4(),\n      role: 'user',\n      parts: [{ kind: 'text', text: 'Hi there!' }],\n      kind: 'message',\n    },\n  };\n\n  try {\n    const response = await client.sendMessage(sendParams);\n    const result = response as Message;\n    console.log('Agent response:', result.parts[0].text); // \"Hello, world!\"\n  } catch(e) {\n    console.error('Error:', e);\n  }\n}\n\nawait run();\n```\n\n---\n\n## A2A `Task` Support\n\nFor operations that are stateful or long-running, agents create a `Task`. A task has a state (e.g., `working`, `completed`) and can produce `Artifacts` (e.g., files, data).\n\n### Server: Creating a Task\n\nThis agent creates a task, attaches a file artifact to it, and marks it as complete.\n\n```typescript\n// server.ts\nimport { Task, TaskArtifactUpdateEvent, TaskStatusUpdateEvent } from '@a2a-js/sdk';\n// ... other imports from the quickstart server ...\n\nclass TaskExecutor implements AgentExecutor {\n  async execute(requestContext: RequestContext, eventBus: ExecutionEventBus): Promise<void> {\n    const { taskId, contextId, userMessage, task } = requestContext;\n\n    // 1. Create and publish the initial task object if it doesn't exist.\n    if (!task) {\n      const initialTask: Task = {\n        kind: 'task',\n        id: taskId,\n        contextId: contextId,\n        status: {\n          state: 'submitted',\n          timestamp: new Date().toISOString(),\n        },\n        history: [userMessage],\n      };\n      eventBus.publish(initialTask);\n    }\n\n    // 2. Create and publish an artifact.\n    const artifactUpdate: TaskArtifactUpdateEvent = {\n      kind: 'artifact-update',\n      taskId: taskId,\n      contextId: contextId,\n      artifact: {\n        artifactId: 'report-1',\n        name: 'analysis_report.txt',\n        parts: [{ kind: 'text', text: `This is the analysis for task ${taskId}.` }],\n      },\n    };\n    eventBus.publish(artifactUpdate);\n\n    // 3. Publish the final status and mark the event as 'final'.\n    const finalUpdate: TaskStatusUpdateEvent = {\n      kind: 'status-update',\n      taskId: taskId,\n      contextId: contextId,\n      status: { state: 'completed', timestamp: new Date().toISOString() },\n      final: true,\n    };\n    eventBus.publish(finalUpdate);\n    eventBus.finished();\n  }\n\n  cancelTask = async (): Promise<void> => {};\n}\n```\n\n### Client: Receiving a Task\n\nThe client sends a message and receives a `Task` object as the result.\n\n```typescript\n// client.ts\nimport { ClientFactory } from '@a2a-js/sdk/client';\nimport { Message, MessageSendParams, SendMessageSuccessResponse, Task } from '@a2a-js/sdk';\n// ... other imports ...\n\nconst factory = new ClientFactory();\n\n// createFromUrl accepts baseUrl and optional path,\n// (the default path is /.well-known/agent-card.json)\nconst client = await factory.createFromUrl('http://localhost:4000');\n\ntry {\n  const result = await client.sendMessage({\n    message: {\n      messageId: uuidv4(),\n      role: 'user',\n      parts: [{ kind: 'text', text: 'Do something.' }],\n      kind: 'message',\n    },\n  });\n\n  // Check if the agent's response is a Task or a direct Message.\n  if (result.kind === 'task') {\n    const task = result as Task;\n    console.log(`Task [${task.id}] completed with status: ${task.status.state}`);\n\n    if (task.artifacts && task.artifacts.length > 0) {\n      console.log(`Artifact found: ${task.artifacts[0].name}`);\n      console.log(`Content: ${task.artifacts[0].parts[0].text}`);\n    }\n  } else {\n    const message = result as Message;\n    console.log('Received direct message:', message.parts[0].text);\n  }\n} catch (e) {\n  console.error('Error:', e);\n}\n```\n\n---\n\n## Client Customization\n\nClient can be customized via [`CallInterceptor`'s](src/client/interceptors.ts) which is a recommended way as it's transport-agnostic.\n\nCommon use cases include:\n\n- **Request Interception**: Log outgoing requests or collect metrics.\n- **Header Injection**: Add custom headers for authentication, tracing, or routing.\n- **A2A Extensions**: Modifying payloads to include protocol extension data.\n\n### Example: Injecting a Custom Header\n\nThis example defines a `CallInterceptor` to update `serviceParameters` which are passed as HTTP headers.\n\n```typescript\nimport { v4 as uuidv4 } from 'uuid';\nimport { AfterArgs, BeforeArgs, CallInterceptor, ClientFactory, ClientFactoryOptions } from '@a2a-js/sdk/client';\n\n// 1. Define an interceptor\nclass RequestIdInterceptor implements CallInterceptor {\n  before(args: BeforeArgs): Promise<void> {\n    args.options = {\n      ...args.options,\n      serviceParameters: {\n        ...args.options.serviceParameters,\n        ['X-Request-ID']: uuidv4(),\n      },\n    };\n    return Promise.resolve();\n  }\n\n  after(): Promise<void> {\n    return Promise.resolve();\n  }\n}\n\n// 2. Register the interceptor in the client factory\nconst factory = new ClientFactory(ClientFactoryOptions.createFrom(ClientFactoryOptions.default, {\n  clientConfig: {\n    interceptors: [new RequestIdInterceptor()]\n  }\n}))\nconst client = await factory.createFromAgentCardUrl('http://localhost:4000');\n\n// Now, all requests made by clients created by this factory will include the X-Request-ID header.\nawait client.sendMessage({\n  message: {\n    messageId: uuidv4(),\n    role: 'user',\n    parts: [{ kind: 'text', text: 'A message requiring custom headers.' }],\n    kind: 'message',\n  },\n});\n```\n\n### Example: Specifying a Timeout\n\nEach client method can be configured with an optional `signal` field.\n\n```typescript\nimport { ClientFactory } from '@a2a-js/sdk/client';\n\nconst factory = new ClientFactory();\n\n// createFromUrl accepts baseUrl and optional path,\n// (the default path is /.well-known/agent-card.json)\nconst client = await factory.createFromUrl('http://localhost:4000');\n\nawait client.sendMessage(\n  {\n    message: {\n      messageId: uuidv4(),\n      role: 'user',\n      parts: [{ kind: 'text', text: 'A long-running message.' }],\n      kind: 'message',\n    },\n  },\n  {\n    signal: AbortSignal.timeout(5000), // 5 seconds timeout\n  }\n);\n```\n\n### Customizing Transports: Using the Provided `AuthenticationHandler`\n\nFor advanced authentication scenarios, the SDK includes a higher-order function `createAuthenticatingFetchWithRetry` and an `AuthenticationHandler` interface. This utility automatically adds authorization headers and can retry requests that fail with authentication errors (e.g., 401 Unauthorized).\n\nHere's how to use it to manage a Bearer token:\n\n```typescript\nimport {\n  ClientFactory,\n  ClientFactoryOptions,\n  JsonRpcTransportFactory,\n  AuthenticationHandler,\n  createAuthenticatingFetchWithRetry,\n} from '@a2a-js/sdk/client';\n\n// A simple token provider that simulates fetching a new token.\nconst tokenProvider = {\n  token: 'initial-stale-token',\n  getNewToken: async () => {\n    console.log('Refreshing auth token...');\n    tokenProvider.token = `new-token-${Date.now()}`;\n    return tokenProvider.token;\n  },\n};\n\n// 1. Implement the AuthenticationHandler interface.\nconst handler: AuthenticationHandler = {\n  // headers() is called on every request to get the current auth headers.\n  headers: async () => ({\n    Authorization: `Bearer ${tokenProvider.token}`,\n  }),\n\n  // shouldRetryWithHeaders() is called after a request fails.\n  // It decides if a retry is needed and provides new headers.\n  shouldRetryWithHeaders: async (req: RequestInit, res: Response) => {\n    if (res.status === 401) {\n      // Unauthorized\n      const newToken = await tokenProvider.getNewToken();\n      // Return new headers to trigger a single retry.\n      return { Authorization: `Bearer ${newToken}` };\n    }\n\n    // Return undefined to not retry for other errors.\n    return undefined;\n  },\n};\n\n// 2. Create the authenticated fetch function.\nconst authFetch = createAuthenticatingFetchWithRetry(fetch, handler);\n\n// 3. Inject new fetch implementation into a client factory.\nconst factory = new ClientFactory(ClientFactoryOptions.createFrom(ClientFactoryOptions.default, {\n  transports: [\n    new JsonRpcTransportFactory({ fetchImpl: authFetch })\n  ]\n}))\n\n// 4. Clients created from the factory are going to have custom fetch attached.\nconst client = await factory.createFromUrl('http://localhost:4000');\n```\n\n---\n\n## Streaming\n\nFor real-time updates, A2A supports streaming responses over Server-Sent Events (SSE).\n\n### Server: Streaming Task Updates\n\nThe agent publishes events as it works on the task. The client receives these events in real-time.\n\n```typescript\n// server.ts\n// ... imports ...\n\nclass StreamingExecutor implements AgentExecutor {\n  async execute(requestContext: RequestContext, eventBus: ExecutionEventBus): Promise<void> {\n    const { taskId, contextId, userMessage, task } = requestContext;\n\n    // 1. Create and publish the initial task object if it doesn't exist.\n    if (!task) {\n      const initialTask: Task = {\n        kind: 'task',\n        id: taskId,\n        contextId: contextId,\n        status: {\n          state: 'submitted',\n          timestamp: new Date().toISOString(),\n        },\n        history: [userMessage],\n      };\n      eventBus.publish(initialTask);\n    }\n\n    // 2. Publish 'working' state.\n    eventBus.publish({\n      kind: 'status-update',\n      taskId,\n      contextId,\n      status: { state: 'working', timestamp: new Date().toISOString() },\n      final: false,\n    });\n\n    // 3. Simulate work and publish an artifact.\n    await new Promise((resolve) => setTimeout(resolve, 1000));\n    eventBus.publish({\n      kind: 'artifact-update',\n      taskId,\n      contextId,\n      artifact: { artifactId: 'result.txt', parts: [{ kind: 'text', text: 'First result.' }] },\n    });\n\n    // 4. Publish final 'completed' state.\n    eventBus.publish({\n      kind: 'status-update',\n      taskId,\n      contextId,\n      status: { state: 'completed', timestamp: new Date().toISOString() },\n      final: true,\n    });\n    eventBus.finished();\n  }\n  cancelTask = async (): Promise<void> => {};\n}\n```\n\n### Client: Consuming a Stream\n\nThe `sendMessageStream` method returns an `AsyncGenerator` that yields events as they arrive from the server.\n\n```typescript\n// client.ts\nimport { ClientFactory } from '@a2a-js/sdk/client';\nimport { MessageSendParams } from '@a2a-js/sdk';\nimport { v4 as uuidv4 } from 'uuid';\n// ... other imports ...\n\nconst factory = new ClientFactory();\n\n// createFromUrl accepts baseUrl and optional path,\n// (the default path is /.well-known/agent-card.json)\nconst client = await factory.createFromUrl('http://localhost:4000');\n\nasync function streamTask() {\n  const streamParams: MessageSendParams = {\n    message: {\n      messageId: uuidv4(),\n      role: 'user',\n      parts: [{ kind: 'text', text: 'Stream me some updates!' }],\n      kind: 'message',\n    },\n  };\n\n  try {\n    const stream = client.sendMessageStream(streamParams);\n\n    for await (const event of stream) {\n      if (event.kind === 'task') {\n        console.log(`[${event.id}] Task created. Status: ${event.status.state}`);\n      } else if (event.kind === 'status-update') {\n        console.log(`[${event.taskId}] Status Updated: ${event.status.state}`);\n      } else if (event.kind === 'artifact-update') {\n        console.log(`[${event.taskId}] Artifact Received: ${event.artifact.artifactId}`);\n      }\n    }\n    console.log('--- Stream finished ---');\n  } catch (error) {\n    console.error('Error during streaming:', error);\n  }\n}\n\nawait streamTask();\n```\n\n## Handling Task Cancellation\n\nTo support user-initiated cancellations, you must implement the `cancelTask` method in your **`AgentExecutor`**. The executor is responsible for gracefully stopping the ongoing work and publishing a final `canceled` status event.\n\nA straightforward way to manage this is by maintaining an in-memory set of canceled task IDs. The `execute` method can then periodically check this set to see if it should terminate its process.\n\n### Server: Implementing a Cancellable Executor\n\nThis example demonstrates an agent that simulates a multi-step process. In each step of its work, it checks if a cancellation has been requested. If so, it stops the work and updates the task's state accordingly.\n\n```typescript\n// server.ts\nimport {\n  AgentExecutor,\n  RequestContext,\n  ExecutionEventBus,\n  TaskStatusUpdateEvent,\n} from '@a2a-js/sdk/server';\n// ... other imports ...\n\nclass CancellableExecutor implements AgentExecutor {\n  // Use a Set to track the IDs of tasks that have been requested to be canceled.\n  private cancelledTasks = new Set<string>();\n\n  /**\n   * When a cancellation is requested, add the taskId to our tracking set.\n   * The `execute` loop will handle the rest.\n   */\n  public async cancelTask(taskId: string, eventBus: ExecutionEventBus): Promise<void> {\n    console.log(`[Executor] Received cancellation request for task: ${taskId}`);\n    this.cancelledTasks.add(taskId);\n  }\n\n  public async execute(requestContext: RequestContext, eventBus: ExecutionEventBus): Promise<void> {\n    const { taskId, contextId } = requestContext;\n\n    // Start the task\n    eventBus.publish({\n      kind: 'status-update',\n      taskId,\n      contextId,\n      status: { state: 'working', timestamp: new Date().toISOString() },\n      final: false,\n    });\n\n    // Simulate a multi-step, long-running process\n    for (let i = 0; i < 5; i++) {\n      // **Cancellation Checkpoint**\n      // Before each step, check if the task has been canceled.\n      if (this.cancelledTasks.has(taskId)) {\n        console.log(`[Executor] Aborting task ${taskId} due to cancellation.`);\n\n        // Publish the final 'canceled' status.\n        const cancelledUpdate: TaskStatusUpdateEvent = {\n          kind: 'status-update',\n          taskId: taskId,\n          contextId: contextId,\n          status: { state: 'canceled', timestamp: new Date().toISOString() },\n          final: true,\n        };\n        eventBus.publish(cancelledUpdate);\n        eventBus.finished();\n\n        // Clean up and exit.\n        this.cancelledTasks.delete(taskId);\n        return;\n      }\n\n      // Simulate one step of work.\n      console.log(`[Executor] Working on step ${i + 1} for task ${taskId}...`);\n      await new Promise((resolve) => setTimeout(resolve, 1000));\n    }\n\n    console.log(`[Executor] Task ${taskId} finished all steps without cancellation.`);\n\n    // If not canceled, finish the work and publish the completed state.\n    const finalUpdate: TaskStatusUpdateEvent = {\n      kind: 'status-update',\n      taskId,\n      contextId,\n      status: { state: 'completed', timestamp: new Date().toISOString() },\n      final: true,\n    };\n    eventBus.publish(finalUpdate);\n    eventBus.finished();\n  }\n}\n```\n\n## A2A Push Notifications\n\nFor very long-running tasks (e.g., lasting minutes, hours, or even days) or when clients cannot or prefer not to maintain persistent connections (like mobile clients or serverless functions), A2A supports asynchronous updates via push notifications. This mechanism allows the A2A Server to actively notify a client-provided webhook when a significant task update occurs.\n\n### Server-Side Configuration\n\nTo enable push notifications, your agent card must declare support:\n\n```typescript\nconst movieAgentCard: AgentCard = {\n  // ... other properties\n  capabilities: {\n    streaming: true,\n    pushNotifications: true, // Enable push notifications\n    stateTransitionHistory: true,\n  },\n  // ... rest of agent card\n};\n```\n\nWhen creating the `DefaultRequestHandler`, you can optionally provide custom push notification components:\n\n```typescript\nimport {\n  DefaultRequestHandler,\n  InMemoryPushNotificationStore,\n  DefaultPushNotificationSender,\n} from '@a2a-js/sdk/server';\n\n// Optional: Custom push notification store and sender\nconst pushNotificationStore = new InMemoryPushNotificationStore();\nconst pushNotificationSender = new DefaultPushNotificationSender(pushNotificationStore, {\n  timeout: 5000, // 5 second timeout\n  tokenHeaderName: 'X-A2A-Notification-Token', // Custom header name\n});\n\nconst requestHandler = new DefaultRequestHandler(\n  movieAgentCard,\n  taskStore,\n  agentExecutor,\n  undefined, // eventBusManager (optional)\n  pushNotificationStore, // custom store\n  pushNotificationSender, // custom sender\n  undefined // extendedAgentCard (optional)\n);\n```\n\n### Client-Side Usage\n\nConfigure push notifications when sending messages:\n\n```typescript\n// Configure push notification for a message\nconst pushConfig: PushNotificationConfig = {\n  id: 'my-notification-config', // Optional, defaults to task ID\n  url: 'https://my-app.com/webhook/task-updates',\n  token: 'your-auth-token', // Optional authentication token\n};\n\nconst sendParams: MessageSendParams = {\n  message: {\n    messageId: uuidv4(),\n    role: 'user',\n    parts: [{ kind: 'text', text: 'Hello, agent!' }],\n    kind: 'message',\n  },\n  configuration: {\n    blocking: true,\n    acceptedOutputModes: ['text/plain'],\n    pushNotificationConfig: pushConfig, // Add push notification config\n  },\n};\n```\n\n### Webhook Endpoint Implementation\n\nYour webhook endpoint should expect POST requests with the task data:\n\n```typescript\n// Example Express.js webhook endpoint\napp.post('/webhook/task-updates', (req, res) => {\n  const task = req.body; // The complete task object\n\n  // Verify the token if provided\n  const token = req.headers['x-a2a-notification-token'];\n  if (token !== 'your-auth-token') {\n    return res.status(401).json({ error: 'Unauthorized' });\n  }\n\n  console.log(`Task ${task.id} status: ${task.status.state}`);\n\n  // Process the task update\n  // ...\n\n  res.status(200).json({ received: true });\n});\n```\n\n## License\n\nThis project is licensed under the terms of the [Apache 2.0 License](https://raw.githubusercontent.com/google-a2a/a2a-python/refs/heads/main/LICENSE).\n\n## Contributing\n\nSee [CONTRIBUTING.md](https://github.com/google-a2a/a2a-js/blob/main/CONTRIBUTING.md) for contribution guidelines.\n","_attachments":{},"homepage":"https://github.com/a2aproject/a2a-js#readme","bugs":{"url":"https://github.com/a2aproject/a2a-js/issues"},"license":"Apache-2.0"}