Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 14 additions & 3 deletions PRIVACY.md
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ The optional JEV executor is disabled by default. A CLI task must include
`--enable-fast-agent`. The optional `browser_task` MCP tool must first be
enabled for the server, and each call must include `cloudConsent: true`.
`--dry-run` validates local task configuration without opening a browser
connection, reading an API key or making network requests.
connection or making network requests; no API key is required.

An enabled task sends a bounded, allowlisted model payload to BeatAPI:

Expand All @@ -79,8 +79,19 @@ An enabled task sends a bounded, allowlisted model payload to BeatAPI:
The default endpoint is `https://api.beatapi.io`; a trusted local operator may
set `BEATAPI_BASE_URL`. The destination matters: the configured endpoint
receives the BeatAPI authorization key in the request header. Only the Node
process reads `BEATAPI_API_KEY`; the key is not sent across the extension bridge
or included in the model state or trace. Per-task MCP arguments cannot override
process reads `BEATAPI_API_KEY`. Alternatively, the extension FAST setup sends a
human-entered key over its local loopback bridge connection. The Node bridge
stores it in `~/.beat-browser/fast-settings.json` with owner-only (`0600`)
permissions. This file contains plaintext credentials, not keychain-encrypted
credentials. The key is not saved in Chrome storage, returned to the extension
or an agent, logged, or included in model state or traces. The extension password
field retains an unsaved draft only until it is saved or the extension page is
closed. UI setup always targets `https://api.beatapi.io`. **Test connection** and
**Test & enable** make a real synthetic decision request and may consume credits;
they do not read any browser page. Disabling preserves the local key; **Remove
saved key** removes it and disables FAST, without changing environment secrets.
Settings are shared by local processes using the same BeatBrowser home.
Per-task MCP arguments cannot override
credentials, endpoint or model.

The fast path does not collect cookie or storage dumps, browser authorization
Expand Down
49 changes: 33 additions & 16 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@

Connect Codex, Claude Code and other compatible agents directly to the Chrome you already use. Keep your website logins, run tasks in background windows, and take over when needed. BeatBrowser is a free, MIT-licensed Chrome extension and local bridge.

[Get started](#quick-start) · [Cloud agents](#cloud-agents-your-chrome) · [Examples](#what-you-can-do) · [Compare](#compare-browser-integrations) · [JavaScript SDK](docs/JAVASCRIPT.md) · [Website](https://beatapi.io/browser)
[Get started](#quick-start) · [FAST mode](#fast-mode) · [Cloud agents](#cloud-agents-your-chrome) · [Examples](#what-you-can-do) · [Compare](#compare-browser-integrations) · [JavaScript SDK](docs/JAVASCRIPT.md) · [Website](https://beatapi.io/browser)

Normal local browser tools are **free**, with **no BeatBrowser account or API key**. Your agent uses its own model access.

Expand All @@ -27,6 +27,7 @@ Normal local browser tools are **free**, with **no BeatBrowser account or API ke
| **Choose your agent** | Codex, Claude Code, WorkBuddy and more. |
| **Own the toolchain** | Extension, bridge, MCP, CLI and SDK source. |
| **Work in the background** | Task windows with pause and takeover. |
| **Optional FAST execution** | Your agent supplies the goal and inputs; JEV chooses bounded browser actions. Requires a BeatAPI key. |
| **Cloud access preview** | Self-hosted access to your local Chrome. |

The extension, local bridge, MCP server, CLI and Node SDK are public under [MIT](LICENSE). Task windows share their Chrome profile's cookies and storage.
Expand Down Expand Up @@ -109,6 +110,37 @@ page title, report the result, and pause for my review.

Open the extension → **Workspace** to inspect the task. The agent supplies the reasoning; BeatBrowser supplies the browser tools.

<a id="fast-mode"></a>

## FAST mode: let JEV execute a bounded browser task

In normal mode, your agent calls browser tools step by step. **FAST mode** lets a local agent hand a goal, exact inputs and success assertions to `browser_task`. JEV chooses among bounded actions such as clicking, typing, selecting and scrolling, and the executor checks the result. Use it for interaction tasks with clear boundaries; the outer agent still handles planning and exceptions.

FAST is **off by default** and requires a **BeatAPI key**. Connection tests and live model calls may consume credits. Normal browser tools remain free and need no key.

**To enable:**

1. In the extension popup or workspace, open **Settings → FAST → Configure**.
2. Enter a BeatAPI key and JEV model (default `jev-1.13`), confirm model calls, and choose **Test & enable**.
3. Ask your local agent to use `browser_task` with a concrete goal, inputs and success assertions. Each task still requires cloud-processing consent. **Turn off FAST** stops FAST execution.

Only the local Node bridge saves the key in an owner-only file; Chrome storage does not retain it. **The new settings entry is currently on the source branch and has not shipped in a new npm package or extension download.** Both the CLI/MCP package and extension must contain it. Existing `1.4.1` installations use [environment configuration](docs/JEV_FAST_AGENT.md#prerequisites-and-configuration).

FAST currently supports top-frame light DOM, excluding iframes and shadow DOM, and stops on uncertainty. [Full configuration and execution boundaries](docs/JEV_FAST_AGENT.md) · [Dated test results](TEST_RESULTS.md)

<details>
<summary>Check task arguments locally without a key</summary>

```sh
beat-browser run --dry-run \
--url https://example.com \
--goal 'Check that the Example Domain page is ready'
```

Dry-run only validates arguments; it makes no model call and opens no browser connection.

</details>

## Cloud agents, your Chrome

**Run the agent in the cloud. Keep the browser on your computer.**
Expand Down Expand Up @@ -229,21 +261,6 @@ npm run check:package

Bug reports and pull requests are welcome. Include the CLI/extension versions, reproduction steps and sanitized output. Do not include tokens, cookies or private page data. Unit and isolated Chromium checks do not certify every agent client or macOS foreground-focus behavior.

<details>
<summary>Optional BeatAPI execution — Fast JEV</summary>

The optional Fast JEV executor lets a BeatAPI model choose from a bounded set of browser actions. It uses the same connection, is **off by default**, and requires a BeatAPI key and explicit task consent. Normal browser tools do not require it.

```sh
beat-browser run --dry-run \
--url https://example.com \
--goal 'Check that the Example Domain page is ready'
```

Dry-run makes no model call and opens no browser connection. Fast JEV targets top-frame light DOM, not iframes or shadow DOM; it stops on uncertainty instead of replaying an uncertain submission. [Configuration and consent](docs/JEV_FAST_AGENT.md)

</details>

## License

Released under the [MIT License](LICENSE).
49 changes: 33 additions & 16 deletions README.zh-CN.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@

保留现有浏览器、登录态与使用习惯,让 Codex、Claude Code 等兼容 Agent 直接在 Chrome 里完成网页任务。任务使用独立后台窗口,你随时查看、暂停或接管。BeatBrowser 是免费、MIT 开源的 Chrome 扩展与本地桥接工具。

[快速开始](#快速开始) · [云端 Agent](#云端-agent你的-chrome) · [使用示例](#可以用来做什么) · [能力对比](#浏览器接入方式对比) · [JavaScript SDK](docs/JAVASCRIPT.md) · [项目官网](https://beatapi.io/browser)
[快速开始](#快速开始) · [FAST 模式](#fast模式) · [云端 Agent](#云端-agent你的-chrome) · [使用示例](#可以用来做什么) · [能力对比](#浏览器接入方式对比) · [JavaScript SDK](docs/JAVASCRIPT.md) · [项目官网](https://beatapi.io/browser)

普通本地浏览器工具**免费**,**不需要 BeatBrowser 账号或 API Key**;Agent 使用自己的模型服务。

Expand All @@ -27,6 +27,7 @@
| **Agent 自由选择** | 接入 Codex、Claude Code、WorkBuddy 等。 |
| **工具链源码公开** | 扩展、桥接、MCP、CLI、SDK 均可检查和修改。 |
| **后台任务工作区** | 独立任务窗口,可暂停、继续或接管。 |
| **可选 FAST 执行** | Agent 给定目标与输入,JEV 选择有限的浏览器动作;需要 BeatAPI Key。 |
| **云端接入预览** | 自建认证入口,连接你本地的 Chrome。 |

扩展、桥接服务、MCP、CLI 和 Node SDK 源码按 [MIT](LICENSE) 公开。同一 Chrome 配置下的任务共享 Cookie 与存储。
Expand Down Expand Up @@ -106,6 +107,37 @@ beat-browser doctor --json

点击扩展 → **工作区** 查看任务。Agent 负责推理,BeatBrowser 提供浏览器工具。

<a id="fast模式"></a>

## FAST 模式:让 JEV 执行明确的浏览器任务

普通模式由你的 Agent 逐步调用浏览器工具。**FAST 模式**允许本地 Agent 把目标、准确输入和成功条件交给 `browser_task`,由 JEV 在点击、输入、选择和滚动等有限动作中决定下一步,执行后检查结果。它适合步骤边界明确的交互任务;规划和异常处理仍由外层 Agent 负责。

FAST **默认关闭**,需要 **BeatAPI Key**;测试连接和实际模型调用可能消耗额度。普通浏览器工具仍免费,无需 Key。

**开启方式:**

1. 在扩展弹窗或工作区打开 **设置 → FAST → 配置**。
2. 填入 BeatAPI Key 和 JEV 模型(默认 `jev-1.13`),勾选允许模型调用,点击 **测试并开启**。
3. 让本地 Agent 使用 `browser_task`,提供具体目标、输入和成功条件;每次任务仍需云端处理授权。**关闭 FAST** 可停止 FAST 执行。

Key 由本机 Node 桥接以受限权限文件保存,不写入 Chrome 存储。**新版设置入口目前在源码分支中,尚未随新的 npm 包或扩展下载发布**;需要同时使用包含该入口的 CLI/MCP 与扩展,现有 `1.4.1` 安装仍按[环境变量方式](docs/JEV_FAST_AGENT.md#prerequisites-and-configuration)配置。

FAST 当前支持页面顶层的普通 DOM,不支持 iframe 或 shadow DOM;遇到不确定状态会停止。[完整配置与执行边界](docs/JEV_FAST_AGENT.md) · [注明日期的测试记录](TEST_RESULTS.md)

<details>
<summary>无需 Key 的本地参数检查</summary>

```sh
beat-browser run --dry-run \
--url https://example.com \
--goal 'Check that the Example Domain page is ready'
```

Dry-run 只检查参数,不调用模型、不连接浏览器。

</details>

## 云端 Agent,你的 Chrome

**Agent 在云端,浏览器留在你的电脑。**
Expand Down Expand Up @@ -225,21 +257,6 @@ npm run check:package

欢迎提交问题与 PR,请附上 CLI/扩展版本、复现步骤和脱敏输出,不要包含令牌、Cookie 或私有页面数据。单元测试和隔离 Chromium 检查不代表已验收每个 Agent 客户端或 macOS 原生焦点行为。

<details>
<summary>可选 BeatAPI 执行能力 — Fast JEV</summary>

Fast JEV 让 BeatAPI 模型从有限的浏览器动作中选择下一步,复用相同连接,**默认关闭**。真实调用需要 BeatAPI Key 和明确任务授权,普通浏览器工具不需要。

```sh
beat-browser run --dry-run \
--url https://example.com \
--goal 'Check that the Example Domain page is ready'
```

Dry-run 不调用模型、不连接浏览器。Fast JEV 面向顶层 light DOM,不支持 iframe 或 shadow DOM;遇到不确定状态会停止,不自动重发结果不明的提交。[配置与授权](docs/JEV_FAST_AGENT.md)

</details>

## 许可证

本项目采用 [MIT 许可证](LICENSE)。
56 changes: 56 additions & 0 deletions TEST_RESULTS.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,61 @@
# Test results

### GitHub source submission validation, 2026-10-26

- Re-ran all 292 tests: zero failures, cancellations or skips. Syntax checks
passed for 78 JavaScript files; the narrow source-pattern security scan found
no findings in 128 files. Clean package installation (134 files), 24 normal
MCP tools, and local extension packaging passed.
- Re-ran isolated Chrome for Testing acceptance with synthetic provider responses.
Popup/sidebar setup, consent, test without saving, enable/disable/remove,
credential boundaries, Chinese layout and collapsed Settings passed. The real
browser runner performed one click and passed its outcome assertion with
`status: completed`, `verified: true`.
- This recheck made no real BeatAPI model calls and does not revalidate the
dated live-provider observations below. Source submission does not publish
a new npm version, GitHub Release or extension download.

### Source preview: extension FAST entry, 2026-10-25

- The revised popup/sidebar keep tasks first and nest FAST inside the collapsed
Settings section. Expanding Settings shows a compact FAST row; only Configure
reveals API key/model/consent fields. Isolated Chromium acceptance confirmed
this initial state, configuration expansion, and unsaved-key clearing when
Settings is closed. Default, Settings-row and expanded-form screenshots were
regenerated without making additional live model calls for the layout change.
- 292 tests passed with zero failures/skips. Eight new integration tests cover
ephemeral connection testing, private key persistence, consent, fixed BeatAPI
routing, failure preservation, permission/symlink rejection, opt-out precedence,
live MCP tool discovery, revocation, and credential-free bridge replies/audits.
- `node scripts/check-fast-browser.mjs` with `BEAT_TEST_CHROME` uses an isolated
Chrome for Testing profile, temporary bridge and synthetic model responses.
Actual popup and sidebar controls passed: consent gating, invalid-key response,
test-without-saving, enable/disable/remove, saved-state recovery, Chinese UI and
340px layout. Keys were absent from Chrome local/session storage, and an injected
content script could not change FAST settings.
- The real extension/bridge runner completed a local fixture task with one JEV
decision and one actual browser click, followed by a passing page assertion.
The provider response was synthetic: this does not establish current real JEV
availability, billing, latency, or decision quality.
- Syntax: 78 JavaScript files. Narrow source-pattern scan: no findings. Clean
134-file package installation, stable launcher and 24 normal MCP tools passed.
- A subsequent explicit live run used the operator-authorized credential through
process memory. The non-billable `GET /v1/usage` check returned HTTP 200.
Exactly two `POST /v1/systemone` calls to BeatAPI with `jev-1.13` returned 200:
the popup's **Test & enable** request (1,773 ms response-header latency) and
the actual browser runner decision (614 ms response-header latency). The
runner performed one real click and passed its page assertion with
`status: completed`, `verified: true`. These are two observed requests,
not a general latency or reliability benchmark. The popup/sidebar and
enable/disable/remove controls passed with this real provider configuration.
- The live run used a disposable browser profile and owner-only temporary settings;
the key was removed from those settings and the test profile was deleted.
It was not written to the repository, result report or Chrome storage. The
authorized existing secret-store entry was unchanged. No exact billing charge
was audited. Signed-in websites, complex workflows and native macOS focus
behavior remain unverified. This is an unreleased development branch; the
active extension was not replaced.

### 1.4 release validation, 2026-10-18

- 1.4.0 includes the optional remote adapter and current WorkBuddy configuration detection. The 284-test suite, syntax, source-pattern security scan, comparison assets, clean package installation, MCP discovery and extension packaging passed.
Expand Down
51 changes: 50 additions & 1 deletion docs/JEV_FAST_AGENT.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ and success assertions. The executor observes the current page, asks BeatAPI
JEV to choose from a finite action set, validates that choice, rechecks the
live target, performs one supported action and verifies the result.

It is off by default. The 23 ordinary manual MCP tools, local bridge,
It is off by default. The ordinary manual MCP tools, local bridge,
installation flow and existing `ask` mechanism remain available without a
BeatAPI API key. Fast mode is intended for constrained interaction loops; the
outer agent retains planning, task authorization and handling of exceptions.
Expand All @@ -20,6 +20,55 @@ page and update the note after the run.

## Prerequisites and configuration

### Extension FAST entry

The popup and workspace keep tasks first. Open **Settings**, then choose
**Configure** on its FAST row to reveal the API key, JEV model and consent
options. Settings and the configuration form are collapsed on initial load;
FAST remains disabled by default. Closing Settings also closes the form and
clears its unsaved key. Enter a BeatAPI API key and JEV model, and confirm model calls. **Test connection**
makes one synthetic JEV decision request without reading a browser page or saving
the draft. **Test & enable** repeats that check and enables FAST only after a
valid JEV response. Tests can consume model credits. The default model remains
`jev-1.13`; the model field accepts another published JEV model ID.

The Node bridge must be running from a package containing this entry; an older
bridge needs a package update and agent restart. The key is sent once over the
local extension-to-bridge WebSocket and stored in `~/.beat-browser/fast-settings.json`
with owner-only permissions (`0600`). This is a local plaintext credential file,
not an OS keychain. It is never saved in Chrome storage, returned in settings
responses, exposed to an agent, or included in audit/model/trace data. UI setup
always uses `https://api.beatapi.io` even if the process has another base URL.
The password field keeps an unsaved draft only while that extension page is open.

Enabling FAST adds `browser_task` to a local MCP server's current tool list and
sends a tool-list-changed notification. Clients that cache the list may need a
reconnect. Each task still requires `cloudConsent: true`; the switch itself
does not start a task or authorize a website action. Turning FAST off prevents
new calls, stops running MCP tasks, and prevents a further runner operation
after revocation. Removing a saved key also switches FAST off. Disabling keeps
the saved key for later use; removing it does not erase a separately configured
process-environment key. Settings apply to local processes sharing this user's
BeatBrowser home, across Chrome profiles. Remote servers explicitly keep FAST
disabled.

Existing process-environment configuration still works when no saved settings
file exists. A saved disabled configuration overrides startup opt-in until the
user enables FAST again. `BEAT_BROWSER_FAST_AGENT=0` is an explicit opt-out that
also overrides saved configuration. CLI live runs still require their explicit
`--enable-fast-agent` flag and can reuse the saved key. Dry runs remain offline.

For isolated test processes only, `BEAT_BROWSER_FAST_CONFIG_FILE` selects a
different trusted local settings path; it is never a per-task argument.

`BEAT_TEST_CHROME=/path/to/chrome node scripts/check-fast-browser.mjs` exercises
the popup, sidebar and real browser actions with synthetic provider responses in
a disposable profile. Explicit `--live` additionally requires `BEATAPI_API_KEY`
in process memory and uses real BeatAPI calls. It skips redundant/negative live
model tests to limit billed calls. Reports and screenshots contain no key, and
temporary credential settings are removed when the run exits. See `TEST_RESULTS.md`
for the dated live run and its narrow acceptance scope.

Use the repository's supported Node.js version, install its existing
dependencies, and load the BeatBrowser Chrome extension. No new runtime
dependency is needed for fast mode. `beat-browser doctor --json` can diagnose
Expand Down
Loading