Skip to content

Migrate grounder extension to wxt + close WASM-runtime verification gap #10

Description

@espetro

Replace the hand-rolled MV3 extension (extension/manifest.json, content.js, sidepanel.js, vendored wllama/) with a wxt project mirroring play-ai/apps/extension (wxt 0.20.26, bun, vanilla TS side panel).

Why: wxt removes the hand-rolled manifest/CSP/wasm/worker risk, exposes a CDP endpoint so agent-browser can drive .output/chrome-mv3 for a real-browser smoke test (does wllama's WASM actually run under MV3 CSP?), and makes the pure grounding/DOM-extraction logic unit-testable via vitest.

Plan: .agents/plans/2026-07-16-wxt-extension.md

Scope:

  • Port content.js -> entrypoints/content.ts (extract roleOf/labelOf/isVisible/extractPage for jsdom unit tests)
  • Port sidepanel.js -> entrypoints/sidepanel/main.ts (npm @wllama/wllama, not vendored copy)
  • Port background.js -> entrypoints/background.ts
  • Port grounding.js -> lib/grounding.ts verbatim
  • wxt.config.ts with CDP webExt wiring (--remote-debugging-port=9222)
  • Unit tests: grounding.test.ts, content-map.test.ts
  • Real-browser smoke test via agent-browser (not Playwright, per global rule)
  • Delete hand-rolled files once ported

Out of scope: Firefox build target, multi-step agent behavior, model/training changes.

Metadata

Metadata

Assignees

No one assigned

    Labels

    featureClassification: feature

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions