{"_id":"@amulet-laboratories/spyglass","_rev":"2-dc54d36928d0eeccbcb423aff90b406f","name":"@amulet-laboratories/spyglass","dist-tags":{"latest":"0.1.0"},"versions":{"0.1.0":{"name":"@amulet-laboratories/spyglass","version":"0.1.0","keywords":["audit","accessibility","performance","lighthouse","web-vitals","seo","security-headers","playwright","axe-core"],"license":"MIT","_id":"@amulet-laboratories/spyglass@0.1.0","maintainers":[{"name":"sndhl","email":"sndhl@pm.me"}],"homepage":"https://github.com/Amulet-Laboratories/spyglass#readme","bugs":{"url":"https://github.com/Amulet-Laboratories/spyglass/issues"},"bin":{"spyglass":"bin/spyglass.mjs"},"dist":{"shasum":"b9273fb53eeb3cb16aa31ae6cf02dd9d24fad139","tarball":"https://registry.npmjs.org/@amulet-laboratories/spyglass/-/spyglass-0.1.0.tgz","fileCount":21,"integrity":"sha512-zUhvyKm51SxiUHTwemtnDaqnScOG1M97wgLJtXd+z1dxslkuG5LCB5xY4RXz1cdDC8L/YbGuxc39S8bGUf98Mw==","signatures":[{"sig":"MEQCIGYfSgW3kI0JnCI2AiADgvR2CGzP1reb6N1r0KoHUYRjAiBFacfEuolXEWKXaYEYO0JUnzDF0oyDsWkuYvEnRPCW3w==","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/@amulet-laboratories%2fspyglass@0.1.0","provenance":{"predicateType":"https://slsa.dev/provenance/v1"}},"unpackedSize":99618},"type":"module","types":"./src/index.d.ts","engines":{"node":">=22"},"exports":{".":{"types":"./src/index.d.ts","default":"./src/index.mjs"}},"gitHead":"d254ef0a56f218f0b2dbbf528a55f0736a7adb9c","scripts":{"test":"vitest run","audit":"node bin/spyglass.mjs","start":"node bin/spyglass.mjs"},"_npmUser":{"name":"sndhl","email":"sndhl@pm.me"},"repository":{"url":"git+https://github.com/Amulet-Laboratories/spyglass.git","type":"git"},"_npmVersion":"10.9.8","description":"Point it at a live URL and get a prioritized, repair-oriented audit of a running website — performance, accessibility, security, SEO, and correctness.","directories":{},"_nodeVersion":"22.23.1","dependencies":{"axe-core":"^4.10.0","playwright":"^1.48.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"packageManager":"pnpm@10.30.2","devDependencies":{"vitest":"^4.1.10"},"_npmOperationalInternal":{"tmp":"tmp/spyglass_0.1.0_1785188347698_0.6907837805902968","host":"s3://npm-registry-packages-npm-production"},"deprecated":"Superseded by @amulet-laboratories/observatory — the runtime lens now ships there as observatory-spyglass"}},"time":{"created":"2026-07-27T21:39:07.510Z","modified":"2026-07-29T08:42:43.943Z","0.1.0":"2026-07-27T21:39:07.834Z"},"bugs":{"url":"https://github.com/Amulet-Laboratories/spyglass/issues"},"license":"MIT","homepage":"https://github.com/Amulet-Laboratories/spyglass#readme","keywords":["audit","accessibility","performance","lighthouse","web-vitals","seo","security-headers","playwright","axe-core"],"repository":{"url":"git+https://github.com/Amulet-Laboratories/spyglass.git","type":"git"},"description":"Point it at a live URL and get a prioritized, repair-oriented audit of a running website — performance, accessibility, security, SEO, and correctness.","maintainers":[{"name":"sndhl","email":"sndhl@pm.me"}],"readme":"# Spyglass\n\n[![npm](https://img.shields.io/npm/v/@amulet-laboratories/spyglass)](https://www.npmjs.com/package/@amulet-laboratories/spyglass)\n[![CI](https://github.com/Amulet-Laboratories/spyglass/actions/workflows/ci.yml/badge.svg)](https://github.com/Amulet-Laboratories/spyglass/actions/workflows/ci.yml)\n[![license: MIT](https://img.shields.io/badge/license-MIT-blue.svg)](./LICENSE)\n\n**Point it at a live URL and get a prioritized, repair-oriented audit of a running website** —\nperformance, accessibility, security, SEO, and correctness, each finding paired with how to fix it.\n\nSpyglass is the black-box, runtime companion to\n[Astrolabe](https://github.com/Amulet-Laboratories/astrolabe): Astrolabe reads your **source** and\nmaps how the app is built; Spyglass reads the **running site** and measures how it behaves. Together\nthey go symptom → cause → fix.\n\n```bash\nnpx @amulet-laboratories/spyglass amuletlabs.org\n```\n\n```\n  Spyglass · https://amuletlabs.org/\n  HTTP 200  ·  https  ·  loaded in 1.7 s\n\n  Overall  ██████████  95\n    performance    ██████████ 100\n    accessibility  ████████░░  75\n    security       ██████████  98\n    seo            ██████████ 100\n    correctness    ██████████ 100\n\n  LCP 460 ms  ·  CLS 0  ·  TTFB 73 ms  ·  386.2 kB / 14 req  ·  1 a11y issue\n\n  Findings — 1 critical, 0 warnings, 1 info\n\n  ACCESSIBILITY\n    ✖ Elements must meet minimum color contrast ratio thresholds\n      31 elements affected (e.g. .text-cream\\/75.italic).\n      fix axe rule \"color-contrast\". https://dequeuniversity.com/rules/axe/…\n```\n\n## What it checks\n\n| Dimension         | What it measures                                                                      |\n| ----------------- | ------------------------------------------------------------------------------------- |\n| **Performance**   | Core Web Vitals (LCP, CLS), TTFB, page weight, oversized images, script/style payload |\n| **Accessibility** | axe-core run on the rendered page — contrast, landmarks, alt text, ARIA               |\n| **Security**      | HTTPS, CSP, HSTS, clickjacking/frame protection, mixed content, stack disclosure      |\n| **SEO**           | Title, description, canonical, `lang`, viewport, heading structure, Open Graph         |\n| **Correctness**   | HTTP status, JavaScript/console errors, failed requests, doctype                       |\n\nEvery finding says three things: **what** is wrong, the **evidence** on your site, and the **fix**.\n\n## Usage\n\n```bash\nspyglass <url> [options]\n\n  --json            Print the full report as JSON.\n  --html            Emit a self-contained HTML report.\n  --dom3d           Emit the 3D stacked-DOM lens (rotatable HTML view).\n  --schema          Print the report's JSON Schema and exit.\n  -o, --out FILE    Write the report to a file (format inferred from .html/.json).\n  --timeout MS      Navigation timeout (default 30000).\n  --settle MS       Wait after load before measuring (default 1500).\n  --fail-on LEVEL   Exit non-zero if a finding at LEVEL+ exists: critical|warn|info.\n  -h, --help        Show help.\n```\n\n### Lenses\n\nOne audit, several **lenses** — the five dimensions above, plus visual ones:\n\n- `--html` — the shareable audit report (scoreboard + findings + fixes).\n- `--dom3d` — the DOM as translucent planes stacked by nesting depth, rotatable\n  and explodable: a structural x-ray of the page.\n\nThe same \"lens\" idea powers [Astrolabe](https://github.com/Amulet-Laboratories/astrolabe)'s\nsource views, so the two tools read as one system.\n\nAs a library:\n\n```js\nimport { audit } from '@amulet-laboratories/spyglass'\n\nconst report = await audit('https://example.com')\nconsole.log(report.scores.overall, report.summary.bySeverity)\n```\n\n## How it works\n\nSpyglass loads the page once in headless Chromium (Playwright), watches it render — console, errors,\nfailed requests, Core Web Vitals — then reads the DOM, headers, resource timing, and an axe-core pass\nback as a single observation. Every probe is a pure function of that observation, so the analysis is\ndeterministic and testable and the browser lives behind one seam. axe is injected via CDP evaluation\nrather than a `<script>` tag, so a strict CSP can't block the audit.\n\nIt's deliberately black-box: it reports **symptoms** and how to fix them, and names its limits. When\nyou need to know _which component_ caused a symptom, that's [Astrolabe](https://github.com/Amulet-Laboratories/astrolabe)'s\njob — see [ROADMAP.md](./ROADMAP.md) for how the two are converging.\n\n## Status\n\nEarly (`0.1`) — the five-probe core works against real sites. The [roadmap](./ROADMAP.md) covers the\nself-contained HTML report, per-dimension depth, whole-site crawl, CI diffing, and the Astrolabe\npairing.\n\n## Requirements\n\nNode ≥ 22. On first run, install the browser: `npx playwright install chromium`.\n\n## License\n\nMIT © Amulet Laboratories\n","readmeFilename":"README.md"}