{"_id":"@animalabs/mcpl-core","_rev":"6-9b17a472d8bfc20cdaf9b68c73e7adf5","name":"@animalabs/mcpl-core","dist-tags":{"latest":"0.3.0"},"versions":{"0.1.0":{"name":"@animalabs/mcpl-core","version":"0.1.0","license":"MIT","_id":"@animalabs/mcpl-core@0.1.0","maintainers":[{"name":"antra_tessera","email":"antra@animalabs.ai"},{"name":"luxiasl","email":"mail.luxia@gmail.com"},{"name":"antra-tessera","email":"antra@tesserae.cc"},{"name":"tengro","email":"tengro@gmail.com"},{"name":"anarchid","email":"annarhiid@proton.me"}],"homepage":"https://github.com/anima-research/mcpl-core-ts#readme","bugs":{"url":"https://github.com/anima-research/mcpl-core-ts/issues"},"dist":{"shasum":"abee8e9f0162cd87a516b136ed225dee40740918","tarball":"https://registry.npmjs.org/@animalabs/mcpl-core/-/mcpl-core-0.1.0.tgz","fileCount":27,"integrity":"sha512-V0d9/0K6yMamgThJi6pJtDt1tOGyBlZw88xF/RC7u7Bj42SNGxN7/n3Bx34DoanYcqOz5049iogqGRbTTi5tTg==","signatures":[{"sig":"MEYCIQDDMWkb/vwDmgGJVAfCEvpAUGwsARjX1+T1cEofFwAoJgIhALwoAjwXZSOL0ImLI64lYyGjWwLJ6yDDkyBmSDGIy7Pi","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":64723},"main":"./dist/src/index.js","type":"module","types":"./dist/src/index.d.ts","engines":{"node":">=20.0.0"},"gitHead":"0e5eacb878c5ebd00eb204948a6d608406db13be","scripts":{"test":"node --import tsx --test test/*.test.ts","build":"tsc","clean":"rm -rf dist","typecheck":"tsc --noEmit","prepublishOnly":"npm run clean && npm run build"},"_npmUser":{"name":"antra_tessera","email":"antra@animalabs.ai"},"repository":{"url":"git+https://github.com/anima-research/mcpl-core-ts.git","type":"git"},"_npmVersion":"10.8.2","description":"MCPL core: JSON-RPC connection, channels, push events, and capability types.","directories":{},"_nodeVersion":"20.20.2","publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"tsx":"^4.7.0","typescript":"^5.5.0","@types/node":"^20.0.0"},"_npmOperationalInternal":{"tmp":"tmp/mcpl-core_0.1.0_1781456764949_0.9202049712774141","host":"s3://npm-registry-packages-npm-production"}},"0.2.0":{"name":"@animalabs/mcpl-core","version":"0.2.0","license":"MIT","_id":"@animalabs/mcpl-core@0.2.0","maintainers":[{"name":"antra_tessera","email":"antra@animalabs.ai"},{"name":"luxiasl","email":"mail.luxia@gmail.com"},{"name":"antra-tessera","email":"antra@tesserae.cc"},{"name":"tengro","email":"tengro@gmail.com"},{"name":"anarchid","email":"annarhiid@proton.me"}],"homepage":"https://github.com/anima-research/mcpl-core-ts#readme","bugs":{"url":"https://github.com/anima-research/mcpl-core-ts/issues"},"dist":{"shasum":"79aee3c7b1b8d13383819945aced87a4cd624a51","tarball":"https://registry.npmjs.org/@animalabs/mcpl-core/-/mcpl-core-0.2.0.tgz","fileCount":31,"integrity":"sha512-n8ENEC6GmoJE1nWc4q7JLUnpB+Z/pz3O36XAMvkhgCAdRUwtlr3mKnPegZ52UZabK8gKDvWWDWYdZhVKPayQaw==","signatures":[{"sig":"MEQCIEHz+CUGB14IllMloSOhieiz9LHAjdO2fRegDEpkMAbHAiAXPs8tLvUL2kGLz/j+U8+h+eInomvU89WQzvgq+v+EwA==","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":75571},"main":"./dist/src/index.js","type":"module","types":"./dist/src/index.d.ts","engines":{"node":">=20.0.0"},"gitHead":"4aebf44f3aea9d8cfbe1736c06f6af4b72a9cda5","scripts":{"test":"node --import tsx --test test/*.test.ts","build":"tsc","clean":"rm -rf dist","typecheck":"tsc --noEmit","prepublishOnly":"npm run clean && npm run build"},"_npmUser":{"name":"luxiasl","email":"mail.luxia@gmail.com"},"repository":{"url":"git+https://github.com/anima-research/mcpl-core-ts.git","type":"git"},"_npmVersion":"10.9.3","description":"MCPL core: JSON-RPC connection, channels, push events, and capability types.","directories":{},"_nodeVersion":"22.20.0","publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"tsx":"^4.7.0","typescript":"^5.5.0","@types/node":"^20.0.0"},"_npmOperationalInternal":{"tmp":"tmp/mcpl-core_0.2.0_1783127045754_0.10595099584776602","host":"s3://npm-registry-packages-npm-production"}},"0.2.1":{"name":"@animalabs/mcpl-core","version":"0.2.1","license":"MIT","_id":"@animalabs/mcpl-core@0.2.1","maintainers":[{"name":"antra_tessera","email":"antra@animalabs.ai"},{"name":"luxiasl","email":"mail.luxia@gmail.com"},{"name":"antra-tessera","email":"antra@tesserae.cc"},{"name":"tengro","email":"tengro@gmail.com"},{"name":"anarchid","email":"annarhiid@proton.me"}],"homepage":"https://github.com/anima-research/mcpl-core-ts#readme","bugs":{"url":"https://github.com/anima-research/mcpl-core-ts/issues"},"dist":{"shasum":"b63aaf322d00214191440968682d35a213fa0968","tarball":"https://registry.npmjs.org/@animalabs/mcpl-core/-/mcpl-core-0.2.1.tgz","fileCount":31,"integrity":"sha512-Q3jx9kXr3OwwL0Xpsh49BVEzz+x4PIa+XiVot+eC/OQH2KjlNlmN/wvdu5YbVVWTAtFZS0/K6Zzwwb3Zu0NQLg==","signatures":[{"sig":"MEQCIB/A2F84nlfntQj+Ap0RtK6oyOWDCPb7osAReXbDnUFlAiAFL4RQ+Lh6DXKzUBqZBStnEZXxAg/IYMdvF26oHI5BOg==","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/@animalabs%2fmcpl-core@0.2.1","provenance":{"predicateType":"https://slsa.dev/provenance/v1"}},"unpackedSize":75571},"main":"./dist/src/index.js","type":"module","types":"./dist/src/index.d.ts","engines":{"node":">=20.0.0"},"gitHead":"c5f4275bf069753465646be318dfba1fd908eafb","scripts":{"test":"node --import tsx --test test/*.test.ts","build":"tsc","clean":"rm -rf dist","typecheck":"tsc --noEmit","prepublishOnly":"npm run clean && npm run build"},"_npmUser":{"name":"GitHub Actions","email":"npm-oidc-no-reply@github.com","trustedPublisher":{"id":"github","oidcConfigId":"oidc:173fae35-75cd-4059-928d-dadb3752d71f"}},"repository":{"url":"git+https://github.com/anima-research/mcpl-core-ts.git","type":"git"},"_npmVersion":"11.16.0","description":"MCPL core: JSON-RPC connection, channels, push events, and capability types.","directories":{},"_nodeVersion":"24.18.0","publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"tsx":"^4.7.0","typescript":"^5.5.0","@types/node":"^20.0.0"},"_npmOperationalInternal":{"tmp":"tmp/mcpl-core_0.2.1_1783994975074_0.6246057886027423","host":"s3://npm-registry-packages-npm-production"}},"0.2.2":{"name":"@animalabs/mcpl-core","version":"0.2.2","license":"MIT","_id":"@animalabs/mcpl-core@0.2.2","maintainers":[{"name":"antra_tessera","email":"antra@animalabs.ai"},{"name":"luxiasl","email":"mail.luxia@gmail.com"},{"name":"antra-tessera","email":"antra@tesserae.cc"},{"name":"tengro","email":"tengro@gmail.com"},{"name":"anarchid","email":"annarhiid@proton.me"}],"homepage":"https://github.com/anima-research/mcpl-core-ts#readme","bugs":{"url":"https://github.com/anima-research/mcpl-core-ts/issues"},"dist":{"shasum":"7270c658e9398a3d2b93089fa51b64dd075576b2","tarball":"https://registry.npmjs.org/@animalabs/mcpl-core/-/mcpl-core-0.2.2.tgz","fileCount":31,"integrity":"sha512-7vcw0g4KgsMyYIcNC5TRdhLCplY5s2381jWkowEtRdv6RNH5T/JFAbRYV/paGTAnHz5DKcqMRF9LBGlK4kULdw==","signatures":[{"sig":"MEYCIQDFs5tWnlP/WoEe52hJ5O6NaR6uoXEJlgWUcW1pxThXMAIhAJXiNFd9sAyX4xMFgeJe7a4q8DNdvAGZFAfxnBd0qUWM","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/@animalabs%2fmcpl-core@0.2.2","provenance":{"predicateType":"https://slsa.dev/provenance/v1"}},"unpackedSize":78861},"main":"./dist/src/index.js","type":"module","types":"./dist/src/index.d.ts","engines":{"node":">=20.0.0"},"gitHead":"0f1c289019b1f7ba4bf57fcc4e86f9e1dd0f35b2","scripts":{"test":"node --import tsx --test test/*.test.ts","build":"tsc","clean":"rm -rf dist","typecheck":"tsc --noEmit","prepublishOnly":"npm run clean && npm run build"},"_npmUser":{"name":"GitHub Actions","email":"npm-oidc-no-reply@github.com","trustedPublisher":{"id":"github","oidcConfigId":"oidc:173fae35-75cd-4059-928d-dadb3752d71f"}},"repository":{"url":"git+https://github.com/anima-research/mcpl-core-ts.git","type":"git"},"_npmVersion":"11.16.0","description":"MCPL core: JSON-RPC connection, channels, push events, and capability types.","directories":{},"_nodeVersion":"24.18.0","publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"tsx":"^4.7.0","typescript":"^5.5.0","@types/node":"^20.0.0"},"_npmOperationalInternal":{"tmp":"tmp/mcpl-core_0.2.2_1785194016291_0.5492164890062043","host":"s3://npm-registry-packages-npm-production"}},"0.3.0":{"name":"@animalabs/mcpl-core","version":"0.3.0","license":"MIT","_id":"@animalabs/mcpl-core@0.3.0","maintainers":[{"name":"antra_tessera","email":"antra@animalabs.ai"},{"name":"luxiasl","email":"mail.luxia@gmail.com"},{"name":"antra-tessera","email":"antra@tesserae.cc"},{"name":"tengro","email":"tengro@gmail.com"},{"name":"anarchid","email":"annarhiid@proton.me"}],"homepage":"https://github.com/anima-research/mcpl-core-ts#readme","bugs":{"url":"https://github.com/anima-research/mcpl-core-ts/issues"},"dist":{"shasum":"6246d7d17ddf7310378b6306e5c82d39b07313fc","tarball":"https://registry.npmjs.org/@animalabs/mcpl-core/-/mcpl-core-0.3.0.tgz","fileCount":35,"integrity":"sha512-9BEmfvVeutdQCfIv5sJNuMt/WGiwsBSJ5i5DVz2dxqtH1beuPKX/2CNk5n2OtZixUeUNDPakmLT86jLi8O42Yg==","signatures":[{"sig":"MEUCIA/DFIsAJhOuR4esOne451vgyz7X6h3jkQagYhrb0f8cAiEA9AJUj5/GogwzUeiIFKmCvQ3Rl8cZJ6xnxNrFILb8nho=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/@animalabs%2fmcpl-core@0.3.0","provenance":{"predicateType":"https://slsa.dev/provenance/v1"}},"unpackedSize":185836},"main":"./dist/src/index.js","type":"module","types":"./dist/src/index.d.ts","engines":{"node":">=20.0.0"},"gitHead":"d7084242e048e77e9eb8f174d1591833c5ae2f05","scripts":{"test":"node --import tsx --test test/*.test.ts","build":"tsc","clean":"rm -rf dist","typecheck":"tsc --noEmit","prepublishOnly":"npm run clean && npm run build"},"_npmUser":{"name":"GitHub Actions","email":"npm-oidc-no-reply@github.com","trustedPublisher":{"id":"github","oidcConfigId":"oidc:173fae35-75cd-4059-928d-dadb3752d71f"}},"repository":{"url":"git+https://github.com/anima-research/mcpl-core-ts.git","type":"git"},"_npmVersion":"11.17.0","description":"MCPL core: JSON-RPC connection, channels, push events, and capability types.","directories":{},"_nodeVersion":"24.19.0","publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"tsx":"^4.7.0","typescript":"^5.5.0","@types/node":"^20.0.0"},"_npmOperationalInternal":{"tmp":"tmp/mcpl-core_0.3.0_1787190112067_0.7783240714840467","host":"s3://npm-registry-packages-npm-production"}}},"time":{"created":"2026-06-14T17:06:04.763Z","modified":"2026-08-26T22:21:59.039Z","0.1.0":"2026-06-14T17:06:05.102Z","0.2.0":"2026-07-04T01:04:05.890Z","0.2.1":"2026-07-14T02:09:35.231Z","0.2.2":"2026-07-27T23:13:36.446Z","0.3.0":"2026-08-20T01:41:52.224Z"},"bugs":{"url":"https://github.com/anima-research/mcpl-core-ts/issues"},"license":"MIT","homepage":"https://github.com/anima-research/mcpl-core-ts#readme","repository":{"url":"git+https://github.com/anima-research/mcpl-core-ts.git","type":"git"},"description":"MCPL core: JSON-RPC connection, channels, push events, and capability types.","maintainers":[{"email":"antra@animalabs.ai","name":"antra_tessera"},{"email":"mail.luxia@gmail.com","name":"luxiasl"},{"email":"antra@tesserae.cc","name":"antra-tessera"},{"email":"tengro@gmail.com","name":"tengro"},{"email":"annarhiid@proton.me","name":"anarchid"},{"email":"aster@tesserae.cc","name":"meganeuridae"}],"readme":"# @animalabs/mcpl-core\n\n> Published on npm as **`@animalabs/mcpl-core`**. Inside the connectome\n> ecosystem it's consumed as a sibling source checkout under the\n> `@connectome/mcpl-core` dependency key (`file:../mcpl-core-ts`) — npm keys\n> `file:` deps by name, so both work side by side.\n\nTypeScript core for **MCPL** — an MCP-superset wire protocol that adds\nserver-initiated **push events**, **channels** (bidirectional, push-driven\nmessage streams), conversation **branches**, inference hooks, host-managed\nstate, and capability / feature-set negotiation on top of plain JSON-RPC.\n\nThis package is the shared, transport-agnostic core used across the connectome\nagents (relays, bridges, hosts). It contains no business logic — just the wire\ncontract and a connection primitive.\n\n## What's in here\n\n- **`McplConnection`** — a JSON-RPC 2.0 connection over a readable/writable\n  stream pair (`McplConnection.fromStreams(stdin, stdout)`), with a pull-based\n  `nextMessage()` for incoming requests/notifications and promise-based\n  `sendRequest()` / `sendResponse()` / `sendNotification()` / `sendError()`.\n- **`method`** — the method-name constants: `initialize`, `push/event`,\n  `channels/*` (`list`, `open`, `close`, `publish`, `changed`, …),\n  `branches/*`, `inference/*`, `state/*`, `model/info`, …\n- **Typed params/results** for every method (e.g. `ChannelDescriptor`,\n  `PushEventParams`, `ChannelsPublishParams`).\n- **Content blocks** — `ContentBlock` (`text` / `image` / `audio`) plus helpers\n  like `textContent(...)`.\n- **Capabilities & feature sets** — negotiation types (`InitializeCapabilities`,\n  `McplCapabilities`, `FeatureSetDeclaration`, context/inference hook caps), the\n  closed `CAPABILITY_PATHS` vocabulary (SPEC §6.2), the recursive advertisement\n  walk (`advertisedCapabilities`, §5.1), grant matching (`capabilityGranted`,\n  §5.4) and fail-closed `uses` validation (`validateUses`, §6.4).\n- **Manifest changes (§17 / RFC-003)** — `manifestDigest` (the canonical content\n  digest), `changedDomains`, and `ManifestTracker`: call `setManifest(next)` and\n  the digest, the diff, the per-connection `mcpl/manifestChanged` announcement\n  and the `mcpl/manifest` snapshot all follow. Servers never hand-author an\n  announcement.\n- **Errors** — `ConnectionClosedError`, `ConnectionTimeoutError`, and `ERR_*`\n  protocol error codes.\n\n## Capability advertisement is a tree, and absence is denial\n\n`channels`, `contextHooks.beforeInference` and `inferenceRequest` are **objects**\nwhose members are the leaves of the §6.2 vocabulary. A boolean `true` at any\nlevel is shorthand for every leaf beneath it; `false` or absence means none.\n\n```ts\nconst mcpl: McplCapabilities = {\n  version: '0.5',\n  channels: { register: true, publish: true, incoming: true, streaming: true },\n  contextHooks: {\n    beforeInference: { observe: false, inject: { beforeUser: true, afterUser: true } },\n  },\n};\n\nadvertisedCapabilities(mcpl);\n// Set { 'channels.register', 'channels.publish', 'channels.incoming',\n//       'channels.streaming',\n//       'contextHooks.beforeInference.inject.beforeUser',\n//       'contextHooks.beforeInference.inject.afterUser' }\n```\n\nThat is an **input to** the host's grant computation, never an authorization.\n`effectiveCapabilities` (§5.4) is the sole normative allowlist: every path not\npresent is denied. `deniedCapabilities` is diagnostics and MUST NOT reach an\nauthorization decision.\n\n## Conformance vectors\n\n`test/vectors/manifest-digest-vectors.json` is a verbatim copy of the frozen\ninterop vectors from\n[`anima-research/mcpl`](https://github.com/anima-research/mcpl)\n`conformance/manifest-digest-vectors.json`. It is not edited here — a vector\nbelieved wrong is an issue against that repo. Run a newer checkout with:\n\n```bash\nMCPL_DIGEST_VECTORS=/path/to/mcpl/conformance/manifest-digest-vectors.json npm test\n```\n\n## Install\n\n```bash\nnpm install @animalabs/mcpl-core\n```\n\n## Usage\n\n```ts\nimport { McplConnection, textContent, method } from '@animalabs/mcpl-core';\n\nconst conn = McplConnection.fromStreams(process.stdin, process.stdout);\n\nwhile (!conn.isClosed) {\n  const msg = await conn.nextMessage();\n  if (msg.type === 'request' && msg.request.method === 'tools/list') {\n    conn.sendResponse(msg.request.id, { tools: [] });\n  }\n}\n\n// server-initiated push:\nconn.sendNotification(method.PUSH_EVENT, { /* … */ });\n```\n\n## Build & test\n\n```bash\nnpm install\nnpm run build   # tsc → dist/\nnpm test\n```\n\n## License\n\nMIT — see [LICENSE](./LICENSE).\n","readmeFilename":"README.md"}