openvibers/openvibe.link Commits

Node: browser — the computer plugin drives a browser of its own over a pipe, at the level the owner set (#46)

OP OpenVibers committed 29 days ago · tag v0.10. · 0 files, +0 −0

* Node: browser — the computer plugin drives a browser of its own over a pipe, at the level the owner set

Plan T14/T17 next step: "a browser kind" (contracts 0.174.0).

**The computer plugin's `browser` kind** (plugin 0.5.0) drives a Chromium-family browser (Chromium, Chrome, Edge or Brave) for the owner's agents.

**Its own profile.** It runs in `browser_profile` (default `~/.local/share/openvibe-node/browser`), so the agent never sees the owner's browser sessions unless the owner points it at one. `browser_headless: false` shows the window.

**No port.** It starts lazily with `--remote-debugging-pipe` and speaks the DevTools protocol over fds 3 and 4, NUL-framed JSON, stdlib only (`openvibe_computer/browser.py`). Nothing else on the machine can drive it.

**Actions:**
- `open` an http(s) `url`;
- `click` a CSS `selector`, or the button or link showing `text`;
- `fill` a field (`selector`, `text` ≤ 2000);
- `press` a named key (Enter, Tab, Escape, arrows …);
- `back`, `read`, `screenshot` (`max_width`) and `close`.

A page answer is `{url, title, text (≤ 20,000 chars), truncated, links (first 60)}`.

**Levels:**
- `read`, `screenshot` and `close` run at every level. `open`, `click`, `fill`, `press` and `back` are acting commands: refused at observe, approved one by one at ask, with a summary that says exactly what would happen ("type 5 characters into #q in the browser: 'hello'").
- Below full, `open` refuses an address on the machine's own network (every resolved address is checked).
- The kill switch closes the browser. `browser_idle_s` (600) closes it when idle.
- It is not offered on Windows yet.

**Core:** `KindBrowser`, the `browser` capability mapping, and `ComputerActs` (open, click, fill, press and back act). A latched stop refuses them in the core too.

**Tests:**
- `plugins/computer/tests/test_browser.py`: a fake browser covers the description, levels, approvals and their summaries, the agent's own profile, refused URLs and values (`file:`, `javascript:`, LAN names, mixed resolutions, `[::1]`, chords, missing fields, unknown actions; full reaches the LAN), and the kill switch.
- A real-Chromium test (skipped when none is installed) opens, clicks by text, goes back, fills, submits with Enter and takes a screenshot over the pipe.
- Go: `TestComputerActsBrowser`, and the local-stop test refuses a browser `open`.
- Plugin suite 28/28; `go test ./internal/...` passes.

Docs: `docs/computer.md` (the kind, the browser section, config) and the README.

* Node browser: a browser that closes says why (its last stderr lines); the CI test runs Chrome without its sandbox, which Ubuntu 24.04 runners refuse

* Node browser: the first command after a start waits up to 45 s (a cold profile on a slow machine)

This commit has no diff to show.