{"_id":"@cognitive-swarm/a2a","name":"@cognitive-swarm/a2a","dist-tags":{"latest":"0.2.0"},"versions":{"0.2.0":{"name":"@cognitive-swarm/a2a","version":"0.2.0","description":"A2A (Agent-to-Agent) protocol server for cognitive-swarm","type":"module","main":"./dist/index.js","types":"./dist/index.d.ts","exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js"}},"scripts":{"build":"tsc","test":"vitest run","test:watch":"vitest","lint":"eslint src/","clean":"rm -rf dist"},"dependencies":{"@cognitive-swarm/core":"*","@a2a-js/sdk":"^0.3.13"},"license":"Apache-2.0","author":{"name":"Dmitry Zorin"},"repository":{"type":"git","url":"git+https://github.com/medonomator/cognitive-swarm.git","directory":"packages/a2a"},"publishConfig":{"access":"public"},"homepage":"https://medonomator.github.io/cognitive-swarm/","bugs":{"url":"https://github.com/medonomator/cognitive-swarm/issues"},"gitHead":"8613f7b139c03719ef14fe9f2c01bdc1c5532a26","_id":"@cognitive-swarm/a2a@0.2.0","_nodeVersion":"24.11.1","_npmVersion":"11.6.2","dist":{"integrity":"sha512-0IaYf9na/zr+kL9u9jX8xM7e5ZPu70ngG9iwAJ1NExR10SBHMGkhD/mmsU2GgxH7vq0k8et8czJZRnZZs/rCkg==","shasum":"a75883d009bf55d3b5d665dce9ac57ee33d6669f","tarball":"https://registry.npmjs.org/@cognitive-swarm/a2a/-/a2a-0.2.0.tgz","fileCount":30,"unpackedSize":45864,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEYCIQCZmfR+36M44ZQBfrBiWDRf9XWtIxQ+RcPSme2vl7ZxxgIhAPXnOsxT0J+ilYgxBAxJr/eHic7mw1S6uUYUFwwZWL79"}]},"_npmUser":{"name":"medonomator","email":"budteschastlivi1@gmail.com"},"directories":{},"maintainers":[{"name":"medonomator","email":"budteschastlivi1@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/a2a_0.2.0_1776497173428_0.5525079103485897"},"_hasShrinkwrap":false}},"time":{"created":"2026-04-18T07:26:13.297Z","0.2.0":"2026-04-18T07:26:13.587Z","modified":"2026-04-18T07:26:13.896Z"},"maintainers":[{"name":"medonomator","email":"budteschastlivi1@gmail.com"}],"description":"A2A (Agent-to-Agent) protocol server for cognitive-swarm","homepage":"https://medonomator.github.io/cognitive-swarm/","repository":{"type":"git","url":"git+https://github.com/medonomator/cognitive-swarm.git","directory":"packages/a2a"},"author":{"name":"Dmitry Zorin"},"bugs":{"url":"https://github.com/medonomator/cognitive-swarm/issues"},"license":"Apache-2.0","readme":"# @cognitive-swarm/a2a\n\nA2A (Agent-to-Agent) protocol server for cognitive-swarm.\n\n## Installation\n\n```bash\nnpm install @cognitive-swarm/a2a\n```\n\n## Overview\n\nExposes a cognitive-swarm orchestrator as an A2A-compatible server, allowing external agents and clients to interact with it over the standard Agent-to-Agent protocol. Handles agent card generation, task streaming, and event mapping between swarm signals and A2A events.\n\n## Usage\n\n```ts\nimport { createA2AServer, buildAgentCard } from '@cognitive-swarm/a2a';\n\nconst server = createA2AServer({\n  orchestratorFactory: (task) => createMyOrchestrator(task),\n  skills: [\n    { id: 'code-review', name: 'Code Review', description: 'Review PRs' },\n  ],\n  port: 3000,\n});\n\nawait server.start();\n// A2A endpoint available at http://localhost:3000\n// Agent card at http://localhost:3000/.well-known/agent.json\n```\n\n### Custom handler (e.g., for Express or other frameworks)\n\n```ts\nimport { createA2AHandler, SwarmAgentExecutor } from '@cognitive-swarm/a2a';\n\nconst handler = createA2AHandler({\n  executor: new SwarmAgentExecutor({ /* ... */ }),\n  skills: [{ id: 'debug', name: 'Debug', description: 'Debug issues' }],\n});\n\n// Mount handler in your HTTP framework\napp.post('/a2a', handler);\n```\n\n## Exports\n\n| Export                | Kind     | Description                                |\n| --------------------- | -------- | ------------------------------------------ |\n| `createA2AServer`     | Function | Start a standalone A2A server              |\n| `createA2AHandler`    | Function | Create an A2A request handler              |\n| `SwarmAgentExecutor`  | Class    | Executes swarm runs for A2A tasks          |\n| `buildAgentCard`      | Function | Generate an A2A agent card                 |\n| `mapSwarmEventToA2A`  | Function | Map swarm signals to A2A events            |\n| `A2ASwarmServerConfig`| Type     | Full server configuration                  |\n| `A2AServerOptions`    | Type     | Server startup options                     |\n| `A2ASkillDef`         | Type     | Skill definition for the agent card        |\n| `Orchestratable`      | Type     | Orchestrator interface for A2A             |\n| `OrchestratorFactory` | Type     | Factory function producing orchestrators   |\n| `StreamVerbosity`     | Type     | Controls streaming detail level            |\n| `A2AServer`           | Type     | Server instance returned by factory        |\n\n## Links\n\n- [Root repository](https://github.com/medonomator/cognitive-swarm)\n","readmeFilename":"README.md","_rev":"1-96fe7a8a4c636070e80edc366dea6002"}