Repository navigation
Browser extension with a shared LLM + Jev core - #39
Merged
Merged
Conversation
A Manifest V3 side-panel extension for Chrome, Edge, Brave and Arc that works in the user's current tab with their existing logins. Shared core (used by the extension, testable in Node): - lib/cdp/driver.ts: browser driver over the Chrome DevTools Protocol for any transport (chrome.debugger, or Playwright's CDP session in tests); real mouse/keyboard input, waits for navigations - lib/cdp/snapshot.ts: Chrome accessibility tree -> the same snapshot text Playwright MCP produces, so the page parser and fast mode are shared; refs are stable backend node ids - lib/core/run-task.ts: the task flow (Jev preflight, starting page aware of the current tab, fast mode, answer check, LLM planner fallback, confirmations) with UI events and cancellation Extension (extension/): chrome.debugger transport, React side panel with a live step log and an Allow/Cancel card for irreversible actions, Connect OpenRouter (OAuth PKCE) or a pasted key, local settings. npm run extension:build / extension:dev / extension:smoke. Agent changes for both desktop and extension: - Requests that change something (buy, book, send, delete, submit) skip fast mode and use the careful planner; Jev's preflight asks this in the same call. Jev is weak at multi-step flows like add to cart -> checkout. - Fast mode sees short excerpts of earlier pages (e.g. the price list). - Stopping a task aborts in-flight model and Jev requests. Scenario harness: --engine cdp runs the suite on the extension engine. Results: 34/34 on the extension engine (fast mode median 5.4s on the realistic suite vs 32s LLM-only); extension smoke through the real side panel 4/4. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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.
Summary
A Manifest V3 side-panel extension for Chrome, Edge, Brave and Arc. WebPilot works in the user's current tab, with the logins they already have: "summarize this page", "find that email about relocation" with their inbox open, "find some recent tents on Kijiji". It asks before anything irreversible.
Shared core (plain TypeScript +
fetch; runs in the extension and in Node tests):lib/cdp/driver.ts: a browser driver over the Chrome DevTools Protocol for any transport,chrome.debuggerin the extension or Playwright's CDP session in tests. Input is sent as real mouse/keyboard events; navigations are awaited.lib/cdp/snapshot.ts: converts Chrome's accessibility tree (~60-170ms for a large page) into the same snapshot text Playwright MCP produces, solib/jev/page.ts, fast mode and the planner read pages identically. Refs areb<backendDOMNodeId>, stable for the life of the document.lib/core/run-task.ts: the task flow over anyTaskBrowser: Jev preflight (chat vs browse), a starting page that is aware of the current tab, fast mode, answer check, LLM planner fallback and confirmations. It streams events for the UI and cancels through anAbortSignal.Extension (
extension/):chrome.debuggertransport.chrome.identity) or a pasted key; settings in local extension storage.npm run extension:build/extension:dev(esbuild) /extension:smoke.extension/README.md, covering permissions and privacy.Agent changes for desktop and extension:
Testing
npm run build,npm run extension:buildnpm run healthnpm run extension:smokeloads the built extension into Chromium and drives the real side panel against the local webmail/shop: current-page question, relocation email, prompt-injection email, and "buy" cancelled at the confirmation. 4/4, headless and headed. Screenshots were checked (light theme, flight log, confirmation card).npm test(46 pass; newtests/cdp-snapshot.test.ts, gate and abort tests),npm run lint,npx tsc --noEmitnpm run bench:fast-mode -- --engine cdp --suite all: the full 17-scenario suite on the extension engine in both modes, 34/34 passed. On the realistic suite fast mode's median was 5.4s vs 32s for the LLM-only path; e.g. Kijiji 17.6s vs 123s, injection inbox 3.9s vs 125s.Checklist
🤖 Generated with Claude Code