jevnav

io.github.dtduc-git由 GitHub 账号 dtduc-git 发布v0.2.2更新于 Oct 24, 2026

Replayable browser automation: Jev picks the element, a gate blocks risky actions, every run traces.

概览

AI 生成的概览

本地浏览器自动化 MCP 服务器,让助手打开页面、按意图以校准概率选择元素、对高风险操作设闸,并记录可离线重放的决策轨迹。

可以做什么
打开页面并以结构化事实检查:大纲、计算样式、页面状态与会话汇总,决策环节不使用截图。把一条意图解析为单个元素并给出概率,由闸门决定执行、转人工复核还是拦截。用上下文值和成功选择器驱动完整目标,返回 done、stuck 或 review 及验证结果。通过表单、按键、上传、标签页、控制台、网络、模拟、追踪和 Lighthouse 工具执行与检查。离线重放已记录的决策以确定性复核。
适用场景
当助手或测试套件需要在真实网页上操作,且你希望元素决策可审计、可重放,而不是脆弱的 CSS 选择器或截图驱动的代理时使用。也适合把设计稿与运行中的应用按结构化事实比对,并在 CI 中把界面结果固定为回归检查。
运行要求
以 Python 包形式通过 uvx 本地运行(需 Python 3.10+),并需通过 Playwright 一次性下载 Chromium。决策类工具需要 TypeSafe API 密钥,放在 TYPESAFE_API_KEY 或用户主目录下的配置文件中;replay、diff、outline 和 styles 不需要密钥。需要访问目标站点和 Jev 端点的网络。
安装前请注意
决策类工具会把页面元素候选列表发送到外部 Jev 端点,目标循环还会发送可见文本和表单值的摘要(密码已遮蔽);脚本化流程两者都不发送。每次决策收取少量费用。操作类工具会改变页面状态,可能提交表单或触发购买,因此复核闸门和高风险模式很重要。轨迹会记录网址、元素名称和操作,请勿纳入版本控制,分享前先审查。

安装

在 SourceWeft 中

  1. 打开 控制台中的 jevnav,将其添加到工作区。
  2. 为需要使用其工具的对话启用该服务。

Desktop only,通过 STDIO。 STDIO 服务会启动本地进程,因此需要 SourceWeft 桌面宿主。

其他 MCP 客户端

参照 仓库 中的启动说明。

README

jevnav

Page truth for browser agents — and decisions that replay, test and audit.

[CI] [PyPI] [Python] [MCP registry] [Marketplace] [License]

https://github.com/user-attachments/assets/502550ec-77d4-439e-b334-fe7007f946b9

jevnav is a browser layer for agents and tests. It reads a page as facts (structure, computed styles, the controls on screen), lets Jev — TypeSafe's model for structured questions — pick the element for an intent with a calibrated probability, gates risky or uncertain actions to a human, and records every decision in a trace that replay re-checks offline in CI.

  • Page truth, not pixels. outline, styles and diff return what the browser resolved — font-size 32px → 28px between a mockup and the running app is something an agent can fix. No screenshots in the decision loop.
  • Evidence, not confidence. Each decision carries its probability, the gate verdict and its cost. A site change that breaks a recorded decision makes replay exit 1 — no model call, no API key.
  • Works where your agent works. CLI, Python/pytest, an MCP server for Claude Code, Cursor, Codex and friends, and a GitHub Action.

Why it exists — selector tests break when a label changes; LLM browser agents are confident, unauditable and occasionally wrong: docs/why.md.

Install

bash
uv tool install jevnav          # or: pip install jevnav  (the MCP server is included)playwright install chromium     # one-time browser download

Requires Python 3.10+. Deciding (go, run, browse, goal) needs a TypeSafe API key in TYPESAFE_API_KEY or ~/.config/typesafe/apikey.txt. replay, diff, outline and styles need no key — that is the point.

Quickstart

1. Let Jev drive — state a goal and the outcome that proves it:

bash
jevnav go --goal "sign in with the demo account and open the pricing page" \  --start https://app.example.com/login \  --context [email protected] --context password="${ACME_PASSWORD}" \  --success "#pricing.visible" \  --report goal.md
status: done — outcome verified against the pagesteps: 5 — auto 4, review 0, blocked 0

One Jev request per step; every step is gated and traced. The loop stops when the goal is met, when nothing on the page can make progress (stuck), when the gate wants a human (review), when the page stops changing (no_progress), or at --max-steps. done is a claim — --success turns it into evidence (verified, or unverified and the run fails). --dry-run decides without acting.

2. Or script the flow and let Jev resolve each intent:

yaml
# flows/acme-login/flow.yamlid: acme-loginstart: https://app.example.com/loginsteps:  - intent: "Sign in to the existing account"    action: click  - intent: "Type the password"    action: fill    value: "${ACME_PASSWORD}"   # read from the environment, never written to the trace  - intent: "Submit the login form"    action: click
bash
jevnav run flows/acme-login/flow.yaml --report run.md

3. Replay it in CI — offline, deterministic, no key:

bash
jevnav replay acme-login.trace.jsonl            # re-resolve every recorded decisionjevnav replay acme-login.trace.jsonl --execute  # also re-run the actions + check --success
steps 3  verdicts: ok 3

Change Sign in to Log in on the site and the same replay fails:

[01] changed   Sign in to the existing account      no element now has 'button|sign in' (was 'Sign in' / 'button')

Exit code 1, with the reason. That is the regression test.

Page truth for your agent

The facts a coding agent needs about a rendered page, without a screenshot: outline(selector) for a region's structure (tags, headings, text, boxes), styles(selector, props) for the computed values, page_state() for the controls jevnav can act on.

jevnav diff compares a mockup with the running app as facts and exits 1 on drift:

bash
jevnav diff new-ui.html http://localhost:3000 --report ui-diff.md
elementpropertymockupapp
h1 [Pricing]font-size32px28px
button#cta [Start free]border-radius8px4px

The report also lists structure differences (missing, new and moved elements; boxes compared with a 4px --tolerance). The loop for "here is a new UI, update the codebase": the agent reads both pages with jevnav, edits the code itself, re-runs diff until it exits 0, then pins the outcome with goal(..., success="<selector>") so replay --execute keeps checking it. jevnav reports; it never edits your repository and never compares pixels.

Gates

Every decision gets one of three verdicts:

verdictmeaning
autoconfidence at or above the threshold and nothing risky — the action runs
reviewa human confirms first: low p, a risky intent, or a truncated candidate list
blockedno decision was possible (the model answered none, or the call failed)

review and blocked never execute. Thresholds and risky patterns live in an optional gates.yaml; defaults ship for nine languages:

yaml
# flows/acme-login/gates.yamlmin_confidence: 0.9        # scripted flows: one question per step, well calibratedloop_min_confidence: 0.5   # goal loop: four questions at once, p runs lowerrisky:  - "\\b(delete|remove|purchase|pay)\\b"   # matched against intent + element name + roleintents:  "delete the *": { min_confidence: 0.99 }truncated: review          # the page had more than 255 candidates

The goal loop uses a lower threshold on purpose: measured correct loop decisions land at p 0.41–0.99 and wrong ones at 0.39–0.47, so its safety comes from deterministic checks instead — fill on a button is refused, a field with no context value is blocked, two steps that change nothing stop the run, risky patterns always go to review, and the outcome is verified against --success.

MCP server

bash
claude mcp add --scope user jevnav -- uvx jevnav mcp

Or, for Cursor, Claude Desktop, VS Code and other clients:

json
{  "mcpServers": {    "jevnav": {      "command": "uvx",      "args": ["jevnav", "mcp"],      "env": { "TYPESAFE_API_KEY": "..." }    }  }}

No URL or flags needed: the agent opens pages with goto, one server serves every site, and each session writes an auditable jevnav-session.trace.jsonl (--no-trace opts out). The deciding tools are what no other browser MCP has:

toolwhat it does
browse(intent, action, value, min_confidence)one step: Jev picks the element, the gate decides, only auto acts
goal(goal, context_json, max_steps, success)drive the whole way; returns done / stuck / review plus the verification
goto(url) · page_state() · summary()open a page, list what jevnav can act on, session totals

Plus 28 acting and inspecting tools (forms, keys, uploads, tabs, console, network, styles, outline, emulation, tracing, Lighthouse), each with MCP annotations so the host knows which calls change state. A decision costs about $0.00004 and ~330ms, and the page never enters the LLM's context. Full tool reference, security flags and when to pick jevnav vs. Playwright or chrome-devtools-mcp: docs/mcp.md.

CI — GitHub Action

yaml
- uses: dtduc-git/jevnav@v0  with:    trace: examples/local-demo/demo.trace.jsonl    execute: "true"          # also re-run the recorded actions    report: replay.md

No model call, no API key, ~30 seconds. Fails when a recorded target changed, became ambiguous, or a recorded --success selector is no longer visible. Inputs: trace, report, execute, json, version (default latest from PyPI, or local for a checkout). @v0 floats; pin a release tag such as @v0.2.2 for fully reproducible CI.

pytest

The jev fixture ships with the package: an ordinary Playwright test gets Jev decisions, and every test writes a trace that replays in CI.

python
def test_sign_in(jev):    jev.goto("https://app.example.com/login")    jev.fill("the email address", "[email protected]")    jev.fill("the password field", "${DEMO_PASSWORD}")    jev.click("the sign-in button")    jev.expect("#welcome")
bash
DEMO_PASSWORD=... pytest --jev-trace-dir=tracesDEMO_PASSWORD=... jevnav replay --execute traces/test_sign_in.trace.jsonl   # offline, no key

A review verdict fails the test before the action runs, ${VAR} values are recorded by name only, and jev.page is the real Playwright page for everything else. Runnable example with a committed trace: examples/pytest-interop/.

Your own browser

bash
jevnav go --goal "..."                                          # fresh headless Chromium (default)jevnav go --goal "..." --user-data-dir ~/.cache/jevnav-profile --headed   # persistent profilejevnav go --goal "..." --cdp http://127.0.0.1:9222              # attach to a running Chrome

Log in once with --headed and every later run reuses the profile; --cdp drives the Chrome you already have open, keeps its own settings (so it refuses --user-data-dir, --locale, --timezone and --user-agent) and never closes it. Both work on run, go, replay and mcp, and so does --browser for firefox or webkit (plus --locale, --timezone, --user-agent). Profile paths and cookies never reach a trace.

Evidence

whatresultsource
element picks on real sites (9 sites, jev-1.13.0)41/41 scored cases correct; 30/30 at the p ≥ 0.9 gateresearch/browser-element-selection.md
decision latency and costp50 365ms, $0.000153 per decisionsame
goal loop (local fixture, 4 goals × 2 wordings)8/8 goals correct, incl. the impossible one (stuck)docs/evidence.md
driving tasks vs. chrome-devtools-mcp (same LLM, n=2)jevnav 8/8, chrome-devtools-mcp 6/8; chrome-devtools 2.4× faster end to endresearch/driving-benchmark.md
replaydeterministic: offline, no key, exit 1 on a broken decisionrun it on your own traces

Small samples with a single annotator: read them as direction, not proof. jevnav's advantage is decision cost and evidence, not wall-clock speed on small pages. Method, caveats and the tool-level comparison: docs/evidence.md.

How it works

[jevnav architecture]

  • A shortlist, not the page. Visible interactive elements from every frame and open shadow root, ranked by how likely a human would act on them and capped at 120 (--max-candidates, hard cap 254). Each carries role, accessible name, type, href, placeholder and a scope, so three "Email" fields stay distinguishable.
  • One question per step. The shortlist plus none becomes a choice question; Jev answers with one element and its probability.
  • Fingerprints, never positions. An element's identity is role|name. The trace stores every candidate's fingerprint as the model saw it, and actions and replay resolve by fingerprint with a uniqueness check, so a shifted page cannot click the wrong thing.
  • Replay verdicts. ok, moved, changed, ambiguous, error — the last three fail. --normalize REGEX relaxes known churn such as Cart (3) → Cart (4); strict is the default.

The trace format is a public contract: SPEC.md. Interactive architecture diagram: docs/architecture.html. Beyond the web: docs/games.md (Jev playing a game from structured state, measured against a random control).

Non-goals

  • Not a planner. go/goal drive toward a goal you state; deciding what to do stays with you or your agent — jevnav decides where, and records why.
  • No pixel decisions. No screenshots or canvas vision in the decision loop (screenshot exists for humans), and no text generation — fill values come from your flow, context or environment.
  • No hosted service, no telemetry. Nothing leaves the machine except the question sent to your configured Jev endpoint.

Privacy

Traces contain page URLs, element names and your actions — never screenshots. The goal loop also sends a short digest of the page's visible text and current form values (passwords masked); scripted flows send neither. ${ENV} values are recorded by name only. Add *.trace.jsonl to your .gitignore and audit a trace before sharing it. See SECURITY.md for the authority boundary of the MCP server.

Suite

jevnav is the browser piece of a verification stack: mcplint (MCP configs), harnessguard (agent harnesses), jevassert + jev-packs (calibrated decision packs), and jev-table.

License

Apache-2.0 · Releases and changelog

来源:README.md,提交 3ae54ba

工具

0
SourceWeft 尚未在沙箱中启动过该软件包,因此其工具未知。

版本历史

8
  1. v0.2.2最新Sep 27, 2026
  2. v0.2.1Sep 26, 2026
  3. v0.2.0Sep 25, 2026
  4. v0.1.15Sep 25, 2026
  5. v0.1.14Sep 23, 2026
  6. v0.1.13Sep 22, 2026
  7. v0.1.11Sep 21, 2026
  8. v0.1.6Sep 21, 2026

评分

已满足适用检查项的 50%

该评分衡量此收录条目的完整程度,依据注册中心条目、端点与公开来源计算得出。它不是对服务器本身的评价,也不表示服务器安全或当前可用:可连通性是带日期的检查结果,评分也不包含安装量或用户评价。

  • 近 30 天内可连通25 分

    请保持端点能够响应 MCP 握手;SourceWeft 每 30 天探测一次。

  • 已声明认证方式10 分

    请在注册中心条目中声明凭据请求头,或保持端点能够响应探测,以便判定其认证方式。

  • 已列出工具15 分

    请让服务器在无凭据时响应 tools/list,或发布可在沙箱中无凭据启动的软件包。

  • 描述必需15 分
  • 图标10 分
  • 文档15 分
  • 许可证10 分