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

browrec

v0.1.0

Published

Record browser actions with LLM-assisted mode and replay fast without LLM

Readme

browrec

browrec は、ブラウザ操作を 記録(Record) し、学習/変換(Compile) して、LLMなしで高速実行(Run) するための npm CLI です。

  • 記録時: Playwright + (必要に応じて)ローカルLLM
  • 実行時: LLMを呼ばずに実行(HTTP優先、必要箇所のみPlaywright)

コンセプト

ブラウザ自動化を毎回LLMに依存すると遅くなるため、以下を分離します。

  1. Record(記憶)
  2. Compile(学習/変換)
  3. Run(高速実行)

この分離で、運用時は安定・低遅延を目指します。

フェーズ詳細

1. Record

  • ユーザーが通常どおりブラウザを操作
  • Playwrightイベントを raw.jsonl に保存
  • DOM特徴量(anchors)を保存
    • role/name, label, placeholder, nearbyText
    • selectorVariants(複数候補)
  • navigation時にHTMLスナップショットを保存
  • request/responseログも保存(CompileでHTTP化に使う)

2. Compile

  • 記録ログからレシピ(recipe.json相当)を生成
  • ローカルLLM(例: claude -p)で意図要約を生成可能
  • 各stepに mode: "http" | "pw" を付与
  • フォールバック情報(selector再探索・repair許可)を保存
  • 同名recipeは version をインクリメント

3. Run

  • レシピをLLMなしで実行
  • http stepを先に実行、pw stepは最小限で実行
  • selector候補を順番に試行
  • 失敗時は repair で差分更新

CLI

# 記録開始(GUIブラウザ)
browrec record <name> --url https://example.com

# 記録ログをrecipe化(必要ならローカルLLM使用)
browrec compile <name> --llm-command claude

# recipeを高速実行(LLMなし)
browrec run <name> --json

# 失敗再現用デバッグ(GUI + video)
browrec debug <name>

# 部分修復(version更新)
browrec repair <name>

# レシピ管理UIを起動
browrec ui --port 4312

ディレクトリ構成

recordings/
  <name>/
    raw.jsonl
    snapshots/*.html
recipes/
  <name>.recipe.json
artifacts/
  <name>/
public/
  index.html
src/
  commands/
  core/
  ui/

レシピモデル(要点)

  • steps[]
    • mode: http or pw
    • action: goto | click | fill | press | fetch | extract | ensure_login
    • selectorVariants[](複数候補)
    • guards[], effects[]
  • fallback
    • selectorReSearch
    • selectorVariants
    • allowRepair
  • version

開発

前提

  • Node.js 20+
  • Playwright実行可能環境
  • (任意)ローカルLLMコマンド: claude

セットアップ

npm install

品質チェック

npm run lint
npm run test
npm run build
  • Test: vitest
  • Lint/Format: biome

現在のMVP範囲

  • Record: click/input/navigation/request/response/console を記録
  • Compile: ヒューリスティック変換 + LLM要約(任意)
  • Run: HTTP先行 + Playwright再生
  • Repair: selector候補整理とversion更新
  • UI: recipe一覧/JSON編集/保存

今後の拡張候補

  • NetworkログからAPI自動抽出し、pw -> http 変換率を改善
  • guards/effects の実行時検証を強化
  • storageState/cookie jar連携によるログイン再利用
  • 失敗ステップ単位の差分パッチ生成(真の部分再学習)