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

page-agent-claw

v1.0.6

Published

Page Agent Dashboard - CLI tool to start the dashboard server

Readme

page-agent-claw

Page Agent Dashboard CLI - 将浏览器控制页面和 Node 服务整合为一个全局 CLI 命令。

功能

  • 启动一个集成的 Web 服务器,同时提供前端页面和后端 API
  • 前端页面:React 构建的 Dashboard 界面
  • 后端服务:Express + WebSocket,支持任务分发和结果收集
  • 自动打开浏览器访问页面

安装

本地调试

cd page-agent-claw
npm install
npm link

发布到 npm

npm publish
npm install -g page-agent-claw

使用

page-agent-claw

服务启动后会自动打开浏览器访问 http://localhost:4222

命令行选项

  • PORT 环境变量:指定服务器端口(默认 4222)
PORT=8080 page-agent-claw

API 端点

| 端点 | 方法 | 描述 | |------|------|------| | /health | GET | 健康检查 | | /api/task | POST | 提交任务 | | /api/clients | GET | 查看连接的客户端数 | | /api/status | GET | 状态监测 | | /proxy/:target | ALL | 代理请求(解决跨域) | | WebSocket | WS | 实时通信(端口 4222) |

POST /api/task

提交任务到已连接的客户端执行。

请求体:

{
  "task": "在当前页面执行某个操作",
  "metadata": { }
}

响应:

{
  "success": true,
  "taskId": "task_1234567890_abc",
  "result": {
    "success": true,
    "data": "执行结果",
    "history": []
  }
}

/api/status 状态码

| 状态码 | 含义 | |--------|------| | 100 | 仅 node 服务启动,无 WebSocket 连接(页面未打开) | | 105 | 有 WebSocket 连接,但 page-agent(扩展)未连接 | | 200 | 正常(WebSocket + page-agent 已连接) |

响应示例:

// 100 无连接
{"code":100,"message":"请打开 localhost:4222 页面","connectedNumber":0}

// 105 有连接但无 page-agent
{"code":105,"message":"page-agent 未连接","connectedNumber":1}

// 200 正常
{"code":200,"message":"正常","connectedNumber":1,"pageAgentCount":1}

项目结构

page-agent-claw/
├── src/
│   ├── server/
│   │   ├── index.ts           # 服务器入口
│   │   ├── types.ts           # 共享类型定义
│   │   ├── middleware/
│   │   │   └── proxy.ts       # 代理中间件
│   │   ├── routes/
│   │   │   └── task.ts        # API 路由
│   │   └── websocket/
│   │       ├── index.ts       # WebSocket 服务
│   │       └── types.ts       # WebSocket 类型
│   └── cli/index.ts           # CLI 入口
├── client/                    # 前端页面源码(React)
├── dist/                      # 构建输出
└── package.json

开发

# 安装依赖
npm install
cd client && npm install

# 开发模式
npm run dev

# 构建
npm run build