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

@baichuan-os/plugin-sdk

v0.1.1

Published

Baichuan OS plugin SDK types and development bridge

Downloads

331

Readme

@baichuan-os/plugin-sdk

百川 OS 插件 SDK 的内部 npm 包。

这个包提供:

  • SDK 类型定义
  • 插件开发期 bridge 工厂
  • 全局 baiChuanSDK 类型声明

真实机器人能力由百川 OS 宿主内部实现并注入到插件运行环境。

插件调试 Host Bridge

百川 OS 插件调试页会向插件页面注入 window.__baichuanPluginHost,用于插件主动向宿主上报加载状态、日志和错误。

window.__baichuanPluginHost?.ready({
  pluginId: 'baichuan-os-battery-plugin',
  pluginVersion: '0.1.0',
  sdkVersion: '0.1.1',
  entryName: 'main',
});

window.__baichuanPluginHost?.status({
  level: 'success',
  stage: 'battery-loaded',
  message: '电池状态读取成功',
});

window.__baichuanPluginHost?.error({
  stage: 'battery-load-failed',
  message: '读取电池状态失败',
});

建议插件在以下节点上报状态:

  1. 页面启动后,上报 booting
  2. 检测到宿主 bridge 后,上报 ready
  3. 业务数据加载成功后,上报对应 success 状态。
  4. SDK 注入失败、接口调用失败、渲染异常时,上报 error

发布到 npmjs.com 公网 registry

  1. 注册并登录 npm 账号。
  2. 确认 npm 账号或 npm organization 拥有 @baichuan-os 这个 scope。
  3. 执行 pnpm build,确认发布产物正常生成。
  4. 执行 npm pack --dry-run,确认包内只包含 distREADME.mdpackage.json
  5. 首次发布 scoped public package 时执行 pnpm publish --access public --no-git-checks

如果使用 token 发布,可以复制 .npmrc.example 为本地 .npmrc,并设置环境变量 NPM_TOKEN

安装方直接执行:

pnpm add @baichuan-os/[email protected]

如果 npm 上没有 @baichuan-os scope 权限,需要先创建对应 npm organization,或者把包名改成未被占用的公开包名。