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

@xiaoqiong0v0/opencode-playwright-tool

v1.0.1

Published

opencode Playwright 浏览器工具插件,提供浏览器操控 + 零注入视觉元素选取面板

Readme

opencode-playwright-tool

opencode 插件:通过独立 Node 服务管理 Playwright 浏览器,提供 32+ 个浏览器自动化工具。

安装

// opencode.json
{
  "plugin": ["@xiaoqiong0v0/opencode-playwright-tool"]
}

配置

配置文件:~/.config/opencode/playwright-tool.jsonc(首次运行自动生成)

{
  "panelLang": "zh",
  "toolLang": "en",
  "sessionIsolation": false,
  "browserType": "chromium",
  "browsersPath": "D:/browsers"
}

项目级配置放 <项目根目录>/playwright-tool.jsonc,会覆盖全局。

环境变量(优先级最高):

  • PW_LANG — 同时设置 panelLang 和 toolLang
  • PW_BROWSERS_PATH — 浏览器缓存目录
  • PW_NODE_PATH — Node.js 路径

架构

opencode(Bun)
  └─ spawn("node", ["service/index.js"]) → HTTP 127.0.0.1:PORT
       └─ Playwright(chromium / firefox / webkit)

插件启动时 spawn 一个独立 Node 子进程运行 Playwright,所有工具调用通过 POST http://127.0.0.1:PORT/api/{command} 通信。多层 proxy 和 IPC 转发的历史问题已彻底消除。

工具

| 类别 | 工具 | |------|------| | 导航 | pw_navigate(可带 browserType 切换 chromium/firefox/webkit), pw_go_back, pw_go_forward, pw_reload, pw_close | | 交互 | pw_click, pw_fill, pw_clear, pw_select, pw_hover, pw_drag, pw_press_key, pw_upload_file | | iframe | pw_iframe_click, pw_iframe_fill | | 标签页 | pw_list_tabs, pw_switch_tab, pw_new_tab, pw_close_tab, pw_click_and_switch_tab | | 信息 | pw_screenshot, pw_evaluate, pw_get_visible_text, pw_get_visible_html, pw_console_logs, pw_get_browser_status, pw_get_element_state, pw_get_dropdown_options, pw_list_records | | 滚动/等待 | pw_scroll, pw_scroll_to_element, pw_wait_for_selector, pw_resize | | 网络 | pw_expect_response, pw_assert_response | | 其他 | pw_save_as_pdf, pw_custom_user_agent, pw_select_user_agent, pw_show_notification, pw_read_record_content |

浏览器切换

pw_navigate 支持 browserType 参数,调用时动态切换浏览器引擎:

用 chromium 打开 https://example.com
换成 firefox 打开 https://mozilla.org

批注面板

右下角 ✦ 按钮打开 Magic Panel:

  • 批注模式 — 悬停高亮元素,点击添加批注
  • 截图工具 — 框选区域,添加说明
  • 发送全部 → 数据推送到 opencode 对话

手动关闭检测

关闭 Chrome 窗口或结束进程后,非导航工具立即返回 "Browser was closed manually", 阻止 LLM 继续操作。pw_navigate 可重新打开浏览器恢复正常使用。

多会话

父子会话共享一个浏览器。开启 sessionIsolation: true 后,每个 opencode 会话有独立 BrowserContext(cookies/存储隔离)。

发布

npm publish

只发布 dist/ 目录(files: ["dist"]),package.jsonREADME.md 等默认文件自动包含。

开发

npm install
npm run build
npm run open