Skip to content

Commit 4ef116e

Browse files
authored
native press key, scroll, drag mouse (#78)
<!-- CURSOR_SUMMARY --> > [!NOTE] > Adds new input endpoints (press_key, scroll, drag_mouse), serializes input actions, updates OpenAPI/client, installs xdotool, and expands/refactors e2e tests with dependency bumps. > > - **API/Backend**: > - **New endpoints**: `POST /computer/press_key`, `POST /computer/scroll`, `POST /computer/drag_mouse` with validation and xdotool integration. > - **Input serialization**: add `inputMu` to serialize mouse/keyboard/screenshot actions; apply across `MoveMouse`, `ClickMouse`, `TakeScreenshot`, `TypeText`. > - **OpenAPI + Client**: extend `openapi.yaml`; regenerate `lib/oapi` with new models/requests/responses and adjusted click button enums. > - **Infrastructure**: > - **Dockerfile** (headless): install `xdotool`. > - **Tests**: > - Add `TestInputEndpointsSmoke`; modernize e2e tests (use `require`, simplify flows) and minor cleanups. > - **Dependencies**: > - Bump `testify`, `golang.org/x/sync`, add `samber/lo`, `golang.org/x/text`. > > <sup>Written by [Cursor Bugbot](https://cursor.com/dashboard?tab=bugbot) for commit 2b85972. This will update automatically on new commits. Configure [here](https://cursor.com/dashboard?tab=bugbot).</sup> <!-- /CURSOR_SUMMARY -->
1 parent 0260b79 commit 4ef116e

File tree

8 files changed

+1629
-1178
lines changed

8 files changed

+1629
-1178
lines changed

images/chromium-headless/image/Dockerfile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,7 @@ RUN set -xe; \
5252
dbus-x11 \
5353
xvfb \
5454
x11-utils \
55+
xdotool \
5556
software-properties-common \
5657
supervisor;
5758

server/cmd/api/api/api.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,9 @@ type ApiService struct {
3636
// DevTools upstream manager (Chromium supervisord log tailer)
3737
upstreamMgr *devtoolsproxy.UpstreamManager
3838
stz scaletozero.Controller
39+
40+
// inputMu serializes input-related operations (mouse, keyboard, screenshot)
41+
inputMu sync.Mutex
3942
}
4043

4144
var _ oapi.StrictServerInterface = (*ApiService)(nil)

server/cmd/api/api/computer.go

Lines changed: 422 additions & 26 deletions
Large diffs are not rendered by default.

0 commit comments

Comments
 (0)