Skip to content

Commit b9911dd

Browse files
feat: expose smooth drag mouse movement via public API
1 parent f3704ee commit b9911dd

File tree

3 files changed

+30
-2
lines changed

3 files changed

+30
-2
lines changed

.stats.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
configured_endpoints: 103
2-
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/kernel%2Fkernel-bda5e58fa0bbd08761f27a1e0edbc602c44141ac9483bf6c96d52b7f4d10d9a7.yml
3-
openapi_spec_hash: 10833b36358e8cda023e5bb0abeab0ba
2+
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/kernel%2Fkernel-e6936890166ce5b11abaccd511a43a8807e2abf96c1f542d4f8d94655ef27d1f.yml
3+
openapi_spec_hash: 0146ecaea96d8136ef4a35cd04aacf22
44
config_hash: cff4d43372b6fa66b64e2d4150f6aa76

src/resources/browsers/computer.ts

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -353,11 +353,23 @@ export namespace ComputerBatchParams {
353353
*/
354354
delay?: number;
355355

356+
/**
357+
* Target total duration in milliseconds for the entire drag movement when
358+
* smooth=true. Omit for automatic timing based on total path length.
359+
*/
360+
duration_ms?: number;
361+
356362
/**
357363
* Modifier keys to hold during the drag
358364
*/
359365
hold_keys?: Array<string>;
360366

367+
/**
368+
* Use human-like Bezier curves between path waypoints instead of linear
369+
* interpolation. When true, steps_per_segment and step_delay_ms are ignored.
370+
*/
371+
smooth?: boolean;
372+
361373
/**
362374
* Delay in milliseconds between relative steps while dragging (not the initial
363375
* delay).
@@ -554,11 +566,23 @@ export interface ComputerDragMouseParams {
554566
*/
555567
delay?: number;
556568

569+
/**
570+
* Target total duration in milliseconds for the entire drag movement when
571+
* smooth=true. Omit for automatic timing based on total path length.
572+
*/
573+
duration_ms?: number;
574+
557575
/**
558576
* Modifier keys to hold during the drag
559577
*/
560578
hold_keys?: Array<string>;
561579

580+
/**
581+
* Use human-like Bezier curves between path waypoints instead of linear
582+
* interpolation. When true, steps_per_segment and step_delay_ms are ignored.
583+
*/
584+
smooth?: boolean;
585+
562586
/**
563587
* Delay in milliseconds between relative steps while dragging (not the initial
564588
* delay).

tests/api-resources/browsers/computer.test.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,9 @@ describe('resource computer', () => {
4141
],
4242
button: 'left',
4343
delay: 0,
44+
duration_ms: 50,
4445
hold_keys: ['string'],
46+
smooth: true,
4547
step_delay_ms: 0,
4648
steps_per_segment: 1,
4749
},
@@ -141,7 +143,9 @@ describe('resource computer', () => {
141143
],
142144
button: 'left',
143145
delay: 0,
146+
duration_ms: 50,
144147
hold_keys: ['string'],
148+
smooth: true,
145149
step_delay_ms: 0,
146150
steps_per_segment: 1,
147151
});

0 commit comments

Comments
 (0)