{"_id":"@agntcy/slim-a2a","_rev":"2-0a4cf31402f920d347f07ba3255009c6","name":"@agntcy/slim-a2a","dist-tags":{"latest":"0.2.0"},"versions":{"0.1.0":{"name":"@agntcy/slim-a2a","version":"0.1.0","license":"Apache-2.0","_id":"@agntcy/slim-a2a@0.1.0","maintainers":[{"name":"agntcy-admin","email":"artifacts@agntcy.io"},{"name":"acsepi","email":"replace_donor328@mail.doas.best"},{"name":"janossk","email":"janossk@cisco.com"},{"name":"muscariello","email":"muscariello@ieee.org"},{"name":"adamtagscherer","email":"adam.tagscherer@gmail.com"}],"dist":{"shasum":"10158886097550004f90d901f05561e31f72c982","tarball":"https://registry.npmjs.org/@agntcy/slim-a2a/-/slim-a2a-0.1.0.tgz","fileCount":59,"integrity":"sha512-+3eAexA9ucHB6TL+x5GyRx3z1amYyC5oX/dwVwFhAXhl1fC6rK9IJZYeawjJmZJ+RDYUlxU9AafSJ32Wm8HVdg==","signatures":[{"sig":"MEYCIQDc8Q/yDOhIuHyT6RHwkPKVr4Nxa+kqRBaYREtZPcNBjAIhANrIWw3Qy9ruAJMA1l2+beGYj92dYuXu7uusEYPP0RMX","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":357841},"main":"./dist/index.js","type":"module","types":"./dist/index.d.ts","engines":{"node":">=18"},"exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js"},"./types/v1":{"types":"./dist/types/v1/index.d.ts","import":"./dist/types/v1/index.js"}},"gitHead":"e4943f2e3cd9d54126220a5a6b7296bf056ab9b5","scripts":{"test":"vitest run","build":"tsc -p tsconfig.build.json","format":"prettier --write \"src/**/*.ts\" \"examples/**/*.ts\" \"tests/**/*.ts\"","generate":"buf generate --include-imports --template buf.gen.v1.yaml","typecheck":"tsc -p tsconfig.json --noEmit","test:watch":"vitest","format:check":"prettier --check \"src/**/*.ts\" \"examples/**/*.ts\" \"tests/**/*.ts\"","example:client":"tsx examples/echo-agent/client.ts","example:server":"tsx examples/echo-agent/server.ts","prepublishOnly":"npm run build"},"_npmUser":{"name":"janossk","email":"janossk@cisco.com"},"_npmVersion":"11.6.2","description":"SLIM (slimrpc) transport for the A2A protocol, plugging into the official @a2a-js/sdk.","directories":{},"_nodeVersion":"24.12.0","dependencies":{"@a2a-js/sdk":"1.0.0-beta.0","@bufbuild/protobuf":"^2.12.1","@agntcy/slim-bindings":"2.0.0-alpha.3"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"tsx":"^4.19.2","vitest":"^2.1.8","prettier":"^3.4.2","typescript":"^5.7.3","@types/node":"^20.19.0"},"_npmOperationalInternal":{"tmp":"tmp/slim-a2a_0.1.0_1784126910683_0.06516056089679156","host":"s3://npm-registry-packages-npm-production"}},"0.2.0":{"name":"@agntcy/slim-a2a","version":"0.2.0","description":"SLIM (slimrpc) transport for the A2A protocol, plugging into the official @a2a-js/sdk.","license":"Apache-2.0","repository":{"type":"git","url":"git+https://github.com/agntcy/slim-a2a-node.git"},"homepage":"https://github.com/agntcy/slim-a2a-node#readme","bugs":{"url":"https://github.com/agntcy/slim-a2a-node/issues"},"type":"module","engines":{"node":">=18"},"main":"./dist/index.js","types":"./dist/index.d.ts","exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js"},"./types/v1":{"types":"./dist/types/v1/index.d.ts","import":"./dist/types/v1/index.js"}},"publishConfig":{"access":"public"},"scripts":{"generate":"buf generate --include-imports --template buf.gen.v1.yaml","build":"tsc -p tsconfig.build.json","prepublishOnly":"npm run build","typecheck":"tsc -p tsconfig.json --noEmit","test":"vitest run","test:watch":"vitest","format":"prettier --write \"src/**/*.ts\" \"examples/**/*.ts\" \"tests/**/*.ts\"","format:check":"prettier --check \"src/**/*.ts\" \"examples/**/*.ts\" \"tests/**/*.ts\"","example:server":"tsx examples/echo-agent/server.ts","example:client":"tsx examples/echo-agent/client.ts"},"dependencies":{"@a2a-js/sdk":"1.0.0-beta.0","@agntcy/slim-bindings":"2.0.0","@bufbuild/protobuf":"^2.12.1"},"devDependencies":{"@types/node":"^20.19.0","prettier":"^3.4.2","tsx":"^4.19.2","typescript":"^5.7.3","vitest":"^2.1.8"},"gitHead":"f6ad15270d1c714fcb907dc8f47c612cee11792b","_id":"@agntcy/slim-a2a@0.2.0","_nodeVersion":"24.18.0","_npmVersion":"11.16.0","dist":{"integrity":"sha512-VMAb7uvqZdaITAXaomW147OjeH8t2Pm7D4ihsZTWTN5o0gp4CKlkk1wRXHX+2ZfefvgSDN8Mhy/DYP3+jJWOVw==","shasum":"a7ce0e1cea0120d1388ec7a67fd8b4cca9ffe3e8","tarball":"https://registry.npmjs.org/@agntcy/slim-a2a/-/slim-a2a-0.2.0.tgz","fileCount":63,"unpackedSize":370626,"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/@agntcy%2fslim-a2a@0.2.0","provenance":{"predicateType":"https://slsa.dev/provenance/v1"}},"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEUCIQCFt7sZtpSgeKZpqF3c9lb2Z0+LMxRY5UsVrEJBcgO+VAIgazfHUvo70nxBEUbJIx3M7W9RMTWW2dmGJSfQE+aKvbo="}]},"_npmUser":{"name":"GitHub Actions","email":"npm-oidc-no-reply@github.com","trustedPublisher":{"id":"github","oidcConfigId":"oidc:58b265b3-4732-435b-9368-73c1bcc95f16"}},"directories":{},"maintainers":[{"name":"agntcy-admin","email":"artifacts@agntcy.io"},{"name":"acsepi","email":"replace_donor328@mail.doas.best"},{"name":"janossk","email":"janossk@cisco.com"},{"name":"muscariello","email":"muscariello@ieee.org"},{"name":"adamtagscherer","email":"adam.tagscherer@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/slim-a2a_0.2.0_1786373052306_0.7937258721671347"},"_hasShrinkwrap":false}},"time":{"created":"2026-07-15T14:48:30.573Z","modified":"2026-08-10T14:44:12.884Z","0.1.0":"2026-07-15T14:48:30.826Z","0.2.0":"2026-08-10T14:44:12.565Z"},"license":"Apache-2.0","description":"SLIM (slimrpc) transport for the A2A protocol, plugging into the official @a2a-js/sdk.","maintainers":[{"name":"agntcy-admin","email":"artifacts@agntcy.io"},{"name":"acsepi","email":"replace_donor328@mail.doas.best"},{"name":"janossk","email":"janossk@cisco.com"},{"name":"muscariello","email":"muscariello@ieee.org"},{"name":"adamtagscherer","email":"adam.tagscherer@gmail.com"}],"readme":"# slim-a2a-node\n\nA **SLIM (slimrpc) transport for the [A2A](https://github.com/a2aproject/A2A)\nprotocol** in TypeScript. It lets A2A agents communicate over the SLIM network\nusing SLIM identities for addressing and authentication, and plugs directly into\nthe official [`@a2a-js/sdk`](https://www.npmjs.com/package/@a2a-js/sdk) — it does\n**not** reinvent the A2A domain types.\n\nThis is the JavaScript/TypeScript peer of `slim-a2a-python` (and the Go, Java,\nand .NET SDKs).\n\n- **Client** — `SRPCTransport` / `SRPCTransportFactory` implement the SDK's\n  `Transport` / `TransportFactory`.\n- **Server** — `SRPCHandler` bridges an SDK `A2ARequestHandler` (e.g.\n  `DefaultRequestHandler`) onto the generated slimrpc servicer.\n- **Bootstrap** — `setupSlimClient` and friends handle SLIM init + connect.\n\n## How it works\n\nThe generated slimrpc stubs speak [protobuf-es](https://github.com/bufbuild/protobuf-es)\nmessages, while `@a2a-js/sdk` (>= 1.0.0-beta) exposes ts-proto domain objects for\nthe same A2A v1.0.0 proto. slim-a2a-node bridges the two through the canonical\nproto3 JSON representation (see `src/conversions.ts`), so message shapes, enums,\noneofs, and bytes all round-trip faithfully with no hand-written field mapping.\n\n```\n@a2a-js/sdk (ts-proto)  <-- proto3 JSON bridge -->  protobuf-es  <-- slimrpc -->  SLIM\n```\n\n## Requirements\n\n- Node.js >= 18, native ESM.\n- To regenerate stubs only: [`buf`](https://buf.build/docs/cli/installation/) and\n  the `protoc-gen-slimrpc-node` plugin on `PATH`:\n\n  ```sh\n  cargo install --locked --version 2.0.1 agntcy-protoc-slimrpc-plugin --bin protoc-gen-slimrpc-node\n  ```\n\n  The committed stubs under `src/types/v1/` are generated with the 2.0 line of\n  the plugin, matching `@agntcy/slim-bindings` 2.0.\n\n## Install\n\n```sh\nnpm install\n```\n\nPulls `@agntcy/slim-bindings` and the matching native platform package for your\nOS/arch from npm automatically.\n\n## Usage\n\n### Server\n\n```ts\nimport { AgentCard } from '@a2a-js/sdk';\nimport { DefaultRequestHandler, InMemoryTaskStore } from '@a2a-js/sdk/server';\nimport {\n  registerSlimA2AHandler,\n  setupSlimClient,\n  slim,\n  SRPCHandler,\n} from '@agntcy/slim-a2a';\n\nconst agentCard = AgentCard.fromJSON({\n  name: 'My Agent',\n  version: '1.0.0',\n  capabilities: { streaming: true },\n  supportedInterfaces: [\n    { url: 'agntcy/demo/my_agent', protocolBinding: 'slimrpc', protocolVersion: '1.0' },\n  ],\n  // ...skills, input/output modes\n});\n\nconst requestHandler = new DefaultRequestHandler(\n  agentCard,\n  new InMemoryTaskStore(),\n  new MyAgentExecutor(), // your AgentExecutor\n);\n\nconst { app, name, connId } = await setupSlimClient('agntcy', 'demo', 'my_agent');\nconst server = slim.Server.newWithConnection(app, name, connId);\nregisterSlimA2AHandler(server, new SRPCHandler(agentCard, requestHandler));\nawait server.serveAsync();\n```\n\n### Client\n\n```ts\nimport { setupSlimClient, createSlimClient } from '@agntcy/slim-a2a';\nimport { SendMessageRequest } from '@a2a-js/sdk';\n\nconst { app, connId } = await setupSlimClient('agntcy', 'demo', 'client');\nconst client = await createSlimClient(app, connId, agentCard); // A2A SDK Client\n\nconst request = SendMessageRequest.fromJSON({\n  message: { messageId: crypto.randomUUID(), role: 'ROLE_USER', parts: [{ text: 'hello' }] },\n});\nconst result = await client.sendMessage(request); // Message | Task\n```\n\n`createSlimClient` uses the SDK's `ClientFactory` under the hood, selecting the\n`slimrpc` transport from the agent card's declared interfaces. For manual wiring,\nregister `SRPCTransportFactory` yourself:\n\n```ts\nimport { ClientFactory } from '@a2a-js/sdk/client';\nimport { SRPCTransportFactory } from '@agntcy/slim-a2a';\n\nconst factory = new ClientFactory({ transports: [new SRPCTransportFactory(app, connId)] });\nconst client = await factory.createFromAgentCard(agentCard);\n```\n\nSLIM names are the 3-tuple `organization/namespace/app`; the agent card's slimrpc\n`AgentInterface.url` carries that name.\n\n### Multicast\n\n`SRPCMulticastClient` queries several agents over a SLIM group channel, yielding\n`{ source, response }` per responding member — see `src/clientTransport.ts`.\n\n### The `slim` namespace\n\n`slim` re-exports the `@agntcy/slim-bindings` 2.0 runtime — `Name`, `Service`,\n`App`, `Channel`, `Server`, `RpcError`, the config helpers — for the parts this\nSDK does not wrap. Bindings 2.0 split the slimrpc API into a second UniFFI\nnamespace (`slim_rpc`) that the package's type entry point does not re-export,\nso importing `Channel`/`Server`/`ContextLike` straight from\n`@agntcy/slim-bindings` does not typecheck; `slim` stitches both namespaces back\ntogether (see `src/slimBindings.ts`).\n\n## Example\n\nA runnable echo agent lives in [`examples/echo-agent`](examples/echo-agent/):\n\n```sh\nnpm run example:server -- --name echo_agent   # terminal 1\nnpm run example:client -- --text \"hello slim\"  # terminal 2\n```\n\n## Scripts\n\n| Script | Description |\n| --- | --- |\n| `npm run generate`  | Regenerate the A2A v1.0.0 protobuf-es + slimrpc stubs (`buf`). |\n| `npm run build`     | Type-check and emit the ESM build to `dist/`. |\n| `npm run typecheck` | Type-check the whole project. |\n| `npm test`          | Run the vitest suite (unit + end-to-end round-trip). |\n| `npm run format`    | Format sources with prettier. |\n\nA `Taskfile.yaml` mirrors these (`task generate`, `task build`, `task test`, …).\n\n## Continuous integration\n\n[`.github/workflows/ci.yaml`](.github/workflows/ci.yaml) runs on pushes and PRs to\n`main`:\n\n- **format** — Prettier check (standalone; no project install).\n- **codegen** — regenerates the stubs with the published slimrpc plugin and fails\n  on drift from what's committed.\n- **build-and-test** — type-check, build, and test on Node 18/20/22.\n\n## Releasing\n\n[`.github/workflows/release.yaml`](.github/workflows/release.yaml) publishes to\nnpm on a version tag. Push a tag matching `v<version>`:\n\n```sh\ngit tag v0.1.0          # -> published as @latest\ngit tag v0.1.0-alpha.1  # -> published as @alpha\ngit push origin --tags\n```\n\nThe package version is taken from the tag; the npm dist-tag is derived from any\nprerelease id (`alpha`/`beta`/`rc`/… → that tag, plain version → `latest`).\n\nPublishing uses **npm Trusted Publishing (OIDC)** — no `NPM_TOKEN` secret.\nOne-time setup on npmjs.com: the `@agntcy/slim-a2a` package → Settings → Trusted\npublishing → set Repository to this repo and Workflow filename to `release.yaml`.\n\n## Proto version scope\n\nShips **A2A v1.0.0** (`git a2aproject/A2A@v1.0.0`, subdir `specification`).\nv0.3 wire compatibility is a planned follow-up (the SDK exposes `@a2a-js/sdk/compat/v0_3`).\n\n## License\n\nApache-2.0. See [LICENSE](LICENSE).\n","readmeFilename":"README.md","homepage":"https://github.com/agntcy/slim-a2a-node#readme","repository":{"type":"git","url":"git+https://github.com/agntcy/slim-a2a-node.git"},"bugs":{"url":"https://github.com/agntcy/slim-a2a-node/issues"}}