OpenCode Browser no longer depends on the separate Browser Control product.
Its relay, CLI, MCP server, and agent guide (anomalyco/browser-control
8c80ac2, MIT, Anomaly) now live in packages/browser-extension/cli and ship
as the opencode-browser-cli npm package:
- Renamed throughout: `opencode-browser` command and MCP server,
OPENCODE_BROWSER_* environment, opencode-browser skill, injected page ids.
- Its own port, 19988, so a Browser Control relay on 19989 can't hold it,
and it accepts only OpenCode Browser's store and unpacked extension IDs
(the path-hashed bundled-extension origin is gone).
- All files under one data root (src/paths.ts: ~/.local/share/
opencode-browser, %LOCALAPPDATA% on Windows, OPENCODE_BROWSER_HOME):
runtime, logs, relay catalogs and lifecycle, sessions, secrets.
- One entry (src/main.ts, bundled to dist/cli.mjs with npm dependencies
external): setup commands (install, extension, uninstall, host) go to
setup.ts, everything else to the relay CLI; `status` prints setup state
first. The managed relay respawns the same entry.
- install now installs this exact version into <data root>/runtime with
npm (OPENCODE_BROWSER_PACKAGE overrides the spec), points the native host
and a new "opencode-browser" MCP entry at it, and warns about leftover
browser-control MCP entries instead of configuring them. uninstall also
removes the MCP entry and the data root.
- Logging: relay.log is always on (relay ready, extension connected/
rejected/closed with codes, every HTTP request with status and ms except
status/version polls, faults) and rotates to relay.log.1 instead of
truncating; host.log records each native messaging request with timing.
- cli/ has its own package.json, bun.lock, and tsconfig so its pinned
dependencies (effect 4.0.1, playwright-core 1.63.0, ...) stay out of the
monorepo lockfile. The release workflow installs, typechecks, builds, and
smoke tests it.
Verified: cli typecheck; browser-control's own test suite run against the
port outside the repo: 880/888 pass, the 8 failures assert the removed
layout (dist/mcp.js, path-hashed origins, extension/dist). From an npm pack
tarball in a temp HOME: install (5.7s), the native host answered service and
plugin requests, the MCP server listed 25 tools over stdio, and `execute`
started a managed relay, drove headless Chrome with the extension to
example.com, and returned the title; status and relay.log looked right.
cli/package.json is now the one release version: the store zip and the
extension bundled in the npm helper are stamped with it. Bumped to 0.0.2
(0.0.1 is on npm and in the store draft).
.github/workflows/publish-browser-extension.yml runs on a
browser-extension-v<version> tag (checked against cli/package.json) or by
hand: typecheck, build the helper and the store zip, smoke test the helper,
upload the zip as an artifact, then publish opencode-browser-cli to npm with
provenance (trusted publishing, or OPENCODE_BROWSER_NPM_TOKEN; skipped when the
version exists) and attach the zip to a GitHub release. Manual runs only
build unless `publish` is checked.
Verified: actionlint (only the repo's custom runner label is unknown to it);
locally, cli build + `bun run package` produced version 0.0.2 in both the zip
(no key) and the bundled extension, the built helper ran, and `npm pack
--dry-run` packs 0.0.2.
Move files deployments to Wrangler, make CLI and desktop own their publishing destinations, add direct-download update metadata and desktop feeds, and refresh installation docs.