Repository navigation
Expose cursor position and modifier keys for computer actions - #127
Merged
Merged
Conversation
|
I'll fix CI failures and address comments from users with write access. I'll skip comments containing "(aside)".
|
AHarmlessPyro
approved these changes
Oct 7, 2026
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes using default effort and found 2 potential issues.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit d2d7df8. Configure here.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

Summary
Expose desktop cursor position and pointer modifier keys through existing browserctrl functionality. Keep existing coordinate-based click/scroll APIs intact, with separate current-pointer helpers and the standard
ComputerActionResponsefor every action.Changes
cursorPosition()returning the standardComputerActionResponse; the request executor uses the same concrete response type as every other action.ComputerAction.CURSOR_POSITIONand its request/coordinate variants to the existing general action and response unions.ScrollAtCursorActionParamsinComputerActionParams; the shared request executor accepts only the main request union.click()andscroll()and required scroll deltas/fields; useclickAtCursor()andscrollAtCursor()for coordinate-free actions.keysto click, drag and scroll, preserving existing positional arguments and no-modifier wire payloads.1.0.3→1.1.0; no backend changes or new dependencies.Compatibility
Existing click/scroll signatures and coordinate-based
ScrollActionParamsfields are preserved. The main request union also accepts coordinate-free scroll payloads; generic scroll-request consumers must check for coordinates before reading them. The general action enum, request union and response-data union gain cursor position, following prior SDK expansion practice: strict exhaustive switches/maps and generic response consumers may need to handle the new variant. All actions returnComputerActionResponse; callers checkdata && "x" in databefore reading cursor coordinates. No dedicated cursor-response type or generic request-executor return type is introduced.Validation
yarn lint,yarn typecheck,yarn test,yarn build: passedprettier --check;git diff --check: passedScrollAtCursorActionParamsis assignable toComputerActionParams.databefore reading coordinates; type assertions verify cursor methods returnComputerActionResponseand preserve required click/scroll coordinates and scroll deltas.Note
Medium Risk
Expands the public computer-action API and request/response unions; callers with exhaustive switches or assumptions about scroll coordinates may need small updates, but existing positional arguments stay compatible.
Overview
Bumps the package to 1.1.0 and extends computer action APIs for desktop pointer control without changing coordinate-based
click()/scroll()signatures.Adds
cursorPosition()and types forCURSOR_POSITION, with cursor coordinates returned on the standardComputerActionResponse.data(x/y). AddsclickAtCursor()andscrollAtCursor()for actions at the current pointer (nox/yon the wire), plus optional modifierkeysonclick,drag, andscroll(including the new helpers).Public exports and
ComputerActionParamsunions gain cursor and scroll-at-cursor variants. New integration tests cover HTTP payloads, session lookup, modifiers, and failures; unit tests lock in the exported type contracts.Reviewed by Cursor Bugbot for commit 53897b1. Bugbot is set up for automated code reviews on this repo. Configure here.