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

@hanyo_ai/pulse

v0.1.10

Published

Self-hosted AI gateway — OpenAI- and Anthropic-compatible, with audit logs, live dashboards, and per-token cost tracking. Powered by Bun.

Readme

⚡ PULSE

透视每个 AI Agent。实时会话可视化、调试与可观测性。

实时观看 Agent 对话展开 — system 提示词、user 消息、assistant 响应、tool_result 工具返回 — 在一个优雅的仪表盘中一览无余。基于 Bun 的自托管 AI 网关,兼容 OpenAI & Anthropic,内置费用追踪与审计日志。

Powered by Bun Built with Elysia TypeScript React 19

English · 演示 · 快速开始 · API · 部署


🎬 演示

PULSE 演示


✨ 为什么选择 PULSE


🚀 快速开始

需要 Bun >= 1.2

从 npm 安装(单用户/本地)

bun install -g @hanyo_ai/pulse
pulse run

打开 http://127.0.0.1:3000,无需登录 — 数据存储在 ~/.pulse/pulse.db。使用 pulse run --help 查看参数(--port--host--db-path--auth 启用登录页)。

随时更新到最新版本:

pulse update

从源码运行(开发模式)

git clone <your-repo-url>
cd pulse
bun install
bun run dev          # http://localhost:3000 (热更新)

使用 admin / admin123 登录,然后立即修改密码。

生产环境(自托管,多用户)

bun run build        # 打包前端 → ./dist
bun run start        # 提供 dist/ + API,端口 $PORT(默认 3000)

bun run start 需要 dist/ 目录存在。前端修改后需重新构建 — 生产分支提供的是打包后的静态资源,不是 src/


🔌 API 参考

PULSE 提供两类接口:网关代理(用于上游 LLM 调用)和 管理 API(用于仪表盘)。

网关代理(对外)

OpenAI 兼容:

POST /v1/chat/completions
Authorization: Bearer <gateway_key>

{
  "model": "gpt-4o",
  "messages": [{"role": "user", "content": "你好!"}],
  "stream": true
}

Anthropic 兼容:

POST /anthropic/v1/messages
x-api-key: <gateway_key>

{
  "model": "claude-sonnet-4-6",
  "messages": [{"role": "user", "content": "你好!"}],
  "stream": true
}

管理 API(内部)

| 方法 | 端点 | 描述 | |--------|----------|-------------| | POST | /api/auth/login · logout · register · change-password | 认证流程 | | GET | /api/auth/me | 当前用户 | | GET / POST / PUT / DELETE | /api/auth/users[/:id] | 用户管理(管理员) | | GET / POST / PUT / DELETE | /api/sessions[/:id] | 会话 CRUD | | GET | /api/sessions/:id/messages | 会话消息 | | GET / POST / PUT / DELETE | /api/endpoints[/:id] | 提供商端点 CRUD | | POST | /api/endpoints/test | 测试端点配置(不保存) | | GET | /api/logs?provider=…&status=… | 按条件查询审计日志 | | GET | /api/usage/stats · by-model · trend | 用量分析 | | GET | /api/health | 服务健康检查 |


🏗️ 技术栈

| 层级 | 技术 | |------------|-------------------------------| | 运行时 | Bun 1.2+ | | 框架 | Elysia | | 数据库 | SQLite (bun:sqlite) | | 前端 | React 19 + TypeScript | | 认证 | bcrypt + JWT |


⚙️ 配置

| 变量 | 默认值 | 描述 | |----------|---------|-------------| | NODE_ENV | — | 设为 production 启用生产模式 | | PORT | 3000 | 服务器监听端口 | | HOST | 0.0.0.0 | 绑定地址(pulse run 默认为 127.0.0.1) | | DB_PATH | pulse.db | SQLite 数据库文件路径 | | PULSE_NO_AUTH | — | 设为 1 禁用登录(单用户/本地安装) |

在仪表盘的端点选项卡中配置上游提供商:上游 URL、上游 API Key、网关 Key(客户端发送的密钥)、默认模型以及每百万 Token 的定价。

⚠️ 不要在 bunfig.toml[define] 表中放入 process.env.NODE_ENV Bun 在运行时和打包时都会应用 [define],所以像 "process.env.NODE_ENV" = "\"development\"" 这行会在 systemd/shell 设置 NODE_ENV=production 时静默覆盖它,导致服务器处于开发模式。如果只需要在打包时强制使用开发模式,请在 bun build 命令行中传入 --define