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 🙏

© 2025 – Pkg Stats / Ryan Hefner

@autifyhq/muon-sdk

v0.0.3

Published

AI-powered test automation SDK for Playwright

Readme

@autifyhq/muon-sdk

AI-powered Playwright agent for writing end-to-end tests in natural language. You describe what to do; the agent operates the browser via Playwright.

What it does

The SDK connects your Playwright test to a Muon server. The server interprets your instruction and returns a sequence of tool calls (like running Playwright code, evaluating JavaScript, reading DOM) that the SDK executes on your page.

Requirements

  • Node.js >= 24.4.1
  • Playwright >= 1.50.0 (and browsers installed)

Install Playwright if you don't have it yet:

npm i -D playwright @playwright/test
npx playwright install

Install the SDK

npm i @autifyhq/muon-sdk

Configure environment

Export these variables (e.g., in your shell, CI, or a dotenv setup):

# Required: Muon server API key (sent as x-muon-api-key)
export MUON_API_KEY=your_api_key_here

# Optional (default: https://muon.autify.com)
export MUON_SERVER_URL=https://your-muon-server.com

# Optional: disable caching (enabled by default)
# Any of: 1/true/yes/on => disabled
export MUON_CACHE_DISABLED=1

Notes:

  • When MUON_SERVER_URL is omitted, the SDK uses https://muon.autify.com.
  • Cache files are stored under .muon/nlstep-cache/ in your project.

Quickstart

Use the ai step inside a Playwright test. It automatically wraps your action as a Playwright test.step using the task text (or a custom stepName). The function automatically fails the test if the AI task is unsuccessful.

import { test } from '@playwright/test';
import { ai } from '@autifyhq/muon-sdk';

test('AI-powered login', async ({ page }) => {
  await page.goto('https://example.com/login');

  await ai({
    task: 'Fill username "testuser", password "password123", then click "Log in"',
    page,
    timeout: 60_000,      // optional (default 180000)
    maxSteps: 50,         // optional (default 50)
    stepName: 'Login via AI', // optional
  });
});

Notes:

  • You can also call ai with positional parameters in the original order if you prefer.
  • If the AI task fails, the test automatically fails with detailed error information.

Caching

The agent caches successful tool call sequences to speed up repeat runs under similar conditions (task, URL, viewport, test title). Files are stored at .muon/nlstep-cache/.

  • Leave caching enabled by default for faster CI.
  • Disable globally by setting MUON_CACHE_DISABLED to any of: 1, true, yes, on (case-insensitive).
  • To clear, delete .muon/nlstep-cache/.

Troubleshooting

  • Missing API key: The SDK throws a clear error: missing MUON_API_KEY with reason and how to set it.
  • Invalid server URL: The SDK validates MUON_SERVER_URL and explains the reason if invalid.
  • Connection errors: The SDK surfaces network/connectivity reasons and hints (check reachability, proxy, TLS, DNS).
  • Long/unstable pages: Increase timeoutMs or allow more maxSteps.
  • Flaky runs with iframes or dynamic DOM: The agent gathers DOM and iframe snapshots but you can give more precise instructions (e.g., name the button text) to stabilize.

Example: robust submit step

await test.step('Submit via AI', async () => {
  await ai({ task: 'Click the primary "Submit" button and wait for confirmation', page, timeout: 90000, maxSteps: 80, stepName: 'Submit via AI' });
});