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

@coralwisdom/anybuilder

v0.1.24

Published

anybuilder daemon CLI cross-platform distribution

Readme

anybuilder 守护进程项目

基于 Go 语言实现的客户端守护进程与命令行工具。参考了 mature 守护进程的脱离终端自拉起、跨平台会话隔离、日志大小滚动轮转、本地 HTTP 探活、防重入以及平台身份鉴权体系。

编译生成的主二进制命令为 anybuilder。

目录结构

.
├── cmd/
│   └── anybuilder/
│       ├── main.go               # 命令根入口,注册 daemon / login / auth / version
│       ├── cmd_daemon.go         # 守护进程 start/stop/restart/status/logs 核心实现
│       ├── cmd_daemon_unix.go    # Unix/macOS 平台系统适配 (Setsid 终端会话脱离)
│       ├── cmd_daemon_windows.go # Windows 平台适配 (进程组与退出处理)
│       ├── cmd_login.go          # 支持浏览器 OAuth 回调换 Token 与 Token 凭证直接登录
│       ├── cmd_auth.go           # auth status 与 auth logout 凭证管理
│       └── cmd_version.go        # 版本信息输出
├── internal/
│   ├── auth/                     # JWT 解析、BFF 换 Token 接口与浏览器唤醒
│   ├── config/                   # 目录与配置持久化 (~/.anybuilder/config.json)
│   ├── daemon/                   # 本地 HTTP 探活服务 (/health) 与主调度循环
│   ├── logger/                   # 基于 slog 与 lumberjack 的大小轮转日志
│   └── version/                  # 编译构建元信息
├── Makefile                      # 编译与构建脚本
└── go.mod                        # Go 模块文件

快速开始

1. 编译构建

make build
# 编译产物位于 bin/anybuilder

2. 身份认证与登录

守护进程使用 AI Agent API Key 登录。CLI 通过 YeeAuth 的 POST /api/v1/ai-agents/access-token 将 API Key 和 Secret 换取短期 Access Token,并将 API Key 凭证以用户私有权限保存到 ~/.anybuilder/config.json。

# 显式传入 API Key 与 Secret
./bin/anybuilder login --api-key "<KEY_ID>" --api-secret "<KEY_SECRET>"

# 交互式输入 API Key 与 Secret
./bin/anybuilder login

--auth-url 可用于指定非默认 YeeAuth 地址。

凭证管理与自动续期

# 查看当前登录状态与有效时长
./bin/anybuilder auth status
./bin/anybuilder auth status --json

# 手动使用已保存的 API Key 重新签发 Access Token
./bin/anybuilder auth refresh

# 退出登录并清理本地凭证
./bin/anybuilder auth logout

平滑续期机制:守护进程在后台运行时,会自动启动后台巡检协程(默认每 5 分钟检查一次)。若发现 Access Token 有效期剩余小于 30 分钟,会使用已保存的 API Key 和 Secret 重新签发,并写回本地配置;同时在建立 WebSocket 长连接前也会自动检测并确保凭证新鲜。

3. 守护进程管理

# 启动守护进程(已登录环境下,后台脱离终端运行)
./bin/anybuilder daemon start

# 前台调试启动(实时控制台日志)
./bin/anybuilder daemon start --foreground

# 查看守护进程运行状态(PID、运行时长、探针地址)
./bin/anybuilder daemon status
./bin/anybuilder daemon status --json

# 查看守护进程运行日志
./bin/anybuilder daemon logs
./bin/anybuilder daemon logs -f -n 50

# 重启守护进程
./bin/anybuilder daemon restart

# 优雅停止守护进程
./bin/anybuilder daemon stop

AI 指挥的真实浏览器测试

frontend:playwright 的 route-only 请求默认进入 AI 指挥模式。守护进程会在宿主机启动真实 Chromium,先执行 page.goto(..., { waitUntil: 'networkidle' }),再将当前可见的输入框、按钮、链接、页面文本、截图路径、console error 和 HTTP 4xx/5xx 交给本机 AI CLI。AI 每轮只能选择一次受约束工具调用(fill、click、站内 navigate、screenshot 或 finish),最多执行 5 轮。

可选请求字段:

  • ai_driven:显式启用或关闭;带固定 steps 的请求默认仍使用确定性执行器。
  • ai_instruction:本次业务目标,例如“使用测试账号登录并确认进入工作台”。
  • ai_test_data:允许 AI 使用的测试数据键值;不要传入生产凭证。
  • max_ai_rounds:探索轮数,上限固定为 5。

结果除真实截图、最终 URL、console/network 异常外,还包含 executed_steps 与 ai_diagnostics.summary。浏览器上下文始终在 Node 驱动脚本的 finally 中关闭。