Repository navigation
Conversation
…and opt-in page tools P0 — operate pages the model could already read: - browser_click now accepts exactly one of index, CSS selector, or visible text (plus role/nth filters). Text resolution scans direct text nodes and accessible names, then walks to the nearest actionable ancestor, so JS-only pagination, <li onclick> rows, and cursor:pointer cells become clickable. Ambiguity is reported with candidate positions instead of guessing. - browser_snapshot discovers inner scroll containers and prints each with a unique selector, scroll percentage, and remaining pixels. browser_scroll moves the addressed container (or the nearest scrollable ancestor of an indexed element); a window scroll that did not move points at the region list. App-shell layouts are no longer unscrollable. - browser_press accepts ctrl/meta/shift/alt modifiers and derives KeyboardEvent.code for common keys, so page-level shortcuts such as Control+Enter can be expressed. P1 — page-crossing tools behind the existing approval machinery, opt-in via the bridge config flag advancedTools (default false; the bundled cordis profile maps it to DSH_ADVANCED_TOOLS=1): - browser_get_storage reads localStorage/sessionStorage; bulk listings mask credential-looking values, naming a key explicitly reads it unmasked. - browser_fetch sends method/headers/body from the page origin with the page's cookies (same-origin APIs work directly; cross-origin stays subject to CORS). - browser_eval evaluates JavaScript in the page main world, supporting both expression and statement/return forms, with async results polled for 3s. - Storage is approved as a page read; fetch and eval are actions that never offer persistent origin trust; every payload crosses the untrusted-content boundary. Tests: new actions-advanced, snapshot-regions, and background-advanced-tools specs cover addressing, modifiers, container scrolling, storage masking, request construction, main-world injection, polling, approvals, and the sharing-off gate. Docs and bilingual pairing hashes updated, plus an architecture agent note recording the decision and its limits.
maxForms was hardcoded in the content script (30) with no path through the handshake, so dense pages could only expose more form fields by hand-patching the built content.js. Make it a first-class negotiated cap: - protocol: add DEFAULT_MAX_FORMS and an optional BridgeCaps.maxForms. Absent stays compatible with an adjacent-release peer; present must be a positive integer. - bridge: new maxForms plugin config (default 30, validated) included in the hello caps; cordis.patch.yml documents the three snapshot caps. - extension: ContentBudget.maxForms flows through contentBudgetFromCaps, the DSH_BUDGET push, and per-frame allocation. The content script default now uses the shared constant instead of a literal. - tests: caps validation, config defaults/validation, per-frame partitioning, and an end-to-end snapshot that only shows the 40th field because the negotiated form cap replaced the built-in default. Bridge README documents the three negotiable caps; pairing hashes re-recorded.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problems
The browser surface addresses everything through snapshot indices and the window scroller, which leaves common pages readable but not operable:
a[href],button, inputs, a few roles) skips<a>withouthref,<li onclick>rows andcursor:pointercells; the 60-item cap then pushes bottom-of-page pagination out. The model sees "Next" in the text but has no index to click.browser_scrollonly moves the window, so app-shell layouts (body { overflow: hidden }plus an inner scrollingdiv) do not move at all.browser_pressbuildsKeyboardEventwithout modifier state, so page-level shortcuts such as Control+Enter are inexpressible.scriptingand all-site host permissions, so this is a tool-contract gap, not a platform limit.Changes
browser_clickaccepts exactly one ofindex,selector, ortext(plusrole/nth); text resolution walks to the nearest actionable ancestor and reports ambiguity instead of guessing. Index addressing keeps its document-binding guard.browser_snapshotlists inner scroll containers with a unique selector, scroll percentage and remaining pixels;browser_scrollmoves an addressed container.browser_pressacceptsmodifiers.advancedTools: true, default off):browser_get_storage,browser_fetch,browser_eval. Approval-gated; bulk storage listings mask credential-looking values; fetch runs from the page origin; eval runs in the page main world and polls async results. Fetch/eval never receive persistent origin trust, and every payload crosses the untrusted-content boundary.maxFormsis negotiated like the other two snapshot caps (protocol, plugin config, budget push, per-frame allocation).Testing
pnpm run typecheckandpnpm run buildpass.token.spec, 0600 mode) is pre-existing on Windows and fails on a clean checkout too.maxForms.Known limits, documented in the READMEs: browser-reserved shortcuts and native editing defaults still need a CDP/debugger path;
browser_evalis subject to page CSP and cannot preempt an infinite loop. The new eval path was unit-tested by executing the injected function directly, not smoke-tested in a real browser.