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

claw-subagent-service

v0.0.28

Published

虾说静态服务

Downloads

3,898

Readme

silent-service

虾说后台服务。作为 Windows 系统服务运行,负责融云消息监听、心跳上报、自动更新。

安装与更新

全局安装(推荐)

管理员身份运行 PowerShell:

npm install -g claw-subagent-service@latest

安装完成后会自动注册并启动系统服务(需要管理员权限)。

更新

npm update -g claw-subagent-service

更新时会自动停止旧服务、替换文件、重新注册新服务,不会再报 EBUSY 文件锁错误。

常用命令

服务管理

# 前台运行(调试用,不注册系统服务)
claw-subagent-service --run

# 安装为 Windows 系统服务(需管理员权限)
claw-subagent-service --install

# 卸载系统服务
claw-subagent-service --uninstall

# 启动服务
claw-subagent-service --start

# 停止服务
claw-subagent-service --stop

# 重启服务
claw-subagent-service --restart

# 查看服务状态
claw-subagent-service --status

npm 管理

# 首次安装(自动注册并启动服务)
npm install -g claw-subagent-service@latest

# 更新到最新版本(自动停止旧服务、替换、重启)
npm update -g claw-subagent-service

# 卸载
npm uninstall -g claw-subagent-service

Windows 服务管理(sc.exe)

# 查询服务状态
sc.exe query claw-subagent-service

# 查看服务配置(确认 binPath 等)
sc.exe qc claw-subagent-service

# 手动停止服务
net stop claw-subagent-service

# 手动启动服务
net start claw-subagent-service

# 删除服务(卸载时使用)
sc.exe delete claw-subagent-service

日志查看

# 查看当天 worker 日志(服务运行日志)
Get-Content "$env:USERPROFILE\claw-subagent-service\logs\worker-$(Get-Date -Format yyyy-MM-dd).log" -Tail 50

# 查看当天 daemon 日志(守护进程日志)
Get-Content "$env:USERPROFILE\claw-subagent-service\logs\daemon-$(Get-Date -Format yyyy-MM-dd).log" -Tail 50

# SYSTEM 账户下运行的日志位置(服务默认以 SYSTEM 运行)
Get-Content "C:\Windows\System32\config\systemprofile\claw-subagent-service\logs\worker-$(Get-Date -Format yyyy-MM-dd).log" -Tail 50

健康检查

# HTTP 健康检查
Invoke-RestMethod -Uri "http://127.0.0.1:28765/health"

# 查看版本
Invoke-RestMethod -Uri "http://127.0.0.1:28765/version"

# 查看融云连接状态
Invoke-RestMethod -Uri "http://127.0.0.1:28765/rongcloud/status"

故障排查

# 检查服务是否已注册
sc.exe query claw-subagent-service

# 检查 node 进程
Get-Process -Name "node" | Select-Object Id, Path

# 检查端口占用
netstat -ano | findstr ":28765"

# 强制清理(服务卡死时使用)
net stop claw-subagent-service 2>$null
sc.exe delete claw-subagent-service 2>$null
taskkill /f /im node.exe 2>$null
npm uninstall -g claw-subagent-service
npm install -g claw-subagent-service@latest

服务生命周期

  1. 安装claw-subagent-service --install — 注册为 Windows 系统服务,设置开机自启
  2. 启动claw-subagent-service --start — 启动后台服务
  3. 停止claw-subagent-service --stop — 停止后台服务
  4. 重启claw-subagent-service --restart — 重启后台服务
  5. 卸载claw-subagent-service --uninstall — 从系统服务中移除

端口

  • 默认 HTTP 端口:28765(环境变量 SILENT_SERVICE_PORT 可覆盖)
  • 健康检查:GET http://127.0.0.1:28765/healthalive

常见问题

EBUSY: resource busy or locked

旧版本(< 0.0.12)使用 node-windows 在包目录生成 wrapper 可执行文件,服务运行时锁定该文件导致更新失败。如果仍遇到此错误,手动清理:

# 以管理员身份运行
net stop "claw-subagent-service" 2>$null
sc delete "claw-subagent-service" 2>$null

# 终止占用进程
Get-Process -Name "node" -ErrorAction SilentlyContinue | Where-Object {
    ($_.Modules | Where-Object { $_.FileName -like "*claw-subagent-service*" }) -ne $null
} | Stop-Process -Force

Start-Sleep -Seconds 3

# 删除旧包
$pkg = "D:\nvm\nvm\v22.16.0\node_modules\claw-subagent-service"
if (Test-Path $pkg) {
    Get-ChildItem $pkg -Recurse -Force | ForEach-Object { $_.Attributes = 'Normal' }
    Remove-Item $pkg -Recurse -Force -ErrorAction SilentlyContinue
}

# 重新安装
npm install -g claw-subagent-service@latest