{"_id":"@autifyhq/muon-sdk","_rev":"8-f10076e48c2f1053da31f480fb75da3b","name":"@autifyhq/muon-sdk","dist-tags":{"latest":"0.0.3"},"versions":{"0.0.1":{"name":"@autifyhq/muon-sdk","version":"0.0.1","keywords":["playwright","automation","ai","testing","llm","test-automation","natural-language"],"author":{"name":"Autify","email":"developer@autify.com"},"_id":"@autifyhq/muon-sdk@0.0.1","maintainers":[{"name":"syamashita","email":"sota.yamashita@gmail.com"},{"name":"riywo","email":"me@riywo.com"},{"name":"autifyhq-release","email":"developer@autify.com"}],"homepage":"https://autify.com","dist":{"shasum":"dd66af8c9080bdafa4786c32c3391d19b2e58295","tarball":"https://registry.npmjs.org/@autifyhq/muon-sdk/-/muon-sdk-0.0.1.tgz","fileCount":26,"integrity":"sha512-RSj9qgcMpxgnl9OFCHkXP5AHbjGalMaslQ8rbiPOmKlV+eTSINQRBeFpkITZbH9sNUEFyQyzMQnyUSLtQP0PiQ==","signatures":[{"sig":"MEYCIQDz0oqTATrpL5NCpbUE7rE5s4ibKyLE6/URTlqHsY5AEAIhAMTYRWBGv7Cpm2vkAo7GFItlP0JQDJjuCDj158sj4dpR","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":69904},"main":"dist/index.js","type":"module","types":"dist/index.d.ts","engines":{"node":">=24.4.1"},"gitHead":"a5788bc0863c1612606013b938ffaf7325bd715c","scripts":{"dev":"tsc --watch","build":"tsc","clean":"rm -rf dist *.tgz","package":"npm pack","publish:dry":"npm publish --dry-run","prepublishOnly":"npm run build"},"_npmUser":{"name":"autifyhq-release","email":"developer@autify.com"},"_npmVersion":"10.9.2","description":"AI-powered test automation SDK for Playwright","directories":{},"_nodeVersion":"23.8.0","dependencies":{},"_hasShrinkwrap":false,"devDependencies":{"typescript":"^5.8.3","@types/node":"^24.1.0","@playwright/test":"^1.54.1"},"peerDependencies":{"playwright":">=1.50.0"},"_npmOperationalInternal":{"tmp":"tmp/muon-sdk_0.0.1_1754042291361_0.5526530108015146","host":"s3://npm-registry-packages-npm-production"}},"0.0.2":{"name":"@autifyhq/muon-sdk","version":"0.0.2","keywords":["playwright","automation","ai","testing","llm","test-automation","natural-language"],"author":{"name":"Autify","email":"developer@autify.com"},"_id":"@autifyhq/muon-sdk@0.0.2","maintainers":[{"name":"syamashita","email":"sota.yamashita@gmail.com"},{"name":"riywo","email":"me@riywo.com"},{"name":"autifyhq-release","email":"developer@autify.com"}],"homepage":"https://autify.com","dist":{"shasum":"69e239ac6e9523ce56818aca6c29f66be0308da3","tarball":"https://registry.npmjs.org/@autifyhq/muon-sdk/-/muon-sdk-0.0.2.tgz","fileCount":26,"integrity":"sha512-SY/zUWxogI5yZvl8rQwD8H35oX3M0z8WrFnbheMGBb4vaBEMzZcj/eLbT4lqintpmccs96XOEi8lNyha2JUrFg==","signatures":[{"sig":"MEYCIQDfd5nUDcThr0btWt2rHxxBgLe2JAjX58YBdxzRH4gU5wIhAPWAowcz+VjoL/UYU1UqDYAyLZ8PLyfKLfUOs0tvyOR1","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":104412},"main":"dist/index.js","type":"module","types":"dist/index.d.ts","engines":{"node":">=24.4.1"},"gitHead":"57a61cb8d5fd9a22f9dd71afd4ad86491affcd50","scripts":{"dev":"tsc --watch","build":"tsc","clean":"rm -rf dist *.tgz","package":"npm pack","typecheck":"tsc --noEmit","publish:dry":"npm publish --dry-run","prepublishOnly":"npm run build"},"_npmUser":{"name":"autifyhq-release","email":"developer@autify.com"},"_npmVersion":"10.8.2","description":"AI-powered test automation SDK for Playwright","directories":{},"_nodeVersion":"20.19.4","dependencies":{"consola":"^3.2.3","@playwright/test":"^1.54.1"},"_hasShrinkwrap":false,"devDependencies":{"typescript":"^5.8.3","@types/node":"^24.1.0","@biomejs/biome":"^2.1.2"},"peerDependencies":{"playwright":">=1.50.0"},"_npmOperationalInternal":{"tmp":"tmp/muon-sdk_0.0.2_1755738743893_0.43423174778995044","host":"s3://npm-registry-packages-npm-production"}},"0.0.3":{"name":"@autifyhq/muon-sdk","version":"0.0.3","keywords":["playwright","automation","ai","testing","llm","test-automation","natural-language"],"author":{"name":"Autify","email":"developer@autify.com"},"_id":"@autifyhq/muon-sdk@0.0.3","maintainers":[{"name":"syamashita","email":"sota.yamashita@gmail.com"},{"name":"riywo","email":"me@riywo.com"},{"name":"autifyhq-release","email":"developer@autify.com"}],"homepage":"https://autify.com","dist":{"shasum":"db0aaab372df29d55149943e7ba50388532ebabf","tarball":"https://registry.npmjs.org/@autifyhq/muon-sdk/-/muon-sdk-0.0.3.tgz","fileCount":26,"integrity":"sha512-QF5wWeV/4kVy8JQ6TtvnlnL4cekNwr74jaVfn0lKBAr6sHcAerBzzYc2ovwCfFQZXIKw5zC1ThkOBUlIbyNlMg==","signatures":[{"sig":"MEQCIHhp2O9J3j3HJjkhVJV/4FtOz+3uCJqUODnFi6lNZsuMAiBwVULKB/B7rl9gUSBtKUweaGlGEy6A9RVAJg7ERLcXYA==","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":111225},"main":"dist/index.js","type":"module","types":"dist/index.d.ts","engines":{"node":">=24.4.1"},"gitHead":"28ae3cde115ebd8d99afb8fdd4d8f01f8e765b93","scripts":{"dev":"tsc --watch","build":"tsc","clean":"rm -rf dist *.tgz","package":"npm pack","typecheck":"tsc --noEmit","publish:dry":"npm publish --dry-run","prepublishOnly":"npm run build"},"_npmUser":{"name":"autifyhq-release","email":"developer@autify.com"},"_npmVersion":"10.8.2","description":"AI-powered test automation SDK for Playwright","directories":{},"_nodeVersion":"20.19.4","dependencies":{"consola":"^3.2.3","@playwright/test":"^1.54.1"},"_hasShrinkwrap":false,"devDependencies":{"typescript":"^5.8.3","@types/node":"^24.1.0","@biomejs/biome":"^2.1.2"},"peerDependencies":{"playwright":">=1.50.0"},"_npmOperationalInternal":{"tmp":"tmp/muon-sdk_0.0.3_1756168883363_0.723018720818992","host":"s3://npm-registry-packages-npm-production"}}},"time":{"created":"2025-08-01T09:58:11.253Z","modified":"2026-04-30T09:47:55.613Z","0.0.1":"2025-08-01T09:58:11.581Z","0.0.2":"2025-08-21T01:12:24.085Z","0.0.3":"2025-08-26T00:41:23.562Z"},"author":{"name":"Autify","email":"developer@autify.com"},"homepage":"https://autify.com","keywords":["playwright","automation","ai","testing","llm","test-automation","natural-language"],"description":"AI-powered test automation SDK for Playwright","maintainers":[{"email":"sota.yamashita@gmail.com","name":"syamashita"},{"email":"developer@autify.com","name":"autifyhq-release"},{"email":"fadhlirahim@gmail.com","name":"fadhlirahim"},{"email":"kristine.tan@autify.com","name":"kristine.tan"},{"email":"thomas.santonja@autify.com","name":"thomas.santonja"},{"email":"jason.ravencroft@autify.com","name":"jsravencroft"}],"readme":"# @autifyhq/muon-sdk\n\nAI-powered Playwright agent for writing end-to-end tests in natural language. You describe what to do; the agent operates the browser via Playwright.\n\n## What it does\n\nThe 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`.\n\n## Requirements\n\n- Node.js >= 24.4.1\n- Playwright >= 1.50.0 (and browsers installed)\n\nInstall Playwright if you don't have it yet:\n\n```bash\nnpm i -D playwright @playwright/test\nnpx playwright install\n```\n\n## Install the SDK\n\n```bash\nnpm i @autifyhq/muon-sdk\n```\n\n## Configure environment\n\nExport these variables (e.g., in your shell, CI, or a dotenv setup):\n\n```bash\n# Required: Muon server API key (sent as x-muon-api-key)\nexport MUON_API_KEY=your_api_key_here\n\n# Optional (default: https://muon.autify.com)\nexport MUON_SERVER_URL=https://your-muon-server.com\n\n# Optional: disable caching (enabled by default)\n# Any of: 1/true/yes/on => disabled\nexport MUON_CACHE_DISABLED=1\n```\n\nNotes:\n- When `MUON_SERVER_URL` is omitted, the SDK uses `https://muon.autify.com`.\n- Cache files are stored under `.muon/nlstep-cache/` in your project.\n\n## Quickstart\n\nUse 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.\n\n```ts\nimport { test } from '@playwright/test';\nimport { ai } from '@autifyhq/muon-sdk';\n\ntest('AI-powered login', async ({ page }) => {\n  await page.goto('https://example.com/login');\n\n  await ai({\n    task: 'Fill username \"testuser\", password \"password123\", then click \"Log in\"',\n    page,\n    timeout: 60_000,      // optional (default 180000)\n    maxSteps: 50,         // optional (default 50)\n    stepName: 'Login via AI', // optional\n  });\n});\n```\n\nNotes:\n- You can also call `ai` with positional parameters in the original order if you prefer.\n- If the AI task fails, the test automatically fails with detailed error information.\n\n## Caching\n\nThe 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/`.\n\n- Leave caching enabled by default for faster CI.\n- Disable globally by setting `MUON_CACHE_DISABLED` to any of: `1`, `true`, `yes`, `on` (case-insensitive).\n- To clear, delete `.muon/nlstep-cache/`.\n\n## Troubleshooting\n\n- Missing API key: The SDK throws a clear error: missing `MUON_API_KEY` with reason and how to set it.\n- Invalid server URL: The SDK validates `MUON_SERVER_URL` and explains the reason if invalid.\n- Connection errors: The SDK surfaces network/connectivity reasons and hints (check reachability, proxy, TLS, DNS).\n- Long/unstable pages: Increase `timeoutMs` or allow more `maxSteps`.\n- 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.\n\n## Example: robust submit step\n\n```ts\nawait test.step('Submit via AI', async () => {\n  await ai({ task: 'Click the primary \"Submit\" button and wait for confirmation', page, timeout: 90000, maxSteps: 80, stepName: 'Submit via AI' });\n});\n```\n","readmeFilename":"README.md"}