Skip to content

feat: browser.image, self-checking collections and the 45-tool MCP catalogue (v1.6.0) - #61

Merged
KazKozDev merged 11 commits into
mainfrom
feat/browser-image
Nov 22, 2026
Merged

KazKozDev merged 11 commits into
mainfrom
feat/browser-image

Conversation

@KazKozDev

@KazKozDev KazKozDev commented Nov 22, 2026 •

Copy link
Copy Markdown
Owner

What this changes

Adds browser.image, which returns an image by ref, and replaces the bridge's hand-written tool list with one shared 45-tool MCP catalogue. stdio and HTTP both serve it, and the OpenClaw config mirrors it. Bumps weboperator-mcp to 1.6.0.

  • browser.image (c7831d8): reads an <img>, or the largest loaded image inside a container, through the page's own session. If CORS blocks that, the background worker fetches it instead. Nothing on the page is clicked.
  • MCP catalogue (weboperator-bridge/tools.js, core/src/lib/bridge-schema.ts): covers images, select options, JavaScript dialogs, task pause/resume/wait, tabs, network/console, storage and local files (weboperator-bridge/local-files.js).
  • Background split: bridge handlers now live in bridge-browser, bridge-confirmation, bridge-dialog, bridge-io, bridge-media and bridge-observation, plus cdp-session, cursor and side-panel.
  • Side panel: preview for prompt refinement (prompt-refinement.ts, PromptRefinementPreview.tsx), plus conversation and collection helpers.
  • Long collections: a request for N records stops at the total the pager claims, a scroll that adds nothing is rechecked once before reporting the actual count, and long text is read in paragraph-sized chunks that record the section reached.
  • Collections over MCP: browser_extract with mode:"rows"|"chunk" runs the same traversal inside the extension (12 s per call, resumable by collectionId, returns complete and stopReason). Clicks on Next go through the external-agent trace like browser_click.
  • Fixes: the content script now loads on pages that block dynamic extension-module imports. Vite is upgraded to 8.3.4 for security advisories.
  • Docs: docs/mcp-tools.md and docs/prompt-refinement.md.
  • Cleanup: removed the duplicate root icon, two unreferenced README images, the 1.0.0 release criteria and the bridge working reports.

Why

Agents could not take a generated picture without going through a download dialog. The bridge also exposed only part of what the extension can do, and the tool lists for stdio, HTTP and OpenClaw had drifted apart.

How it was verified

  • ./scripts/check.sh passes locally (lint, 412 unit tests, knip, bridge and MCP smoke tests, build)
  • Unit tests added or updated for the changed behaviour (new *.test.ts for bridge modules, actions, collection, conversation, prompt refinement, and scripts/mcp-tools.test.mjs, scripts/bridge-files.test.mjs)
  • Live scripts scripts/bridge-p0-live.mjs, bridge-p1-p2-live.mjs and bridge-tools-live.mjs were added, but they were not run for this PR

Checklist

  • One concern per PR: this bundles the bridge catalogue, the side-panel prompt refinement and the Vite bump
  • Commit messages follow Conventional Commits
  • Docs updated
  • CHANGELOG.md updated, as a [1.6.0] release section rather than under Unreleased

Security-sensitive areas

  • weboperator-bridge parsing, binding, or authentication: new tools and local-file access (local-files.js)
  • The prompt-injection boundary: new observation and dialog tools return page content to the model

🤖 Generated with Claude Code

KazKozDev and others added 2 commits October 18, 2026 13:33
…e by ref

The ref may point at an <img> or at a container (a dialog, a button that wraps a
picture), then the largest loaded <img> inside it is read. The page fetches it
with its own session; when CORS stops the page, the background worker fetches the
same address under the extension's host permission. Nothing on the page is
clicked. Lets an agent take a generated picture without a download dialog.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- Shared 45-tool MCP catalogue for stdio and HTTP: images, select options,
  JavaScript dialogs, task pause/resume/wait, tabs, network/console,
  storage and local files.
- Complete OpenClaw tool configuration with the same 45 tools.
- Prompt refinement preview in the side panel.
- Fix content script loading on pages that block dynamic module imports.
- Upgrade Vite to 8.3.4 for security advisories.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@chatgpt-codex-connector

Copy link
Copy Markdown
Codex Review Summary: ❌ Failed

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ❌ Failed 2026-11-22T08:17:59.373796Z
We couldn’t complete this review. Comment @codex review to try again.
0a9572b PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@chatgpt-codex-connector

Copy link
Copy Markdown

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.
To continue using code reviews, you can upgrade your account or add credits to your account and enable them for code reviews in your settings.

KazKozDev and others added 8 commits November 22, 2026 09:20
- icons/icon128.png: duplicate of core/public/icons/icon128.png, which the
  manifest uses.
- docs/assets/futter.png, docs/assets/webim.png: no longer referenced.
- docs/1.0.0-release-criteria.md: criteria for the 1.0.0 release, long shipped.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The P0 and P1/P2 acceptance reports and the gap list were working notes for
the MCP catalogue. What they record now lives in docs/mcp-tools.md and
CHANGELOG.md.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…ection

- Ranges: "1–50 of N" now keeps N. A request for 200 records stops at N when
  the site has fewer, and progress says so. N alone never becomes a goal.
- Infinite scroll: a list scroll during collection waits for the DOM to go
  quiet before the next capture. A capture that adds nothing is rechecked
  once after 2.5 s; a second empty capture marks the collection stalled and
  progress reports where loading stopped.
- Long text: chunks end on a paragraph or line break instead of at a fixed
  6000 characters, and progress names the last section heading reached.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…ents

browser_extract takes mode "rows" or "chunk" (with target, selector,
collectionId and since). The extension runs the same traversal the
side-panel agent queues: capture, Next or list scroll, a single recheck
when a move adds nothing, and the cap from the pager's claimed total.
Each call works for up to 12 s, saves progress in session storage under
collectionId (last 20 kept), and returns complete, stopReason, progress
and only the rows or text after `since`. Each step lands in the
external-agent trace like any bridge action.

A capture that adds nothing now counts as a stall only right after a
scroll, page change or wait. A plain re-read, such as a resumed call,
moves on to the next page instead of reporting a false stall.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…able

A "first 50 articles" run on arXiv stopped at 25: the model passed the
page size as the target, the target could not be raised, and the full
result cards it received per row were lost on history compaction, so the
model reported that the saved rows were unavailable.

- The count named in the goal ("50 статей", "200 вакансий", "50 articles")
  is the floor for the target, and a later larger target replaces an
  earlier one. requestedCount() also learns articles, papers, jobs,
  titles, posts, reviews and their Russian forms.
- The model now gets a compact view of each rows capture: the new rows,
  one 200-character line each. The full rows stay in the collection.
- The prompt says the target is the requested total, not the page size,
  and that saved rows reach the user in full.
- Collected data opens by default when it holds rows.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A "first 100 articles" run on arXiv collected all 100 titles, then had
its answer blocked twice as a hostile-text leak: two real paper titles
("PIPETTE: Prompt Injection Purple-Teaming...", "AutoPI: ... Prompt
Injection in LLM Agents") tripped the names-the-attack pattern. The model
then gave up on the list and pointed at Collected data instead.

For the topic-only leak classes, answer lines that repeat a saved record,
or a whole line of one, are now set aside before the check. The imperative
and attribution classes still run on the full answer, so quoting "ignore
previous instructions" stays blocked even when it came from a record.

The compact rows view also stops counting rows beyond the target as
duplicates: it reports alreadySaved and beyondTarget separately.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Main already carries the MCP catalogue part of this branch (#51-#53) as a
subset of it. Conflicts are resolved with the branch's versions, which
keep the collection, cursor, prompt refinement, conversation and side
panel work that main does not have, plus two changes that exist only on
main:

- bridge-media.ts: the codeLiteral escaping from #54 (CodeQL alert).
- core/package.json and package-lock.json: the Dependabot batch from #55.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
CodeQL js/double-escaping: chained replace() calls turned "&amp;lt;" into
"&lt;" and then into "<". unescapeHtml() now undoes escapeHtml in a single
pass, so an escaped entity in a URL stays an entity.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@KazKozDev KazKozDev changed the title feat(bridge): browser.image and a 45-tool MCP catalogue (v1.6.0) feat: browser.image, self-checking collections and the 45-tool MCP catalogue (v1.6.0) Nov 22, 2026
@KazKozDev
KazKozDev merged commit 6e8550b into main Nov 22, 2026
4 checks passed
@KazKozDev
KazKozDev deleted the feat/browser-image branch November 22, 2026 10:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants