npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@agent-anvil-platform/plugin-runtime

v0.7.0

Published

agent-anvil Platform 插件运行期适配器:ws 生命周期客户端(5 消息)+ MCP/A2A server 装配 + manifest 生成器(FR-5.6)

Readme

@agent-anvil/plugin-runtime

agent-anvil Platform 插件运行期适配器(TypeScript ESM,FR-5.6 Node 适配器)。

提供四类能力:

  • WsLifecycleClient:宿主与插件子进程之间的 ws 生命周期客户端。状态机 DISCONNECTED → REGISTERING → INITIALIZED → READY → ERROR,收发 5 消息 (register / initialize / ready / heartbeat / policy.update), 心跳默认 30s、断连宽限默认 5s 自动重连(close() 主动关闭不重连), 会话 token 替换 bootstrap、policy.update.updates.sessionToken 轮换。
  • McpServerAssembler:基于官方 @modelcontextprotocol/sdk 的 Streamable HTTP 装配,只注册 manifest tools 节声明的工具(全名 plugin:{code}:{domain}:{action}), 未声明注册抛 ToolNotDeclaredError。
  • A2aServerAssembler:基于官方 @a2a-js/sdk 装配 A2A Agent(Agent Card + task 处理),并把 POST|GET /a2a 接入数据面。
  • ManifestGenerator:manifest.json 生成器(schemaVersion 1.0),键序稳定、 仅输出非空节。
  • DataPlaneServer:最小数据面绑定(Node http),POST /mcp / POST|GET /a2a 分发,传输可注入(测试用 mock,不起真端口)。

安装

npm install @agent-anvil/plugin-runtime

运行期依赖:ws、@modelcontextprotocol/sdk、@a2a-js/sdk(Node >= 20)。

快速使用

import { WsLifecycleClient, generateManifest } from '@agent-anvil/plugin-runtime';

const client = new WsLifecycleClient();
client.onInitialize((msg) => {
  console.log('initialized', msg.pluginId, msg.sessionToken);
});
client.connect('wss://host/lifecycle', 'bootstrap-token');
client.register({
  manifest: { code: 'demo', version: '1.0.0', schemaVersion: '1.0' },
  authToken: 'bootstrap-token',
});

开发

npm run typecheck   # tsc --noEmit
npm run build       # tsc
npm test            # jest(约 30 例)

License

Apache-2.0