Skip to content

Add persistent Browser REPL tool - #96

Open
rgarcia wants to merge 1 commit into
mainfrom
rgarcia/extract-browser-repl
Open

Add persistent Browser REPL tool#96
rgarcia wants to merge 1 commit into
mainfrom
rgarcia/extract-browser-repl

Conversation

@rgarcia

@rgarcia rgarcia commented Sep 12, 2026

Copy link
Copy Markdown
Contributor

Summary

Expose kernel-images PR #368's persistent Browser REPL as an ordinary Browser Loop tool.

  • adds loop.tools.repl() with stable identity kloop.repl.v1
  • adds the framework-neutral, root-exported executeBrowserRepl() API client
  • materializes ordered text/image results and explicit REPL lifecycle metadata through LoopExecutionResources
  • adds the pi extension's repl selector and a runnable low-level pi Agent example
  • uses the Kernel browser's base_url and existing cdp_ws_url JWT to call POST /repl

Browser Loop remains a wrapper around the Kernel API. It does not contain, publish, or start the REPL daemon, and adds no package workspace or subpath export. kernel-images remains the sole owner of persistent JavaScript semantics, process supervision, CDP/browser helpers, accessibility snapshots, WebMCP integration, and optional Patchright/Playwright installation.

Usage

const compiled = handle.compile({
  model: "anthropic:claude-opus-5",
  tools: [loop.tools.repl()],
});
// compiled.agentTools can be passed directly to pi Agent

Or through the pi extension:

pi -p --browser-tools repl "Open example.com with browser_repl and report the title"

Validation

  • npm run build --workspace @onkernel/browser-loop
  • npm run typecheck
  • npm run check:lockfile
  • npm test --workspace @onkernel/browser-loop (36 files, 447 tests)
  • npm pack --dry-run confirms no daemon artifact is published

@cursor cursor Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Stale Bugbot comment from a previous run.

Comment thread packages/browser-loop/src/core/tools.ts
@rgarcia
rgarcia force-pushed the rgarcia/extract-browser-repl branch from 8e591a8 to 8c25fc1 Compare September 12, 2026 22:04
@rgarcia rgarcia changed the title Extract persistent Browser REPL into Browser Loop Add persistent Browser REPL tool Sep 12, 2026

@cursor cursor Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cursor Bugbot has reviewed your changes using default effort and found 1 potential issue.

Fix All in Cursor

❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.

Reviewed by Cursor Bugbot for commit 8c25fc1. Configure here.

Comment thread packages/browser-loop/src/core/repl.ts
@rgarcia
rgarcia force-pushed the rgarcia/extract-browser-repl branch from 8c25fc1 to 099936f Compare September 13, 2026 19:18
@rgarcia
rgarcia force-pushed the rgarcia/extract-browser-repl branch from 099936f to c007e05 Compare September 13, 2026 19:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant