Skip to content

feat(stagehand): expose page cursor overlay - #2831

Closed
shrey150 wants to merge 3 commits into
mainfrom
agent/browse-v4-1-cursor-overlay
Closed

feat(stagehand): expose page cursor overlay#2831
shrey150 wants to merge 3 commits into
mainfrom
agent/browse-v4-1-cursor-overlay

Conversation

@shrey150

@shrey150 shrey150 commented Aug 27, 2026

Copy link
Copy Markdown
Contributor

Summary

Expose the existing extension cursor overlay through the public V4 page API:

  • add page.enable_cursor_overlay to the protocol
  • route it through the extension runtime
  • expose page.enableCursorOverlay() in TypeScript, page.enable_cursor_overlay() in Python, and Page.EnableCursorOverlay() in Go
  • regenerate the protocol schema and embedded Go extension
image

Verification

  • pnpm --filter ./packages/protocol test:unit
  • pnpm --filter ./packages/protocol typecheck
  • pnpm --filter ./packages/extension test:unit
  • focused TypeScript Page wrapper tests and SDK build
  • Python Page tests, generation check, Ruff format/lint
  • Go SDK tests/vet, generation check, embedded extension drift check
  • workspace pnpm check

Summary by cubic

Exposes the existing extension cursor overlay through the public V4 page API so SDK users can enable it without touching the extension directly.

  • Adds the page.enable_cursor_overlay protocol method and routes it through the extension runtime.
  • Adds page.enableCursorOverlay() in TypeScript, page.enable_cursor_overlay() in Python, and Page.EnableCursorOverlay() in Go, and documents each in the V4 reference.
  • Regenerates the protocol schema and the embedded Go extension zip.
  • Keeping this isolated from the Browse runtime cutover keeps the core API independently reviewable.

Written for commit 7f883be. Summary will update on new commits.

Review in cubic

@changeset-bot

changeset-bot Bot commented Aug 27, 2026

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: 7f883be

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 12 packages
Name Type
@browserbasehq/stagehand-protocol Patch
@browserbasehq/stagehand-python Patch
@browserbasehq/stagehand-extension Patch
@browserbasehq/stagehand-go Patch
@browserbasehq/stagehand Patch
@browserbasehq/stagehand-integrations Patch
@browserbasehq/stagehand-integrations-example-eve-facade Patch
@browserbasehq/stagehand-integrations-example-pi-facade Patch
@browserbasehq/stagehand-integrations-example-claude-code-facade Patch
@browserbasehq/stagehand-integrations-example-codex-facade Patch
@browserbasehq/stagehand-integrations-example-mastra-facade Patch
@browserbasehq/stagehand-integrations-example-vercel-ai-facade Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

…sor-overlay

# Conflicts:
#	packages/sdk-go/internal/extensionassets/stagehand-extension.zip
@mintlify

mintlify Bot commented Aug 27, 2026

Copy link
Copy Markdown
Contributor

Preview deployment for your docs. Learn more about Mintlify Previews.

Project Status Preview Updated (UTC)
stagehand 🟢 Ready View Preview Aug 27, 2026, 8:57 PM

💡 Tip: Enable Workflows to automatically generate PRs for you.

@shrey150
shrey150 marked this pull request as ready for review August 27, 2026 21:54
@shrey150
shrey150 requested a review from a team as a code owner August 27, 2026 21:54

@cubic-dev-ai cubic-dev-ai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

No issues found across 16 files

Confidence score: 5/5

  • Automated review surfaced no issues in the provided summaries.
  • No files require special attention.
Architecture diagram
sequenceDiagram
    participant TS as TypeScript SDK
    participant PY as Python SDK
    participant GO as Go SDK
    participant EXT as Extension Runtime
    participant PAGE as Understudy Page
    participant PROTO as Protocol Schema

    Note over TS,GO: Public SDK wrappers
    TS->>TS: enableCursorOverlay()
    PY->>PY: enable_cursor_overlay()
    GO->>GO: EnableCursorOverlay()

    Note over TS,GO: Protocol method: page.enable_cursor_overlay
    TS->>PROTO: Validate payload
    PY->>PROTO: Validate payload
    GO->>PROTO: Validate payload

    PROTO->>EXT: JSON-RPC request (page_id)
    EXT->>EXT: Route to page controller
    EXT->>PAGE: enableCursorOverlay() runtime call
    PAGE->>PAGE: Toggle overlay in browser context

    PAGE-->>EXT: Operation result {ok: true}
    EXT-->>PROTO: RPC response
    PROTO-->>TS: Promise<void>
    PROTO-->>PY: None
    PROTO-->>GO: nil (or error)

    Note over TS,GO: Common flow across SDKs: SDK wrapper, protocol schema validation, extension RPC router, understudy page runtime, browser overlay
Loading

Re-trigger cubic

Copy link
Copy Markdown
Contributor Author

Closing after the architecture follow-up: the CLI no longer needs a public Stagehand cursor API. The replacement lives in #2834 as an idempotent CLI-owned page.evaluate() overlay, with real-Chromium DOM assertions and a screenshot in that PR description. #2832 has been restacked directly onto main, and the replacement native stack is #2843 (#2832#2833#2834#2835#2838#2839). No remaining PR depends on this branch.

@shrey150 shrey150 closed this Aug 28, 2026
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