Open-source AI browser agent for Chrome and Firefox (monorepo) 🧠
JavaScript ai-agentai-agentsai-toolsbrowser-aibrowser-automationbrowser-extensionchrome-aichrome-devtoolschrome-extensionchrome-extensionsfirefox-addonfirefox-addonsfirefox-extensionfirefox-extensionsgemmagemma4minimaxoffline-aioffline-llmqwen
Tighten the settings split after review
Emre Sokullu884e4c9654f8
diff --git a/CHANGELOG.md b/CHANGELOG.mdindex 837393f12..7cb7b3c9c 100644--- a/CHANGELOG.md+++ b/CHANGELOG.md@@ -13,7 +13,7 @@ This changelog was generated from the repository Git history and release tags. V### Changed- Settings is reorganized. Its tabs are now General, Budgets, Memory, Skills, CAPTCHA, Bridge and Advanced. The providers and the assistive models moved to a new Providers page with LLM, Vision, Speech, Generative, Decision and SafeSocial tabs; open it from **More…** in the side panel's model menu or from the Providers link at the top of Settings. Site permissions moved to their own page, opened with **Manage site permissions** in the ⚠ menu next to the microphone. Advanced is now a tab instead of a drawer inside General, and the CAPTCHA solvers have a tab of their own. The new Budgets tab holds the cloud cost allowances, the question timeout and what happens when it runs out, Max Agent Steps, the LLM request timeout and the image budget. Screenshot redaction moved to Advanced. Language and UI zoom are chosen in the side panel only. The search box looks through General, Budgets, CAPTCHA and Advanced at once. Old links to the moved tabs open the new pages.-- Auto-screenshot now defaults to On navigation instead of On state change. A choice you made yourself is kept.+- Auto-screenshot now defaults to On navigation instead of On state change. A value already saved is kept, including one restored from an older configuration export, which records the old default.- Record traces and Record full request details are now one switch: traces are recorded with their full request details, or not at all. An install that recorded traces without full details starts recording them after the update.- The side panel layout is rearranged. The language, text size, Settings and pop-out buttons moved to the top left, and History and New chat to the top right, where History opens its list downward. The model picker moved into the message box, next to the attach button below your text, and its list opens upward.- Selecting text on a page now shows a small bar, **Translate | Explain | Proofread | More…**, instead of the single `?` button. Translate, Explain and Proofread answer in a card next to the selection: Translate shows the detected source language, the original text and a target-language picker, and every card has an "Ask a follow-up" box that, once the answer is there, continues in the side panel with the card's answer as context. **More…** opens the same popup the `?` button opened (Summarize, Quiz me, Humanize, a question box and Hide this; Translate, Explain and Proofread are on the bar, so they are not repeated there). A card sends the selected text to your configured model provider, like any other selection action; selections over 4,000 characters go to the side panel instead of a card. A card answer that reaches the model's output limit says it was cut off and offers to continue in the side panel, which picks up from the unfinished text instead of starting over (a side-panel reply that is cut off again says so, including when an OpenAI Responses model reports the limit as an error, in which case the text it wrote is kept and the call still counts toward your cloud-cost allowance), and closing or redoing a card, or reloading or leaving the page, cancels the request it no longer needs. Chrome and Firefox.diff --git a/docs/captcha-provider-coverage.md b/docs/captcha-provider-coverage.mdindex 18d7271f3..d488cc5c2 100644--- a/docs/captcha-provider-coverage.md+++ b/docs/captcha-provider-coverage.md@@ -233,7 +233,7 @@ Automatic widget solves save the selected widget and a paid-attempt gate beforeThe CAPTCHA gate permits `done` with `outcome: "failed"` or `"partial"` in every gate state. Cancelling or reporting blocked work must not require a solve. This exception does not authorize page mutations or bypass verification for successful completion.-**Managed Cloud is separate.** Managed browsers continue using the server-side CapSolver broker and ignore personal keys and weights. Native catalog discovery/submission is excluded for that route. This change does not expand or deploy the server-side broker's allowlist, quotas, or billing.+**Managed Cloud is separate.** Managed browsers continue using the server-side CapSolver broker and ignore personal keys and weights. Settings hides its CAPTCHA tab there, since there is nothing to configure. Native catalog discovery/submission is excluded for that route. This change does not expand or deploy the server-side broker's allowlist, quotas, or billing.## Troubleshootingdiff --git a/docs/localization.md b/docs/localization.mdindex 2399dd453..2c93fd9ad 100644--- a/docs/localization.md+++ b/docs/localization.md@@ -149,8 +149,8 @@ Copy the locale file to `src/firefox/src/ui/locales/<code>.js` and update `src/f### Step 4: Test-1. Open the extension settings-2. Switch to the new language in the Language dropdown+1. Open the side panel+2. Pick the new language from its language menu (top left)3. Verify the side panel, settings, and traces pages render correctly4. Check that missing keys fall back to English gracefully5. Test RTL layouts for Arabic and Hebrew; `RTL_LOCALES` in `i18n.js` controls document direction@@ -170,7 +170,7 @@ Copy the locale file to `src/firefox/src/ui/locales/<code>.js` and update `src/f| Prefix | Section ||---|---|| `sp.` | Side panel UI |-| `st.` | Settings page |+| `st.` | Settings, Providers and Permissions pages || `tr.` | Traces page || `tool.` | Tool labels || `ob.` | Onboarding flow |diff --git a/docs/privacy-and-data-flow.md b/docs/privacy-and-data-flow.mdindex ce7e2b481..435c6ccc7 100644--- a/docs/privacy-and-data-flow.md+++ b/docs/privacy-and-data-flow.md@@ -326,7 +326,7 @@ switch for content they do not want to share.The extension records a local trace for an opted-in run even if the separateRecord traces switch is off. The upload projects only metadata from that trace,-including when the user independently selected local lossless tracing. Research+even when Record traces also keeps its full request details locally. Researchshares use a durable, revocable local outbox and are retried after temporarydelivery failures; the provider's live sharing consent is checked before eachsend. The Compass service admits these records only under explicit@@ -378,7 +378,7 @@ runs use the metadata-only tier:request/response text, tool schemas, tool arguments/results, and errormessages. Metadata-only traces do not write screenshot blobs or data URLs tothe `shots` store.-- **Lossless debug tier (explicit opt-in).** Record traces adds user/final+- **Lossless debug tier (opt-in, through Record traces).** Record traces adds user/finaltext, bounded request messages and tool schemas, model responses and toolcalls, tool arguments/results, detailed errors, screenshot bytes, tabURL/title, and attachment filename metadata. Lossless payloads havediff --git a/docs/providers-and-models.md b/docs/providers-and-models.mdindex 8a38aea9e..80f7f2a24 100644--- a/docs/providers-and-models.md+++ b/docs/providers-and-models.md@@ -25,7 +25,7 @@ and private inference-profile ARNs are omitted from this identity context.### Gemini 4 Argon and new Muse models-Settings suggests `gemini-4-argon` on Google Gemini and+The Providers page suggests `gemini-4-argon` on Google Gemini and`google/gemini-4-argon`, `meta/muse-wonder`, and `meta/muse-spark-open` onOpenRouter. These models support native tools and screenshot input. WebBraininfers their 1,048,576-token context unless a user or local runtime overrides it.@@ -62,7 +62,8 @@ cannot establish live account access or upstream availability.A decision model answers the agent's fixed-choice questions (is the taskfinished, did a watch find what it waited for, what does a request say about an-action) so the chat model does not have to. Settings asks one question first:+action) so the chat model does not have to. The Decision tab of the Providers+page asks one question first:- **Auto** (default) needs no setup. In Chrome it uses Ternary Bonsai 2 2BVision once that preset is downloaded (Providers → WebGPU, the install page or@@ -128,7 +129,7 @@ shape operators are permitted and explicitly disclosed; it is not a pure-GPUclaim. Unload or disabling outsourcing releases the Worker/GPU resources andretains the cache; **Remove cached model** requires the model to be unloaded.After **Download and load** or **Load cached model**, D1 stays loaded until-it is unloaded, removed or switched off in Settings: a decision that finds it+it is unloaded, removed or switched off on the Providers page: a decision that finds itunloaded (a browser restart, a discarded stalled session, a lost GPU device)starts one reload from the verified cache in the background and uses thefallback chain meanwhile. A reload never downloads. A decision whose caller@@ -352,8 +353,8 @@ class BaseLLMProvider {| `z_ai` | `openai` | cloud | `glm-5.2` | Model-name regex |The sidepanel also exposes `webbrain_cloud_max` as **WebBrain Compass XL**.-It is a managed, sidepanel-only runtime profile rather than a second Settings-provider card. It uses the same endpoint and sends `model: max`; the hosted+It is a managed, sidepanel-only runtime profile rather than a second provider+card on the Providers page. It uses the same endpoint and sends `model: max`; the hostedbackend returns `WebBrain Compass XL 1.0` and consumes usage credits at fivetimes the standard rate.@@ -362,8 +363,8 @@ times the standard rate.WebBrain also ships 80 disabled-by-default provider cards. Most are sourcedfrom the OpenCode provider catalog snapshot at commit`62e4641235d7847dadc60da37cca8a023dd54fc1`; provider-specific additions use-their official API documentation. Together with the original cards, Settings-contains **113 built-in providers on Chromium** and **112 on Firefox**; the+their official API documentation. Together with the original cards, the+Providers page lists **113 built-in providers on Chromium** and **112 on Firefox**; thedifference is the Chromium-only in-browser WebGPU runtime.| IDs |@@ -401,7 +402,7 @@ the proxy server and are never entered into WebBrain.[IO.NET](https://io.net/docs/guides/intelligence/io-intelligence) and[Synthetic](https://synthetic.new/) are built-in OpenAI-compatible cloud-providers. Add each service's bearer API key in its Settings card, choose a+providers. Add each service's bearer API key in its card on the Providers page, choose amodel, save, and select the provider.#### NEAR AI Cloud@@ -475,8 +476,8 @@ duplicate request.### Local ProvidersOn Chromium, **WebGPU (In-browser)** is an endpoint-free local provider.-Settings and Apocalypse Mode offer the same two presets, in this order, and-Settings also accepts a custom Hugging Face repository:+The Providers page and Apocalypse Mode offer the same two presets, in this+order, and the Providers page also accepts a custom Hugging Face repository:| Model | Download | Images | Browser context || --- | --- | --- | --- |@@ -485,7 +486,7 @@ Settings also accepts a custom Hugging Face repository:These presets ship but are hidden from the pickers for now(`WEBGPU_HIDDEN_MODEL_IDS` in `src/chrome/src/providers/webgpu.js`). A saved-selection still loads: Settings shows it as a custom model, and Apocalypse Mode+selection still loads: the Providers page shows it as a custom model, and Apocalypse Modeswitches to an offered preset.| Model | Download | Images | Browser context |@@ -685,7 +686,7 @@ Ollama, llama.cpp, ODS, LM Studio, and LocalAI default to `visionMode: auto`. Wethe selected server for model capability metadata before enrichment and sendsscreenshots only when the response explicitly reports image input. A failed ormalformed metadata request is text-only for that turn and is retried later;-Settings can override Auto with Force on or Off. For providers whose Model+The Providers page can override Auto with Force on or Off. For providers whose Modelfield may be blank, WebBrain coalesces concurrent checks but rechecks once peruser turn, so changing the model loaded by the server cannot reuse a staleanswer. Other local providers retain@@ -823,7 +824,7 @@ await pm.setActive("openai"); // Switch active providerawait pm.updateProvider("openai", { model: "gpt-5" }); // Update configawait pm.duplicateProvider("openai"); // Create openai__duplicateawait pm.removeDuplicateProvider("openai__duplicate"); // Remove it-pm.getAll(); // All provider configs (for Settings UI)+pm.getAll(); // All provider configs (for the Providers page)await pm.testProvider("openai"); // Test connection```@@ -834,11 +835,11 @@ state and is separate from `activeProvider`, which is the provider currentlyconfigured. Connection tests report reachability but do not control the Activeflag.-Settings can rename configurable providers using **Provider title** and Save.-The persisted `label` appears in Settings and the chat provider picker without+The Providers page can rename configurable providers using **Provider title**+and Save. The persisted `label` appears there and in the chat provider picker withoutchanging the provider's ID, implementation, or model.-Settings can create any number of independent duplicates of each configurable+The Providers page can create any number of independent duplicates of each configurableendpoint provider, including from a saved duplicate. The first duplicate keepsthe existing ID `<source>__duplicate`; subsequent instances use`<source>__duplicate_2`, `<source>__duplicate_3`, and so on. Each stores a@@ -854,9 +855,9 @@ Chromium-only WebGPU runtime are not duplicable because they do not representindependent user-managed API credentials or endpoints; their cards keep theDuplicate affordance disabled with an explanatory tooltip.-### Settings Search+### Provider Search-The Settings search index includes provider IDs, labels, type/category, model,+The search on the Providers page's LLM tab indexes provider IDs, labels, type/category, model,base URL, field labels/placeholders, suggestions, and compatibility options.Matching cards are ordered by exact provider name/ID, then name/ID prefix, thenname/ID substring, then field-only matches. Original provider order breaks@@ -939,10 +940,10 @@ Firefox, whose build has no MV3 offscreen document and no local option.Neither local model is in the general provider catalog as a vision sidecar orever receives agent tools or planning turns. No choice, Apocalypse Mode orscreenshot operation starts a download. Downloads run in Chrome's offscreen-extension worker, so the user may switch tabs or close Settings while they+extension worker, so the user may switch tabs or close the Providers page while theycontinue, but must keep Chrome running. Screenshots stay on-device and only the-generated description is passed to the active provider. Only Settings and-Apocalypse Mode may change the choice (`set_webgpu_vision_choice`).+generated description is passed to the active provider. Only the Providers+page and Apocalypse Mode may change the choice (`set_webgpu_vision_choice`).Screenshot routing is deterministic: an explicit dedicated vision endpoint,then a vision-capable active provider receiving raw pixels, then the in-browserdiff --git a/docs/remote-downloads.md b/docs/remote-downloads.mdindex d36d5cc86..3662b8c82 100644--- a/docs/remote-downloads.md+++ b/docs/remote-downloads.md@@ -94,7 +94,7 @@ flowchart TDdownload caches that repository.- Local vision never downloads on its own. Ternary Bonsai 2 2B Vision(1.45 GB) is the chat preset's download, started by a click on its- Download button here, in Settings or in the Text Model picker; the separate+ Download button here, on the Providers page or in the Text Model picker; the separate810 MB WebBrain VL 2 450M is downloaded only after the user consents to itin **Providers -> Vision**.diff --git a/docs/security-model.md b/docs/security-model.mdindex 99cb44a9f..1378d3d31 100644--- a/docs/security-model.md+++ b/docs/security-model.md@@ -67,8 +67,8 @@ This is a feature (it makes the agent useful with zero setup) but also the most### Experimental Local D1 DecisionsD1 is an optional finite-decision provider, not a chat generator or browser-executor. Explicit Settings consent controls download/load; the control handler-accepts only the extension's Settings sender. Chrome uses its shared offscreen+executor. Explicit consent on the Providers page controls download/load; the+control handler accepts only that extension page as the sender. Chrome uses its shared offscreendocument and a separate Worker; Firefox attempts its background-page Worker onlywhen hardware WebGPU and OPFS are available. Software adapters and inadequatebuffer limits are rejected, but other capable devices are not declared validated.@@ -80,8 +80,8 @@ Page text/pixels stay untrusted and existing redaction/wrapping remains in placeDisabling outsourcing or Strict Secret Mode discards the Worker and its GPUsessions; cached weights remain until explicitly removed. A caller that stopswaiting cancels only its own request; the Worker's deadline discards a stalled-inference session. Neither invents an answer. While the user's Settings Load-stands, a reload after a restart reads only the verified cache and never+inference session. Neither invents an answer. While the user's Load on the+Providers page stands, a reload after a restart reads only the verified cache and neverdownloads. CPU/WASM control/shapefallback is disclosed, not represented as pure GPU. A positive experimental D1judgment alone cannot establish completion: independent LLM or existing checks@@ -279,7 +279,7 @@ loop budgets are not guards and keep their behavior. Settings → General →## `/allow-api` FlagSet per-conversation via the `/allow-api` slash command in the side panel, or-persistently with **Always allow API mutations** under **Settings → General →+persistently with **Always allow API mutations** under **Settings →Advanced**. The persistent setting is on by default when absent. Read failuresand non-boolean stored values grant no authorization. When either option isactive, it waives the permission prompt for **write-method network egress only**:@@ -346,8 +346,9 @@ messages, tool schemas, tool arguments/results, and detailed error text. Defaultrun records also omit full tab URLs/titles and attachment filenames, and defaulttraces do not write screenshot blobs or data URLs to the `shots` store.-The separate lossless debug tier is off by default and requires explicit user-opt-in. A lossless run may retain bounded user/final text, request and response+The lossless debug tier is off by default and is an opt-in: Record traces+records it, and an update turns it on once for an install that recorded traces+without it. A lossless run may retain bounded user/final text, request and responsepayloads, tool schemas/calls/arguments/results, error details, screenshotbytes, tab URL/title, and attachment filename metadata. It is visibly marked,subject to per-payload, per-run, and aggregate storage bounds, and should bediff --git a/docs/test-scenarios.md b/docs/test-scenarios.mdindex 1451574a2..2e0d5dae7 100644--- a/docs/test-scenarios.md+++ b/docs/test-scenarios.md@@ -75,7 +75,7 @@ A dozen end-to-end tasks for evaluating the WebBrain browser agent across a spreRanked from easiest to most ambitious.### 1. Tracing you already have (lowest-effort baseline)-Tracing is already built in. Turn it on in Settings → "Record traces", run each scenario by hand once per model you want to compare, then open the Traces page and diff side by side. This is what we've been doing in this session. Cheap to start, but scoring is manual.+Tracing is already built in. Turn it on in Settings → Advanced → "Record traces", run each scenario by hand once per model you want to compare, then open the Traces page and diff side by side. This is what we've been doing in this session. Cheap to start, but scoring is manual.### 2. Scenario runner from the side panelAdd a `tests.json` containing `{ url, prompt, check }` rows. Build a small Test Runner tab (mirror Traces) that loops through entries: for each one, open the URL, stuff the prompt into the side panel's input, wait for the agent to finish, then evaluate `check`. Three useful flavors of `check`:diff --git a/docs/webgpu-models.md b/docs/webgpu-models.mdindex 9b505fff7..dcd50f1e7 100644--- a/docs/webgpu-models.md+++ b/docs/webgpu-models.md@@ -349,7 +349,8 @@ Results on the held-out test, RTX 5090, through the extension:(Hugging Face commit `b9895bc`, `decision-validation.json`). On the CPU itslogits and caches are bit-identical to the previous graph(`scripts/models/bonsai/check_decision_hidden.py`). Installs that cached- the previous graph keep it until the model is downloaded again in Settings;+ the previous graph keep it until the model is downloaded again on the+ Providers page;until then the provider reports that it needs the updated decoder.## Updating a published graphdiff --git a/docs/zh-CN/agent-tools.md b/docs/zh-CN/agent-tools.mdindex 906ad3fc8..3b7221496 100644--- a/docs/zh-CN/agent-tools.md+++ b/docs/zh-CN/agent-tools.md@@ -112,7 +112,7 @@ FreeSkillz.xyz 技能可暴露 `read_youtube_transcript` 以及 `resolve_public_即使所属技能已加载,Ask 模式仍会过滤变更类和下载类工具。参见[技能](skills.md)。**WebMCP(实验性,默认启用)。** 上表中的 `list_webmcp_tools` /-`execute_webmcp_tool` 行仅在设置 → 常规 → 高级中启用**实验性 WebMCP** 时适用。+`execute_webmcp_tool` 行仅在设置 → Bridge 中启用**实验性 WebMCP** 时适用。该设置默认开启;关闭时,这些工具及其提示引导不会包含在模型请求中。诸如`readOnly` 之类的 WebMCP 注解是页面自行声明的提示,而非安全边界。每次调用都需要Act 或 Dev 模式、逐次的新确认,以及常规的「能力 × 注册帧来源」权限。WebMCP 目前diff --git a/docs/zh-CN/localization.md b/docs/zh-CN/localization.mdindex b4aa169d3..a9c2273ef 100644--- a/docs/zh-CN/localization.md+++ b/docs/zh-CN/localization.md@@ -37,7 +37,7 @@ src/chrome/src/ui/└── zh.js # 中文```-设置 → 语言会列出 `i18n.js` 中 `LANGUAGES` 的全部 **23** 种语言(英语和中文置顶;+侧边栏的语言菜单会列出 `i18n.js` 中 `LANGUAGES` 的全部 **23** 种语言(英语和中文置顶;其余按英文名排序)。### 关键函数@@ -126,8 +126,8 @@ export const LANGUAGES = [### 步骤 4:测试-1. 打开扩展设置-2. 在语言下拉菜单中选择新语言+1. 打开侧边栏+2. 在左上角的语言菜单中选择新语言3. 验证侧面板、设置和追踪页面是否正确渲染4. 检查缺失的键是否优雅地回退到英语5. 如果添加阿拉伯语或希伯来语,测试 RTL 布局@@ -147,7 +147,7 @@ export const LANGUAGES = [| 前缀 | 区域 ||---|---|| `sp.` | 侧面板 UI |-| `st.` | 设置页面 |+| `st.` | 设置、提供商和权限页面 || `tr.` | 追踪页面 || `tool.` | 工具标签 || `ob.` | 引导流程 |diff --git a/docs/zh-CN/privacy-and-data-flow.md b/docs/zh-CN/privacy-and-data-flow.mdindex d7a451966..ec26f9cea 100644--- a/docs/zh-CN/privacy-and-data-flow.md+++ b/docs/zh-CN/privacy-and-data-flow.md@@ -24,7 +24,7 @@### 哪个提供商接收数据?-用户在设置中选择他们的提供商。选项包括:+用户在提供商页面中选择他们的提供商。选项包括:- **WebBrain Compass**:请求会经过 `api.webbrain.one`;“帮助改进 WebBrain”默认启用,在其保持启用期间,部分交互可能会被保留并用于评估、改进、微调和训练- **用户自带的云提供商**:OpenAI、Anthropic、Google Gemini、Mistral、DeepSeek、xAI、Groq、OpenRouter 等——请求使用用户凭据直接发送给提供商,WebBrain 不会收集这些请求@@ -46,7 +46,7 @@### 追踪记录器-启用时(设置 → 显示 → "记录追踪"),每次代理运行都会写入一个 IndexedDB 数据库(`webbrain_traces`):+启用时(设置 → 高级 → "记录轨迹"),每次代理运行都会写入一个 IndexedDB 数据库(`webbrain_traces`):- **`runs` 存储**:模型、提供商、令牌总数、时间戳、用户消息、最终内容- **`events` 存储**:每一步的 LLM 请求/响应、工具调用及其参数和结果diff --git a/docs/zh-CN/prompt-injection-defense.md b/docs/zh-CN/prompt-injection-defense.mdindex 7c0db1795..74d96ec66 100644--- a/docs/zh-CN/prompt-injection-defense.md+++ b/docs/zh-CN/prompt-injection-defense.md@@ -16,7 +16,7 @@ WebBrain 的智能体在**用户已认证的浏览器会话内**运行:它可- 代码:`tools.js` 中的 `SYSTEM_PROMPT_ASK`、`SYSTEM_PROMPT_ACT`、`SYSTEM_PROMPT_ACT_MID`、`SYSTEM_PROMPT_ACT_COMPACT` 和 `SYSTEM_PROMPT_DEV_APPENDIX`,以及 `planner.js` 中的 `PLANNER_SYSTEM_PROMPT`(用于行动前规划的循环前调用)。3. **能力 × 来源权限门(第 3 层)。** 在后果性工具运行之前,智能体检查 `(capability, host)` 授权,如果没有则提示用户(允许一次 / 始终允许 / 拒绝)。无文本检查,无 LLM — 人类是信任锚点。- 代码:`permission-gate.js`(`capabilityFor`、`requiredHosts`、`PermissionManager`);`agent.js` 中的门循环 `_executeToolBatch`。- - 用户控制:设置 → 权限(审查/撤销授权 + 主开关"在后果性操作前询问")。+ - 用户控制:权限页面(审查/撤销授权 + 主开关"在后果性操作前询问")。4. **输出清理器(第 4 层)。** 模型输出经过 HTML 转义,只有 `[label](url)` 格式的 markdown 会变成允许列表中的(http/https/mailto)链接 — 不自动加载图像,不将裸 URL 转换为链接。- 代码:`ui/markdown-link.js`。@@ -67,7 +67,7 @@ messages.push({ role: 'user', content: `[…]\n${wrapped}` });- `done` 工具结果推送(在正常包装前特殊处理)。### 不要为"可信站点"削弱边界-主开关(设置 → 权限)**仅禁用第 3 层**(提示)。第 1、2、4 层始终保持开启 — 它们不消耗任何成本,并且正是保护用户在真正存在注入内容的可信站点上安全的部分(知名域名与安全内容*负相关*)。绝不要将第 1/2/4 层置于某个设置开关之后。+主开关(权限页面)**仅禁用第 3 层**(提示)。第 1、2、4 层始终保持开启 — 它们不消耗任何成本,并且正是保护用户在真正存在注入内容的可信站点上安全的部分(知名域名与安全内容*负相关*)。绝不要将第 1/2/4 层置于某个设置开关之后。---@@ -77,7 +77,7 @@ messages.push({ role: 'user', content: `[…]\n${wrapped}` });- **穷举守卫**:来自 `getToolsForMode('act')` 和 `getToolsForMode('dev')` 的每个模型暴露的行动工具必须被门控(`capabilityFor`)、不可信读取(`UNTRUSTED_CONTENT_TOOLS`)或在 `KNOWN_SAFE_TOOLS` 允许列表中(定义于 `test/run.js`)— 否则 CI 失败。- 能力映射、主机解析、`requiredHosts`、`frameHostMatches`、授权存储 / `hydrateFrom`、内容包装的越狱剥离。- `test/security/injection-corpus.mjs` 中的规划器提示对等性/边界检查。-- `test/manual-permissions.md` — 浏览器内检查清单(3 选项权限卡片和设置 → 权限标签页),单元套件无法覆盖这些内容。+- `test/manual-permissions.md` — 浏览器内检查清单(3 选项权限卡片和权限页面),单元套件无法覆盖这些内容。**守卫检查工具是否被*列出*,而不是它们是否被*正确列出*。** 如果工具的结果携带页面派生字节,它属于 `UNTRUSTED_CONTENT_TOOLS`,即使它"只是一个状态工具"(参见 `done`)。如有疑问,请包装它 — 包装可信字段是无害的;留下未包装的页面派生字段则是一个漏洞。diff --git a/docs/zh-CN/providers-and-models.md b/docs/zh-CN/providers-and-models.mdindex a8852004d..7a50c16c2 100644--- a/docs/zh-CN/providers-and-models.md+++ b/docs/zh-CN/providers-and-models.md@@ -71,7 +71,7 @@ class BaseLLMProvider {WebBrain 从 OpenCode 提供商目录提交`62e4641235d7847dadc60da37cca8a023dd54fc1` 的快照中新增了 76 张默认禁用的-提供商卡片。设置中在 **Chromium 上共有 106 个内置提供商**,在 **Firefox+提供商卡片。提供商页面在 **Chromium 上共有 106 个内置提供商**,在 **Firefox上共有 105 个**;两者的差异是仅 Chromium 提供的本地 WebGPU 运行时。完整 ID列表如下:@@ -111,7 +111,7 @@ WebBrain 会直接记录;若服务省略用量,则记录基于字符数的### 本地提供商-在 Chromium 上,**WebGPU(浏览器内)** 是无端点的本地提供商。提供商页面和末日模式选择器提供两个预设:**Compass Tiny v2.1**(默认,`q4f16`,约 1.87 GB,仅文本,32k 上下文)和 **Ternary Bonsai 2 2B Vision**(约 1.45 GB,支持图片,16k 上下文),走 Transformers.js / ONNX;Settings 还接受自定义 Hugging Face 仓库。其他 Bonsai 2 预设随扩展提供,但暂时不在选择器中显示。启用末日模式时会自动下载所选模型;缓存完成后,即使未启用末日模式也可正常使用。在显存受限的 GPU 上,可在 Settings → Providers 中调低上下文窗口。Firefox 不提供该卡片。+在 Chromium 上,**WebGPU(浏览器内)** 是无端点的本地提供商。提供商页面和末日模式选择器提供两个预设:**Compass Tiny v2.1**(默认,`q4f16`,约 1.87 GB,仅文本,32k 上下文)和 **Ternary Bonsai 2 2B Vision**(约 1.45 GB,支持图片,16k 上下文),走 Transformers.js / ONNX;提供商页面还接受自定义 Hugging Face 仓库。其他 Bonsai 2 预设随扩展提供,但暂时不在选择器中显示。启用末日模式时会自动下载所选模型;缓存完成后,即使未启用末日模式也可正常使用。在显存受限的 GPU 上,可在提供商页面的 WebGPU 卡片中调低上下文窗口。Firefox 不提供该卡片。浏览器内模型只回答问题。在侧边栏中,每个 Ask 回合只进行一次不带工具的调用:WebBrain 先读取当前页面、选中文本、PDF 标签页以及问题中链接的页面,再把这些文本和一个简短提示一起发送(tiny Ask,见 `docs/webgpu-models.md`)。该提供商不支持 Act 和 Dev 模式;如需在浏览器中执行操作,请选择其他提供商。@@ -155,7 +155,7 @@ CLIProxyAPI 官方插件商店安装 `gemini-cli`,重启代理,再使用 `--Ollama、llama.cpp、LM Studio 和 LocalAI 默认使用 `visionMode: auto`。WebBrain 在页面上下文增强前读取所选模型的原生服务器元数据,只有服务器明确报告支持图像输入时才-发送截图。元数据请求失败或格式错误时,本回合按纯文本处理,之后会重试。设置中+发送截图。元数据请求失败或格式错误时,本回合按纯文本处理,之后会重试。提供商页面中可选择自动、强制开启或关闭。模型字段为空时,每个用户回合都会重新检测当前加载模型的能力,以便服务端热切换立即生效;其他本地提供商保持现有的显式开关行为。@@ -268,13 +268,13 @@ await pm.save(); // 持久化到 chrome.storage.localpm.getActive(); // 获取当前激活的提供商实例await pm.setActive('openai'); // 切换激活的提供商await pm.updateProvider('openai', { model: 'gpt-5' }); // 更新配置-pm.getAll(); // 所有提供商配置(用于设置界面)+pm.getAll(); // 所有提供商配置(用于提供商页面)await pm.testProvider('openai'); // 测试连接```-### 设置搜索+### 提供商搜索-设置搜索索引包括提供商 ID、标签、类型/类别、模型、Base URL、字段标签与占位符、建议项和兼容性选项。匹配卡片依次按提供商名称/ID 完全匹配、前缀匹配、子串匹配和仅字段匹配排序;同级结果保持原始提供商顺序,当前选中的提供商在类别筛选时始终可见。+提供商页面 LLM 标签页的搜索索引包括提供商 ID、标签、类型/类别、模型、Base URL、字段标签与占位符、建议项和兼容性选项。匹配卡片依次按提供商名称/ID 完全匹配、前缀匹配、子串匹配和仅字段匹配排序;同级结果保持原始提供商顺序,当前选中的提供商在类别筛选时始终可见。### 配置持久化diff --git a/docs/zh-CN/security-model.md b/docs/zh-CN/security-model.mdindex b665ab50a..a1f2419c9 100644--- a/docs/zh-CN/security-model.md+++ b/docs/zh-CN/security-model.md@@ -73,7 +73,7 @@### 个人资料自动填充-用户可以在设置 → 个人资料中存储简短的个人资料(姓名、电子邮件、一次性密码)。此文本在启用时附加到系统提示中。界面中的警告:+用户可以在设置 → 记忆中存储简短的个人资料(姓名、电子邮件、一次性密码)。此文本在启用时附加到系统提示中。界面中的警告:- 以明文存储在 `chrome.storage.local` 中- 每次轮次都作为系统提示的一部分发送给 LLM 提供商@@ -96,7 +96,7 @@| **分层工具暴露** | 提供商层级(`compact | mid | full`)限制较小模型的普通浏览器智能体操作面。Compact 获得最小的操作面;Mid 添加常见任务工具;Full 添加高级 UI/DOM 回退。Compact Dev 被阻止。 || **行动前规划** | 启用时,行动模式的运行首先生成结构化计划,并等待侧面板批准后才执行任何浏览器工具。定时运行仅通过调度器策略可自动批准计划。 || **技能导入边界** | 技能可通过 `webbrain-tools` 清单暴露只读 HTTP 工具和下载任务工具。导入或保持技能启用是对声明的 HTTPS 端点的信任决策;声明的技能工具使用 `credentials: "omit"` 并应将第三方结果标记为 `resultPolicy: "untrusted"`。下载任务技能工具在保存文件前仍需行动模式和正常的下载权限门。 |-| **API 变更覆盖** | 每个对话的 `/allow-api` 标记,或“常规 → 高级”中默认关闭的持久设置,都会*免除*写方法网络出口(`fetch_url`/`research_url` 的 POST/PUT/PATCH/DELETE)的权限提示。两者都不免除 GET 出口或任何其他能力。对话重置仅清除斜杠命令覆盖。 |+| **API 变更覆盖** | 每个对话的 `/allow-api` 标记,或“设置 → 高级”中默认关闭的持久设置,都会*免除*写方法网络出口(`fetch_url`/`research_url` 的 POST/PUT/PATCH/DELETE)的权限提示。两者都不免除 GET 出口或任何其他能力。对话重置仅清除斜杠命令覆盖。 || **`done()` 阻塞** | 在接受完成前,智能体探测是否有打开的对话框/表单。如果摘要声称"已创建"/"已保存"但模态框仍打开,则强制智能体继续。 || **重复提交防护** | 在 45 秒窗口内,每个标签页+URL 阻止对类似提交文本(create/save/submit/add/post/publish/send/confirm/sign up/log in/pay/checkout/order 等)的点击(Chrome)。 || **CLICK 遮挡测试** | 在点击前,解析器调用 `elementFromPoint()`。如果另一个元素视觉上位于上方,则拒绝点击。 |@@ -117,7 +117,7 @@## `/allow-api` 标记-可通过侧面板中的 `/allow-api` 斜杠命令为每个对话设置,也可在**设置 → 常规 → 高级**中+可通过侧面板中的 `/allow-api` 斜杠命令为每个对话设置,也可在**设置 → 高级**中开启**始终允许 API 变更**使其持久生效。持久设置默认关闭。任一选项激活时,都仅免除**写方法网络出口**的权限提示:@@ -137,7 +137,7 @@## 追踪数据隔离-追踪记录器(`trace/recorder.js`)在用户显式启用时(设置 → 显示 →"记录追踪")写入用户机器上的 IndexedDB。数据从不离开浏览器:+追踪记录器(`trace/recorder.js`)在用户显式启用时(设置 → 高级 →"记录轨迹")写入用户机器上的 IndexedDB。数据从不离开浏览器:- `runs` 存储:模型、提供商、令牌总数、时间戳- `events` 存储:LLM 请求/响应、工具调用、截图元数据diff --git a/docs/zh-CN/slash-commands.md b/docs/zh-CN/slash-commands.mdindex 731ae0d5d..2350de04d 100644--- a/docs/zh-CN/slash-commands.md+++ b/docs/zh-CN/slash-commands.md@@ -76,7 +76,7 @@ CDP 截图,并仅在该次运行期间模拟焦点;Firefox 使用 `tabs.capt`/allow-api` 会为当前对话解除 UI 优先限制,使智能体在 UI 失败时可通过 `fetch_url`或 `research_url` 使用 POST/PUT/PATCH/DELETE。激活期间会显示徽章,并在 `/reset` 时清除。-若要让相同策略在不同对话和浏览器重启后继续生效,请在**设置 → 常规 → 高级**中开启+若要让相同策略在不同对话和浏览器重启后继续生效,请在**设置 → 高级**中开启**始终允许 API 变更**。该设置默认关闭,并会一直生效到你手动关闭。`/reset` 仍会清除当前对话的 `/allow-api` 覆盖,但不会更改此持久设置。diff --git a/docs/zh-CN/test-scenarios.md b/docs/zh-CN/test-scenarios.mdindex 9614f5b4e..a80f38c7a 100644--- a/docs/zh-CN/test-scenarios.md+++ b/docs/zh-CN/test-scenarios.md@@ -75,7 +75,7 @@按从最简单到最宏大的顺序排列。### 1. 你已经拥有的追踪(最低成本基线)-追踪已经内置。在设置中打开"录制追踪",为每个要比较的模型手动运行每个场景一次,然后打开追踪页面并排对比。这就是我们本轮一直在做的。启动成本低,但评分是手动的。+追踪已经内置。在设置 → 高级中打开"记录轨迹",为每个要比较的模型手动运行每个场景一次,然后打开追踪页面并排对比。这就是我们本轮一直在做的。启动成本低,但评分是手动的。### 2. 从侧面板运行场景运行器添加一个 `tests.json`,包含 `{ url, prompt, check }` 行。构建一个小型测试运行器标签页(镜像追踪),循环遍历条目:对于每个条目,打开 URL,将提示填入侧面板的输入框,等待代理完成,然后评估 `check`。三种有用的 `check` 类型:diff --git a/src/chrome/src/background.js b/src/chrome/src/background.jsindex 159d35d0c..e764527eb 100644--- a/src/chrome/src/background.js+++ b/src/chrome/src/background.js@@ -628,10 +628,17 @@ loadAutoScreenshot();// Settings has one Record traces switch for both trace tiers: full request// details are recorded whenever traces are. A profile from before the merge-// can have the two set apart; line them up once so the switch shows what is-// recorded. Harnesses that set the tiers apart afterwards keep their choice.+// can have the two set apart, so the update lines them up once and the switch+// shows what is recorded. A new install has nothing to line up and only notes+// that, so harnesses that set the tiers apart on a fresh profile keep their+// choice, as does anyone who sets them apart after the merge.const TRACE_TIERS_MERGED_KEY = 'traceTiersMergedV1';-async function mergeTraceTiers() {+async function mergeTraceTiers(reason) {+ if (reason === 'install') {+ await chrome.storage.local.set({ [TRACE_TIERS_MERGED_KEY]: true });+ return;+ }+ if (reason !== 'update') return;const stored = await chrome.storage.local.get(['tracingEnabled', 'losslessTrace', TRACE_TIERS_MERGED_KEY]);if (stored[TRACE_TIERS_MERGED_KEY] === true) return;const updates = { [TRACE_TIERS_MERGED_KEY]: true };@@ -640,7 +647,9 @@ async function mergeTraceTiers() {}await chrome.storage.local.set(updates);}-mergeTraceTiers().catch(() => {});+chrome.runtime.onInstalled.addListener(({ reason }) => {+ mergeTraceTiers(reason).catch(() => {});+});async function loadSiteAdapters() {const stored = await chrome.storage.local.get('useSiteAdapters');@@ -4488,11 +4497,14 @@ async function handleMessage(msg, sender) {imported.settings,): imported.settings;- // A restored export carries Record traces only; full request details follow- // it, as they do in Settings. Provisioning patches keep their own tiers.- await chrome.storage.local.set(msg.action === 'import_config' && Object.hasOwn(settings, 'tracingEnabled')- ? { ...settings, losslessTrace: settings.tracingEnabled === true }- : settings);+ // Exports carry Record traces only. A restored export brings full request+ // details along with it, as the Settings switch does. A provisioning+ // patch can turn both off, but never turns full request details on.+ const traceTiers = Object.hasOwn(settings, 'tracingEnabled')+ && (msg.action === 'import_config' || settings.tracingEnabled !== true)+ ? { losslessTrace: settings.tracingEnabled === true }+ : {};+ await chrome.storage.local.set({ ...settings, ...traceTiers });await providerManager.load();await Promise.all([loadMaxSteps(),diff --git a/src/chrome/src/ui/captcha-settings.js b/src/chrome/src/ui/captcha-settings.jsindex 1565a1c26..937d41c00 100644--- a/src/chrome/src/ui/captcha-settings.js+++ b/src/chrome/src/ui/captcha-settings.js@@ -6,7 +6,16 @@ export async function initCaptchaSettings(storage, sendToBackground, t) {const card = document.getElementById('captcha-card');if (!card) return;card.hidden = managed;- if (managed) return;+ if (managed) {+ // A managed browser solves through WebBrain Cloud and has no keys to set+ // here, so its CAPTCHA tab steps aside and a deep link lands on General.+ const tab = document.querySelector('.tab-btn[data-tab="captcha"]');+ if (tab) {+ tab.hidden = true;+ if (tab.classList.contains('active')) document.querySelector('.tab-btn[data-tab="display"]')?.click();+ }+ return;+ }for (const provider of CAPTCHA_PROVIDERS) {const id = provider.domId;const typeLabels = { recaptcha_v2: 'reCAPTCHA v2', recaptcha_v2_enterprise: 'reCAPTCHA v2 Enterprise',diff --git a/src/chrome/src/ui/settings.js b/src/chrome/src/ui/settings.jsindex b8357e15a..83c19e8e7 100644--- a/src/chrome/src/ui/settings.js+++ b/src/chrome/src/ui/settings.js@@ -416,8 +416,10 @@ function searchTextForGeneralItem(item) {return normalizeGeneralSearchText(`${item.textContent || ''} ${keyedText}`);}+// The search hides rows with a class of its own and leaves the hidden+// attribute to the code that owns each row, so clearing a search cannot bring+// back a card that is hidden for another reason (a managed CAPTCHA card, say).function setGeneralSearchHidden(item, hidden) {- item.hidden = hidden;item.classList.toggle('general-search-hidden', hidden);}@@ -435,7 +437,7 @@ function filterGeneralSettings() {const scope = panel.querySelector('[data-search-scope]') || panel;let panelMatches = 0;for (const item of Array.from(scope.children)) {- const matches = !query || searchTextForGeneralItem(item).includes(query);+ const matches = !query || (!item.hidden && searchTextForGeneralItem(item).includes(query));setGeneralSearchHidden(item, !!query && !matches);if (matches) panelMatches += 1;}@@ -2326,6 +2328,13 @@ async function reloadProfileSyncData() {activeProviderId = res.active;renderProviders();}+// Profile sync runs from Settings, but what it pulls also fills the Providers+// page. Settings pages open in other tabs reload what they show, so a Save+// there cannot write stale values over the synced ones.+const settingsPagesChannel = typeof BroadcastChannel === 'function' ? new BroadcastChannel('webbrain-settings-pages') : null;+settingsPagesChannel?.addEventListener('message', (event) => {+ if (event.data?.type === 'profile-sync-data-changed') reloadProfileSyncData().catch(() => {});+});function profileSyncButtonRestore(button, pendingLabel) {if (!button) return () => {};const previousDisabled = button.disabled;@@ -2339,7 +2348,10 @@ async function profileSyncAction(action, data = {}, options = {}) {try {if (options.pending) showProfileSyncResult(true, options.pending);const result = await sendToBackground(action, data);- if (['profile_sync_unlock', 'profile_sync_now', 'profile_sync_reset'].includes(action)) await reloadProfileSyncData();+ if (['profile_sync_unlock', 'profile_sync_now', 'profile_sync_reset'].includes(action)) {+ settingsPagesChannel?.postMessage({ type: 'profile-sync-data-changed' });+ await reloadProfileSyncData();+ }showProfileSyncResult(true, options.success || t('st.sync.result.updated'));await refreshProfileSyncState();return result;diff --git a/src/firefox/src/background.js b/src/firefox/src/background.jsindex 4b93ebb14..c8dcbbfae 100644--- a/src/firefox/src/background.js+++ b/src/firefox/src/background.js@@ -531,10 +531,17 @@ loadAutoScreenshot();// Settings has one Record traces switch for both trace tiers: full request// details are recorded whenever traces are. A profile from before the merge-// can have the two set apart; line them up once so the switch shows what is-// recorded. Harnesses that set the tiers apart afterwards keep their choice.+// can have the two set apart, so the update lines them up once and the switch+// shows what is recorded. A new install has nothing to line up and only notes+// that, so harnesses that set the tiers apart on a fresh profile keep their+// choice, as does anyone who sets them apart after the merge.const TRACE_TIERS_MERGED_KEY = 'traceTiersMergedV1';-async function mergeTraceTiers() {+async function mergeTraceTiers(reason) {+ if (reason === 'install') {+ await browser.storage.local.set({ [TRACE_TIERS_MERGED_KEY]: true });+ return;+ }+ if (reason !== 'update') return;const stored = await browser.storage.local.get(['tracingEnabled', 'losslessTrace', TRACE_TIERS_MERGED_KEY]);if (stored[TRACE_TIERS_MERGED_KEY] === true) return;const updates = { [TRACE_TIERS_MERGED_KEY]: true };@@ -543,7 +550,9 @@ async function mergeTraceTiers() {}await browser.storage.local.set(updates);}-mergeTraceTiers().catch(() => {});+browser.runtime.onInstalled.addListener(({ reason }) => {+ mergeTraceTiers(reason).catch(() => {});+});async function loadSiteAdapters() {const stored = await browser.storage.local.get('useSiteAdapters');@@ -3901,11 +3910,14 @@ async function handleMessage(msg, sender) {imported.settings,): imported.settings;- // A restored export carries Record traces only; full request details follow- // it, as they do in Settings. Provisioning patches keep their own tiers.- await browser.storage.local.set(msg.action === 'import_config' && Object.hasOwn(settings, 'tracingEnabled')- ? { ...settings, losslessTrace: settings.tracingEnabled === true }- : settings);+ // Exports carry Record traces only. A restored export brings full request+ // details along with it, as the Settings switch does. A provisioning+ // patch can turn both off, but never turns full request details on.+ const traceTiers = Object.hasOwn(settings, 'tracingEnabled')+ && (msg.action === 'import_config' || settings.tracingEnabled !== true)+ ? { losslessTrace: settings.tracingEnabled === true }+ : {};+ await browser.storage.local.set({ ...settings, ...traceTiers });await providerManager.load();await Promise.all([loadMaxSteps(),diff --git a/src/firefox/src/ui/captcha-settings.js b/src/firefox/src/ui/captcha-settings.jsindex 1565a1c26..937d41c00 100644--- a/src/firefox/src/ui/captcha-settings.js+++ b/src/firefox/src/ui/captcha-settings.js@@ -6,7 +6,16 @@ export async function initCaptchaSettings(storage, sendToBackground, t) {const card = document.getElementById('captcha-card');if (!card) return;card.hidden = managed;- if (managed) return;+ if (managed) {+ // A managed browser solves through WebBrain Cloud and has no keys to set+ // here, so its CAPTCHA tab steps aside and a deep link lands on General.+ const tab = document.querySelector('.tab-btn[data-tab="captcha"]');+ if (tab) {+ tab.hidden = true;+ if (tab.classList.contains('active')) document.querySelector('.tab-btn[data-tab="display"]')?.click();+ }+ return;+ }for (const provider of CAPTCHA_PROVIDERS) {const id = provider.domId;const typeLabels = { recaptcha_v2: 'reCAPTCHA v2', recaptcha_v2_enterprise: 'reCAPTCHA v2 Enterprise',diff --git a/src/firefox/src/ui/settings.js b/src/firefox/src/ui/settings.jsindex 532d142da..0ea44a34f 100644--- a/src/firefox/src/ui/settings.js+++ b/src/firefox/src/ui/settings.js@@ -363,8 +363,10 @@ function searchTextForGeneralItem(item) {return normalizeGeneralSearchText(`${item.textContent || ''} ${keyedText}`);}+// The search hides rows with a class of its own and leaves the hidden+// attribute to the code that owns each row, so clearing a search cannot bring+// back a card that is hidden for another reason (a managed CAPTCHA card, say).function setGeneralSearchHidden(item, hidden) {- item.hidden = hidden;item.classList.toggle('general-search-hidden', hidden);}@@ -382,7 +384,7 @@ function filterGeneralSettings() {const scope = panel.querySelector('[data-search-scope]') || panel;let panelMatches = 0;for (const item of Array.from(scope.children)) {- const matches = !query || searchTextForGeneralItem(item).includes(query);+ const matches = !query || (!item.hidden && searchTextForGeneralItem(item).includes(query));setGeneralSearchHidden(item, !!query && !matches);if (matches) panelMatches += 1;}@@ -1929,6 +1931,13 @@ function renderProfileSyncState(state) {async function refreshProfileSyncState() { const state = await sendToBackground('profile_sync_state').catch(e => ({ status: 'error', error: e.message })); renderProfileSyncState(state); return state; }async function reloadProfileSyncData() { const stored = await browser.storage.local.get(['profileEnabled', 'profileText', 'visionModel', 'transcriptionModel', 'imageGenModel']); if (profileEnabledToggle) profileEnabledToggle.checked = !!stored.profileEnabled; if (profileTextArea) profileTextArea.value = stored.profileText || ''; const vision = stored.visionModel || {}; if (visionBaseUrlInput) { visionBaseUrlInput.value = vision.baseUrl || ''; visionApiKeyInput.value = vision.apiKey || ''; visionModelInput.value = vision.model || ''; } const transcription = stored.transcriptionModel || {}; if (transcriptionBaseUrlInput) transcriptionBaseUrlInput.value = transcription.baseUrl || ''; if (transcriptionApiKeyInput) transcriptionApiKeyInput.value = transcription.apiKey || ''; if (transcriptionModelInput) transcriptionModelInput.value = transcription.model || ''; const imageGen = stored.imageGenModel || {}; if (imageGenApiKeyInput) imageGenApiKeyInput.value = imageGen.apiKey || ''; if (imageGenModelInput) imageGenModelInput.value = imageGen.model || ''; updateMultimodalDetectedProvider('vision'); updateMultimodalDetectedProvider('transcription'); await loadUserMemorySettings(); if (!providersContainer) return; const res = await sendToBackground('get_providers'); providersData = res.providers; activeProviderId = res.active; renderProviders(); }async function requestProfileSyncDataConsent() { const permissions = await browser.permissions.getAll(); if (!Object.hasOwn(permissions, 'data_collection')) return window.confirm(t('st.sync.consent.legacy')); return browser.permissions.request({ data_collection: ['personallyIdentifyingInfo', 'authenticationInfo', 'personalCommunications', 'websiteContent', 'technicalAndInteraction'] }); }+// Profile sync runs from Settings, but what it pulls also fills the Providers+// page. Settings pages open in other tabs reload what they show, so a Save+// there cannot write stale values over the synced ones.+const settingsPagesChannel = typeof BroadcastChannel === 'function' ? new BroadcastChannel('webbrain-settings-pages') : null;+settingsPagesChannel?.addEventListener('message', (event) => {+ if (event.data?.type === 'profile-sync-data-changed') reloadProfileSyncData().catch(() => {});+});function profileSyncButtonRestore(button, pendingLabel) {if (!button) return () => {};const previousDisabled = button.disabled;@@ -1942,7 +1951,10 @@ async function profileSyncAction(action, data = {}, options = {}) {try {if (options.pending) showProfileSyncResult(true, options.pending);const result = await sendToBackground(action, data);- if (['profile_sync_unlock', 'profile_sync_now', 'profile_sync_reset'].includes(action)) await reloadProfileSyncData();+ if (['profile_sync_unlock', 'profile_sync_now', 'profile_sync_reset'].includes(action)) {+ settingsPagesChannel?.postMessage({ type: 'profile-sync-data-changed' });+ await reloadProfileSyncData();+ }showProfileSyncResult(true, options.success || t('st.sync.result.updated'));await refreshProfileSyncState();return result;diff --git a/test/README.md b/test/README.mdindex 8922e3d5d..6d11fb73e 100644--- a/test/README.md+++ b/test/README.md@@ -120,7 +120,7 @@ workflow itself.### First run-No providers are configured yet. The runner opens the Settings page; add a provider + API key there, close the browser, re-run. Or run `npm run test:anonymous -- --setup` just to open Settings without trying to execute.+No providers are configured yet. The runner opens the Providers page; add a provider + API key there, close the browser, re-run. Or run `npm run test:anonymous -- --setup` just to open the Providers page without trying to execute.### Scenarios@@ -136,7 +136,7 @@ Only anonymous/public sites here. Signed-in scenarios (Gmail, GitHub issue filin```bashnpm run test:anonymous # all scenariosnpm run test:anonymous -- --scenario=arxiv-attention-title # just one-npm run test:anonymous -- --setup # open settings only+npm run test:anonymous -- --setup # open the Providers page only```Headed by default so you can watch runs and intervene. Budget ≈ 10–30 seconds per scenario + LLM tokens per the configured provider.diff --git a/test/anonymous/run.mjs b/test/anonymous/run.mjsindex a10096452..67a861f2d 100644--- a/test/anonymous/run.mjs+++ b/test/anonymous/run.mjs@@ -73,8 +73,8 @@ async function main() {});if (!providerCheck.ok) {console.log(`\n No active provider configured (${providerCheck.reason}).`);- console.log(` Opening Settings — enable a provider, set it active, then close the browser and re-run.`);- await context.newPage().then(p => p.goto(`chrome-extension://${extensionId}/src/ui/settings.html`));+ console.log(` Opening Providers — enable a provider, set it active, then close the browser and re-run.`);+ await context.newPage().then(p => p.goto(`chrome-extension://${extensionId}/src/ui/providers.html`));if (interactiveSetup) {console.log(' Waiting for the browser to close...');await context.waitForEvent('close', { timeout: 0 });diff --git a/test/captcha-settings-ui.mjs b/test/captcha-settings-ui.mjsindex b6cd6995e..f02d7f5f0 100644--- a/test/captcha-settings-ui.mjs+++ b/test/captcha-settings-ui.mjs@@ -143,8 +143,23 @@ try {assert.equal(await page.evaluate(name => testStore[name], enabledName), true);}await page.evaluate(() => chrome.storage.local.set({ webbrainCloudManaged: true }));- await openSettings();+ // A managed browser has no keys to set: its CAPTCHA tab steps aside, and+ // neither a search nor a language change brings the card back.+ await page.goto(`${origin}/src/${build}/src/ui/settings.html#captcha`);+ await page.reload();+ await page.waitForFunction(() => document.documentElement.dataset.settingsReady === 'true');+ assert.equal(await page.locator('.tab-btn.active').getAttribute('data-tab'), 'display', 'a managed CAPTCHA deep link lands on General');+ assert.equal(await page.locator('.tab-btn[data-tab="captcha"]').isVisible(), false, 'managed settings hide the CAPTCHA tab');assert.equal(await card.isVisible(), false, 'managed settings keep broker-only UI');+ await page.locator('#input-general-search').fill('CapSolver');+ assert.equal(await page.locator('[data-panel="captcha"]').isVisible(), false, 'search leaves the managed CAPTCHA card out');+ assert.equal(await page.locator('#general-search-empty').isVisible(), true, 'nothing else matches the solver name');+ await page.locator('#input-general-search').fill('');+ const otherLang = lang === 'en' ? 'de' : 'en';+ await page.evaluate(code => chrome.storage.local.set({ wbLocale: code }), otherLang);+ await page.waitForFunction(code => document.documentElement.lang === code, otherLang);+ assert.equal(await card.evaluate(el => el.hidden), true, 'a cleared search or a language change keeps the managed card hidden');+ assert.equal(await page.locator('.tab-btn[data-tab="captcha"]').isVisible(), false);assert.deepEqual(errors, []);await page.close();console.log(`PASS ${build} ${lang} ${width}: settings, validation, independent consent, persistence, balance, and managed mode`);diff --git a/test/manual-permissions.md b/test/manual-permissions.mdindex 2b7f54fa2..2d25ea77d 100644--- a/test/manual-permissions.md+++ b/test/manual-permissions.md@@ -1,4 +1,4 @@-# Manual test: capability × origin permission gate + Settings UI+# Manual test: capability × origin permission gate + Permissions pageThese two paths can't be covered by `test/run.js` (they need a live browser —the 3-option permission card and the Permissions page are DOM/storage@@ -11,7 +11,7 @@ Load the unpacked extension your usual dev way:- **Chrome:** `chrome://extensions` → Developer mode → Load unpacked → `src/chrome`.Helpers you'll reuse (run in the background/service-worker console, or the-Settings page console):+Permissions page console):- **Inspect grants:** `await browser.storage.local.get('wb_permissions')`(Firefox) / `chrome.storage.local.get('wb_permissions')` (Chrome).- **Reset grants:** `browser.storage.local.remove('wb_permissions')`, or@@ -31,7 +31,7 @@ simple page with a visible clickable button.and **NO free-text input** (permission cards are structured — the buttonsreturn `once`/`always`/`deny`, not typed text).3. **Check layout** — all three buttons visible, not clipped/overlapping/wrapping.-4. **Localization** — switch the language (Settings → display) to a non-English+4. **Localization** — switch the language (the side panel's language menu) to a non-Englishlocale and trigger the prompt again: the question, the verb, and the threebuttons should be translated (English is the fallback for unset keys), andclicking still works (the returned value is locale-independent).@@ -73,7 +73,7 @@ Confirms a grant is scoped to exactly one capability+host, not a blanket pass.**Setup:** grant 2–3 "Always allow" entries across different sites/capabilities.-1. Open Settings (options page) → **Permissions** tab.+1. Open the Permissions page (**Manage site permissions** in the side panel's ⚠ menu).2. **Expect** each grant on its own row — host as bold label,**"Allowed to \<verb\>"** beneath (or **"⛔ Blocked from \<verb\>"** for a deny),and a **Revoke** button; a **Clear all permissions** button at the bottom.diff --git a/test/run.js b/test/run.jsindex 074625297..428d94f00 100644--- a/test/run.js+++ b/test/run.js@@ -12551,7 +12551,7 @@ test('trace privacy documentation distinguishes metadata-only and lossless retenassert.match(document, /default[\s\S]*(?:omit|omits|omitting)[\s\S]*tool arguments\/results/i, `${label}: default event-payload omission is undocumented`);assert.match(document, /default[\s\S]*(?:omit|omits|omitting)[\s\S]*(?:tab URLs\/titles|tab URL\/title)[\s\S]*attachment filename/i, `${label}: sensitive run metadata omission is undocumented`);assert.match(document, /default[\s\S]*do(?:es)? not write screenshot blobs/i, `${label}: default screenshot-byte omission is undocumented`);- assert.match(document, /lossless[\s\S]*explicit\s+(?:user\s+)?opt-in[\s\S]*screenshot\s+bytes/i, `${label}: lossless content retention is undocumented`);+ assert.match(document, /lossless[\s\S]*(?:explicit\s+(?:user\s+)?)?opt-in[\s\S]*Record traces[\s\S]*screenshot\s+bytes/i, `${label}: lossless content retention is undocumented`);assert.match(document, /historical[\s\S]*(?:not\s+(?:migrated|rewrite|rewritten)|do(?:es)? not rewrite)/i, `${label}: historical trace retention is undocumented`);}});@@ -14868,14 +14868,19 @@ test('trace tiers: one Record traces switch sets both tiers and discloses full r}});-test('trace tiers: a profile with the tiers set apart is lined up once, then left alone', async () => {- for (const [label, prefix, apiName] of [['chrome', 'src/chrome', 'chrome'], ['firefox', 'src/firefox', 'browser']]) {+test('trace tiers: an update lines up tiers set apart once; a new install leaves them to the harness', async () => {+ for (const [label, prefix, apiName, browserUpdate] of [['chrome', 'src/chrome', 'chrome', 'chrome_update'], ['firefox', 'src/firefox', 'browser', 'browser_update']]) {const bg = fs.readFileSync(path.join(ROOT, prefix, 'src/background.js'), 'utf8');const start = bg.indexOf("const TRACE_TIERS_MERGED_KEY = 'traceTiersMergedV1';");- const end = bg.indexOf('mergeTraceTiers().catch(() => {});', start);+ const marker = ' mergeTraceTiers(reason).catch(() => {});\n});\n';+ const end = bg.indexOf(marker, start);assert.ok(start > -1 && end > start, `${label}: trace tier migration not found`);- const migrate = async (stored) => {+ const block = bg.slice(start, end + marker.length);+ const settle = () => new Promise(resolve => setImmediate(resolve));+ const migrate = async (stored, reason) => {+ let onInstalled = null;const api = {+ runtime: { onInstalled: { addListener: (listener) => { onInstalled = listener; } } },storage: {local: {get: async (keys) => Object.fromEntries(keys.filter(key => key in stored).map(key => [key, stored[key]])),@@ -14883,17 +14888,27 @@ test('trace tiers: a profile with the tiers set apart is lined up once, then lef},},};- await vm.runInNewContext(`(async () => { ${bg.slice(start, end)} await mergeTraceTiers(); })()`, { [apiName]: api });+ const before = structuredClone(stored);+ vm.runInNewContext(block, { [apiName]: api });+ await settle();+ assert.deepEqual(stored, before, `${label}: nothing changes before the browser says why the extension started`);+ assert.equal(typeof onInstalled, 'function', `${label}: the merge should wait for onInstalled`);+ onInstalled({ reason });+ await settle();return stored;};- assert.deepEqual(await migrate({ tracingEnabled: true }), { tracingEnabled: true, losslessTrace: true, traceTiersMergedV1: true },+ assert.deepEqual(await migrate({ tracingEnabled: true }, 'update'), { tracingEnabled: true, losslessTrace: true, traceTiersMergedV1: true },`${label}: traces without full details should start recording full details`);- assert.deepEqual(await migrate({ tracingEnabled: false, losslessTrace: true }), { tracingEnabled: false, losslessTrace: false, traceTiersMergedV1: true },+ assert.deepEqual(await migrate({ tracingEnabled: false, losslessTrace: true }, 'update'), { tracingEnabled: false, losslessTrace: false, traceTiersMergedV1: true },`${label}: full details without traces should be turned off`);- assert.deepEqual(await migrate({}), { traceTiersMergedV1: true },+ assert.deepEqual(await migrate({}, 'update'), { traceTiersMergedV1: true },`${label}: a profile that never recorded traces should be left as it is`);- assert.deepEqual(await migrate({ tracingEnabled: true, losslessTrace: false, traceTiersMergedV1: true }), { tracingEnabled: true, losslessTrace: false, traceTiersMergedV1: true },+ assert.deepEqual(await migrate({ tracingEnabled: true, losslessTrace: false, traceTiersMergedV1: true }, 'update'), { tracingEnabled: true, losslessTrace: false, traceTiersMergedV1: true },`${label}: tiers set apart after the one-time merge should keep that choice`);+ assert.deepEqual(await migrate({ tracingEnabled: true, losslessTrace: false }, 'install'), { tracingEnabled: true, losslessTrace: false, traceTiersMergedV1: true },+ `${label}: a new install only notes the merge, so a harness that sets the tiers apart keeps them`);+ assert.deepEqual(await migrate({ tracingEnabled: true }, browserUpdate), { tracingEnabled: true },+ `${label}: a browser update is not an extension update`);}});@@ -15959,17 +15974,29 @@ test('import_config_patch background handler merges against live provider storagassert.equal(stored.themeMode, 'system', `${label}: full import should still restore omitted settings to defaults`);assert.equal(stored.providers.webbrain_cloud.baseUrl, 'https://stale-export.example/v1', `${label}: full import intentionally keeps its replace-everything semantics`);- // Exports carry Record traces only; full request details follow it on a- // restore, as they do in Settings, while a provisioning patch sets its own.- const traced = JSON.stringify({ schema: 'webbrain-config/1', settings: { tracingEnabled: true } });+ // Exports carry Record traces only. Full request details follow it on a+ // restore, as they do in Settings; a provisioning patch can turn both off+ // but never turns full request details on.+ const configWith = (settings) => JSON.stringify({ schema: 'webbrain-config/1', settings });stored.losslessTrace = false;- const tracedResponse = await handler({ action: 'import_config', json: traced }, api, helpers);+ const tracedResponse = await handler({ action: 'import_config', json: configWith({ tracingEnabled: true }) }, api, helpers);assert.equal(tracedResponse.settingCount, configTransfer.CONFIG_STORAGE_KEYS.length, `${label}: the derived trace tier is not an imported setting`);assert.equal(stored.tracingEnabled, true, `${label}: a restored export should restore Record traces`);assert.equal(stored.losslessTrace, true, `${label}: full request details should follow a restored Record traces`);+ stored.tracingEnabled = false;stored.losslessTrace = false;- await handler({ action: 'import_config_patch', json: traced }, api, helpers);- assert.equal(stored.losslessTrace, false, `${label}: a provisioning patch keeps its own trace tiers`);+ const tracedPatch = await handler({ action: 'import_config_patch', json: configWith({ tracingEnabled: true }) }, api, helpers);+ assert.equal(tracedPatch.settingCount, 1, `${label}: the derived trace tier is not a patched setting`);+ assert.equal(stored.tracingEnabled, true, `${label}: a provisioning patch can turn Record traces on`);+ assert.equal(stored.losslessTrace, false, `${label}: a provisioning patch never turns full request details on`);+ stored.losslessTrace = true;+ await handler({ action: 'import_config_patch', json: configWith({ tracingEnabled: false }) }, api, helpers);+ assert.equal(stored.tracingEnabled, false, `${label}: a provisioning patch can turn Record traces off`);+ assert.equal(stored.losslessTrace, false, `${label}: turning Record traces off by patch turns full request details off too`);+ stored.tracingEnabled = true;+ stored.losslessTrace = true;+ await handler({ action: 'import_config_patch', json: configWith({ verboseMode: false }) }, api, helpers);+ assert.equal(stored.losslessTrace, true, `${label}: a patch without Record traces leaves both tiers alone`);}assert.deepEqual({ response: results[1].response, stored: results[1].stored },@@ -16239,7 +16266,7 @@ test('/export --config and /import JSON or --file are wired in both browsers', (assert.match(panel, /command\.value === '\/import' && action === 'file'[\s\S]*?requestConfigurationFile\(tabId\)/, `${label}: file config import handler missing`);assert.match(panel, /input\.accept = '\.json,application\/json'[\s\S]*?file\.text\(\)/, `${label}: file picker should read JSON files`);assert.match(bg, /case 'export_config':[\s\S]*?createConfigExport\(stored/, `${label}: background config export missing`);- assert.match(bg, /case 'import_config':[\s\S]*?parseConfigImport\(msg\.json\)[\s\S]*?storage\.local\.set\(msg\.action === 'import_config' && Object\.hasOwn\(settings, 'tracingEnabled'\)[\s\S]*?: settings\);[\s\S]*?providerManager\.load\(\)/, `${label}: background config import and live provider reload missing`);+ assert.match(bg, /case 'import_config':[\s\S]*?parseConfigImport\(msg\.json\)[\s\S]*?const traceTiers = Object\.hasOwn\(settings, 'tracingEnabled'\)[\s\S]*?storage\.local\.set\(\{ \.\.\.settings, \.\.\.traceTiers \}\);[\s\S]*?providerManager\.load\(\)/, `${label}: background config import and live provider reload missing`);assert.match(bg, /case 'import_config_patch':[\s\S]*?parseConfigPatchImport\(msg\.json\)[\s\S]*?mergeConfigPatchSettings/, `${label}: background sparse config import and provider merge missing`);}});@@ -47913,7 +47940,9 @@ test('settings search filters rows across General, Budgets, CAPTCHA and Advancedconst settings = fs.readFileSync(path.join(ROOT, settingsRel), 'utf8');assert.match(settings, /const generalSearchInput = document\.getElementById\('input-general-search'\);/, `${label}: the search input should be wired`);assert.match(settings, /const searchableNodes = \[item, \.\.\.Array\.from\(item\.querySelectorAll/, `${label}: search should index the root row/card id as well as child controls`);- assert.match(settings, /function setGeneralSearchHidden\(item, hidden\) \{[\s\S]*?item\.hidden = hidden;[\s\S]*?item\.classList\.toggle\('general-search-hidden', hidden\);[\s\S]*?\}/, `${label}: search should force-hide filtered DOM nodes with a class`);+ assert.match(settings, /function setGeneralSearchHidden\(item, hidden\) \{\s*item\.classList\.toggle\('general-search-hidden', hidden\);\s*\}/, `${label}: search should hide filtered DOM nodes with a class of its own`);+ assert.doesNotMatch(settings, /function setGeneralSearchHidden\(item, hidden\) \{[^}]*item\.hidden/, `${label}: search must leave the hidden attribute to the code that owns each row`);+ assert.match(settings, /const matches = !query \|\| \(!item\.hidden && searchTextForGeneralItem\(item\)\.includes\(query\)\);/, `${label}: a row hidden for another reason should not count as a match`);assert.match(settings, /const searchPanels = Array\.from\(document\.querySelectorAll\('\.tab-panel\[data-search\]'\)\);/, `${label}: search should cover the tabs marked data-search`);assert.match(settings, /function filterGeneralSettings\(\) \{[\s\S]*?const query = normalizeGeneralSearchText\(generalSearchInput\.value\);[\s\S]*?document\.body\.classList\.toggle\('settings-searching', !!query\);[\s\S]*?const scope = panel\.querySelector\('\[data-search-scope\]'\) \|\| panel;[\s\S]*?setGeneralSearchHidden\(item, !!query && !matches\);[\s\S]*?setGeneralSearchHidden\(panel, !!query && panelMatches === 0\);[\s\S]*?generalSearchEmpty\.hidden = !query \|\| totalMatches > 0;[\s\S]*?\}/, `${label}: search should filter rows in every covered tab, hide tabs without matches, and report an empty result`);assert.match(settings, /generalSearchInput\?\.addEventListener\('input', filterGeneralSettings\);/, `${label}: search should filter as the user types`);diff --git a/test/settings-pages-ui.mjs b/test/settings-pages-ui.mjsindex c7ee51583..f56f391fa 100644--- a/test/settings-pages-ui.mjs+++ b/test/settings-pages-ui.mjs@@ -2,7 +2,8 @@// CAPTCHA, Bridge, Advanced), providers.html (LLM and the assistive models)// and permissions.html. This drives all three pages in both builds with a// stubbed extension API: tab layout, deep links from the old tabs, the-// cross-tab search, the single Record traces switch and the moved controls.+// cross-tab search, the single Record traces switch, the moved controls and+// the Providers page refresh after a profile sync on Settings.import { chromium, firefox } from 'playwright';import { createServer } from 'node:http';import { readFile } from 'node:fs/promises';@@ -72,6 +73,7 @@ function stub({ build, lang, seed }) {}if (msg.action === 'get_user_memory') return { ok: true, enabled: true, records: [] };if (msg.action === 'get_webgpu_vision_choice') return { ok: true, choice: 'auto', bonsaiReady: false };+ if (msg.action === 'profile_sync_state') return window.testProfileSyncState || {};return {};};window.chrome = window.browser = {@@ -228,6 +230,34 @@ try {assert.deepEqual(providerErrors, [], `${build}: providers.html page errors`);await providers.close();+ // A profile sync on Settings refreshes a Providers page open in another+ // tab, so a Save there cannot write stale values over what was pulled.+ const context = await browser.newContext({ viewport: { width: 1280, height: 1000 } });+ try {+ await context.addInitScript(stub, { build, lang: 'en', seed: {} });+ await context.addInitScript(() => { window.testProfileSyncState = { authenticated: true, enabled: true, unlocked: true, status: 'ready' }; });+ const syncErrors = [];+ const synced = await context.newPage();+ synced.on('pageerror', error => syncErrors.push(error.message));+ await synced.goto(`${origin}/src/${build}/src/ui/providers.html#vision`);+ await synced.waitForFunction(() => document.documentElement.dataset.settingsReady === 'true');+ assert.equal(await synced.locator('#vision-model').inputValue(), '', `${build}: no vision model before the sync`);+ // Stands in for what the sync writes to storage.+ await synced.evaluate(() => { window.testStore.visionModel = { baseUrl: 'https://vision.example/v1', apiKey: 'sk-test-synced', model: 'synced-vision' }; });+ const loads = () => synced.evaluate(() => window.testRequests.filter(msg => msg.action === 'get_providers').length);+ const loadsBefore = await loads();+ const syncing = await context.newPage();+ syncing.on('pageerror', error => syncErrors.push(error.message));+ await syncing.goto(`${origin}/src/${build}/src/ui/settings.html#memory`);+ await syncing.waitForFunction(() => document.documentElement.dataset.settingsReady === 'true');+ await syncing.locator('#btn-profile-sync-now').click();+ await synced.waitForFunction(() => document.getElementById('vision-model').value === 'synced-vision');+ assert.ok(await loads() > loadsBefore, `${build}: the Providers page reloads its providers after a sync`);+ assert.deepEqual(syncErrors, [], `${build}: profile sync refresh errors`);+ } finally {+ await context.close();+ }+const { page: aliased, errors: aliasErrors } = await open(browser, build, 'providers.html#multimodal');await aliased.waitForFunction(() => document.querySelector('.tab-btn.active')?.dataset.tab === 'vision');assert.deepEqual(aliasErrors, [], `${build}: providers.html alias errors`);diff --git a/web/docs/settings/index.html b/web/docs/settings/index.htmlindex afd0b1752..ef9bedb02 100644--- a/web/docs/settings/index.html+++ b/web/docs/settings/index.html@@ -29,7 +29,7 @@<section class="doc-section" id="general"><div class="eyebrow">Everyday</div><h2>General: how the agent behaves</h2><p>Appearance and download location are cosmetic. The controls below them change the agent loop: how it plans, when you review, and what it captures. Language and zoom are picked in the side panel, so they are not repeated here.</p><figure class="shot"><a href="/docs/assets/screenshots/settings-general.jpg"><img src="/docs/assets/screenshots/settings-general.jpg" alt="WebBrain General settings with the search box, appearance, download folder, planning and plan review controls"></a><figcaption>General starts with the controls you are most likely to use. Click the image to view it at full size.</figcaption></figure><h3>Planning controls</h3><ul><li><strong>Try planning</strong> is the best general choice. WebBrain attempts a structured plan before Act or Dev tools run; if planner formatting still fails after repair, that turn continues with the Ask prompt and read-only tools.</li><li><strong>Strict planning</strong> cancels the run when a valid plan cannot be produced. Use it where “no plan, no action” matters more than convenience.</li><li><strong>Off</strong> removes the extra full-plan call, while retaining the compact intent check and its safe read-only fallback. It can be faster and cheaper, but you lose the plan review checkpoint.</li></ul><h3>Auto-screenshot</h3><p><strong>On navigation</strong> (the default) takes one picture after the agent opens a page, so the vision model sees where it landed. <strong>On state change</strong> also captures after clicks, typing and other actions that change the page, which costs more image tokens; <strong>Every step</strong> captures after every tool call; <strong>Off</strong> captures only when asked.</p>- <h3>Search</h3><p>The search box above the tabs looks through General, Budgets, CAPTCHA and Advanced at once and shows each match under its tab name. Picking a tab ends the search.</p>+ <h3>Search</h3><p>The search box below the tab bar looks through General, Budgets, CAPTCHA and Advanced at once and shows each match under its tab name. Picking a tab ends the search.</p></section><section class="doc-section" id="budgets"><div class="eyebrow">Limits</div><h2>Budgets: how far one task may go</h2><p>Budgets gathers every limit on spending, waiting and work in one tab: the cloud cost allowances, how long a question waits for you, the step limit, the model timeout and the screenshot image budget.</p><figure class="shot"><a href="/docs/assets/screenshots/settings-budgets.jpg"><img src="/docs/assets/screenshots/settings-budgets.jpg" alt="WebBrain Budgets settings with the cloud cost allowances, question timeout, step limit, request timeout and image budget"></a><figcaption>Every mechanical stop in one place. Example values are the defaults.</figcaption></figure><div class="table-wrap"><table><thead><tr><th>Setting</th><th>Default</th><th>What it limits</th></tr></thead><tbody><tr><td>Cloud cost session allowance</td><td>$10.00</td><td>Estimated spend on cloud and router model calls in one conversation. WebBrain stops before the next call once it is reached.</td></tr><tr><td>Cloud cost total allowance</td><td>$10.00</td><td>Estimated spend across all conversations. The label shows what has been spent so far, for example <code>$0.00 / $10.00</code>; <strong>Reset spend</strong> starts the count again.</td></tr><tr><td>Clarify timeout</td><td>60 seconds</td><td>How long a question card waits for your answer before WebBrain answers it itself. Instant and Off are at the ends of the slider.</td></tr><tr><td>When a question times out</td><td>Finish the task</td><td>Whether the timed-out answer keeps the task moving or takes the safe choice.</td></tr><tr><td>Max Agent Steps</td><td>130</td><td>Tool-use steps for one message, not chat messages.</td></tr><tr><td>LLM request timeout</td><td>120 seconds</td><td>How long WebBrain waits for the model to start answering.</td></tr><tr><td>Image budget</td><td>Auto detail, no per-turn limit, 1568 px</td><td>How many screenshots a turn may send to the vision model and at what size.</td></tr></tbody></table></div>diff --git a/web/docs/zh/settings/index.html b/web/docs/zh/settings/index.htmlindex c687c75ff..782f41f2d 100644--- a/web/docs/zh/settings/index.html+++ b/web/docs/zh/settings/index.html@@ -14,7 +14,7 @@<div class="docs-shell"><aside class="docs-sidebar" aria-label="文档目录"><div class="sidebar-group"><div class="sidebar-label">从这里开始</div><nav><a href="/docs/zh/">概览</a><a href="/docs/zh/faq/">常见问题</a></nav></div><div class="sidebar-group"><div class="sidebar-label">使用 WebBrain</div><nav><a href="/docs/zh/settings/" aria-current="page">设置说明</a><a href="/docs/zh/providers/">提供商与模型</a><a href="/docs/zh/easy-cli-proxy/">订阅代理</a><a href="/docs/zh/safety/">模式、安全与隐私</a><a href="/docs/zh/apocalypse-mode/">末日模式</a><a href="/docs/zh/formats/">导出与工作流</a><a href="/docs/zh/mcp/">MCP 服务器</a><a href="/docs/zh/lm-studio/">LM Studio 插件</a><a href="/docs/zh/ollama/">Ollama</a></nav></div><div class="sidebar-group"><div class="sidebar-label">社区</div><nav><a href="https://discord.gg/cgC325ssfw">Discord 支持</a></nav></div></aside><main class="doc-main" id="main"><div class="breadcrumb"><a href="/docs/zh/">文档</a> / 设置</div><section class="doc-hero"><div class="eyebrow">不再猜测设置含义</div><h1>知道该改什么,也知道什么可以不动。</h1><p class="lede">从侧边栏齿轮或浏览器扩展选项打开设置。聊天模型及其辅助模型有单独的<strong>提供商</strong>页面:在侧边栏模型菜单中选择<strong>更多…</strong>,或点击设置页顶部的“提供商”链接即可打开。网站权限也有单独的页面:在麦克风旁边的 <strong>⚠</strong> 菜单中选择“管理网站权限”即可打开。大多数人主要使用“通用”、提供商和权限;其他标签页用于解决特定问题。</p><div class="meta">截图来自设置重新整理后的英文界面 · 中文界面的控件位置相同 · 合成示例不含真实凭据</div></section><section class="doc-section" id="defaults"><h2>适合大多数人的默认值</h2><div class="table-wrap"><table><thead><tr><th>控制项</th><th>推荐值</th><th>原因</th></tr></thead><tbody><tr><td>执行前计划</td><td>尝试计划</td><td>有计划时使用;如果规划器格式化失败,安全回退到只读轮次。</td></tr><tr><td>计划审查</td><td>低于置信度阈值时停止</td><td>不确定的计划暂停,可靠计划可继续。</td></tr><tr><td>审查阈值</td><td>90%</td><td>在监督与流畅度之间较保守的平衡。</td></tr><tr><td>最大代理步骤</td><td>130</td><td>足够处理多步骤工作;出现重复时仍应手动停止。</td></tr><tr><td>LLM 请求超时</td><td>120 秒</td><td>云模型通常更快,大型本地模型启动可能更慢。</td></tr><tr><td>自动截图</td><td>导航时</td><td>代理打开页面后截一张图,而不是每次点击或输入后都截图。需要视觉模型检查每个操作时再选“状态变化时”。</td></tr><tr><td>云端费用额度</td><td>每个会话 $10,总计 $10</td><td>付费模型调用的机械停止点,可在“预算”中调高或调低。</td></tr><tr><td>计划任务关键操作确认</td><td>开启</td><td>无人值守任务仍会在关键操作前暂停。</td></tr><tr><td>权限闸门</td><td>开启</td><td>首次在网站执行特定操作前询问,并记住你的明确选择。侧边栏输入框中麦克风旁边的 ⚠ 按钮也可以切换它。</td></tr><tr><td>决策模型</td><td>自动</td><td>无需设置。Ternary Bonsai 2 2B Vision 下载完成后用它做完成检查(WebBrain Cloud 激活时使用 Compass 的托管决策模型),其他情况下不使用决策模型。</td></tr><tr><td>浏览器内视觉模型</td><td>自动</td><td>Ternary Bonsai 2 2B Vision 下载完成后用它读取截图,且仅在聊天模型无法看图时使用。</td></tr></tbody></table></div></section>- <section class="doc-section" id="general"><div class="eyebrow">日常使用</div><h2>通用:代理如何行动</h2><p>外观和下载位置只影响使用体验;下面的控制项会改变代理的工作方式:如何计划、何时由你审查、截取哪些截图。语言和缩放在侧边栏中选择,这里不再重复。</p><figure class="shot"><a href="/docs/assets/screenshots/settings-general.jpg"><img src="/docs/assets/screenshots/settings-general.jpg" alt="WebBrain 通用设置英文界面,包含搜索框、外观、下载文件夹、计划与计划审查"></a><figcaption>“通用”标签页顶部是最常用的控制项。点击可查看原图。</figcaption></figure><p><strong>尝试计划</strong>适合日常使用;<strong>严格计划</strong>会在无法生成有效计划时取消任务;<strong>关闭</strong>会省去一次规划调用,但也失去计划审查节点。</p><p><strong>自动截图</strong>默认为<strong>导航时</strong>:代理打开页面后截一张图,让视觉模型看到它到达了哪里。<strong>状态变化时</strong>还会在点击、输入等改变页面的操作后截图,图像令牌消耗更多;<strong>每一步</strong>在每次工具调用后截图;<strong>关闭</strong>只在你要求时截图。</p><p>标签页上方的搜索框会同时搜索“通用”“预算”“CAPTCHA”和“高级”,并把每个结果显示在所属标签页名称下。选择任意标签页即结束搜索。</p></section>+ <section class="doc-section" id="general"><div class="eyebrow">日常使用</div><h2>通用:代理如何行动</h2><p>外观和下载位置只影响使用体验;下面的控制项会改变代理的工作方式:如何计划、何时由你审查、截取哪些截图。语言和缩放在侧边栏中选择,这里不再重复。</p><figure class="shot"><a href="/docs/assets/screenshots/settings-general.jpg"><img src="/docs/assets/screenshots/settings-general.jpg" alt="WebBrain 通用设置英文界面,包含搜索框、外观、下载文件夹、计划与计划审查"></a><figcaption>“通用”标签页顶部是最常用的控制项。点击可查看原图。</figcaption></figure><p><strong>尝试计划</strong>适合日常使用;<strong>严格计划</strong>会在无法生成有效计划时取消任务;<strong>关闭</strong>会省去一次规划调用,但也失去计划审查节点。</p><p><strong>自动截图</strong>默认为<strong>导航时</strong>:代理打开页面后截一张图,让视觉模型看到它到达了哪里。<strong>状态变化时</strong>还会在点击、输入等改变页面的操作后截图,图像令牌消耗更多;<strong>每一步</strong>在每次工具调用后截图;<strong>关闭</strong>只在你要求时截图。</p><p>标签栏下方的搜索框会同时搜索“通用”“预算”“CAPTCHA”和“高级”,并把每个结果显示在所属标签页名称下。选择任意标签页即结束搜索。</p></section><section class="doc-section" id="budgets"><div class="eyebrow">限制</div><h2>预算:单个任务能走多远</h2><p>“预算”把所有关于花费、等待和工作量的限制集中在一个标签页:云端费用额度、问题等待你回答的时间、步骤上限、模型请求超时和截图的图像预算。</p><figure class="shot"><a href="/docs/assets/screenshots/settings-budgets.jpg"><img src="/docs/assets/screenshots/settings-budgets.jpg" alt="WebBrain 预算设置英文界面,包含云端费用额度、问题超时、步骤上限、请求超时和图像预算"></a><figcaption>所有机械停止点都在这里。示例值为默认值。</figcaption></figure><div class="table-wrap"><table><thead><tr><th>设置</th><th>默认值</th><th>限制什么</th></tr></thead><tbody><tr><td>云端费用会话额度</td><td>$10.00</td><td>单个对话中云端和路由模型调用的估算花费。达到额度后,WebBrain 会在下一次调用前停止。</td></tr><tr><td>云端费用总额度</td><td>$10.00</td><td>所有对话的估算总花费。标签会显示已花费金额,例如 <code>$0.00 / $10.00</code>;<strong>重置花费</strong>会重新开始计数。</td></tr><tr><td>澄清超时</td><td>60 秒</td><td>问题卡片等待你回答的时间,超时后 WebBrain 自行作答。滑块两端分别是“立即”和“关闭”。</td></tr><tr><td>问题超时时</td><td>完成任务</td><td>超时后的答案是继续推进任务,还是选择更安全的做法。</td></tr><tr><td>代理最大步骤数</td><td>130</td><td>一条消息中的工具调用步骤,不是聊天消息数。</td></tr><tr><td>LLM 请求超时</td><td>120 秒</td><td>等待模型开始响应的时间。</td></tr><tr><td>图像预算</td><td>自动细节、每轮不限、1568 px</td><td>每轮最多向视觉模型发送多少张截图,以及截图尺寸。</td></tr></tbody></table></div><p>步骤上限越高,长流程越有机会完成和恢复,但也可能消耗更多令牌。请求超时只限制模型开始响应前的等待时间,不会中断已经开始流式输出的响应。</p><div class="callout warning"><strong class="callout-title">无限步骤不等于更可靠</strong><p>∞ 只会移除机械停止点,不会让模型更不容易循环。除非你正在全程监督长任务,否则保留有限上限。</p></div></section><section class="doc-section" id="memory"><div class="eyebrow">按需使用</div><h2>记忆:决定哪些信息长期保留</h2><figure class="shot"><a href="/docs/assets/screenshots/settings-memory.jpg"><img src="/docs/assets/screenshots/settings-memory.jpg" alt="WebBrain 记忆设置英文界面,显示加密云同步与个人资料自动填充"></a><figcaption>记忆标签页包含加密同步、个人资料自动填充和用户记忆三种不同功能。</figcaption></figure><ul><li><strong>加密云同步</strong>面向 WebBrain Compass 会员;支持的提供商密钥、个人资料和记忆会在上传前用同步密码加密。聊天历史与 OAuth 登录不会同步。</li><li><strong>个人资料自动填充</strong>以明文保存在当前浏览器配置中,启用后会发送给当前模型提供商。</li><li><strong>用户记忆</strong>保存稳定偏好;<code>/memory --add</code> 会立即保存,自动学习是可选项。</li></ul><div class="callout danger"><strong class="callout-title">不要把记忆当作密码管理器</strong><p>不要在个人资料或用户记忆中存放密码、API 密钥、令牌、恢复码等秘密。</p></div></section><section class="doc-section" id="skills"><div class="eyebrow">信任决定</div><h2>技能:附加指令与工具</h2><p>技能可以把指令加入系统提示;含 <code>webbrain-tools</code> 清单的技能还可暴露 HTTP 或下载任务工具。导入本身就是信任决定,只导入你信任的来源。</p></section>