feat: implement the REPL integration#46
Conversation
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: ec1c0021ac
ℹ️ 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".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| } | ||
|
|
||
| return tool.cb(args, browser); | ||
| return tool.cb(args, browser as never); |
There was a problem hiding this comment.
Gate MCP actions by REPL transport
When an MCP client opens a session with attach-repl, browser becomes a ReplBrowser, but this path still invokes every action tool regardless of its new supportedTransports value. Tools such as click and navigate are marked launch-browser only and call Webdriver-specific methods that ReplBrowser does not implement, so MCP users can hit runtime failures after attaching to a REPL; the daemon path added a transport check, but the MCP server needs the same guard or transport tracking.
Useful? React with 👍 / 👎.
6519311 to
25c0f3b
Compare
ec1c002 to
7817082
Compare
What's done?
Implemented the REPL integration. The idea is that REPL can be yet another "backend"/"transport" for communicating with browser, so the BrowserAdapter was introduced, which will let us use other backends in the future, namely connect to CDP endpoints.
Currently, this integration lets agents perform two crucial actions:
Other commands will return an error similar to
Tool 'navigate' is not yet supported with REPL sessions. Currently supported in REPL mode: snapshot, run-code.Which together means that agents can execute & debug tests line-by-line.
API is
attach-to-repl, then other tools automatically begin using the repl connection. Command help output: