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

@coralai/sps-plugin-api

v0.10.0

Published

sps 宿主半区的插件契约:ctx 上那些服务的方法签名。插件装它拿类型。

Readme

@coralai/sps-plugin-api

sps 宿主半区的插件契约:ctx 上那些服务的方法签名。

npm i -D @coralai/sps-plugin-api
import type { SpsPluginContext } from '@coralai/sps-plugin-api';

export const name = 'coral-plugin-x';
export const inject = ['sps.tools'];

export function apply(ctx: SpsPluginContext, config: { greeting?: string }) {
  ctx.effect(() =>            // 🔴 注册一定要放进 effect,否则停用时收不干净
    ctx['sps.tools'].register({
      name: 'my_tool',
      description: '给 agent 用的工具',
      inputSchema: { type: 'object', properties: {} },   // 标准 JSON Schema
      handler: async (args, session) => ({ content: [{ type: 'text', text: 'ok' }] }),
    }),
  );
}

这个包只声明插件会调的那一面。服务内部还有别的方法(注册表的 list() 之类), 不写进来 —— 写进来就等于承诺它们不变。

sps-cli 仓里有一道一致性判据钉着这份契约:实现与它对不上,sps-cli 自己的 check 会红

完整写法见 sps-cli 仓的 docs/guides/writing-plugins.md