Zero-dependency web inspector built from scratch on Chrome DevTools Protocol. Semantic page understanding in under 500 tokens.
AI agents dump raw HTML into their context window. AgentLens returns structured, semantic output that actually fits.
<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"
...
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
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();
Every layer is ours. No third-party code at runtime. The only requirement is Chrome on the machine.
| Method | Description |
|---|---|
| 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 |
"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"
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();
$ 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