AI sees the page.
Not the DOM.

Zero-dependency web inspector built from scratch on Chrome DevTools Protocol. Semantic page understanding in under 500 tokens.

$ npm install @jnordq/agentlens

0 dependencies own browser driver

50,000 tokens vs 120

AI agents dump raw HTML into their context window. AgentLens returns structured, semantic output that actually fits.

page.content()
<div class="sc-bdnxRM jKEGSp">
  <div class="sc-gsTCUz kJHfbo">
    <div class="sc-dlfnbm iISzev">
      <span data-reactid=".0.1">
        <div class="css-1dbjc4n">
          <div class="css-901oao">
            Login
          </div>
        </div>
      </span>
      <input class="sc-kgoBCf"
...
~50,000 tokens of noise
agent.digest()
Page: My App (myapp.com/login)
Status: ready
Suggested: fill 2 required fields

[nav]  Header: Home, About, Pricing
[form] Login: 0/2 filled
  Email *: empty
  Password *: empty
  submit: "Sign In"
[hero] Welcome: CTA "Get Started"

Actions: fill | submit | navigate
~120 tokens of signal

How it works

Launch, inspect, act
import { Browser } from "@jnordq/agentlens/browser";
import { AgentPage } from "@jnordq/agentlens/agent";

const browser = await Browser.launch();
const page = await browser.newPage();
const agent = new AgentPage(page);

// Understand the page
const digest = await agent.goto("https://myapp.com");
// digest.text            -> semantic page model
// digest.tokens          -> 127
// digest.suggestedAction -> "fill 2 required fields"

// Act with intent
await agent.do("log in with user@test.com / secret123");
// finds login form, fills both fields, clicks submit, waits

// Only what changed
const delta = await agent.whatChanged();
// "Navigated -> /dashboard"
// "+ [nav] Sidebar"
// "- [form] Login"
// delta.tokens -> 42

await browser.close();

Built from scratch

Every layer is ours. No third-party code at runtime. The only requirement is Chrome on the machine.

agentlens (0 npm dependencies)

browser/ own browser automation
  ws.ts          WebSocket client (RFC 6455 on node:net)
  cdp.ts         Chrome DevTools Protocol (JSON-RPC)
  launcher.ts    Find Chrome, launch headless
  page.ts        Navigate, evaluate, screenshot, click, fill

agent/ semantic intelligence
  components.ts Detect forms, navs, modals, heroes
  digest.ts      Compact page model (< 500 tokens)
  delta.ts       Only-what-changed tracking
  intent.ts      "submit form", "log in", "navigate"
  blockers.ts    Modal/spinner/cookie detection

Features

Zero Dependencies
Built on Node.js builtins and CDP. Nothing to install but Chrome.
Semantic Digest
Pages as forms, navs, modals. Not flat element lists.
Intent Actions
"submit form", "log in with" instead of "click button".
Delta Tracking
Only what changed. "[no change]" = 3 tokens.
Smart Waiting
Watches spinners, network, DOM stability. Not timers.
Blocker Detection
Auto-dismiss modals, cookie banners, loading overlays.

Agent API

MethodDescription
agent.digest()Semantic page model — components, status, suggested actions
agent.do(intent)High-level action — returns result + page delta
agent.whatChanged()Delta since last check — only what's new
agent.waitUntilReady()Smart wait — spinners, network, DOM stability
agent.dismissBlockers()Auto-close modals, banners, overlays
agent.goto(url)Navigate + wait + digest
agent.screenshot(path)Viewport screenshot

Supported intents

"submit form"
"navigate to Pricing"
"log in with user@test.com / password"
"search for [query]"
"fill form with {email: a@b.com, name: John}"
"dismiss blockers"
"wait until ready"
"scroll to [component]"
"go back"

Browser API

Direct CDP-based browser control when you need it. Also zero dependencies.

import { Browser } from "@jnordq/agentlens/browser";

const browser = await Browser.launch();
const page = await browser.newPage();

await page.goto("https://example.com");
await page.fill("#email", "test@example.com");
await page.click("button[type=submit]");
await page.screenshot({ path: "shot.png" });

await browser.close();

CLI

$ agentlens init            # scaffold config + example
$ agentlens doctor --fix    # auto-patch test config
$ agentlens clean           # clear observation log
$ agentlens diff a.json b   # compare runs
$ agentlens ci              # generate CI workflow