{"_id":"@a2anet/a2a-utils","_rev":"10-45933c8810e5d27d0cf044ee97fce6db","name":"@a2anet/a2a-utils","dist-tags":{"latest":"0.7.3"},"versions":{"0.1.0":{"name":"@a2anet/a2a-utils","version":"0.1.0","keywords":["a2a","agent-to-agent","utilities"],"author":{"name":"A2A Net","email":"hello@a2anet.com"},"license":"Apache-2.0","_id":"@a2anet/a2a-utils@0.1.0","maintainers":[{"name":"benclarkenpm","email":"ben@a2anet.com"}],"homepage":"https://github.com/a2anet/a2a-utils#readme","bugs":{"url":"https://github.com/a2anet/a2a-utils/issues"},"dist":{"shasum":"ef383be4241a29547f35f8915cd0fd660e45675d","tarball":"https://registry.npmjs.org/@a2anet/a2a-utils/-/a2a-utils-0.1.0.tgz","fileCount":2,"integrity":"sha512-nHMJl3m0Ktps15e4BdBi/P+tzg2cXOPPKa62U8PCeD78xfWoLswzBQ2mDX37lh8kLd342ANsCoGSr2w8eVvp3A==","signatures":[{"sig":"MEUCIGM2tfN0zuA1vkj7xSF8ix97TrJZjiVFVnC8Aq+RSml+AiEA1rPiNlfuco2KVNKG60XX44TbMJU9K+5b1BojatBYRmk=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":1325},"main":"./dist/index.js","type":"module","types":"./dist/index.d.ts","exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js"}},"gitHead":"7bfca518e2c0cd137cbb951bb684a2d09ea80172","scripts":{"test":"bun test","build":"tsc","check":"biome check .","check:fix":"biome check --write .","typecheck":"tsc --noEmit","test:coverage":"bun test --coverage"},"_npmUser":{"name":"benclarkenpm","email":"ben@a2anet.com"},"repository":{"url":"git+https://github.com/a2anet/a2a-utils.git","type":"git"},"_npmVersion":"10.9.4","description":"A collection of utilities for discovering, communicating, and authenticating with A2A Servers","directories":{},"_nodeVersion":"22.22.0","_hasShrinkwrap":false,"devDependencies":{"@types/bun":"latest","typescript":"^5.7.0","@biomejs/biome":"^1.9.0"},"trustedDependencies":["@biomejs/biome"],"_npmOperationalInternal":{"tmp":"tmp/a2a-utils_0.1.0_1773780142802_0.8336572953527392","host":"s3://npm-registry-packages-npm-production"}},"0.3.0":{"name":"@a2anet/a2a-utils","version":"0.3.0","keywords":["a2a","agent-to-agent","utilities"],"author":{"name":"A2A Net","email":"hello@a2anet.com"},"license":"Apache-2.0","_id":"@a2anet/a2a-utils@0.3.0","maintainers":[{"name":"benclarkenpm","email":"ben@a2anet.com"}],"homepage":"https://github.com/a2anet/a2a-utils#readme","bugs":{"url":"https://github.com/a2anet/a2a-utils/issues"},"dist":{"shasum":"2ad4ced68dd22c118030b0e00ddcbd984e8ab456","tarball":"https://registry.npmjs.org/@a2anet/a2a-utils/-/a2a-utils-0.3.0.tgz","fileCount":58,"integrity":"sha512-v91mXYQCaUtf7vY8TmnjxqMAod9zoCxo2z+vv5sAlmwFBcBHmlW0arbmYKE2TBCF6uE9DArzvH7XjhCI2LCyfA==","signatures":[{"sig":"MEUCIQC5jA45bNhYb0KEpJ+Ww7Rsw9/rD2Y0PfLryJA6/qug/wIgZyLbKOWlJtKd8xLTqsobeLIu25vhnTR0rfwA8wM66Ho=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":231189},"main":"./dist/index.js","type":"module","types":"./dist/index.d.ts","exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js"}},"gitHead":"6e35fc4f11bebe6310b084af6cb76b1a19fad562","scripts":{"test":"bun test","build":"tsc","check":"biome check .","check:fix":"biome check --write .","typecheck":"tsc --noEmit","test:coverage":"bun test --coverage"},"_npmUser":{"name":"benclarkenpm","email":"ben@a2anet.com"},"repository":{"url":"git+https://github.com/a2anet/a2a-utils.git","type":"git"},"_npmVersion":"10.9.4","description":"A collection of utilities for discovering, communicating, and authenticating with A2A Servers","directories":{},"_nodeVersion":"22.22.0","dependencies":{"uuid":"^11.1.0","@a2a-js/sdk":"^0.3.10"},"_hasShrinkwrap":false,"devDependencies":{"@types/bun":"latest","typescript":"^5.7.0","@types/uuid":"^10.0.0","@biomejs/biome":"^1.9.0"},"trustedDependencies":["@biomejs/biome"],"_npmOperationalInternal":{"tmp":"tmp/a2a-utils_0.3.0_1774470454199_0.7826283743179736","host":"s3://npm-registry-packages-npm-production"}},"0.4.0":{"name":"@a2anet/a2a-utils","version":"0.4.0","keywords":["a2a","agent-to-agent","utilities"],"author":{"name":"A2A Net","email":"hello@a2anet.com"},"license":"Apache-2.0","_id":"@a2anet/a2a-utils@0.4.0","maintainers":[{"name":"benclarkenpm","email":"ben@a2anet.com"}],"homepage":"https://github.com/a2anet/a2a-utils#readme","bugs":{"url":"https://github.com/a2anet/a2a-utils/issues"},"dist":{"shasum":"53296678b5635ca4ea3d7db06648186bad626a76","tarball":"https://registry.npmjs.org/@a2anet/a2a-utils/-/a2a-utils-0.4.0.tgz","fileCount":58,"integrity":"sha512-Y9nxJoe0bJKeLwb0GF4QRkiZ5qR8+RuKBJN/ytXeofSMM8QHQ/zTMKXEDz70emGsltJsPA0uOM5ShM7v8tY4HQ==","signatures":[{"sig":"MEUCIAh/amXvX5SZAjIoRZpeMgfjetvON+vbYzklS4dBdZOXAiEA8GAH2f9bYoOFnSCAfbyIaNzNlcFRBk0Oz+hNF/VF5KM=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/@a2anet%2fa2a-utils@0.4.0","provenance":{"predicateType":"https://slsa.dev/provenance/v1"}},"unpackedSize":230994},"main":"./dist/index.js","type":"module","types":"./dist/index.d.ts","exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js"}},"gitHead":"8874308d1d4b949462c616c7bf9cb907ec4dcdfe","scripts":{"test":"bun test","build":"tsc","check":"biome check .","check:fix":"biome check --write .","typecheck":"tsc --noEmit","test:coverage":"bun test --coverage"},"_npmUser":{"name":"GitHub Actions","email":"npm-oidc-no-reply@github.com","trustedPublisher":{"id":"github","oidcConfigId":"oidc:3edba12e-4fbc-49ce-b5b5-c8711a1c02b5"}},"repository":{"url":"git+https://github.com/a2anet/a2a-utils.git","type":"git"},"_npmVersion":"11.9.0","description":"A collection of utilities for discovering, communicating, and authenticating with A2A Servers","directories":{},"_nodeVersion":"24.14.0","dependencies":{"uuid":"^11.1.0","@a2a-js/sdk":"^0.3.10"},"_hasShrinkwrap":false,"devDependencies":{"@types/bun":"latest","typescript":"^5.7.0","@types/uuid":"^10.0.0","@biomejs/biome":"^1.9.0"},"trustedDependencies":["@biomejs/biome"],"_npmOperationalInternal":{"tmp":"tmp/a2a-utils_0.4.0_1774502033811_0.6725929348703401","host":"s3://npm-registry-packages-npm-production"}},"0.5.0":{"name":"@a2anet/a2a-utils","version":"0.5.0","keywords":["a2a","agent-to-agent","utilities"],"author":{"name":"A2A Net","email":"hello@a2anet.com"},"license":"Apache-2.0","_id":"@a2anet/a2a-utils@0.5.0","maintainers":[{"name":"benclarkenpm","email":"ben@a2anet.com"}],"homepage":"https://github.com/a2anet/a2a-utils#readme","bugs":{"url":"https://github.com/a2anet/a2a-utils/issues"},"dist":{"shasum":"08aa71952ec25747893bbac0645ed94991c82386","tarball":"https://registry.npmjs.org/@a2anet/a2a-utils/-/a2a-utils-0.5.0.tgz","fileCount":58,"integrity":"sha512-6Dud+ELQMmuH83aOuHv9TMhAQxtqbtmtg2AHiRVNUs4eJNXicbRCCeSnzI6lufMpRGKaIj7ZRIIvyMem3Wyvfg==","signatures":[{"sig":"MEUCIFOl/5VxtJgRPUCnunApBH++TTMgwY3hxWWnq59tyc9EAiEAn2B8AC7EturCZkKlB/cFCaWLdOdOQgC0JdJ7G5dKp/A=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/@a2anet%2fa2a-utils@0.5.0","provenance":{"predicateType":"https://slsa.dev/provenance/v1"}},"unpackedSize":250967},"main":"./dist/index.js","type":"module","types":"./dist/index.d.ts","exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js"}},"gitHead":"48c133cfe73c681b68933321e227faec58f4e542","scripts":{"test":"bun test","build":"tsc","check":"biome check .","check:fix":"biome check --write .","typecheck":"tsc --noEmit","test:coverage":"bun test --coverage"},"_npmUser":{"name":"GitHub Actions","email":"npm-oidc-no-reply@github.com","trustedPublisher":{"id":"github","oidcConfigId":"oidc:3edba12e-4fbc-49ce-b5b5-c8711a1c02b5"}},"repository":{"url":"git+https://github.com/a2anet/a2a-utils.git","type":"git"},"_npmVersion":"11.11.0","description":"A collection of utilities for discovering, communicating, and authenticating with A2A Servers","directories":{},"_nodeVersion":"24.14.1","dependencies":{"uuid":"^11.1.0","@a2a-js/sdk":"^0.3.10"},"_hasShrinkwrap":false,"devDependencies":{"@types/bun":"latest","typescript":"^5.7.0","@types/uuid":"^10.0.0","@biomejs/biome":"^1.9.0"},"trustedDependencies":["@biomejs/biome"],"_npmOperationalInternal":{"tmp":"tmp/a2a-utils_0.5.0_1775258724194_0.2646354091956955","host":"s3://npm-registry-packages-npm-production"}},"0.6.0":{"name":"@a2anet/a2a-utils","version":"0.6.0","keywords":["a2a","agent-to-agent","utilities"],"author":{"name":"A2A Net","email":"hello@a2anet.com"},"license":"Apache-2.0","_id":"@a2anet/a2a-utils@0.6.0","maintainers":[{"name":"benclarkenpm","email":"ben@a2anet.com"}],"homepage":"https://github.com/a2anet/a2a-utils#readme","bugs":{"url":"https://github.com/a2anet/a2a-utils/issues"},"dist":{"shasum":"5661593509e52347d53c3208d0b993316a4aeafb","tarball":"https://registry.npmjs.org/@a2anet/a2a-utils/-/a2a-utils-0.6.0.tgz","fileCount":58,"integrity":"sha512-FdefKUvgJzoApF2voXg9dXGGox0DKu4AFTkbd96gUnQCOay+gh6iqdT/AclNVXbMpSAhlFf2hZLQTuBh+iDS0Q==","signatures":[{"sig":"MEUCIQDzDLGoNQOqDMbjuxCbRQ9NCXtjvYL7IcU+DITlnQo0KwIgHSFzbEtFAmFZIMEaTFjoHlgQq87Zk5IsxcvNTu/0ayo=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/@a2anet%2fa2a-utils@0.6.0","provenance":{"predicateType":"https://slsa.dev/provenance/v1"}},"unpackedSize":265849},"main":"./dist/index.js","type":"module","types":"./dist/index.d.ts","exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js"}},"gitHead":"71108e3ff602a07007b08344014314beb3325560","scripts":{"test":"bun test","build":"tsc","check":"biome check .","check:fix":"biome check --write .","typecheck":"tsc --noEmit","test:coverage":"bun test --coverage"},"_npmUser":{"name":"GitHub Actions","email":"npm-oidc-no-reply@github.com","trustedPublisher":{"id":"github","oidcConfigId":"oidc:3edba12e-4fbc-49ce-b5b5-c8711a1c02b5"}},"repository":{"url":"git+https://github.com/a2anet/a2a-utils.git","type":"git"},"_npmVersion":"11.11.0","description":"A collection of utilities for discovering, communicating, and authenticating with A2A Servers","directories":{},"_nodeVersion":"24.14.1","dependencies":{"zod":"^3.25.0","uuid":"^11.1.0","@a2a-js/sdk":"^0.3.10"},"_hasShrinkwrap":false,"devDependencies":{"@types/bun":"latest","typescript":"^5.7.0","@types/uuid":"^10.0.0","@biomejs/biome":"^1.9.0"},"trustedDependencies":["@biomejs/biome"],"_npmOperationalInternal":{"tmp":"tmp/a2a-utils_0.6.0_1775263465402_0.818012042851656","host":"s3://npm-registry-packages-npm-production"}},"0.6.1":{"name":"@a2anet/a2a-utils","version":"0.6.1","keywords":["a2a","agent-to-agent","utilities"],"author":{"name":"A2A Net","email":"hello@a2anet.com"},"license":"Apache-2.0","_id":"@a2anet/a2a-utils@0.6.1","maintainers":[{"name":"benclarkenpm","email":"ben@a2anet.com"}],"homepage":"https://github.com/a2anet/a2a-utils#readme","bugs":{"url":"https://github.com/a2anet/a2a-utils/issues"},"dist":{"shasum":"989a6a440c6a41aac3c8e1fb843be2f7eda615b2","tarball":"https://registry.npmjs.org/@a2anet/a2a-utils/-/a2a-utils-0.6.1.tgz","fileCount":58,"integrity":"sha512-0WdcxZvjWNBxNKf8aNo0LFl0RpxwT4h8CzA4PkZPntdX1MsWpZEfaso2a+rME5uM0AKrwy+1Dtk+sK5SdY/9Bg==","signatures":[{"sig":"MEUCIQDGCMoTgwQ2vgPzx0ODsGLUvAO8yYqYtqPt+sVgA9OnogIgUQkW9auHftwJHv1x2drWN6hCboY58UNOiUY/+RnR3XU=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/@a2anet%2fa2a-utils@0.6.1","provenance":{"predicateType":"https://slsa.dev/provenance/v1"}},"unpackedSize":265897},"main":"./dist/index.js","type":"module","types":"./dist/index.d.ts","exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js"}},"gitHead":"25cbd5fd0dc7ccfac7bdb80bd8b334ace42aa35e","scripts":{"test":"bun test","build":"tsc","check":"biome check .","check:fix":"biome check --write .","typecheck":"tsc --noEmit","test:coverage":"bun test --coverage"},"_npmUser":{"name":"GitHub Actions","email":"npm-oidc-no-reply@github.com","trustedPublisher":{"id":"github","oidcConfigId":"oidc:3edba12e-4fbc-49ce-b5b5-c8711a1c02b5"}},"repository":{"url":"git+https://github.com/a2anet/a2a-utils.git","type":"git"},"_npmVersion":"11.11.0","description":"A collection of utilities for discovering, communicating, and authenticating with A2A Servers","directories":{},"_nodeVersion":"24.14.1","dependencies":{"zod":"^3.25.0","uuid":"^11.1.0","@a2a-js/sdk":"^0.3.10"},"_hasShrinkwrap":false,"devDependencies":{"@types/bun":"latest","typescript":"^5.7.0","@types/uuid":"^10.0.0","@biomejs/biome":"^1.9.0"},"trustedDependencies":["@biomejs/biome"],"_npmOperationalInternal":{"tmp":"tmp/a2a-utils_0.6.1_1775580268433_0.8182267481682202","host":"s3://npm-registry-packages-npm-production"}},"0.7.0":{"name":"@a2anet/a2a-utils","version":"0.7.0","keywords":["a2a","agent-to-agent","utilities"],"author":{"name":"A2A Net","email":"hello@a2anet.com"},"license":"Apache-2.0","_id":"@a2anet/a2a-utils@0.7.0","maintainers":[{"name":"benclarkenpm","email":"ben@a2anet.com"}],"homepage":"https://github.com/a2anet/a2a-utils#readme","bugs":{"url":"https://github.com/a2anet/a2a-utils/issues"},"dist":{"shasum":"ca2ba6b610719064b27a204cc5ad48f9de666826","tarball":"https://registry.npmjs.org/@a2anet/a2a-utils/-/a2a-utils-0.7.0.tgz","fileCount":58,"integrity":"sha512-3W4bkJ5u6V8o3tnxbnWTndTnOxZ8bDtIgnZ+ZABQdpwpdKo/YV+DC/orRAB3+8by3pw5YDVODLHpPCj3d8GPCA==","signatures":[{"sig":"MEQCIHux7ln/G7VNS53h7v2s4fCYq3EXEmDvVZiCTOgn5zJGAiALHyajbudn7kMgSZRSV4bAwDcs/8t6bcvZC4ewPwCExQ==","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/@a2anet%2fa2a-utils@0.7.0","provenance":{"predicateType":"https://slsa.dev/provenance/v1"}},"unpackedSize":265944},"main":"./dist/index.js","type":"module","types":"./dist/index.d.ts","exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js"}},"gitHead":"dd3746734a0640e612eece834018ec3802bc75c4","scripts":{"test":"bun test","build":"tsc","check":"biome check .","check:fix":"biome check --write .","typecheck":"tsc --noEmit","test:coverage":"bun test --coverage"},"_npmUser":{"name":"GitHub Actions","email":"npm-oidc-no-reply@github.com","trustedPublisher":{"id":"github","oidcConfigId":"oidc:3edba12e-4fbc-49ce-b5b5-c8711a1c02b5"}},"repository":{"url":"git+https://github.com/a2anet/a2a-utils.git","type":"git"},"_npmVersion":"11.11.0","description":"A collection of utilities for discovering, communicating, and authenticating with A2A Servers","directories":{},"_nodeVersion":"24.14.1","dependencies":{"zod":"^3.25.0","uuid":"^11.1.0","@a2a-js/sdk":"^0.3.10"},"_hasShrinkwrap":false,"devDependencies":{"langchain":"^1.3.1","@types/bun":"latest","typescript":"^5.7.0","@types/uuid":"^10.0.0","@biomejs/biome":"^1.9.0","@langchain/openai":"^1.4.3"},"trustedDependencies":["@biomejs/biome"],"_npmOperationalInternal":{"tmp":"tmp/a2a-utils_0.7.0_1775594942032_0.7978085555271692","host":"s3://npm-registry-packages-npm-production"}},"0.7.1":{"name":"@a2anet/a2a-utils","version":"0.7.1","keywords":["a2a","agent-to-agent","utilities"],"author":{"name":"A2A Net","email":"hello@a2anet.com"},"license":"Apache-2.0","_id":"@a2anet/a2a-utils@0.7.1","maintainers":[{"name":"benclarkenpm","email":"ben@a2anet.com"}],"homepage":"https://github.com/a2anet/a2a-utils#readme","bugs":{"url":"https://github.com/a2anet/a2a-utils/issues"},"dist":{"shasum":"b03fcf5ea1f7c3dfed4ca0531b4a343cd3f9796c","tarball":"https://registry.npmjs.org/@a2anet/a2a-utils/-/a2a-utils-0.7.1.tgz","fileCount":66,"integrity":"sha512-fvGyvv4dVzQx1RCMJ/vTtN2adDfLiC5WU1H/JyiqcrC+PyA/6o6+4/7+G++TveNn4zUIduh2mu27ehixiT34BQ==","signatures":[{"sig":"MEUCIFyruBDQ6aOLTdYnXwAtn5fHNnhBfYX/9BAUznfvkhk2AiEA1jv5AqxmtuJDV8+KfdNkEiJ7tDb5++n+79B26Bo/r8A=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/@a2anet%2fa2a-utils@0.7.1","provenance":{"predicateType":"https://slsa.dev/provenance/v1"}},"unpackedSize":304621},"main":"./dist/index.js","type":"module","types":"./dist/index.d.ts","exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js"}},"gitHead":"af51011c1ef9bb353a1206b87db273b2c923ff59","scripts":{"test":"bun test","build":"tsc","check":"biome check .","check:fix":"biome check --write .","typecheck":"tsc --noEmit","test:coverage":"bun test --coverage"},"_npmUser":{"name":"GitHub Actions","email":"npm-oidc-no-reply@github.com","trustedPublisher":{"id":"github","oidcConfigId":"oidc:3edba12e-4fbc-49ce-b5b5-c8711a1c02b5"}},"repository":{"url":"git+https://github.com/a2anet/a2a-utils.git","type":"git"},"_npmVersion":"11.11.0","description":"A collection of utilities for discovering, communicating, and authenticating with A2A Servers","directories":{},"_nodeVersion":"24.14.1","dependencies":{"zod":"^3.25.0","uuid":"^11.1.0","@a2a-js/sdk":"^0.3.10"},"_hasShrinkwrap":false,"devDependencies":{"langchain":"^1.3.1","@types/bun":"latest","typescript":"^5.7.0","@types/uuid":"^10.0.0","@biomejs/biome":"^1.9.0","@langchain/openai":"^1.4.3"},"trustedDependencies":["@biomejs/biome"],"_npmOperationalInternal":{"tmp":"tmp/a2a-utils_0.7.1_1775757715312_0.8971437478289399","host":"s3://npm-registry-packages-npm-production"}},"0.7.2":{"name":"@a2anet/a2a-utils","version":"0.7.2","keywords":["a2a","agent-to-agent","utilities"],"author":{"name":"A2A Net","email":"hello@a2anet.com"},"license":"Apache-2.0","_id":"@a2anet/a2a-utils@0.7.2","maintainers":[{"name":"benclarkenpm","email":"ben@a2anet.com"}],"homepage":"https://github.com/a2anet/a2a-utils#readme","bugs":{"url":"https://github.com/a2anet/a2a-utils/issues"},"dist":{"shasum":"64e1399f312cfe7306e651175d8add4526a3cf97","tarball":"https://registry.npmjs.org/@a2anet/a2a-utils/-/a2a-utils-0.7.2.tgz","fileCount":66,"integrity":"sha512-1WNUg4DMHq32mFttC3NorMXXY7VTbtMeFP+4qzWpz3uigUxkSMQ5Omthlnoe6EjzA/hnLF8Z+NnO75ZeyI/z6g==","signatures":[{"sig":"MEUCIQCRtTFB3bxUtSJ1ROw+B+3FMbPCbv407X1zIhuPKNp8pQIgZ5qUG4V9Ggu0QyZINTLuDrLAWLRYs+/svqc/nN2igh4=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/@a2anet%2fa2a-utils@0.7.2","provenance":{"predicateType":"https://slsa.dev/provenance/v1"}},"unpackedSize":305480},"main":"./dist/index.js","type":"module","types":"./dist/index.d.ts","exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js"}},"gitHead":"d976a2ca26e27691bec395da6cf4d2e57026f369","scripts":{"test":"bun test","build":"tsc","check":"biome check .","check:fix":"biome check --write .","typecheck":"tsc --noEmit","test:coverage":"bun test --coverage"},"_npmUser":{"name":"GitHub Actions","email":"npm-oidc-no-reply@github.com","trustedPublisher":{"id":"github","oidcConfigId":"oidc:3edba12e-4fbc-49ce-b5b5-c8711a1c02b5"}},"repository":{"url":"git+https://github.com/a2anet/a2a-utils.git","type":"git"},"_npmVersion":"11.11.0","description":"A collection of utilities for discovering, communicating, and authenticating with A2A Servers","directories":{},"_nodeVersion":"24.14.1","dependencies":{"zod":"^3.25.0","uuid":"^11.1.0","@a2a-js/sdk":"^0.3.10"},"_hasShrinkwrap":false,"devDependencies":{"langchain":"^1.3.1","@types/bun":"latest","typescript":"^5.7.0","@types/uuid":"^10.0.0","@biomejs/biome":"^1.9.0","@langchain/openai":"^1.4.3"},"trustedDependencies":["@biomejs/biome"],"_npmOperationalInternal":{"tmp":"tmp/a2a-utils_0.7.2_1776238295981_0.05569102885399113","host":"s3://npm-registry-packages-npm-production"}},"0.7.3":{"name":"@a2anet/a2a-utils","version":"0.7.3","description":"A collection of utilities for discovering, communicating, and authenticating with A2A Servers","type":"module","exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js"}},"main":"./dist/index.js","types":"./dist/index.d.ts","scripts":{"build":"tsc","check":"biome check .","check:fix":"biome check --write .","typecheck":"tsc --noEmit","test":"bun test","test:coverage":"bun test --coverage"},"keywords":["a2a","agent-to-agent","utilities"],"author":{"name":"A2A Net","email":"hello@a2anet.com"},"license":"Apache-2.0","repository":{"type":"git","url":"git+https://github.com/a2anet/a2a-utils.git"},"bugs":{"url":"https://github.com/a2anet/a2a-utils/issues"},"homepage":"https://github.com/a2anet/a2a-utils#readme","dependencies":{"@a2a-js/sdk":">=0.3.10 <1.0.0","uuid":"^11.1.0","zod":"^3.25.0"},"devDependencies":{"@biomejs/biome":"^1.9.0","@langchain/openai":"^1.4.3","@types/bun":"latest","@types/uuid":"^10.0.0","langchain":"^1.3.1","typescript":"^5.7.0"},"trustedDependencies":["@biomejs/biome"],"gitHead":"8a22e185e584479de0642f94bda02af0349345f9","_id":"@a2anet/a2a-utils@0.7.3","_nodeVersion":"24.15.0","_npmVersion":"11.12.1","dist":{"integrity":"sha512-ZUvmr2/cI4weiqjsDfds53kSjBTzWDk8OyZL48FKZKPxx9CBz9ldZWF9h5jJO3uAFSOmwTU9bYemW6u9k/HHYg==","shasum":"c2f7a38432a2887134f4de3bcfb516d3f71930ff","tarball":"https://registry.npmjs.org/@a2anet/a2a-utils/-/a2a-utils-0.7.3.tgz","fileCount":66,"unpackedSize":305488,"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/@a2anet%2fa2a-utils@0.7.3","provenance":{"predicateType":"https://slsa.dev/provenance/v1"}},"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEUCIQClY7pyVMXidoqzk2swdohGPiDg0CeS3wNXcmsMXE5h4QIgA8okZ056lSsvZINyUdbsujvjJsgDUEjla/4xIV/mxl4="}]},"_npmUser":{"name":"GitHub Actions","email":"npm-oidc-no-reply@github.com","trustedPublisher":{"id":"github","oidcConfigId":"oidc:3edba12e-4fbc-49ce-b5b5-c8711a1c02b5"}},"directories":{},"maintainers":[{"name":"benclarkenpm","email":"ben@a2anet.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/a2a-utils_0.7.3_1779730914292_0.16546046502392042"},"_hasShrinkwrap":false}},"time":{"created":"2026-03-17T20:42:22.693Z","modified":"2026-05-25T17:41:54.760Z","0.1.0":"2026-03-17T20:42:22.959Z","0.3.0":"2026-03-25T20:27:34.370Z","0.4.0":"2026-03-26T05:13:53.964Z","0.5.0":"2026-04-03T23:25:24.344Z","0.6.0":"2026-04-04T00:44:25.552Z","0.6.1":"2026-04-07T16:44:28.595Z","0.7.0":"2026-04-07T20:49:02.184Z","0.7.1":"2026-04-09T18:01:55.490Z","0.7.2":"2026-04-15T07:31:36.106Z","0.7.3":"2026-05-25T17:41:54.431Z"},"bugs":{"url":"https://github.com/a2anet/a2a-utils/issues"},"author":{"name":"A2A Net","email":"hello@a2anet.com"},"license":"Apache-2.0","homepage":"https://github.com/a2anet/a2a-utils#readme","keywords":["a2a","agent-to-agent","utilities"],"repository":{"type":"git","url":"git+https://github.com/a2anet/a2a-utils.git"},"description":"A collection of utilities for discovering, communicating, and authenticating with A2A Servers","maintainers":[{"name":"benclarkenpm","email":"ben@a2anet.com"}],"readme":"# A2A Utils JavaScript\n\n[![npm version](https://img.shields.io/npm/v/@a2anet/a2a-utils.svg)](https://www.npmjs.com/package/@a2anet/a2a-utils) [![License](https://img.shields.io/github/license/a2anet/a2a-utils)](https://github.com/a2anet/a2a-utils/blob/main/LICENSE) [![A2A Protocol](https://img.shields.io/badge/A2A-Protocol-blue)](https://a2a-protocol.org) [![Discord](https://img.shields.io/discord/1391916121589944320?color=7289da&label=Discord&logo=discord&logoColor=white)](https://discord.gg/674NGXpAjU)\n\nThis package is a comprehensive set of utility functions for using [A2A servers (remote agents)](https://a2a-protocol.org/latest/topics/key-concepts/#core-actors-in-a2a-interactions), it powers the [A2A MCP Server](https://github.com/a2anet/a2a-mcp).\n\n`A2ASession` is at the core of the package, it takes an `A2AAgents` (for connecting to agents, viewing Agent Cards, etc.), and optionally a `TaskStore` (for saving Tasks) and `FileStore` (for saving files).\nIt has two methods, `sendMessage` and `getTask`.\n\nThese methods are more sophisticated versions of the same methods in the [A2A SDKs](https://github.com/orgs/a2aproject/repositories).\nFor example, `sendMessage` abstracts retrieving Agent Cards, sending headers, etc., allowing you to send a message with an agent's ID, e.g. `sendMessage(\"research-bot\", \"Find recent papers on quantum computing\")`.\nIt also sends the message as non-blocking and streams the response until the Task reaches a terminal state or times out.\nIf `sendMessage` times out, `getTask` can be called with the Task ID to start streaming the response again.\nIf `TaskStore` and `FileStore` are set, the Task, Artifacts, and files will automatically be saved.\n\n`A2AAgents` stores user-defined agent IDs that link to Agent Card URLs and headers.\nAgents are stored this way so that Agent Card URLs and headers are not exposed to the agent and because Agent Cards can be dynamic (i.e. change depending on the headers).\nIt has five methods, `getAgents`, `getAgentsForLlm`, `getAgent`, `getAgentForLlm`, and `addAgent`.\nSee the API reference below for more information.\n\nLastly, `A2ATools` is the most sophisticated class in the package, it takes an `A2ASession` and provides six LLM-friendly tools that can be used out-of-the-box with agent frameworks: `getAgents`, `getAgent`, `sendMessage`, `getTask`, `viewTextArtifact`, and `viewDataArtifact`.\nThe tools are based on [Writing effective tools for AI agents](https://www.anthropic.com/engineering/writing-tools-for-agents): they have LLM-friendly docstrings, return JSON-serialisable objects, and return actionable error messages.\n\nTool outputs are also optimised for LLMs.\nFor example, `getAgents` returns a list of agent names and descriptions, whereas `getAgent` also returns an agent's skill names and descriptions.\n`sendMessage` and `getTask` return LLM-friendly types that are subsets of A2A types (e.g. `TaskForLLM`, `MessageForLLM`, and `ArtifactForLLM`) and automatically minimise large Artifacts, which can be viewed with `viewTextArtifact` and `viewDataArtifact`.\n\n## ✨ Features\n\n- **6 LLM-friendly tools** — `getAgents`, `getAgent`, `sendMessage`, `getTask`, `viewTextArtifact`, and `viewDataArtifact`, designed with clear docstrings, JSON-serialisable outputs, and actionable error messages\n- **Simple message sending** — send messages with just an agent ID and message string; Agent Card fetching, headers, and non-blocking streaming are handled automatically\n- **Multi-turn conversations** — continue conversations across multiple messages using `contextId`\n- **Long-running task support** — if `sendMessage` times out, use `getTask` to resume streaming until the task reaches a terminal state\n- **Automatic artifact minimization** — large text and data artifacts are automatically minimized for LLM context windows, with `viewTextArtifact` and `viewDataArtifact` for detailed navigation\n- **Task persistence** — save and load tasks as JSON files with `JSONTaskStore`\n- **File artifact storage** — save file artifacts to the local filesystem with `LocalFileStore`, or implement `FileStore` for custom backends (S3, GCS, etc.)\n- **Agent Card management** — `A2AAgents` stores agent IDs, URLs, and custom headers, with multiple detail levels for LLM summaries (`name`, `basic`, `skills`, `full`)\n- **Runtime agent registration** — add new agents at runtime with `addAgent`\n- **Configurable timeouts and polling** — customisable timeouts for sending messages, monitoring tasks, and polling intervals\n\n## 📦 Installation\n\nTo install with npm:\n\n```bash\nnpm install @a2anet/a2a-utils\n```\n\nTo install with bun:\n\n```bash\nbun add @a2anet/a2a-utils\n```\n\n## 🚀 Quick Start\n\nCreate an `A2ASession`, then `A2ATools` to get LLM-friendly tools that can be used out-of-the-box with agent frameworks.\n\n```typescript\nimport { A2ATools, A2ASession, A2AAgents, JSONTaskStore, LocalFileStore } from \"@a2anet/a2a-utils\";\nimport { createAgent, tool } from \"langchain\";\nimport { ChatOpenAI } from \"@langchain/openai\";\n\nconst a2aAgents = new A2AAgents({\n    weather: { url: \"https://weather.example.com/.well-known/agent-card.json\" },\n    \"research-bot\": {\n        url: \"https://research.example.com/.well-known/agent-card.json\",\n        custom_headers: { \"X-API-Key\": \"key_123\" },\n    },\n});\n\nconst a2aSession = new A2ASession(a2aAgents, {\n    taskStore: new JSONTaskStore(\"./storage/tasks\"),\n    fileStore: new LocalFileStore(\"./storage/files\"),\n});\n\nconst a2aTools = new A2ATools(a2aSession);\n\nconst langchainTools = a2aTools.tools.map((def) =>\n    tool(def.execute, { name: def.name, description: def.description, schema: def.schema }),\n);\n\nconst model = new ChatOpenAI({ model: \"gpt-5.1\", reasoning: { effort: \"medium\" } });\n\nconst agent = createAgent({ model, tools: langchainTools });\n```\n\n## 📖 API Reference\n\n### A2ATools\n\nReady-made tools for agents to communicate with A2A servers. Each tool is an instance property with `name`, `description`, `schema` (Zod), and `execute`. Use the `tools` getter for the full array.\n\n```typescript\nimport { A2ATools, A2ASession, A2AAgents } from \"@a2anet/a2a-utils\";\n\nconst tools = new A2ATools(session);\n```\n\n| Parameter          | Type                       | Required | Description                                                    |\n| ------------------ | -------------------------- | -------- | -------------------------------------------------------------- |\n| `session`          | `A2ASession`               | Yes      | The session instance for sending messages and managing agents  |\n| `artifactSettings` | `ArtifactSettings \\| null` | No       | Minimization/view settings (default: `new ArtifactSettings()`) |\n\n`artifactSettings` determines how Artifacts are minimized and viewed:\n\n```typescript\nimport { ArtifactSettings } from \"@a2anet/a2a-utils\";\n\nconst settings = new ArtifactSettings({\n    sendMessageCharacterLimit: 100_000,\n    minimizedObjectStringLength: 10_000,\n    viewArtifactCharacterLimit: 100_000,\n});\nconst tools = new A2ATools(session, { artifactSettings: settings });\n```\n\n| Field                         | Type     | Default  | Description                                                             |\n| ----------------------------- | -------- | -------- | ----------------------------------------------------------------------- |\n| `sendMessageCharacterLimit`   | `number` | `50,000` | Character limit above which artifacts are minimized in `sendMessage`    |\n| `minimizedObjectStringLength` | `number` | `5,000`  | Max length for individual string values within minimized data objects   |\n| `viewArtifactCharacterLimit`  | `number` | `50,000` | Character limit for output from `viewTextArtifact` / `viewDataArtifact` |\n\n#### `getAgents`\n\nList all available agents with their names and descriptions.\n\n```typescript\nconst result = await tools.getAgents.execute({});\n```\n\nExample result:\n\n```json\n{\n    \"research-bot\": {\n        \"name\": \"Research Bot\",\n        \"description\": \"Find and summarize research papers\"\n    },\n    \"weather\": {\n        \"name\": \"Weather Agent\",\n        \"description\": \"Get weather forecasts for any location\"\n    }\n}\n```\n\n#### `getAgent`\n\nGet detailed information about a specific agent, including its skills.\n\n```typescript\nconst result = await tools.getAgent.execute({ agentId: \"research-bot\" });\n```\n\nExample result:\n\n```json\n{\n    \"name\": \"Research Bot\",\n    \"description\": \"Find and summarize research papers\",\n    \"skills\": [\n        {\n            \"name\": \"Search Papers\",\n            \"description\": \"Search for papers by topic, author, or keyword\"\n        },\n        {\n            \"name\": \"Summarize Paper\",\n            \"description\": \"Generate a summary of a specific paper\"\n        }\n    ]\n}\n```\n\n#### `sendMessage`\n\nSend a message to an agent and receive a structured response. The response includes the agent's reply and any generated Artifacts. Artifacts are automatically minimized to fit the context window.\n\n| Parameter   | Type        | Required | Description                                                   |\n| ----------- | ----------- | -------- | ------------------------------------------------------------- |\n| `agentId`   | `string`    | Yes      | ID of the agent to message (from get_agents)                  |\n| `message`   | `string`    | Yes      | The message content to send                                   |\n| `contextId` | `string`    | No       | Continue an existing conversation by providing its context ID |\n| `taskId`    | `string`    | No       | Attach to an existing task (for input_required flows)         |\n| `timeout`   | `number`    | No       | Override the default timeout in seconds                       |\n| `data`      | `unknown[]` | No       | Structured data to include with the message                   |\n| `files`     | `string[]`  | No       | Files to include (local paths or URLs)                        |\n\n```typescript\nconst result = await tools.sendMessage.execute({\n    agentId: \"research-bot\",\n    message: \"Find recent papers on quantum computing\",\n});\n```\n\nExample result:\n\n```json\n{\n    \"id\": \"task-123\",\n    \"contextId\": \"ctx-456\",\n    \"kind\": \"task\",\n    \"status\": {\n        \"state\": \"completed\",\n        \"message\": \"I found three recent papers on quantum computing and retrieved the abstract for the most recent one.\"\n    },\n    \"artifacts\": [\n        {\n            \"artifactId\": \"art-789\",\n            \"description\": \"Search results for quantum computing papers\",\n            \"name\": \"Search Results\",\n            \"parts\": [\n                {\n                    \"kind\": \"data\",\n                    \"data\": [\n                        {\n                            \"title\": \"Quantum Error Correction Advances\",\n                            \"year\": 2025,\n                            \"authors\": \"Chen et al.\"\n                        },\n                        {\n                            \"title\": \"Topological Quantum Computing Survey\",\n                            \"year\": 2024,\n                            \"authors\": \"Nakamura et al.\"\n                        },\n                        {\n                            \"title\": \"Fault-Tolerant Logical Qubits\",\n                            \"year\": 2024,\n                            \"authors\": \"Wang et al.\"\n                        }\n                    ]\n                }\n            ]\n        },\n        {\n            \"artifactId\": \"art-790\",\n            \"description\": \"Abstract of 'Quantum Error Correction Advances' by Chen et al.\",\n            \"name\": \"Abstract\",\n            \"parts\": [\n                {\n                    \"kind\": \"text\",\n                    \"text\": \"Quantum computing has seen rapid advances in error correction.\\nRecent work demonstrates fault-tolerant logical qubits at scale.\\nThis paper surveys progress in quantum error correction from 2023-2025.\\nWe review surface codes, color codes, and novel hybrid approaches.\\nKey results include a 10x reduction in logical error rates.\\nThese improvements bring practical quantum computing closer to reality.\\nWe also discuss remaining challenges in qubit connectivity.\\nFinally, we outline a roadmap for achieving fault-tolerant quantum computation.\"\n                }\n            ]\n        }\n    ]\n}\n```\n\nContinue the conversation using `contextId`:\n\n```typescript\nconst result2 = await tools.sendMessage.execute({\n    agentId: \"research-bot\",\n    message: \"Summarize the most recent result\",\n    contextId: \"ctx-456\",\n});\n```\n\n#### `getTask`\n\nCheck the progress of a task that is still in progress. Use this after `sendMessage` returns a task in a non-terminal state (e.g. `\"working\"`).\n\n| Parameter      | Type     | Required | Description                                            |\n| -------------- | -------- | -------- | ------------------------------------------------------ |\n| `agentId`      | `string` | Yes      | ID of the agent that owns the task                     |\n| `taskId`       | `string` | Yes      | Task ID from a previous send_message response          |\n| `timeout`      | `number` | No       | Override the monitoring timeout in seconds             |\n| `pollInterval` | `number` | No       | Override the interval between status checks in seconds |\n\n```typescript\nconst result = await tools.getTask.execute({\n    agentId: \"research-bot\",\n    taskId: \"task-123\",\n});\n```\n\n#### `viewTextArtifact`\n\nView text content from an artifact, optionally selecting a range. Use this for artifacts containing text (documents, logs, code, etc.).\n\n| Parameter        | Type     | Required | Description                                   |\n| ---------------- | -------- | -------- | --------------------------------------------- |\n| `agentId`        | `string` | Yes      | ID of the agent that produced the artifact    |\n| `taskId`         | `string` | Yes      | Task ID containing the artifact               |\n| `artifactId`     | `string` | Yes      | The artifact's unique identifier              |\n| `lineStart`      | `number` | No       | Starting line number (1-based, inclusive)     |\n| `lineEnd`        | `number` | No       | Ending line number (1-based, inclusive)       |\n| `characterStart` | `number` | No       | Starting character index (0-based, inclusive) |\n| `characterEnd`   | `number` | No       | Ending character index (0-based, exclusive)   |\n\n```typescript\nconst result = await tools.viewTextArtifact.execute({\n    agentId: \"research-bot\",\n    taskId: \"task-123\",\n    artifactId: \"art-790\",\n    lineStart: 1,\n    lineEnd: 3,\n});\n```\n\nExample result:\n\n```json\n{\n    \"artifactId\": \"art-790\",\n    \"description\": \"Abstract of 'Quantum Error Correction Advances' by Chen et al.\",\n    \"name\": \"Abstract\",\n    \"parts\": [\n        {\n            \"kind\": \"text\",\n            \"text\": \"Quantum computing has seen rapid advances in error correction.\\nRecent work demonstrates fault-tolerant logical qubits at scale.\\nThis paper surveys progress in quantum error correction from 2023-2025.\"\n        }\n    ]\n}\n```\n\n#### `viewDataArtifact`\n\nView structured data from an artifact with optional filtering. Use this for artifacts containing JSON data (objects, arrays, tables).\n\n| Parameter    | Type     | Required | Description                                                           |\n| ------------ | -------- | -------- | --------------------------------------------------------------------- |\n| `agentId`    | `string` | Yes      | ID of the agent that produced the artifact                            |\n| `taskId`     | `string` | Yes      | Task ID containing the artifact                                       |\n| `artifactId` | `string` | Yes      | The artifact's unique identifier                                      |\n| `jsonPath`   | `string` | No       | Dot-separated path to navigate into the data (e.g. `\"results.items\"`) |\n| `rows`       | `string` | No       | Row selection: `\"0\"`, `\"0-10\"`, `\"0,2,5\"`, `\"all\"`                    |\n| `columns`    | `string` | No       | Column selection: `\"name\"`, `\"name,age\"`, `\"all\"`                     |\n\n```typescript\nconst result = await tools.viewDataArtifact.execute({\n    agentId: \"research-bot\",\n    taskId: \"task-123\",\n    artifactId: \"art-789\",\n    rows: \"0-1\",\n    columns: \"title,year\",\n});\n```\n\nExample result:\n\n```json\n{\n    \"artifactId\": \"art-789\",\n    \"description\": \"Search results for quantum computing papers\",\n    \"name\": \"Search Results\",\n    \"parts\": [\n        {\n            \"kind\": \"data\",\n            \"data\": [\n                { \"title\": \"Quantum Error Correction Advances\", \"year\": 2025 },\n                { \"title\": \"Topological Quantum Computing Survey\", \"year\": 2024 }\n            ]\n        }\n    ]\n}\n```\n\n### A2ASession\n\nProgrammatic interface for sending messages to A2A agents. Returns full A2A SDK types (`Task`, `Message`) for direct use.\n\n```typescript\nimport { A2ASession, A2AAgents, JSONTaskStore, LocalFileStore } from \"@a2anet/a2a-utils\";\n\nconst a2aAgents = new A2AAgents({\n    \"research-bot\": { url: \"https://research-bot.example.com/.well-known/agent-card.json\" },\n});\n\nconst session = new A2ASession(a2aAgents, {\n    taskStore: new JSONTaskStore(\"./storage/tasks\"),\n    fileStore: new LocalFileStore(\"./storage/files\"),\n});\n```\n\n| Parameter             | Type                     | Required | Description                                                         |\n| --------------------- | ------------------------ | -------- | ------------------------------------------------------------------- |\n| `agents`              | `A2AAgents`              | Yes      | The agent manager instance                                          |\n| `taskStore`           | `TaskStore \\| undefined` | No       | Task store for persistence (default: `InMemoryTaskStore`)           |\n| `fileStore`           | `FileStore \\| null`      | No       | File store for saving file artifacts (default: `null`)              |\n| `sendMessageTimeout`  | `number`                 | No       | HTTP timeout in seconds for `sendMessage` (default: `60.0`)         |\n| `getTaskTimeout`      | `number`                 | No       | Total monitoring timeout in seconds for `getTask` (default: `60.0`) |\n| `getTaskPollInterval` | `number`                 | No       | Interval in seconds between `getTask` polls (default: `5.0`)        |\n\n#### `async sendMessage(agentId: string, message: string, opts?): Promise<Task | Message>`\n\nSend a message to an A2A agent. The returned task is automatically saved to the task store. File artifacts are saved via the file store.\n\n| Parameter        | Type             | Required | Description                                                      |\n| ---------------- | ---------------- | -------- | ---------------------------------------------------------------- |\n| `agentId`        | `string`         | Yes      | Registered agent identifier                                      |\n| `message`        | `string`         | Yes      | The message content to send                                      |\n| `opts.contextId` | `string \\| null` | No       | Context ID to continue a conversation (auto-generated when null) |\n| `opts.taskId`    | `string \\| null` | No       | Task ID to attach to the message                                 |\n| `opts.timeout`   | `number \\| null` | No       | Override HTTP timeout in seconds (default: `sendMessageTimeout`) |\n\n```typescript\nimport type { Task, Message } from \"@a2a-js/sdk\";\n\nconst response = await session.sendMessage(\n    \"research-bot\",\n    \"Find recent papers on quantum computing\",\n);\n```\n\nContinue the conversation using `contextId`:\n\n```typescript\nconst response2 = await session.sendMessage(\"research-bot\", \"Summarize the most recent result\", {\n    contextId: response.contextId,\n});\n```\n\n**Returns:** `Task | Message` (from `@a2a-js/sdk`)\n\n#### `async getTask(agentId: string, taskId: string, opts?): Promise<Task>`\n\nGet the current state of a task. Monitors until a terminal state (`completed`, `canceled`, `failed`, `rejected`) or actionable state (`input-required`, `auth-required`) is reached, or until timeout. Uses SSE resubscription if the agent supports streaming, otherwise polls at regular intervals.\n\nOn monitoring timeout, returns the current task state (which may still be non-terminal, e.g. `working`). The only errors from `getTask` are failed HTTP requests (agent down, network error).\n\n| Parameter           | Type             | Required | Description                                                                 |\n| ------------------- | ---------------- | -------- | --------------------------------------------------------------------------- |\n| `agentId`           | `string`         | Yes      | Registered agent identifier                                                 |\n| `taskId`            | `string`         | Yes      | Task ID from a previous `sendMessage` call                                  |\n| `opts.timeout`      | `number \\| null` | No       | Override monitoring timeout in seconds (default: `getTaskTimeout`)          |\n| `opts.pollInterval` | `number \\| null` | No       | Override interval between polls in seconds (default: `getTaskPollInterval`) |\n\n```typescript\nconst task = await session.getTask(\"research-bot\", \"task-123\");\n```\n\n**Returns:** `Task` (from `@a2a-js/sdk`)\n\n### A2AAgents\n\nManages A2A agent cards keyed by user-defined agent IDs.\n\n```typescript\nimport { A2AAgents } from \"@a2anet/a2a-utils\";\n\n// From object\nconst a2aAgents = new A2AAgents({\n    \"language-translator\": {\n        url: \"https://example.com/language-translator/agent-card.json\",\n        custom_headers: { Authorization: \"Bearer tok_123\" },\n    },\n});\n\n// From JSON file\nconst a2aAgentsFromFile = new A2AAgents(\"./agents.json\");\n\n// Empty — add agents later\nconst emptyA2aAgents = new A2AAgents();\n```\n\n#### `async getAgents(): Promise<Record<string, AgentURLAndCustomHeaders>>`\n\nGet all registered agents.\nNote: this should NOT be added to the LLM's context, use `getAgentsForLlm` instead.\n\n**Returns:** `Record<string, AgentURLAndCustomHeaders>`\n\n```typescript\nconst a2aAgentConfigs = await a2aAgents.getAgents();\n```\n\n#### `async getAgentsForLlm(detail?: string): Promise<Record<string, Record<string, unknown>>>`\n\nGenerate summary of all agents, sorted by agent_id.\n\n| Parameter | Type     | Required | Description                                                          |\n| --------- | -------- | -------- | -------------------------------------------------------------------- |\n| `detail`  | `string` | No       | Detail level: `\"name\"`, `\"basic\"` (default), `\"skills\"`, or `\"full\"` |\n\n**Returns:** `Record<string, Record<string, unknown>>`\n\n`\"name\"`:\n\n```typescript\nconst summaries = await a2aAgents.getAgentsForLlm(\"name\");\n```\n\n```json\n{\n    \"code-reviewer\": { \"name\": \"Code Reviewer\" },\n    \"language-translator\": { \"name\": \"Universal Translator\" }\n}\n```\n\n`\"basic\"` (default):\n\n```typescript\nconst summaries = await a2aAgents.getAgentsForLlm();\n```\n\n```json\n{\n    \"code-reviewer\": {\n        \"name\": \"Code Reviewer\",\n        \"description\": \"Review code for best practices\"\n    },\n    \"language-translator\": {\n        \"name\": \"Universal Translator\",\n        \"description\": \"Translate text and audio between 50+ languages\"\n    }\n}\n```\n\n`\"skills\"`:\n\n```typescript\nconst summaries = await a2aAgents.getAgentsForLlm(\"skills\");\n```\n\n```json\n{\n    \"code-reviewer\": {\n        \"name\": \"Code Reviewer\",\n        \"description\": \"Review code for best practices\",\n        \"skills\": [\"Review Code\"]\n    },\n    \"language-translator\": {\n        \"name\": \"Universal Translator\",\n        \"description\": \"Translate text between 50+ languages\",\n        \"skills\": [\"Translate Text\", \"Translate Audio\"]\n    }\n}\n```\n\n`\"full\"`:\n\n```typescript\nconst summaries = await a2aAgents.getAgentsForLlm(\"full\");\n```\n\n```json\n{\n    \"code-reviewer\": {\n        \"name\": \"Code Reviewer\",\n        \"description\": \"Review code for best practices\",\n        \"skills\": [\n            {\n                \"name\": \"Review Code\",\n                \"description\": \"Review code for best practices, identify bugs, and suggest improvements\"\n            }\n        ]\n    },\n    \"language-translator\": {\n        \"name\": \"Universal Translator\",\n        \"description\": \"Translate text between 50+ languages\",\n        \"skills\": [\n            {\n                \"name\": \"Translate Text\",\n                \"description\": \"Translate text between any supported language pair\"\n            },\n            {\n                \"name\": \"Translate Audio\",\n                \"description\": \"Translate audio between any supported language pair\"\n            }\n        ]\n    }\n}\n```\n\n#### `async getAgent(agentId: string): Promise<AgentURLAndCustomHeaders | null>`\n\nRetrieve agent by ID.\nNote: this should NOT be added to the LLM's context, use `getAgentForLlm` instead.\n\n| Parameter | Type     | Required | Description                   |\n| --------- | -------- | -------- | ----------------------------- |\n| `agentId` | `string` | Yes      | User-defined agent identifier |\n\n**Returns:** [`AgentURLAndCustomHeaders`](#agenturlandcustomheaders) | `null`\n\n```typescript\nconst agent = await a2aAgents.getAgent(\"language-translator\");\n```\n\nReturns `null` if the agent ID is not registered.\n\n#### `async getAgentForLlm(agentId: string, detail?: string): Promise<Record<string, unknown> | null>`\n\nGenerate summary for a single agent.\n\n| Parameter | Type     | Required | Description                                                          |\n| --------- | -------- | -------- | -------------------------------------------------------------------- |\n| `agentId` | `string` | Yes      | User-defined agent identifier                                        |\n| `detail`  | `string` | No       | Detail level: `\"name\"`, `\"basic\"` (default), `\"skills\"`, or `\"full\"` |\n\n**Returns:** `Record<string, unknown> | null` — summary object or `null` if not found.\n\n```typescript\nconst summary = await a2aAgents.getAgentForLlm(\"language-translator\");\n```\n\n```json\n{\n    \"name\": \"Universal Translator\",\n    \"description\": \"Translate text and audio between 50+ languages\"\n}\n```\n\n#### `async addAgent(agentId: string, url: string, customHeaders?: Record<string, string>): Promise<void>`\n\nRegister a new agent at runtime.\n\n| Parameter       | Type                     | Required | Description                   |\n| --------------- | ------------------------ | -------- | ----------------------------- |\n| `agentId`       | `string`                 | Yes      | User-defined agent identifier |\n| `url`           | `string`                 | Yes      | Agent card URL                |\n| `customHeaders` | `Record<string, string>` | No       | Custom HTTP headers           |\n\n**Throws:** `Error` if `agentId` is already registered.\n\n```typescript\nawait a2aAgents.addAgent(\"code-reviewer\", \"https://review.example.com/.well-known/agent-card.json\", {\n    \"X-API-Key\": \"key_123\",\n});\n```\n\n### 💾 JSONTaskStore\n\nPersists Task objects as individual JSON files. Implements the A2A SDK `TaskStore` interface.\n\n```typescript\nimport { JSONTaskStore } from \"@a2anet/a2a-utils\";\n\nconst taskStore = new JSONTaskStore(\"./storage/tasks\");\n```\n\n#### `async save(task: Task): Promise<void>`\n\nSave a task to disk. Creates `./storage/tasks/{task_id}.json`.\n\n#### `async load(taskId: string): Promise<Task | undefined>`\n\nLoad a task from disk.\n\nReturns `undefined` if the task file does not exist.\n\n#### `async delete(taskId: string): Promise<void>`\n\nDelete a task from disk.\n\n### 📁 Files\n\n#### FileStore\n\nInterface for file storage. Implement this to use custom storage backends (S3, GCS, etc.).\n\n```typescript\nimport type { Artifact } from \"@a2a-js/sdk\";\n\ninterface FileStore {\n    save(taskId: string, artifact: Artifact): Promise<string[]>;\n    get(taskId: string, artifactId: string): Promise<string[]>;\n    delete(taskId: string, artifactId: string): Promise<void>;\n}\n```\n\n#### LocalFileStore\n\nSaves artifact file parts to the local filesystem. Files are stored at `storageDir/taskId/artifactId/filename`.\n\n```typescript\nimport { LocalFileStore } from \"@a2anet/a2a-utils\";\n\nconst fileStore = new LocalFileStore(\"./storage/files\");\n```\n\n##### `async save(taskId: string, artifact: Artifact): Promise<string[]>`\n\nSave file parts from an artifact to disk.\n\n```typescript\nconst savedPaths = await fileStore.save(\"task-123\", artifact);\n```\n\nExample result:\n\n```typescript\n[\"./storage/files/task-123/art-789/quarterly_report.pdf\"];\n```\n\n##### `async get(taskId: string, artifactId: string): Promise<string[]>`\n\nGet saved file paths for an artifact.\n\n```typescript\nconst paths = await fileStore.get(\"task-123\", \"art-789\");\n```\n\nExample result:\n\n```typescript\n[\"./storage/files/task-123/art-789/quarterly_report.pdf\"];\n```\n\nReturns an empty array if no files are found.\n\n##### `async delete(taskId: string, artifactId: string): Promise<void>`\n\nDelete saved files for an artifact.\n\n```typescript\nawait fileStore.delete(\"task-123\", \"art-789\");\n```\n\n### 🎨 Artifacts\n\n`A2ATools` uses the `TextArtifacts` and `DataArtifacts` classes to automatically minimize Artifacts returned from `sendMessage` and view Artifacts using `viewTextArtifact` and `viewDataArtifact`. They can also be used independently on raw data.\n\n#### TextArtifacts\n\n##### `TextArtifacts.view(text, opts?): string`\n\nView text content with optional line or character range selection. Supports line selection (1-based, inclusive) or character selection (0-based, slice semantics). These are mutually exclusive — providing both throws an `Error`.\n\n| Parameter             | Type             | Required | Description                                   |\n| --------------------- | ---------------- | -------- | --------------------------------------------- |\n| `text`                | `string`         | Yes      | The text to view                              |\n| `opts.lineStart`      | `number \\| null` | No       | Starting line number (1-based, inclusive)     |\n| `opts.lineEnd`        | `number \\| null` | No       | Ending line number (1-based, inclusive)       |\n| `opts.characterStart` | `number \\| null` | No       | Starting character index (0-based, inclusive) |\n| `opts.characterEnd`   | `number \\| null` | No       | Ending character index (0-based, exclusive)   |\n| `opts.characterLimit` | `number`         | No       | Maximum output size (default: `50,000`)       |\n\n**Returns:** `string`\n\nLine selection:\n\n```typescript\nimport { TextArtifacts } from \"@a2anet/a2a-utils\";\n\nconst text = \"[INFO] Server started\\n[INFO] Connected to DB\\n[WARN] Cache miss\\n[INFO] Request OK\";\nTextArtifacts.view(text, { lineStart: 1, lineEnd: 2 });\n```\n\nExample result:\n\n```\n\"[INFO] Server started\\n[INFO] Connected to DB\"\n```\n\nCharacter selection:\n\n```typescript\nTextArtifacts.view(\"Hello, World!\", { characterStart: 0, characterEnd: 5 });\n```\n\nExample result:\n\n```\n\"Hello\"\n```\n\n##### `TextArtifacts.minimize(text, opts?): Record<string, unknown>`\n\nMinimize text content for display. If text is within the character limit, returns it unchanged. If over the limit, shows first and last halves with metadata.\n\n| Parameter             | Type             | Required | Description                                                |\n| --------------------- | ---------------- | -------- | ---------------------------------------------------------- |\n| `text`                | `string`         | Yes      | The text content to minimize                               |\n| `opts.characterLimit` | `number`         | No       | Character limit (default: `50,000`)                        |\n| `opts.tip`            | `string \\| null` | No       | Tip string (default: `null`; pass a string to include one) |\n\n**Returns:** `Record<string, unknown>`\n\nShort text (under limit):\n\n```typescript\nimport { TextArtifacts } from \"@a2anet/a2a-utils\";\n\nTextArtifacts.minimize(\"Hello, world!\");\n```\n\n```json\n{ \"text\": \"Hello, world!\" }\n```\n\nLong text (over limit):\n\n```typescript\nTextArtifacts.minimize(\"x\".repeat(60_000));\n```\n\n```json\n{\n    \"text\": \"xxxxxxx...\\n\\n[... 10,000 characters omitted ...]\\n\\nxxxxxxx...\",\n    \"_total_lines\": 1,\n    \"_total_characters\": 60000,\n    \"_start_line_range\": \"1-1\",\n    \"_end_line_range\": \"1-1\",\n    \"_start_character_range\": \"0-25000\",\n    \"_end_character_range\": \"35000-60000\"\n}\n```\n\n#### DataArtifacts\n\n##### `DataArtifacts.view(data, opts?): unknown`\n\nView structured data with optional filtering. Navigate with `jsonPath`, then filter with `rows`/`columns`.\n\n| Parameter             | Type                                   | Required | Description                                   |\n| --------------------- | -------------------------------------- | -------- | --------------------------------------------- |\n| `data`                | `unknown`                              | Yes      | The data to view                              |\n| `opts.jsonPath`       | `string \\| null`                       | No       | Dot-separated path to extract specific fields |\n| `opts.rows`           | `number \\| number[] \\| string \\| null` | No       | Row selection                                 |\n| `opts.columns`        | `string \\| string[] \\| null`           | No       | Column selection                              |\n| `opts.characterLimit` | `number`                               | No       | Maximum output size (default: `50,000`)       |\n\n**Returns:** `unknown` (filtered data)\n\n```typescript\nimport { DataArtifacts } from \"@a2anet/a2a-utils\";\n\nconst data = {\n    employees: [\n        { name: \"Alice\", department: \"Engineering\", level: 5 },\n        { name: \"Bob\", department: \"Design\", level: 3 },\n        { name: \"Carol\", department: \"Engineering\", level: 4 },\n    ],\n};\n\nDataArtifacts.view(data, { jsonPath: \"employees\", rows: \"0-2\", columns: [\"name\", \"department\"] });\n```\n\nExample result:\n\n```json\n[\n    { \"name\": \"Alice\", \"department\": \"Engineering\" },\n    { \"name\": \"Bob\", \"department\": \"Design\" }\n]\n```\n\n##### `DataArtifacts.minimize(data, opts?): Record<string, unknown>`\n\nMinimize data content for display based on type. Automatically selects the best strategy: list-of-objects gets a table summary, dicts get string truncation, strings delegate to `TextArtifacts.minimize`.\n\n| Parameter                          | Type             | Required | Description                                                |\n| ---------------------------------- | ---------------- | -------- | ---------------------------------------------------------- |\n| `data`                             | `unknown`        | Yes      | The data to minimize                                       |\n| `opts.characterLimit`              | `number`         | No       | Character limit (default: `50,000`)                        |\n| `opts.minimizedObjectStringLength` | `number`         | No       | Max string length in objects (default: `5,000`)            |\n| `opts.tip`                         | `string \\| null` | No       | Tip string (default: `null`; pass a string to include one) |\n\n**Returns:** `Record<string, unknown>`\n\nLists of objects are summarized as table summaries (see `summarizeTable`) and lists of values as value summaries (see `summarizeValues`).\n\n```typescript\nimport { DataArtifacts } from \"@a2anet/a2a-utils\";\n\nconst data = {\n    title: \"Quarterly Report Q4 2025\",\n    summary: \"x\".repeat(10_000),\n    metrics: { revenue: 1_250_000, growth: 12.5 },\n    employees: Array.from({ length: 100 }, (_, i) => ({\n        name: `Employee ${i}`,\n        department: [\"Eng\", \"Marketing\", \"Design\", \"Sales\"][i % 4],\n        salary: 60_000 + i * 500,\n    })),\n    tags: [\"finance\", \"quarterly\", \"internal\"],\n};\n\nDataArtifacts.minimize(data, { characterLimit: 100, minimizedObjectStringLength: 10 });\n```\n\n```json\n{\n    \"data\": {\n        \"title\": \"Quarterly ... [14 more chars]\",\n        \"summary\": \"xxxxxxxxxx... [9,990 more chars]\",\n        \"metrics\": {\n            \"revenue\": 1250000,\n            \"growth\": 12.5\n        },\n        \"employees\": {\n            \"_total_rows\": 100,\n            \"_columns\": [\n                {\n                    \"count\": 100,\n                    \"unique_count\": 100,\n                    \"types\": [\n                        {\n                            \"name\": \"string\",\n                            \"count\": 100,\n                            \"percentage\": 100.0,\n                            \"sample_value\": \"Employee 42\",\n                            \"length_minimum\": 10,\n                            \"length_maximum\": 11,\n                            \"length_average\": 10.9,\n                            \"length_stdev\": 0.3\n                        }\n                    ],\n                    \"name\": \"name\"\n                },\n                {\n                    \"count\": 100,\n                    \"unique_count\": 4,\n                    \"types\": [\n                        {\n                            \"name\": \"string\",\n                            \"count\": 100,\n                            \"percentage\": 100.0,\n                            \"sample_value\": \"Engineering\",\n                            \"length_minimum\": 5,\n                            \"length_maximum\": 11,\n                            \"length_average\": 7.75,\n                            \"length_stdev\": 2.4\n                        }\n                    ],\n                    \"name\": \"department\"\n                },\n                {\n                    \"count\": 100,\n                    \"unique_count\": 100,\n                    \"types\": [\n                        {\n                            \"name\": \"int\",\n                            \"count\": 100,\n                            \"percentage\": 100.0,\n                            \"sample_value\": 75000,\n                            \"minimum\": 60000,\n                            \"maximum\": 109500,\n                            \"average\": 84750,\n                            \"stdev\": 14505.75\n                        }\n                    ],\n                    \"name\": \"salary\"\n                }\n            ],\n            \"_json_path\": \"employees\"\n        },\n        \"tags\": [\"finance\", \"quarterly\", \"internal\"]\n    }\n}\n```\n\n##### `DataArtifacts.summarizeTable(data): Record<string, unknown>[]`\n\nGenerate a summary of tabular data (array of objects). Returns one summary object per column with count, unique count, and per-type statistics.\n\n| Parameter | Type                        | Required | Description |\n| --------- | --------------------------- | -------- | ----------- |\n| `data`    | `Record<string, unknown>[]` | Yes      | Table rows  |\n\n**Returns:** `Record<string, unknown>[]`\n\n```typescript\nimport { DataArtifacts } from \"@a2anet/a2a-utils\";\n\nconst data = Array.from({ length: 100 }, (_, i) => ({\n    name: `Employee ${i}`,\n    department: [\"Eng\", \"Marketing\", \"Design\", \"Sales\"][i % 4],\n    salary: 60_000 + i * 500,\n}));\n\nDataArtifacts.summarizeTable(data);\n```\n\n```json\n[\n    {\n        \"count\": 100,\n        \"unique_count\": 100,\n        \"types\": [\n            {\n                \"name\": \"string\",\n                \"count\": 100,\n                \"percentage\": 100.0,\n                \"sample_value\": \"Employee 42\",\n                \"length_minimum\": 10,\n                \"length_maximum\": 11,\n                \"length_average\": 10.9,\n                \"length_stdev\": 0.3\n            }\n        ],\n        \"name\": \"name\"\n    },\n    {\n        \"count\": 100,\n        \"unique_count\": 4,\n        \"types\": [\n            {\n                \"name\": \"string\",\n                \"count\": 100,\n                \"percentage\": 100.0,\n                \"sample_value\": \"Engineering\",\n                \"length_minimum\": 5,\n                \"length_maximum\": 11,\n                \"length_average\": 7.75,\n                \"length_stdev\": 2.4\n            }\n        ],\n        \"name\": \"department\"\n    },\n    {\n        \"count\": 100,\n        \"unique_count\": 100,\n        \"types\": [\n            {\n                \"name\": \"int\",\n                \"count\": 100,\n                \"percentage\": 100.0,\n                \"sample_value\": 75000,\n                \"minimum\": 60000,\n                \"maximum\": 109500,\n                \"average\": 84750,\n                \"stdev\": 14505.75\n            }\n        ],\n        \"name\": \"salary\"\n    }\n]\n```\n\n##### `DataArtifacts.summarizeValues(values): Record<string, unknown> | unknown[]`\n\nGenerate statistics for a list of values (like a single column). Includes count, unique count, and per-type statistics (min/max/avg/stdev for numbers, length stats for strings, etc.). If the summary would be larger than the original values, the original list is returned instead (inflation guard).\n\n| Parameter | Type        | Required | Description         |\n| --------- | ----------- | -------- | ------------------- |\n| `values`  | `unknown[]` | Yes      | Values to summarize |\n\n**Returns:** `Record<string, unknown> | unknown[]`\n\n```typescript\nimport { DataArtifacts } from \"@a2anet/a2a-utils\";\n\nconst salaries = [\n    95000,\n    72000,\n    105000,\n    68000,\n    88000,\n    // ... ~100 salary values total, with some nulls\n    null,\n    115000,\n    92000,\n    null,\n    78000,\n];\n\nDataArtifacts.summarizeValues(salaries);\n```\n\n```json\n{\n    \"count\": 100,\n    \"unique_count\": 87,\n    \"types\": [\n        {\n            \"name\": \"int\",\n            \"count\": 92,\n            \"percentage\": 92.0,\n            \"sample_value\": 95000,\n            \"minimum\": 45000,\n            \"maximum\": 185000,\n            \"average\": 87250.5,\n            \"stdev\": 28430.12\n        },\n        {\n            \"name\": \"null\",\n            \"count\": 8,\n            \"percentage\": 8.0,\n            \"sample_value\": null\n        }\n    ]\n}\n```\n\n#### `minimizeArtifacts(artifacts, opts?): ArtifactForLLM[]`\n\nMinimize a list of artifacts for LLM display. Called automatically by `A2ATools.sendMessage`. Combines all TextParts within each artifact into a single [`TextPartForLLM`](#textpartforllm). Handles `FilePart`s by including file metadata and saved paths.\n\n| Parameter                          | Type                               | Required | Description                                               |\n| ---------------------------------- | ---------------------------------- | -------- | --------------------------------------------------------- |\n| `artifacts`                        | `Artifact[]`                       | Yes      | List of artifacts to minimize                             |\n| `opts.characterLimit`              | `number`                           | No       | Character limit (default: `50,000`)                       |\n| `opts.minimizedObjectStringLength` | `number`                           | No       | Max string length in objects (default: `5,000`)           |\n| `opts.savedFilePaths`              | `Record<string, string[]> \\| null` | No       | Mapping of artifactId to saved file paths                 |\n| `opts.textTip`                     | `string \\| null`                   | No       | Tip string for minimized text artifacts (default: `null`) |\n| `opts.dataTip`                     | `string \\| null`                   | No       | Tip string for minimized data artifacts (default: `null`) |\n\n**Returns:** [`ArtifactForLLM`](#artifactforllm)`[]`\n\n```typescript\nimport type { Artifact } from \"@a2a-js/sdk\";\nimport { minimizeArtifacts } from \"@a2anet/a2a-utils\";\n\nconst artifacts: Artifact[] = [\n    {\n        artifactId: \"art-123\",\n        description: \"Full text of a research paper abstract spanning several pages.\",\n        name: \"Research Paper Abstract\",\n        parts: [{ kind: \"text\", text: \"x\".repeat(60_000) }],\n    },\n    {\n        artifactId: \"art-456\",\n        description: \"Company employee directory with names, departments, and salaries.\",\n        name: \"Employee Directory\",\n        parts: [\n            {\n                kind: \"data\",\n                data: Array.from({ length: 100 }, (_, i) => ({\n                    name: `Employee ${i}`,\n                    department: [\"Eng\", \"Marketing\", \"Design\", \"Sales\"][i % 4],\n                    salary: 60_000 + i * 500,\n                })),\n            },\n        ],\n    },\n    {\n        artifactId: \"art-789\",\n        description: \"Generated quarterly financial report in PDF format.\",\n        name: \"Quarterly Report\",\n        parts: [\n            {\n                kind: \"file\",\n                file: {\n                    name: \"q4-report.pdf\",\n                    mimeType: \"application/pdf\",\n                    bytes: \"base64encodeddata...\",\n                },\n            },\n        ],\n    },\n];\n\nconst minimized = minimizeArtifacts(artifacts, {\n    textTip: \"Text was minimized. Call viewTextArtifact() to see specific line ranges.\",\n    dataTip: \"Data was minimized. Call viewDataArtifact() to navigate to specific data.\",\n    savedFilePaths: { \"art-789\": [\"./storage/files/task-123/art-789/q4-report.pdf\"] },\n});\n```\n\nExample result:\n\n```json\n[\n    {\n        \"artifactId\": \"art-123\",\n        \"description\": \"Full text of a research paper abstract spanning several pages.\",\n        \"name\": \"Research Paper Abstract\",\n        \"parts\": [\n            {\n                \"kind\": \"text\",\n                \"text\": \"xxxxxxx...\\n\\n[... 10,000 characters omitted ...]\\n\\nxxxxxxx...\"\n            }\n        ]\n    },\n    {\n        \"artifactId\": \"art-456\",\n        \"description\": \"Company employee directory with names, departments, and salaries.\",\n        \"name\": \"Employee Directory\",\n        \"parts\": [\n            {\n                \"kind\": \"data\",\n                \"data\": {\n                    \"data\": {\n                        \"_total_rows\": 100,\n                        \"_columns\": [\"...\"],\n                        \"_tip\": \"Data was minimized. Call viewDataArtifact() to navigate to specific data.\"\n                    }\n                }\n            }\n        ]\n    },\n    {\n        \"artifactId\": \"art-789\",\n        \"description\": \"Generated quarterly financial report in PDF format.\",\n        \"name\": \"Quarterly Report\",\n        \"parts\": [\n            {\n                \"kind\": \"file\",\n                \"name\": \"q4-report.pdf\",\n                \"mimeType\": \"application/pdf\",\n                \"uri\": null,\n                \"bytes\": {\n                    \"_saved_to\": [\"./storage/files/task-123/art-789/q4-report.pdf\"]\n                }\n            }\n        ]\n    }\n]\n```\n\n### 📋 Types\n\nAll types are readonly interfaces exported from `@a2anet/a2a-utils`.\n\n#### `AgentURLAndCustomHeaders`\n\nReturned by `A2AAgents.getAgent()` and `A2AAgents.getAgents()`.\n\n```typescript\nconst agent: AgentURLAndCustomHeaders = {\n    agentCard: {\n        name: \"Universal Translator\",\n        description: \"Translate text and audio between 50+ languages\",\n        url: \"https://translate.example.com\",\n        version: \"1.0.0\",\n        capabilities: { streaming: false, pushNotifications: false },\n        skills: [\n            {\n                id: \"translate-text\",\n                name: \"Translate Text\",\n                description: \"Translate text between any supported language pair\",\n                tags: [\"translate\", \"text\", \"language\"],\n                examples: [\"Translate 'hello' to French\"],\n            },\n            {\n                id: \"translate-audio\",\n                name: \"Translate Audio\",\n                description: \"Translate audio between any supported language pair\",\n                tags: [\"translate\", \"audio\", \"language\"],\n            },\n        ],\n        defaultInputModes: [\"text\", \"audio/mpeg\"],\n        defaultOutputModes: [\"text\", \"audio/mpeg\"],\n    },\n    customHeaders: { Authorization: \"Bearer tok_123\" },\n};\n```\n\n| Field           | Type                     |\n| --------------- | ------------------------ |\n| `agentCard`     | `AgentCard`              |\n| `customHeaders` | `Record<string, string>` |\n\n#### `TaskForLLM`\n\nReturned by `A2ATools.sendMessage.execute()` for task responses.\n\n```typescript\nconst task: TaskForLLM = {\n    id: \"task-123\",\n    contextId: \"ctx-456\",\n    kind: \"task\",\n    status: {\n        state: \"completed\",\n        message: {\n            contextId: \"ctx-456\",\n            kind: \"message\",\n            parts: [\n                {\n                    kind: \"text\",\n                    text: \"I found three recent papers on quantum computing and retrieved the abstract for the most recent one.\",\n                },\n            ],\n        },\n    },\n    artifacts: [\n        {\n            artifactId: \"art-789\",\n            description: \"Search results for quantum computing papers\",\n            name: \"Search Results\",\n            parts: [\n                {\n                    kind: \"data\",\n                    data: [\n                        {\n                            title: \"Quantum Error Correction Advances\",\n                            year: 2025,\n                            authors: \"Chen et al.\",\n                        },\n                        {\n                            title: \"Topological Quantum Computing Survey\",\n                            year: 2024,\n                            authors: \"Nakamura et al.\",\n                        },\n                        {\n                            title: \"Fault-Tolerant Logical Qubits\",\n                            year: 2024,\n                            authors: \"Wang et al.\",\n                        },\n                    ],\n                },\n            ],\n        },\n        {\n            artifactId: \"art-790\",\n            description: \"Abstract of 'Quantum Error Correction Advances' by Chen et al.\",\n            name: \"Abstract\",\n            parts: [\n                {\n                    kind: \"text\",\n                    text: \"Quantum computing has seen rapid advances in error correction.\\nRecent work demonstrates fault-tolerant logical qubits at scale.\\nThis paper surveys progress in quantum error correction from 2023-2025.\\nWe review surface codes, color codes, and novel hybrid approaches.\\nKey results include a 10x reduction in logical error rates.\\nThese improvements bring practical quantum computing closer to reality.\\nWe also discuss remaining challenges in qubit connectivity.\\nFinally, we outline a roadmap for achieving fault-tolerant quantum computation.\",\n                },\n            ],\n        },\n    ],\n};\n```\n\n| Field       | Type                                    |\n| ----------- | --------------------------------------- |\n| `id`        | `string`                                |\n| `contextId` | `string`                                |\n| `kind`      | `string` (`\"task\"`)                     |\n| `status`    | [`TaskStatusForLLM`](#taskstatusforllm) |\n| `artifacts` | [`ArtifactForLLM`](#artifactforllm)`[]` |\n\n#### `MessageForLLM`\n\nReturned by `A2ATools.sendMessage.execute()` for message-only responses, or as `TaskStatusForLLM.message`.\n\n```typescript\nconst message: MessageForLLM = {\n    contextId: \"ctx-456\",\n    kind: \"message\",\n    parts: [\n        {\n            kind: \"text\",\n            text: \"I found three recent papers on quantum computing and retrieved the abstract for the most recent one.\",\n        },\n    ],\n};\n```\n\n| Field       | Type                                                                                                                  |\n| ----------- | --------------------------------------------------------------------------------------------------------------------- |\n| `contextId` | `string \\| null`                                                                                                      |\n| `kind`      | `string` (`\"message\"`)                                                                                                |\n| `parts`     | ([`TextPartForLLM`](#textpartforllm) \\| [`DataPartForLLM`](#datapartforllm) \\| [`FilePartForLLM`](#filepartforllm))[] |\n\n#### `TaskStatusForLLM`\n\n```typescript\nconst taskStatus: TaskStatusForLLM = {\n    state: \"completed\",\n    message: {\n        contextId: \"ctx-456\",\n        kind: \"message\",\n        parts: [\n            {\n                kind: \"text\",\n                text: \"I found three recent papers on quantum computing and retrieved the abstract for the most recent one.\",\n            },\n        ],\n    },\n};\n```\n\n| Field     | Type                                        |\n| --------- | ------------------------------------------- |\n| `state`   | `TaskState`                                 |\n| `message` | [`MessageForLLM`](#messageforllm) `\\| null` |\n\n#### `ArtifactForLLM`\n\nReturned by `viewTextArtifact.execute()`, `viewDataArtifact.execute()`, and `minimizeArtifacts()`. Used in `TaskForLLM.artifacts`.\n\n```typescript\nconst artifact: ArtifactForLLM = {\n    artifactId: \"art-790\",\n    description: \"Abstract of 'Quantum Error Correction Advances' by Chen et al.\",\n    name: \"Abstract\",\n    parts: [\n        {\n            kind: \"text\",\n            text: \"Quantum computing has seen rapid advances in error correction.\\nRecent work demonstrates fault-tolerant logical qubits at scale.\\nThis paper surveys progress in quantum error correction from 2023-2025.\\nWe review surface codes, color codes, and novel hybrid approaches.\\nKey results include a 10x reduction in logical error rates.\\nThese improvements bring practical quantum computing closer to reality.\\nWe also discuss remaining challenges in qubit connectivity.\\nFinally, we outline a roadmap for achieving fault-tolerant quantum computation.\",\n        },\n    ],\n};\n```\n\n| Field         | Type                                                                                                                  |\n| ------------- | --------------------------------------------------------------------------------------------------------------------- |\n| `artifactId`  | `string`                                                                                                              |\n| `description` | `string \\| null`                                                                                                      |\n| `name`        | `string \\| null`                                                                                                      |\n| `parts`       | ([`TextPartForLLM`](#textpartforllm) \\| [`DataPartForLLM`](#datapartforllm) \\| [`FilePartForLLM`](#filepartforllm))[] |\n\n#### `TextPartForLLM`\n\n```typescript\nconst textPart: TextPartForLLM = {\n    kind: \"text\",\n    text: \"Quantum computing has seen rapid advances in error correction.\\nRecent work demonstrates fault-tolerant logical qubits at scale.\\nThis paper surveys progress in quantum error correction from 2023-2025.\",\n};\n```\n\n| Field  | Type                |\n| ------ | ------------------- |\n| `kind` | `string` (`\"text\"`) |\n| `text` | `string`            |\n\n#### `DataPartForLLM`\n\n```typescript\nconst dataPart: DataPartForLLM = {\n    kind: \"data\",\n    data: [\n        {\n            title: \"Quantum Error Correction Advances\",\n            year: 2025,\n            authors: \"Chen et al.\",\n        },\n        {\n            title: \"Topological Quantum Computing Survey\",\n            year: 2024,\n            authors: \"Nakamura et al.\",\n        },\n        {\n            title: \"Fault-Tolerant Logical Qubits\",\n            year: 2024,\n            authors: \"Wang et al.\",\n        },\n    ],\n};\n```\n\n| Field  | Type                |\n| ------ | ------------------- |\n| `kind` | `string` (`\"data\"`) |\n| `data` | `unknown`           |\n\n#### `FilePartForLLM`\n\nRepresents a file part in artifacts and messages. `uri` and `bytes` are mutually exclusive — at most one is set.\n\n```typescript\nconst filePart: FilePartForLLM = {\n    kind: \"file\",\n    name: \"q4-report.pdf\",\n    mimeType: \"application/pdf\",\n    uri: null,\n    bytes: {\n        _saved_to: [\"./storage/files/task-123/art-789/q4-report.pdf\"],\n    },\n};\n```\n\n| Field      | Type                                        | Description                                                                       |\n| ---------- | ------------------------------------------- | --------------------------------------------------------------------------------- |\n| `kind`     | `string` (`\"file\"`)                         | Always `\"file\"`                                                                   |\n| `name`     | `string \\| null`                            | Filename from the original FilePart                                               |\n| `mimeType` | `string \\| null`                            | MIME type from the original FilePart                                              |\n| `uri`      | `string \\| Record<string, unknown> \\| null` | Raw URI (no FileStore) or `{\"_saved_to\": [...]}` (FileStore saved it)             |\n| `bytes`    | `Record<string, unknown> \\| null`           | `{\"_saved_to\": [...]}` (FileStore saved it) or `{\"_error\": \"...\"}` (no FileStore) |\n\n## 📄 License\n\n`@a2anet/a2a-utils` is distributed under the terms of the [Apache-2.0](https://spdx.org/licenses/Apache-2.0.html) license.\n\n## 🤝 Join the A2A Net Community\n\nA2A Net is a site to find and share AI agents and open-source community.\n\n- 🌍 Site: [A2A Net](https://a2anet.com)\n- 🤖 Discord: [Join the Discord](https://discord.gg/674NGXpAjU)\n","readmeFilename":"README.md"}