jevnav

v0.2.2
io.github.dtduc-git/jevnav Checked 4 days ago Published 2 months ago

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

These tools were reported by the server itself during our smoke test (tools/list), not copied from the README.

browse

Find the element matching an intent and, if the gate allows it, act on it. Returns the gate verdict (auto / review / blocked), the confidence, the target element and its Playwright selector. Only ``auto`` decisions are executed. On large pages even precise intents score 0.8-0.95, so pass ``min_confidence`` to set your own bar; risky patterns and the deterministic checks still apply and cannot be overridden.

ParameterTypeDescription
intent *string
actionstring
min_confidence
value

goto

Open a URL in the current tab, replacing its content, and wait until the DOM is ready. Returns {url, title, elements}, where elements is the number of interactive elements found; call page_state for the candidate list.

ParameterTypeDescription
url *string

goal

Drive the browser towards a goal: Jev decides every step, jevnav acts. ``context_json`` is a JSON object of values the goal may need, e.g. {"email": "a@b.c", "password": "${PW}"}. ``success`` is a selector that must be visible when the goal is done: pass it and the outcome comes back verified or the run is reported as unverified. Returns the outcome (done, stuck, review, ...), the steps taken, cost and the verification. Risky steps stop the loop and come back unexecuted.

ParameterTypeDescription
goal *string
context_jsonstring
max_stepsinteger
success

page_state

Current URL, title and the interactive elements jevnav can see. The elements it can act on carry a jevnav data-jevcid stamp.

console

Recent console messages and page errors, newest last (observation only; not part of a trace). Returns {messages:[{type, text}]}, where type is the console method (log, info, warning, error, debug, ...) or pageerror; only_errors keeps warning, error and pageerror. Read it after an action to see what the page complained about.

ParameterTypeDescription
limitinteger
only_errorsboolean

network

Recent network requests, newest last; only_failed keeps 4xx/5xx and transport errors. Each entry carries method, url, status, resource, error (for failed requests) and id — pass that id to network_detail for headers and body.

ParameterTypeDescription
limitinteger
only_failedboolean

screenshot

Save a PNG of the page (or one element) to a path, for a human to look at.

ParameterTypeDescription
full_pageboolean
path
selector

upload_files

Set files on a file input, chosen by a CSS selector or by an intent Jev resolves. With an intent and several file inputs, the choice goes through the gate first. Every path must exist and sit inside --file-root (default: the working directory; set it explicitly if the server runs from / or $HOME); the call replaces the input's current selection. Returns {files, status, reason, target, executed} — status "review" or "blocked" means nothing was set.

ParameterTypeDescription
paths *array
intent
selector

drag

Drag the element at source_selector onto target_selector. The drag runs immediately with no confirmation, so a wrong target can change page state.

ParameterTypeDescription
source_selector *string
target_selector *string

press_key

Press a key or a combination ("Control+A", "Shift+Enter"). With a selector, presses on that element (first match); without, on the page. Acts immediately — a shortcut or Enter can submit or delete — and returns {key, selector}.

ParameterTypeDescription
key *string
selector

fill_form

Fill several fields in one call. fields_json is a JSON list of {selector|intent, value, action?}; action is fill (default), select, check or type. fill and select replace the value, type appends, check ticks when value is true-like ("true", "1", "yes", "on" or omitted) and clears otherwise. An intent is resolved by Jev against the page's text, search, combobox, checkbox and radio inputs — or, when the page has none of those, any interactive element. Returns {filled:[...]}; a field with neither selector nor intent is an error.

ParameterTypeDescription
fields_json *string

network_detail

Headers and (text) body of one recorded request: pass the id from network's output, or url_contains for the newest matching URL. Reads jevnav's own network buffer; nothing is re-requested.

ParameterTypeDescription
id
url_contains

dialog_policy

Answer dialogs from now on. match=None sets the session default; with a match, adds a rule for dialogs whose text contains it (an earlier rule with the same text is replaced). Applies to future dialogs only; dialogs already seen stay recorded.

ParameterTypeDescription
actionstring
match

resize

Resize the browser viewport to width x height. The size persists for the session and can change what the page renders (responsive layout).

ParameterTypeDescription
height *integer
width *integer

emulate

Emulate media, geolocation ("lat,lon"), connectivity and a slow device. Media overrides (color scheme, reduced motion, forced colors) apply to the current tab; geolocation and offline apply to the whole browser context, so later tabs and loads keep them. Fields you omit are left unchanged. The position persists context-wide, but only an http(s) origin that called emulate can read it (that origin gets the geolocation permission); call emulate again after navigating elsewhere. cpu_throttle slows the current tab's CPU by that factor (4 = fou…

ParameterTypeDescription
color_scheme
cpu_throttle
download_kbps
forced_colors
geolocation
latency_ms
media
network_conditions
offline
reduced_motion
upload_kbps

route

Stub or block requests matching a URL pattern (testing). The stub persists until unroute; the call is recorded as an action, never part of a replay path.

ParameterTypeDescription
pattern *string
abortboolean
body
content_typestring
statusinteger

unroute

Remove one route stub, or all of them.

ParameterTypeDescription
pattern

perf_metrics

Chromium performance counters for the current page, read over CDP: DOM nodes, JS heap size, layout and task durations. Cheap telemetry for spotting growth between actions; for real profiling use chrome-devtools. Reads the page, changes nothing, chromium only.

heap_snapshot

Write a Chromium heap snapshot of the current page to a file (default: jevnav-heap-<timestamp>.heapsnapshot under --file-root, which defaults to the working directory and must be set explicitly if the server runs from / or $HOME; the path must stay inside it), for Chrome DevTools > Memory. A snapshot is a full JS heap dump, often hundreds of MB; an existing file at the same path is overwritten. Use it to chase a memory leak, not for routine inspection — it changes nothing on the page, and it is chromium-only.

ParameterTypeDescription
path

lighthouse

Run Lighthouse (through npx) against the current or given URL and return the scores. Needs node/npx on PATH (npx fetches Lighthouse on first use), takes tens of seconds, and does not change the page.

ParameterTypeDescription
categoriesstring
url

trace_start

Start a Playwright trace (open it later with `npx playwright show-trace`).

ParameterTypeDescription
screenshotsboolean

trace_stop

Stop the Playwright trace started by trace_start and write the zip to path (default: jevnav-trace-<timestamp>.zip under --file-root, which defaults to the working directory and must be set explicitly if the server runs from / or $HOME; the path must stay inside it). The zip holds snapshots and, if enabled, screenshots of everything since trace_start — open it with `npx playwright show-trace <path>`. Stopping without a started trace is an error; passing the same path again overwrites that zip. Chromium, Firefox and WebKit all support it.

ParameterTypeDescription
path

dialogs

Every alert/confirm/prompt seen, with the policy that resolved it.

outline

Structural outline of a page or region: the shape an agent can act on, without a screenshot. Returns {selector, count, elements}, one entry per heading, landmark, section, form, label, control, link, image or text block inside selector (default "body"), capped at limit (default 200) in document order; each entry carries tag, level (h1-h6), text, ownText, leaf, name, id, classes and box [x, y, width, height]. A selector that matches nothing falls back to the whole body (the result still echoes the selector you asked for). Use it before edi…

ParameterTypeDescription
limitinteger
selectorstring

styles

Computed styles for the elements matching a selector (the facts behind a visual diff).

ParameterTypeDescription
selector *string
limitinteger
props

read_js

Evaluate a JS expression in the page and return its value. This is arbitrary JavaScript: an expression can change page state, so treat it as an action and keep it for reading values only (disable with --no-eval).

ParameterTypeDescription
expression *string

wait_for

Wait until text or a selector appears, then report the page like page_state (element stamps included).

ParameterTypeDescription
selector
text
timeout_msinteger

scroll

Scroll the page down or up by pixels of document height.

ParameterTypeDescription
amountinteger
directionstring

tabs

List the open pages and which one jevnav is driving.

new_page

Open a new tab (optionally at a URL) and drive it from now on.

ParameterTypeDescription
url

select_page

Drive the tab at this index (see tabs). The switch is immediate; the tab keeps its state, and an out-of-range index is an error.

ParameterTypeDescription
index *integer

close_page

Close the tab at this index (see tabs). If it was the tab being driven, jevnav drives the last remaining one; closing the only tab, or an out-of-range index, is an error. Returns the tabs that remain.

ParameterTypeDescription
index *integer

summary

This session so far: steps, auto/review/blocked counts, cost, latency.