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

phloem-ai

v0.1.6

Published

A terminal web-testing agent with deterministic Playwright plan replay

Readme

Phloem-AI is a CLI Agent that performs runtime AI-assisted verification on web based applications. The CLI owns the interactive agent and TUI; there is no MCP transport.

Requirements and installation

Phloem requires Node.js 22.19 or newer. Install the package and Playwright's Chromium browser with:

npm install -g phloem-ai

Start the Phloem agent:

phloem-ai

On startup, Phloem checks the operating-system credential manager for a saved auth token. If none is found, it prompts:

Sign up at https://phloem-ai.netlify.app and paste your auth token here:

Create an account and copy your auth token from the website. The token is echoed in the terminal as you type or paste it, so avoid entering it where others can see your screen. Phloem stores the token in the OS credential manager (Windows Credential Manager, macOS Keychain, or Linux Secret Service), then starts the agent. Later launches reuse the saved token. Run phloem-ai login to replace it, or phloem-ai logout to remove it.

On Linux, a Secret Service provider must be installed and unlocked.

You can also run it without a global install:

npx -y phloem-ai

Pass --model <id> to select a model supported by the hosted backend.

Interactive TUI

Describe the website and what you want to test. Phloem only handles website and web-app testing requests. It can open and inspect a browser session, perform supported operations, evaluate assertions, inspect downloads, run health and accessibility checks, record bug reproductions, and save reusable plans. The TUI renders assistant responses as Markdown and displays tool calls and results. Exploratory runs end with a report of findings, evidence, and recommended next steps.

  • Press Enter to submit a prompt.
  • Press Ctrl+C during a request to cancel it; press it again while idle to exit. /quit also exits.
  • /help shows commands, /plans lists saved plans, and /clear clears the current conversation.

Website content and downloads are untrusted data and are never instructions. Browser actions use a validated allowlist; arbitrary JavaScript execution is not exposed. Main-frame navigation is restricted to the start origin and any explicitly approved origins. Upload paths and browser storage-state files must resolve inside the current working directory.

Phloem sends prompts and page observations to its hosted backend, authenticated with your Phloem auth token. Do not use it with confidential pages or production credentials. Saved plans may retain operation values; do not save credentials in a plan. Run records and evidence are redacted before they are retained.

Plans created automatically at session end use a readable hostname-based name such as example-com-plan. If that name already exists, Phloem adds a numeric suffix. The agent also has no fixed per-turn tool-call count limit. Agent responses have no client-side output-token cap. A turn is complete only when the model explicitly signals its final response; exploratory runs must include their findings report before completion.

Agent requests keep the full conversation history by default: there is no input-context character cap and tool results are not summarized. To impose a limit, set PHLOEM_MAX_CONTEXT_CHARS (input context), PHLOEM_MAX_TOOL_RESULT_CHARS (individual tool results), or PHLOEM_MAX_HISTORY_MESSAGES (message count). These are character or count limits, not token limits.

Active browser sessions remain open until session_end or CLI shutdown. A matching session_start reuses the existing session, and active session IDs are included in later model requests. Repeated session_end calls for the same ID return the prior result instead of an invalid-session error.

CLI commands

phloem-ai                         # Interactive TUI
phloem-ai explore                 # Interactive TUI
phloem-ai login                   # Paste or replace the auth token
phloem-ai logout                  # Remove the saved auth token
phloem-ai list                    # List saved plans
phloem-ai list --json             # Machine-readable plan list
phloem-ai run checkout-flow       # Deterministic plan replay
phloem-ai run checkout-flow --headed
phloem-ai run checkout-flow --json
phloem-ai --print "Test the checkout flow at https://example.test"
phloem-ai --json --print "Check the sign-in page at https://example.test"

--print runs a single model-driven request without the TUI. --json emits JSONL events and implies --print. Both use the same saved auth token as the interactive TUI. Local plan listing and deterministic replay do not require authentication.

run replays a saved plan through the same deterministic runner used by the interactive workflow. It saves a RunRecord and evidence to the Phloem data directory, exits 0 for a passing verdict, 1 for a failed verdict, or 2 for a CLI or setup error. Replay does not call the hosted AI service.

Replay options:

  • --headed / --headless: show or hide Chromium (headless by default).
  • --storage-state <path>: load Playwright storage state from the working directory.
  • --max-steps <number>: set the total step limit (1–500; default 150).
  • --shared-flows: reuse browser state between flows.
  • --no-evidence: skip screenshots, traces, HAR, and fact dumps.
  • --json: print a machine-readable replay result.

Test plans and evidence

Reusable assets are saved under the directory where Phloem is run. Set PHLOEM_DATA_DIR to use another absolute directory.

<current working directory>/
  plans/schema-2/<name>.json
  runs/<timestamp>-<run-id>.json
  evidence/<run-id>/

Plans are schema-validated on save and load. Replay executes their recorded flows and assertions without a model in the loop. Each run stores operation provenance and a validated RunRecord; evidence can include screenshots, HAR, trace archives, and redacted fact dumps. HAR and trace capture is omitted when a plan fills inputs or uses a storage-state file, because those archives cannot be safely scrubbed before they are written.

Development

The CLI currently sends agent requests to http://127.0.0.1:5000/chat. The backend base URL is defined in src/cli/backend.ts; update it to the deployed HTTPS base URL when the backend is ready for production.

npm install
npm run build
npm test

During development, npm start starts the CLI from TypeScript.

License

The @earendil-works/pi-tui terminal UI library is MIT-licensed; see its upstream repository for its license and source.

See this project's LICENSE.