From c6f6862d03620bb218a99c85431e384c5c8e5e4c Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Tue, 10 Mar 2026 22:02:41 +0000 Subject: [PATCH 1/9] feat: expose smooth drag mouse movement via public API --- .stats.yml | 4 ++-- src/kernel/resources/browsers/computer.py | 20 +++++++++++++++++++ .../types/browsers/computer_batch_params.py | 12 +++++++++++ .../browsers/computer_drag_mouse_params.py | 12 +++++++++++ tests/api_resources/browsers/test_computer.py | 4 ++++ 5 files changed, 50 insertions(+), 2 deletions(-) diff --git a/.stats.yml b/.stats.yml index ae22a711..81407436 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 103 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/kernel%2Fkernel-bda5e58fa0bbd08761f27a1e0edbc602c44141ac9483bf6c96d52b7f4d10d9a7.yml -openapi_spec_hash: 10833b36358e8cda023e5bb0abeab0ba +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/kernel%2Fkernel-e6936890166ce5b11abaccd511a43a8807e2abf96c1f542d4f8d94655ef27d1f.yml +openapi_spec_hash: 0146ecaea96d8136ef4a35cd04aacf22 config_hash: cff4d43372b6fa66b64e2d4150f6aa76 diff --git a/src/kernel/resources/browsers/computer.py b/src/kernel/resources/browsers/computer.py index 1357c1e8..bcde24e5 100644 --- a/src/kernel/resources/browsers/computer.py +++ b/src/kernel/resources/browsers/computer.py @@ -213,7 +213,9 @@ def drag_mouse( path: Iterable[Iterable[int]], button: Literal["left", "middle", "right"] | Omit = omit, delay: int | Omit = omit, + duration_ms: int | Omit = omit, hold_keys: SequenceNotStr[str] | Omit = omit, + smooth: bool | Omit = omit, step_delay_ms: int | Omit = omit, steps_per_segment: int | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. @@ -234,8 +236,14 @@ def drag_mouse( delay: Delay in milliseconds between button down and starting to move along the path. + duration_ms: Target total duration in milliseconds for the entire drag movement when + smooth=true. Omit for automatic timing based on total path length. + hold_keys: Modifier keys to hold during the drag + smooth: Use human-like Bezier curves between path waypoints instead of linear + interpolation. When true, steps_per_segment and step_delay_ms are ignored. + step_delay_ms: Delay in milliseconds between relative steps while dragging (not the initial delay). @@ -259,7 +267,9 @@ def drag_mouse( "path": path, "button": button, "delay": delay, + "duration_ms": duration_ms, "hold_keys": hold_keys, + "smooth": smooth, "step_delay_ms": step_delay_ms, "steps_per_segment": steps_per_segment, }, @@ -804,7 +814,9 @@ async def drag_mouse( path: Iterable[Iterable[int]], button: Literal["left", "middle", "right"] | Omit = omit, delay: int | Omit = omit, + duration_ms: int | Omit = omit, hold_keys: SequenceNotStr[str] | Omit = omit, + smooth: bool | Omit = omit, step_delay_ms: int | Omit = omit, steps_per_segment: int | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. @@ -825,8 +837,14 @@ async def drag_mouse( delay: Delay in milliseconds between button down and starting to move along the path. + duration_ms: Target total duration in milliseconds for the entire drag movement when + smooth=true. Omit for automatic timing based on total path length. + hold_keys: Modifier keys to hold during the drag + smooth: Use human-like Bezier curves between path waypoints instead of linear + interpolation. When true, steps_per_segment and step_delay_ms are ignored. + step_delay_ms: Delay in milliseconds between relative steps while dragging (not the initial delay). @@ -850,7 +868,9 @@ async def drag_mouse( "path": path, "button": button, "delay": delay, + "duration_ms": duration_ms, "hold_keys": hold_keys, + "smooth": smooth, "step_delay_ms": step_delay_ms, "steps_per_segment": steps_per_segment, }, diff --git a/src/kernel/types/browsers/computer_batch_params.py b/src/kernel/types/browsers/computer_batch_params.py index 9aca7244..db68466d 100644 --- a/src/kernel/types/browsers/computer_batch_params.py +++ b/src/kernel/types/browsers/computer_batch_params.py @@ -59,9 +59,21 @@ class ActionDragMouse(TypedDict, total=False): delay: int """Delay in milliseconds between button down and starting to move along the path.""" + duration_ms: int + """ + Target total duration in milliseconds for the entire drag movement when + smooth=true. Omit for automatic timing based on total path length. + """ + hold_keys: SequenceNotStr[str] """Modifier keys to hold during the drag""" + smooth: bool + """ + Use human-like Bezier curves between path waypoints instead of linear + interpolation. When true, steps_per_segment and step_delay_ms are ignored. + """ + step_delay_ms: int """ Delay in milliseconds between relative steps while dragging (not the initial diff --git a/src/kernel/types/browsers/computer_drag_mouse_params.py b/src/kernel/types/browsers/computer_drag_mouse_params.py index fb03b4be..c0dd4c8e 100644 --- a/src/kernel/types/browsers/computer_drag_mouse_params.py +++ b/src/kernel/types/browsers/computer_drag_mouse_params.py @@ -23,9 +23,21 @@ class ComputerDragMouseParams(TypedDict, total=False): delay: int """Delay in milliseconds between button down and starting to move along the path.""" + duration_ms: int + """ + Target total duration in milliseconds for the entire drag movement when + smooth=true. Omit for automatic timing based on total path length. + """ + hold_keys: SequenceNotStr[str] """Modifier keys to hold during the drag""" + smooth: bool + """ + Use human-like Bezier curves between path waypoints instead of linear + interpolation. When true, steps_per_segment and step_delay_ms are ignored. + """ + step_delay_ms: int """ Delay in milliseconds between relative steps while dragging (not the initial diff --git a/tests/api_resources/browsers/test_computer.py b/tests/api_resources/browsers/test_computer.py index 09960bfc..31974d5b 100644 --- a/tests/api_resources/browsers/test_computer.py +++ b/tests/api_resources/browsers/test_computer.py @@ -224,7 +224,9 @@ def test_method_drag_mouse_with_all_params(self, client: Kernel) -> None: path=[[0, 0], [0, 0]], button="left", delay=0, + duration_ms=50, hold_keys=["string"], + smooth=True, step_delay_ms=0, steps_per_segment=1, ) @@ -887,7 +889,9 @@ async def test_method_drag_mouse_with_all_params(self, async_client: AsyncKernel path=[[0, 0], [0, 0]], button="left", delay=0, + duration_ms=50, hold_keys=["string"], + smooth=True, step_delay_ms=0, steps_per_segment=1, ) From 0735b45fc92950cef3afea92a879712ea0ebdf0f Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Thu, 12 Mar 2026 20:04:37 +0000 Subject: [PATCH 2/9] feat: Add GPU viewport presets and GPU encoder defaults --- .stats.yml | 4 +- src/kernel/resources/browser_pools.py | 40 +++++++++++++------ src/kernel/resources/browsers/browsers.py | 20 +++++++--- src/kernel/types/browser_create_params.py | 22 +++++----- src/kernel/types/browser_create_response.py | 22 +++++----- src/kernel/types/browser_list_response.py | 22 +++++----- src/kernel/types/browser_pool.py | 22 +++++----- .../types/browser_pool_acquire_response.py | 22 +++++----- .../types/browser_pool_create_params.py | 22 +++++----- .../types/browser_pool_update_params.py | 22 +++++----- src/kernel/types/browser_retrieve_response.py | 22 +++++----- src/kernel/types/browser_update_response.py | 22 +++++----- .../invocation_list_browsers_response.py | 22 +++++----- src/kernel/types/shared/browser_viewport.py | 10 +++-- .../types/shared_params/browser_viewport.py | 10 +++-- 15 files changed, 188 insertions(+), 116 deletions(-) diff --git a/.stats.yml b/.stats.yml index 81407436..904cb96c 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 103 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/kernel%2Fkernel-e6936890166ce5b11abaccd511a43a8807e2abf96c1f542d4f8d94655ef27d1f.yml -openapi_spec_hash: 0146ecaea96d8136ef4a35cd04aacf22 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/kernel%2Fkernel-95bb1cbe27cbed0339067fa133590e675b99cda4a9c04fad802a5b14563eb572.yml +openapi_spec_hash: 3a24e61711eedb9ea7bb7589a7df956f config_hash: cff4d43372b6fa66b64e2d4150f6aa76 diff --git a/src/kernel/resources/browser_pools.py b/src/kernel/resources/browser_pools.py index a5b6e59a..ea45cd13 100644 --- a/src/kernel/resources/browser_pools.py +++ b/src/kernel/resources/browser_pools.py @@ -110,9 +110,13 @@ def create( are destroyed. Defaults to 600 seconds if not specified viewport: Initial browser window size in pixels with optional refresh rate. If omitted, - image defaults apply (1920x1080@25). Arbitrary viewport dimensions are accepted, - but the following configurations are known-good and fully tested: 2560x1440@10, - 1920x1080@25, 1920x1200@25, 1440x900@25, 1280x800@60, 1024x768@60, 1200x800@60. + image defaults apply (1920x1080@25). For GPU images, the default is + 1920x1080@60. Arbitrary viewport dimensions and refresh rates are accepted. + Known-good presets include: 2560x1440@10, 1920x1080@25, 1920x1200@25, + 1440x900@25, 1280x800@60, 1024x768@60, 1200x800@60. For GPU images, recommended + presets use one of these resolutions with refresh rates 60, 30, 25, or 10: + 800x600, 960x720, 1024x576, 1024x768, 1152x648, 1200x800, 1280x720, 1368x768, + 1440x900, 1600x900, 1920x1080, 1920x1200, 390x844, 360x250, 768x1024, 800x1600. Viewports outside this list may exhibit unstable live view or recording behavior. If refresh_rate is not provided, it will be automatically determined based on the resolution (higher resolutions use lower refresh rates to keep @@ -242,9 +246,13 @@ def update( are destroyed. Defaults to 600 seconds if not specified viewport: Initial browser window size in pixels with optional refresh rate. If omitted, - image defaults apply (1920x1080@25). Arbitrary viewport dimensions are accepted, - but the following configurations are known-good and fully tested: 2560x1440@10, - 1920x1080@25, 1920x1200@25, 1440x900@25, 1280x800@60, 1024x768@60, 1200x800@60. + image defaults apply (1920x1080@25). For GPU images, the default is + 1920x1080@60. Arbitrary viewport dimensions and refresh rates are accepted. + Known-good presets include: 2560x1440@10, 1920x1080@25, 1920x1200@25, + 1440x900@25, 1280x800@60, 1024x768@60, 1200x800@60. For GPU images, recommended + presets use one of these resolutions with refresh rates 60, 30, 25, or 10: + 800x600, 960x720, 1024x576, 1024x768, 1152x648, 1200x800, 1280x720, 1368x768, + 1440x900, 1600x900, 1920x1080, 1920x1200, 390x844, 360x250, 768x1024, 800x1600. Viewports outside this list may exhibit unstable live view or recording behavior. If refresh_rate is not provided, it will be automatically determined based on the resolution (higher resolutions use lower refresh rates to keep @@ -550,9 +558,13 @@ async def create( are destroyed. Defaults to 600 seconds if not specified viewport: Initial browser window size in pixels with optional refresh rate. If omitted, - image defaults apply (1920x1080@25). Arbitrary viewport dimensions are accepted, - but the following configurations are known-good and fully tested: 2560x1440@10, - 1920x1080@25, 1920x1200@25, 1440x900@25, 1280x800@60, 1024x768@60, 1200x800@60. + image defaults apply (1920x1080@25). For GPU images, the default is + 1920x1080@60. Arbitrary viewport dimensions and refresh rates are accepted. + Known-good presets include: 2560x1440@10, 1920x1080@25, 1920x1200@25, + 1440x900@25, 1280x800@60, 1024x768@60, 1200x800@60. For GPU images, recommended + presets use one of these resolutions with refresh rates 60, 30, 25, or 10: + 800x600, 960x720, 1024x576, 1024x768, 1152x648, 1200x800, 1280x720, 1368x768, + 1440x900, 1600x900, 1920x1080, 1920x1200, 390x844, 360x250, 768x1024, 800x1600. Viewports outside this list may exhibit unstable live view or recording behavior. If refresh_rate is not provided, it will be automatically determined based on the resolution (higher resolutions use lower refresh rates to keep @@ -682,9 +694,13 @@ async def update( are destroyed. Defaults to 600 seconds if not specified viewport: Initial browser window size in pixels with optional refresh rate. If omitted, - image defaults apply (1920x1080@25). Arbitrary viewport dimensions are accepted, - but the following configurations are known-good and fully tested: 2560x1440@10, - 1920x1080@25, 1920x1200@25, 1440x900@25, 1280x800@60, 1024x768@60, 1200x800@60. + image defaults apply (1920x1080@25). For GPU images, the default is + 1920x1080@60. Arbitrary viewport dimensions and refresh rates are accepted. + Known-good presets include: 2560x1440@10, 1920x1080@25, 1920x1200@25, + 1440x900@25, 1280x800@60, 1024x768@60, 1200x800@60. For GPU images, recommended + presets use one of these resolutions with refresh rates 60, 30, 25, or 10: + 800x600, 960x720, 1024x576, 1024x768, 1152x648, 1200x800, 1280x720, 1368x768, + 1440x900, 1600x900, 1920x1080, 1920x1200, 390x844, 360x250, 768x1024, 800x1600. Viewports outside this list may exhibit unstable live view or recording behavior. If refresh_rate is not provided, it will be automatically determined based on the resolution (higher resolutions use lower refresh rates to keep diff --git a/src/kernel/resources/browsers/browsers.py b/src/kernel/resources/browsers/browsers.py index 235da236..e12b2842 100644 --- a/src/kernel/resources/browsers/browsers.py +++ b/src/kernel/resources/browsers/browsers.py @@ -196,9 +196,13 @@ def create( see is +/- 5 seconds around the specified value. viewport: Initial browser window size in pixels with optional refresh rate. If omitted, - image defaults apply (1920x1080@25). Arbitrary viewport dimensions are accepted, - but the following configurations are known-good and fully tested: 2560x1440@10, - 1920x1080@25, 1920x1200@25, 1440x900@25, 1280x800@60, 1024x768@60, 1200x800@60. + image defaults apply (1920x1080@25). For GPU images, the default is + 1920x1080@60. Arbitrary viewport dimensions and refresh rates are accepted. + Known-good presets include: 2560x1440@10, 1920x1080@25, 1920x1200@25, + 1440x900@25, 1280x800@60, 1024x768@60, 1200x800@60. For GPU images, recommended + presets use one of these resolutions with refresh rates 60, 30, 25, or 10: + 800x600, 960x720, 1024x576, 1024x768, 1152x648, 1200x800, 1280x720, 1368x768, + 1440x900, 1600x900, 1920x1080, 1920x1200, 390x844, 360x250, 768x1024, 800x1600. Viewports outside this list may exhibit unstable live view or recording behavior. If refresh_rate is not provided, it will be automatically determined based on the resolution (higher resolutions use lower refresh rates to keep @@ -623,9 +627,13 @@ async def create( see is +/- 5 seconds around the specified value. viewport: Initial browser window size in pixels with optional refresh rate. If omitted, - image defaults apply (1920x1080@25). Arbitrary viewport dimensions are accepted, - but the following configurations are known-good and fully tested: 2560x1440@10, - 1920x1080@25, 1920x1200@25, 1440x900@25, 1280x800@60, 1024x768@60, 1200x800@60. + image defaults apply (1920x1080@25). For GPU images, the default is + 1920x1080@60. Arbitrary viewport dimensions and refresh rates are accepted. + Known-good presets include: 2560x1440@10, 1920x1080@25, 1920x1200@25, + 1440x900@25, 1280x800@60, 1024x768@60, 1200x800@60. For GPU images, recommended + presets use one of these resolutions with refresh rates 60, 30, 25, or 10: + 800x600, 960x720, 1024x576, 1024x768, 1152x648, 1200x800, 1280x720, 1368x768, + 1440x900, 1600x900, 1920x1080, 1920x1200, 390x844, 360x250, 768x1024, 800x1600. Viewports outside this list may exhibit unstable live view or recording behavior. If refresh_rate is not provided, it will be automatically determined based on the resolution (higher resolutions use lower refresh rates to keep diff --git a/src/kernel/types/browser_create_params.py b/src/kernel/types/browser_create_params.py index 6df24637..fd22ee76 100644 --- a/src/kernel/types/browser_create_params.py +++ b/src/kernel/types/browser_create_params.py @@ -73,13 +73,17 @@ class BrowserCreateParams(TypedDict, total=False): """ viewport: BrowserViewport - """Initial browser window size in pixels with optional refresh rate. - - If omitted, image defaults apply (1920x1080@25). Arbitrary viewport dimensions - are accepted, but the following configurations are known-good and fully tested: - 2560x1440@10, 1920x1080@25, 1920x1200@25, 1440x900@25, 1280x800@60, 1024x768@60, - 1200x800@60. Viewports outside this list may exhibit unstable live view or - recording behavior. If refresh_rate is not provided, it will be automatically - determined based on the resolution (higher resolutions use lower refresh rates - to keep bandwidth reasonable). + """ + Initial browser window size in pixels with optional refresh rate. If omitted, + image defaults apply (1920x1080@25). For GPU images, the default is + 1920x1080@60. Arbitrary viewport dimensions and refresh rates are accepted. + Known-good presets include: 2560x1440@10, 1920x1080@25, 1920x1200@25, + 1440x900@25, 1280x800@60, 1024x768@60, 1200x800@60. For GPU images, recommended + presets use one of these resolutions with refresh rates 60, 30, 25, or 10: + 800x600, 960x720, 1024x576, 1024x768, 1152x648, 1200x800, 1280x720, 1368x768, + 1440x900, 1600x900, 1920x1080, 1920x1200, 390x844, 360x250, 768x1024, 800x1600. + Viewports outside this list may exhibit unstable live view or recording + behavior. If refresh_rate is not provided, it will be automatically determined + based on the resolution (higher resolutions use lower refresh rates to keep + bandwidth reasonable). """ diff --git a/src/kernel/types/browser_create_response.py b/src/kernel/types/browser_create_response.py index bbfd9a22..4b567659 100644 --- a/src/kernel/types/browser_create_response.py +++ b/src/kernel/types/browser_create_response.py @@ -66,13 +66,17 @@ class BrowserCreateResponse(BaseModel): """Session usage metrics.""" viewport: Optional[BrowserViewport] = None - """Initial browser window size in pixels with optional refresh rate. - - If omitted, image defaults apply (1920x1080@25). Arbitrary viewport dimensions - are accepted, but the following configurations are known-good and fully tested: - 2560x1440@10, 1920x1080@25, 1920x1200@25, 1440x900@25, 1280x800@60, 1024x768@60, - 1200x800@60. Viewports outside this list may exhibit unstable live view or - recording behavior. If refresh_rate is not provided, it will be automatically - determined based on the resolution (higher resolutions use lower refresh rates - to keep bandwidth reasonable). + """ + Initial browser window size in pixels with optional refresh rate. If omitted, + image defaults apply (1920x1080@25). For GPU images, the default is + 1920x1080@60. Arbitrary viewport dimensions and refresh rates are accepted. + Known-good presets include: 2560x1440@10, 1920x1080@25, 1920x1200@25, + 1440x900@25, 1280x800@60, 1024x768@60, 1200x800@60. For GPU images, recommended + presets use one of these resolutions with refresh rates 60, 30, 25, or 10: + 800x600, 960x720, 1024x576, 1024x768, 1152x648, 1200x800, 1280x720, 1368x768, + 1440x900, 1600x900, 1920x1080, 1920x1200, 390x844, 360x250, 768x1024, 800x1600. + Viewports outside this list may exhibit unstable live view or recording + behavior. If refresh_rate is not provided, it will be automatically determined + based on the resolution (higher resolutions use lower refresh rates to keep + bandwidth reasonable). """ diff --git a/src/kernel/types/browser_list_response.py b/src/kernel/types/browser_list_response.py index 915df11c..c6d97527 100644 --- a/src/kernel/types/browser_list_response.py +++ b/src/kernel/types/browser_list_response.py @@ -66,13 +66,17 @@ class BrowserListResponse(BaseModel): """Session usage metrics.""" viewport: Optional[BrowserViewport] = None - """Initial browser window size in pixels with optional refresh rate. - - If omitted, image defaults apply (1920x1080@25). Arbitrary viewport dimensions - are accepted, but the following configurations are known-good and fully tested: - 2560x1440@10, 1920x1080@25, 1920x1200@25, 1440x900@25, 1280x800@60, 1024x768@60, - 1200x800@60. Viewports outside this list may exhibit unstable live view or - recording behavior. If refresh_rate is not provided, it will be automatically - determined based on the resolution (higher resolutions use lower refresh rates - to keep bandwidth reasonable). + """ + Initial browser window size in pixels with optional refresh rate. If omitted, + image defaults apply (1920x1080@25). For GPU images, the default is + 1920x1080@60. Arbitrary viewport dimensions and refresh rates are accepted. + Known-good presets include: 2560x1440@10, 1920x1080@25, 1920x1200@25, + 1440x900@25, 1280x800@60, 1024x768@60, 1200x800@60. For GPU images, recommended + presets use one of these resolutions with refresh rates 60, 30, 25, or 10: + 800x600, 960x720, 1024x576, 1024x768, 1152x648, 1200x800, 1280x720, 1368x768, + 1440x900, 1600x900, 1920x1080, 1920x1200, 390x844, 360x250, 768x1024, 800x1600. + Viewports outside this list may exhibit unstable live view or recording + behavior. If refresh_rate is not provided, it will be automatically determined + based on the resolution (higher resolutions use lower refresh rates to keep + bandwidth reasonable). """ diff --git a/src/kernel/types/browser_pool.py b/src/kernel/types/browser_pool.py index fc4e0f1d..c6286acc 100644 --- a/src/kernel/types/browser_pool.py +++ b/src/kernel/types/browser_pool.py @@ -68,15 +68,19 @@ class BrowserPoolConfig(BaseModel): """ viewport: Optional[BrowserViewport] = None - """Initial browser window size in pixels with optional refresh rate. - - If omitted, image defaults apply (1920x1080@25). Arbitrary viewport dimensions - are accepted, but the following configurations are known-good and fully tested: - 2560x1440@10, 1920x1080@25, 1920x1200@25, 1440x900@25, 1280x800@60, 1024x768@60, - 1200x800@60. Viewports outside this list may exhibit unstable live view or - recording behavior. If refresh_rate is not provided, it will be automatically - determined based on the resolution (higher resolutions use lower refresh rates - to keep bandwidth reasonable). + """ + Initial browser window size in pixels with optional refresh rate. If omitted, + image defaults apply (1920x1080@25). For GPU images, the default is + 1920x1080@60. Arbitrary viewport dimensions and refresh rates are accepted. + Known-good presets include: 2560x1440@10, 1920x1080@25, 1920x1200@25, + 1440x900@25, 1280x800@60, 1024x768@60, 1200x800@60. For GPU images, recommended + presets use one of these resolutions with refresh rates 60, 30, 25, or 10: + 800x600, 960x720, 1024x576, 1024x768, 1152x648, 1200x800, 1280x720, 1368x768, + 1440x900, 1600x900, 1920x1080, 1920x1200, 390x844, 360x250, 768x1024, 800x1600. + Viewports outside this list may exhibit unstable live view or recording + behavior. If refresh_rate is not provided, it will be automatically determined + based on the resolution (higher resolutions use lower refresh rates to keep + bandwidth reasonable). """ diff --git a/src/kernel/types/browser_pool_acquire_response.py b/src/kernel/types/browser_pool_acquire_response.py index 373274c4..29cc6abc 100644 --- a/src/kernel/types/browser_pool_acquire_response.py +++ b/src/kernel/types/browser_pool_acquire_response.py @@ -66,13 +66,17 @@ class BrowserPoolAcquireResponse(BaseModel): """Session usage metrics.""" viewport: Optional[BrowserViewport] = None - """Initial browser window size in pixels with optional refresh rate. - - If omitted, image defaults apply (1920x1080@25). Arbitrary viewport dimensions - are accepted, but the following configurations are known-good and fully tested: - 2560x1440@10, 1920x1080@25, 1920x1200@25, 1440x900@25, 1280x800@60, 1024x768@60, - 1200x800@60. Viewports outside this list may exhibit unstable live view or - recording behavior. If refresh_rate is not provided, it will be automatically - determined based on the resolution (higher resolutions use lower refresh rates - to keep bandwidth reasonable). + """ + Initial browser window size in pixels with optional refresh rate. If omitted, + image defaults apply (1920x1080@25). For GPU images, the default is + 1920x1080@60. Arbitrary viewport dimensions and refresh rates are accepted. + Known-good presets include: 2560x1440@10, 1920x1080@25, 1920x1200@25, + 1440x900@25, 1280x800@60, 1024x768@60, 1200x800@60. For GPU images, recommended + presets use one of these resolutions with refresh rates 60, 30, 25, or 10: + 800x600, 960x720, 1024x576, 1024x768, 1152x648, 1200x800, 1280x720, 1368x768, + 1440x900, 1600x900, 1920x1080, 1920x1200, 390x844, 360x250, 768x1024, 800x1600. + Viewports outside this list may exhibit unstable live view or recording + behavior. If refresh_rate is not provided, it will be automatically determined + based on the resolution (higher resolutions use lower refresh rates to keep + bandwidth reasonable). """ diff --git a/src/kernel/types/browser_pool_create_params.py b/src/kernel/types/browser_pool_create_params.py index 78268a50..63ef712b 100644 --- a/src/kernel/types/browser_pool_create_params.py +++ b/src/kernel/types/browser_pool_create_params.py @@ -67,13 +67,17 @@ class BrowserPoolCreateParams(TypedDict, total=False): """ viewport: BrowserViewport - """Initial browser window size in pixels with optional refresh rate. - - If omitted, image defaults apply (1920x1080@25). Arbitrary viewport dimensions - are accepted, but the following configurations are known-good and fully tested: - 2560x1440@10, 1920x1080@25, 1920x1200@25, 1440x900@25, 1280x800@60, 1024x768@60, - 1200x800@60. Viewports outside this list may exhibit unstable live view or - recording behavior. If refresh_rate is not provided, it will be automatically - determined based on the resolution (higher resolutions use lower refresh rates - to keep bandwidth reasonable). + """ + Initial browser window size in pixels with optional refresh rate. If omitted, + image defaults apply (1920x1080@25). For GPU images, the default is + 1920x1080@60. Arbitrary viewport dimensions and refresh rates are accepted. + Known-good presets include: 2560x1440@10, 1920x1080@25, 1920x1200@25, + 1440x900@25, 1280x800@60, 1024x768@60, 1200x800@60. For GPU images, recommended + presets use one of these resolutions with refresh rates 60, 30, 25, or 10: + 800x600, 960x720, 1024x576, 1024x768, 1152x648, 1200x800, 1280x720, 1368x768, + 1440x900, 1600x900, 1920x1080, 1920x1200, 390x844, 360x250, 768x1024, 800x1600. + Viewports outside this list may exhibit unstable live view or recording + behavior. If refresh_rate is not provided, it will be automatically determined + based on the resolution (higher resolutions use lower refresh rates to keep + bandwidth reasonable). """ diff --git a/src/kernel/types/browser_pool_update_params.py b/src/kernel/types/browser_pool_update_params.py index 74b76a63..d1f003b5 100644 --- a/src/kernel/types/browser_pool_update_params.py +++ b/src/kernel/types/browser_pool_update_params.py @@ -73,13 +73,17 @@ class BrowserPoolUpdateParams(TypedDict, total=False): """ viewport: BrowserViewport - """Initial browser window size in pixels with optional refresh rate. - - If omitted, image defaults apply (1920x1080@25). Arbitrary viewport dimensions - are accepted, but the following configurations are known-good and fully tested: - 2560x1440@10, 1920x1080@25, 1920x1200@25, 1440x900@25, 1280x800@60, 1024x768@60, - 1200x800@60. Viewports outside this list may exhibit unstable live view or - recording behavior. If refresh_rate is not provided, it will be automatically - determined based on the resolution (higher resolutions use lower refresh rates - to keep bandwidth reasonable). + """ + Initial browser window size in pixels with optional refresh rate. If omitted, + image defaults apply (1920x1080@25). For GPU images, the default is + 1920x1080@60. Arbitrary viewport dimensions and refresh rates are accepted. + Known-good presets include: 2560x1440@10, 1920x1080@25, 1920x1200@25, + 1440x900@25, 1280x800@60, 1024x768@60, 1200x800@60. For GPU images, recommended + presets use one of these resolutions with refresh rates 60, 30, 25, or 10: + 800x600, 960x720, 1024x576, 1024x768, 1152x648, 1200x800, 1280x720, 1368x768, + 1440x900, 1600x900, 1920x1080, 1920x1200, 390x844, 360x250, 768x1024, 800x1600. + Viewports outside this list may exhibit unstable live view or recording + behavior. If refresh_rate is not provided, it will be automatically determined + based on the resolution (higher resolutions use lower refresh rates to keep + bandwidth reasonable). """ diff --git a/src/kernel/types/browser_retrieve_response.py b/src/kernel/types/browser_retrieve_response.py index 76fc6ce1..9355af9a 100644 --- a/src/kernel/types/browser_retrieve_response.py +++ b/src/kernel/types/browser_retrieve_response.py @@ -66,13 +66,17 @@ class BrowserRetrieveResponse(BaseModel): """Session usage metrics.""" viewport: Optional[BrowserViewport] = None - """Initial browser window size in pixels with optional refresh rate. - - If omitted, image defaults apply (1920x1080@25). Arbitrary viewport dimensions - are accepted, but the following configurations are known-good and fully tested: - 2560x1440@10, 1920x1080@25, 1920x1200@25, 1440x900@25, 1280x800@60, 1024x768@60, - 1200x800@60. Viewports outside this list may exhibit unstable live view or - recording behavior. If refresh_rate is not provided, it will be automatically - determined based on the resolution (higher resolutions use lower refresh rates - to keep bandwidth reasonable). + """ + Initial browser window size in pixels with optional refresh rate. If omitted, + image defaults apply (1920x1080@25). For GPU images, the default is + 1920x1080@60. Arbitrary viewport dimensions and refresh rates are accepted. + Known-good presets include: 2560x1440@10, 1920x1080@25, 1920x1200@25, + 1440x900@25, 1280x800@60, 1024x768@60, 1200x800@60. For GPU images, recommended + presets use one of these resolutions with refresh rates 60, 30, 25, or 10: + 800x600, 960x720, 1024x576, 1024x768, 1152x648, 1200x800, 1280x720, 1368x768, + 1440x900, 1600x900, 1920x1080, 1920x1200, 390x844, 360x250, 768x1024, 800x1600. + Viewports outside this list may exhibit unstable live view or recording + behavior. If refresh_rate is not provided, it will be automatically determined + based on the resolution (higher resolutions use lower refresh rates to keep + bandwidth reasonable). """ diff --git a/src/kernel/types/browser_update_response.py b/src/kernel/types/browser_update_response.py index fdf4fb51..3bf53e70 100644 --- a/src/kernel/types/browser_update_response.py +++ b/src/kernel/types/browser_update_response.py @@ -66,13 +66,17 @@ class BrowserUpdateResponse(BaseModel): """Session usage metrics.""" viewport: Optional[BrowserViewport] = None - """Initial browser window size in pixels with optional refresh rate. - - If omitted, image defaults apply (1920x1080@25). Arbitrary viewport dimensions - are accepted, but the following configurations are known-good and fully tested: - 2560x1440@10, 1920x1080@25, 1920x1200@25, 1440x900@25, 1280x800@60, 1024x768@60, - 1200x800@60. Viewports outside this list may exhibit unstable live view or - recording behavior. If refresh_rate is not provided, it will be automatically - determined based on the resolution (higher resolutions use lower refresh rates - to keep bandwidth reasonable). + """ + Initial browser window size in pixels with optional refresh rate. If omitted, + image defaults apply (1920x1080@25). For GPU images, the default is + 1920x1080@60. Arbitrary viewport dimensions and refresh rates are accepted. + Known-good presets include: 2560x1440@10, 1920x1080@25, 1920x1200@25, + 1440x900@25, 1280x800@60, 1024x768@60, 1200x800@60. For GPU images, recommended + presets use one of these resolutions with refresh rates 60, 30, 25, or 10: + 800x600, 960x720, 1024x576, 1024x768, 1152x648, 1200x800, 1280x720, 1368x768, + 1440x900, 1600x900, 1920x1080, 1920x1200, 390x844, 360x250, 768x1024, 800x1600. + Viewports outside this list may exhibit unstable live view or recording + behavior. If refresh_rate is not provided, it will be automatically determined + based on the resolution (higher resolutions use lower refresh rates to keep + bandwidth reasonable). """ diff --git a/src/kernel/types/invocation_list_browsers_response.py b/src/kernel/types/invocation_list_browsers_response.py index 673615b2..0c6451ca 100644 --- a/src/kernel/types/invocation_list_browsers_response.py +++ b/src/kernel/types/invocation_list_browsers_response.py @@ -66,15 +66,19 @@ class Browser(BaseModel): """Session usage metrics.""" viewport: Optional[BrowserViewport] = None - """Initial browser window size in pixels with optional refresh rate. - - If omitted, image defaults apply (1920x1080@25). Arbitrary viewport dimensions - are accepted, but the following configurations are known-good and fully tested: - 2560x1440@10, 1920x1080@25, 1920x1200@25, 1440x900@25, 1280x800@60, 1024x768@60, - 1200x800@60. Viewports outside this list may exhibit unstable live view or - recording behavior. If refresh_rate is not provided, it will be automatically - determined based on the resolution (higher resolutions use lower refresh rates - to keep bandwidth reasonable). + """ + Initial browser window size in pixels with optional refresh rate. If omitted, + image defaults apply (1920x1080@25). For GPU images, the default is + 1920x1080@60. Arbitrary viewport dimensions and refresh rates are accepted. + Known-good presets include: 2560x1440@10, 1920x1080@25, 1920x1200@25, + 1440x900@25, 1280x800@60, 1024x768@60, 1200x800@60. For GPU images, recommended + presets use one of these resolutions with refresh rates 60, 30, 25, or 10: + 800x600, 960x720, 1024x576, 1024x768, 1152x648, 1200x800, 1280x720, 1368x768, + 1440x900, 1600x900, 1920x1080, 1920x1200, 390x844, 360x250, 768x1024, 800x1600. + Viewports outside this list may exhibit unstable live view or recording + behavior. If refresh_rate is not provided, it will be automatically determined + based on the resolution (higher resolutions use lower refresh rates to keep + bandwidth reasonable). """ diff --git a/src/kernel/types/shared/browser_viewport.py b/src/kernel/types/shared/browser_viewport.py index dacac1f2..c53505be 100644 --- a/src/kernel/types/shared/browser_viewport.py +++ b/src/kernel/types/shared/browser_viewport.py @@ -8,11 +8,15 @@ class BrowserViewport(BaseModel): - """Initial browser window size in pixels with optional refresh rate. - + """ + Initial browser window size in pixels with optional refresh rate. If omitted, image defaults apply (1920x1080@25). - Arbitrary viewport dimensions are accepted, but the following configurations are known-good and fully tested: + For GPU images, the default is 1920x1080@60. + Arbitrary viewport dimensions and refresh rates are accepted. + Known-good presets include: 2560x1440@10, 1920x1080@25, 1920x1200@25, 1440x900@25, 1280x800@60, 1024x768@60, 1200x800@60. + For GPU images, recommended presets use one of these resolutions with refresh rates 60, 30, 25, or 10: + 800x600, 960x720, 1024x576, 1024x768, 1152x648, 1200x800, 1280x720, 1368x768, 1440x900, 1600x900, 1920x1080, 1920x1200, 390x844, 360x250, 768x1024, 800x1600. Viewports outside this list may exhibit unstable live view or recording behavior. If refresh_rate is not provided, it will be automatically determined based on the resolution (higher resolutions use lower refresh rates to keep bandwidth reasonable). diff --git a/src/kernel/types/shared_params/browser_viewport.py b/src/kernel/types/shared_params/browser_viewport.py index f98ece82..2290f930 100644 --- a/src/kernel/types/shared_params/browser_viewport.py +++ b/src/kernel/types/shared_params/browser_viewport.py @@ -8,11 +8,15 @@ class BrowserViewport(TypedDict, total=False): - """Initial browser window size in pixels with optional refresh rate. - + """ + Initial browser window size in pixels with optional refresh rate. If omitted, image defaults apply (1920x1080@25). - Arbitrary viewport dimensions are accepted, but the following configurations are known-good and fully tested: + For GPU images, the default is 1920x1080@60. + Arbitrary viewport dimensions and refresh rates are accepted. + Known-good presets include: 2560x1440@10, 1920x1080@25, 1920x1200@25, 1440x900@25, 1280x800@60, 1024x768@60, 1200x800@60. + For GPU images, recommended presets use one of these resolutions with refresh rates 60, 30, 25, or 10: + 800x600, 960x720, 1024x576, 1024x768, 1152x648, 1200x800, 1280x720, 1368x768, 1440x900, 1600x900, 1920x1080, 1920x1200, 390x844, 360x250, 768x1024, 800x1600. Viewports outside this list may exhibit unstable live view or recording behavior. If refresh_rate is not provided, it will be automatically determined based on the resolution (higher resolutions use lower refresh rates to keep bandwidth reasonable). From 9841aac21588beb0c6a22baf5c5b0bf8e8cdd024 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Fri, 13 Mar 2026 13:26:07 +0000 Subject: [PATCH 3/9] feat: Adds description to OAS spec for docs about delta_x, delta_y --- .stats.yml | 4 ++-- src/kernel/resources/browsers/computer.py | 12 ++++++++---- src/kernel/types/browsers/computer_batch_params.py | 10 ++++++++-- src/kernel/types/browsers/computer_scroll_params.py | 10 ++++++++-- 4 files changed, 26 insertions(+), 10 deletions(-) diff --git a/.stats.yml b/.stats.yml index 904cb96c..c129c7d3 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 103 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/kernel%2Fkernel-95bb1cbe27cbed0339067fa133590e675b99cda4a9c04fad802a5b14563eb572.yml -openapi_spec_hash: 3a24e61711eedb9ea7bb7589a7df956f +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/kernel%2Fkernel-aa981bcc44bf8382844c53b705f75eeac53fdc7cd828a9260755c5b4537ed966.yml +openapi_spec_hash: e78521a8956dc87b25c076e30600a95e config_hash: cff4d43372b6fa66b64e2d4150f6aa76 diff --git a/src/kernel/resources/browsers/computer.py b/src/kernel/resources/browsers/computer.py index bcde24e5..116a7037 100644 --- a/src/kernel/resources/browsers/computer.py +++ b/src/kernel/resources/browsers/computer.py @@ -486,9 +486,11 @@ def scroll( y: Y coordinate at which to perform the scroll - delta_x: Horizontal scroll amount. Positive scrolls right, negative scrolls left. + delta_x: Horizontal scroll amount in xdotool "wheel units." Positive scrolls right, + negative scrolls left. - delta_y: Vertical scroll amount. Positive scrolls down, negative scrolls up. + delta_y: Vertical scroll amount in xdotool "wheel units." Positive scrolls down, negative + scrolls up. hold_keys: Modifier keys to hold during the scroll @@ -1087,9 +1089,11 @@ async def scroll( y: Y coordinate at which to perform the scroll - delta_x: Horizontal scroll amount. Positive scrolls right, negative scrolls left. + delta_x: Horizontal scroll amount in xdotool "wheel units." Positive scrolls right, + negative scrolls left. - delta_y: Vertical scroll amount. Positive scrolls down, negative scrolls up. + delta_y: Vertical scroll amount in xdotool "wheel units." Positive scrolls down, negative + scrolls up. hold_keys: Modifier keys to hold during the scroll diff --git a/src/kernel/types/browsers/computer_batch_params.py b/src/kernel/types/browsers/computer_batch_params.py index db68466d..7fc6abb5 100644 --- a/src/kernel/types/browsers/computer_batch_params.py +++ b/src/kernel/types/browsers/computer_batch_params.py @@ -131,10 +131,16 @@ class ActionScroll(TypedDict, total=False): """Y coordinate at which to perform the scroll""" delta_x: int - """Horizontal scroll amount. Positive scrolls right, negative scrolls left.""" + """ + Horizontal scroll amount in xdotool "wheel units." Positive scrolls right, + negative scrolls left. + """ delta_y: int - """Vertical scroll amount. Positive scrolls down, negative scrolls up.""" + """ + Vertical scroll amount in xdotool "wheel units." Positive scrolls down, negative + scrolls up. + """ hold_keys: SequenceNotStr[str] """Modifier keys to hold during the scroll""" diff --git a/src/kernel/types/browsers/computer_scroll_params.py b/src/kernel/types/browsers/computer_scroll_params.py index 110cb302..3af38af3 100644 --- a/src/kernel/types/browsers/computer_scroll_params.py +++ b/src/kernel/types/browsers/computer_scroll_params.py @@ -17,10 +17,16 @@ class ComputerScrollParams(TypedDict, total=False): """Y coordinate at which to perform the scroll""" delta_x: int - """Horizontal scroll amount. Positive scrolls right, negative scrolls left.""" + """ + Horizontal scroll amount in xdotool "wheel units." Positive scrolls right, + negative scrolls left. + """ delta_y: int - """Vertical scroll amount. Positive scrolls down, negative scrolls up.""" + """ + Vertical scroll amount in xdotool "wheel units." Positive scrolls down, negative + scrolls up. + """ hold_keys: SequenceNotStr[str] """Modifier keys to hold during the scroll""" From 9ee4d0c080da7f649a3bde63640593f33d5d0f6b Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Mon, 16 Mar 2026 22:33:43 +0000 Subject: [PATCH 4/9] feat: Rename hardware acceleration UI/docs wording to GPU acceleration --- .stats.yml | 4 ++-- src/kernel/resources/browsers/browsers.py | 8 ++++---- src/kernel/types/browser_create_params.py | 2 +- src/kernel/types/browser_create_response.py | 2 +- src/kernel/types/browser_list_response.py | 2 +- src/kernel/types/browser_pool_acquire_response.py | 2 +- src/kernel/types/browser_retrieve_response.py | 2 +- src/kernel/types/browser_update_response.py | 2 +- src/kernel/types/invocation_list_browsers_response.py | 2 +- 9 files changed, 13 insertions(+), 13 deletions(-) diff --git a/.stats.yml b/.stats.yml index c129c7d3..663d1ab4 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 103 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/kernel%2Fkernel-aa981bcc44bf8382844c53b705f75eeac53fdc7cd828a9260755c5b4537ed966.yml -openapi_spec_hash: e78521a8956dc87b25c076e30600a95e +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/kernel%2Fkernel-f57c1468805aef5055a41e942a1ec374df98d58f1071b07c31e6496045e0d902.yml +openapi_spec_hash: a4848d54211d6c6330b5ddd08992035a config_hash: cff4d43372b6fa66b64e2d4150f6aa76 diff --git a/src/kernel/resources/browsers/browsers.py b/src/kernel/resources/browsers/browsers.py index e12b2842..a112bdaa 100644 --- a/src/kernel/resources/browsers/browsers.py +++ b/src/kernel/resources/browsers/browsers.py @@ -166,8 +166,8 @@ def create( Args: extensions: List of browser extensions to load into the session. Provide each by id or name. - gpu: If true, launches a hardware-accelerated browser with GPU rendering. Requires - Start-Up or Enterprise plan. + gpu: If true, enables GPU acceleration for the browser session. Requires Start-Up or + Enterprise plan. headless: If true, launches the browser using a headless image (no VNC/GUI). Defaults to false. @@ -597,8 +597,8 @@ async def create( Args: extensions: List of browser extensions to load into the session. Provide each by id or name. - gpu: If true, launches a hardware-accelerated browser with GPU rendering. Requires - Start-Up or Enterprise plan. + gpu: If true, enables GPU acceleration for the browser session. Requires Start-Up or + Enterprise plan. headless: If true, launches the browser using a headless image (no VNC/GUI). Defaults to false. diff --git a/src/kernel/types/browser_create_params.py b/src/kernel/types/browser_create_params.py index fd22ee76..f59959e0 100644 --- a/src/kernel/types/browser_create_params.py +++ b/src/kernel/types/browser_create_params.py @@ -21,7 +21,7 @@ class BrowserCreateParams(TypedDict, total=False): """ gpu: bool - """If true, launches a hardware-accelerated browser with GPU rendering. + """If true, enables GPU acceleration for the browser session. Requires Start-Up or Enterprise plan. """ diff --git a/src/kernel/types/browser_create_response.py b/src/kernel/types/browser_create_response.py index 4b567659..f1f8c781 100644 --- a/src/kernel/types/browser_create_response.py +++ b/src/kernel/types/browser_create_response.py @@ -45,7 +45,7 @@ class BrowserCreateResponse(BaseModel): """When the browser session was soft-deleted. Only present for deleted sessions.""" gpu: Optional[bool] = None - """Whether the browser session has hardware-accelerated GPU rendering.""" + """Whether GPU acceleration is enabled for the browser session.""" kiosk_mode: Optional[bool] = None """Whether the browser session is running in kiosk mode.""" diff --git a/src/kernel/types/browser_list_response.py b/src/kernel/types/browser_list_response.py index c6d97527..8dbaf1dd 100644 --- a/src/kernel/types/browser_list_response.py +++ b/src/kernel/types/browser_list_response.py @@ -45,7 +45,7 @@ class BrowserListResponse(BaseModel): """When the browser session was soft-deleted. Only present for deleted sessions.""" gpu: Optional[bool] = None - """Whether the browser session has hardware-accelerated GPU rendering.""" + """Whether GPU acceleration is enabled for the browser session.""" kiosk_mode: Optional[bool] = None """Whether the browser session is running in kiosk mode.""" diff --git a/src/kernel/types/browser_pool_acquire_response.py b/src/kernel/types/browser_pool_acquire_response.py index 29cc6abc..24e436ef 100644 --- a/src/kernel/types/browser_pool_acquire_response.py +++ b/src/kernel/types/browser_pool_acquire_response.py @@ -45,7 +45,7 @@ class BrowserPoolAcquireResponse(BaseModel): """When the browser session was soft-deleted. Only present for deleted sessions.""" gpu: Optional[bool] = None - """Whether the browser session has hardware-accelerated GPU rendering.""" + """Whether GPU acceleration is enabled for the browser session.""" kiosk_mode: Optional[bool] = None """Whether the browser session is running in kiosk mode.""" diff --git a/src/kernel/types/browser_retrieve_response.py b/src/kernel/types/browser_retrieve_response.py index 9355af9a..8b8353f5 100644 --- a/src/kernel/types/browser_retrieve_response.py +++ b/src/kernel/types/browser_retrieve_response.py @@ -45,7 +45,7 @@ class BrowserRetrieveResponse(BaseModel): """When the browser session was soft-deleted. Only present for deleted sessions.""" gpu: Optional[bool] = None - """Whether the browser session has hardware-accelerated GPU rendering.""" + """Whether GPU acceleration is enabled for the browser session.""" kiosk_mode: Optional[bool] = None """Whether the browser session is running in kiosk mode.""" diff --git a/src/kernel/types/browser_update_response.py b/src/kernel/types/browser_update_response.py index 3bf53e70..5b90fa43 100644 --- a/src/kernel/types/browser_update_response.py +++ b/src/kernel/types/browser_update_response.py @@ -45,7 +45,7 @@ class BrowserUpdateResponse(BaseModel): """When the browser session was soft-deleted. Only present for deleted sessions.""" gpu: Optional[bool] = None - """Whether the browser session has hardware-accelerated GPU rendering.""" + """Whether GPU acceleration is enabled for the browser session.""" kiosk_mode: Optional[bool] = None """Whether the browser session is running in kiosk mode.""" diff --git a/src/kernel/types/invocation_list_browsers_response.py b/src/kernel/types/invocation_list_browsers_response.py index 0c6451ca..7e4225ec 100644 --- a/src/kernel/types/invocation_list_browsers_response.py +++ b/src/kernel/types/invocation_list_browsers_response.py @@ -45,7 +45,7 @@ class Browser(BaseModel): """When the browser session was soft-deleted. Only present for deleted sessions.""" gpu: Optional[bool] = None - """Whether the browser session has hardware-accelerated GPU rendering.""" + """Whether GPU acceleration is enabled for the browser session.""" kiosk_mode: Optional[bool] = None """Whether the browser session is running in kiosk mode.""" From a815a8237cce2098b2f5d6a8ad5def400d418fbb Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Tue, 17 Mar 2026 04:58:44 +0000 Subject: [PATCH 5/9] fix(pydantic): do not pass `by_alias` unless set --- src/kernel/_compat.py | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/src/kernel/_compat.py b/src/kernel/_compat.py index 786ff42a..e6690a4f 100644 --- a/src/kernel/_compat.py +++ b/src/kernel/_compat.py @@ -2,7 +2,7 @@ from typing import TYPE_CHECKING, Any, Union, Generic, TypeVar, Callable, cast, overload from datetime import date, datetime -from typing_extensions import Self, Literal +from typing_extensions import Self, Literal, TypedDict import pydantic from pydantic.fields import FieldInfo @@ -131,6 +131,10 @@ def model_json(model: pydantic.BaseModel, *, indent: int | None = None) -> str: return model.model_dump_json(indent=indent) +class _ModelDumpKwargs(TypedDict, total=False): + by_alias: bool + + def model_dump( model: pydantic.BaseModel, *, @@ -142,6 +146,9 @@ def model_dump( by_alias: bool | None = None, ) -> dict[str, Any]: if (not PYDANTIC_V1) or hasattr(model, "model_dump"): + kwargs: _ModelDumpKwargs = {} + if by_alias is not None: + kwargs["by_alias"] = by_alias return model.model_dump( mode=mode, exclude=exclude, @@ -149,7 +156,7 @@ def model_dump( exclude_defaults=exclude_defaults, # warnings are not supported in Pydantic v1 warnings=True if PYDANTIC_V1 else warnings, - by_alias=by_alias, + **kwargs, ) return cast( "dict[str, Any]", From fd55947f1776b43cca804622d0c771ebe99ead60 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Tue, 17 Mar 2026 05:03:36 +0000 Subject: [PATCH 6/9] fix(deps): bump minimum typing-extensions version --- pyproject.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pyproject.toml b/pyproject.toml index 021d31eb..62a14748 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -11,7 +11,7 @@ authors = [ dependencies = [ "httpx>=0.23.0, <1", "pydantic>=1.9.0, <3", - "typing-extensions>=4.10, <5", + "typing-extensions>=4.14, <5", "anyio>=3.5.0, <5", "distro>=1.7.0, <2", "sniffio", From 8781c7d9aa8759e487e5d86cbb82bfb7eb3d314e Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Tue, 17 Mar 2026 05:06:36 +0000 Subject: [PATCH 7/9] chore(internal): tweak CI branches --- .github/workflows/ci.yml | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 5f78a6a1..c7bc99ae 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -1,12 +1,14 @@ name: CI on: push: - branches-ignore: - - 'generated' - - 'codegen/**' - - 'integrated/**' - - 'stl-preview-head/**' - - 'stl-preview-base/**' + branches: + - '**' + - '!integrated/**' + - '!stl-preview-head/**' + - '!stl-preview-base/**' + - '!generated' + - '!codegen/**' + - 'codegen/stl/**' pull_request: branches-ignore: - 'stl-preview-head/**' From cda8f94f6cebabc3b3b6f95aff765816255a9270 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Tue, 17 Mar 2026 17:14:54 +0000 Subject: [PATCH 8/9] feat: Drop headless GPU support and disable pooling --- .stats.yml | 4 ++-- src/kernel/resources/browsers/browsers.py | 4 ++-- src/kernel/types/browser_create_params.py | 2 +- src/kernel/types/browser_create_response.py | 5 ++++- src/kernel/types/browser_list_response.py | 5 ++++- src/kernel/types/browser_pool_acquire_response.py | 5 ++++- src/kernel/types/browser_retrieve_response.py | 5 ++++- src/kernel/types/browser_update_response.py | 5 ++++- src/kernel/types/invocation_list_browsers_response.py | 5 ++++- 9 files changed, 29 insertions(+), 11 deletions(-) diff --git a/.stats.yml b/.stats.yml index 663d1ab4..ad84265a 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 103 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/kernel%2Fkernel-f57c1468805aef5055a41e942a1ec374df98d58f1071b07c31e6496045e0d902.yml -openapi_spec_hash: a4848d54211d6c6330b5ddd08992035a +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/kernel%2Fkernel-17e50cf93d8052ff655c160fc0f156621d9029b041526d4e2e3317b13f80822f.yml +openapi_spec_hash: f7dadc8d93e77983936eb18a8080ce15 config_hash: cff4d43372b6fa66b64e2d4150f6aa76 diff --git a/src/kernel/resources/browsers/browsers.py b/src/kernel/resources/browsers/browsers.py index a112bdaa..1d1ce22a 100644 --- a/src/kernel/resources/browsers/browsers.py +++ b/src/kernel/resources/browsers/browsers.py @@ -167,7 +167,7 @@ def create( extensions: List of browser extensions to load into the session. Provide each by id or name. gpu: If true, enables GPU acceleration for the browser session. Requires Start-Up or - Enterprise plan. + Enterprise plan and headless=false. headless: If true, launches the browser using a headless image (no VNC/GUI). Defaults to false. @@ -598,7 +598,7 @@ async def create( extensions: List of browser extensions to load into the session. Provide each by id or name. gpu: If true, enables GPU acceleration for the browser session. Requires Start-Up or - Enterprise plan. + Enterprise plan and headless=false. headless: If true, launches the browser using a headless image (no VNC/GUI). Defaults to false. diff --git a/src/kernel/types/browser_create_params.py b/src/kernel/types/browser_create_params.py index f59959e0..2827b1dc 100644 --- a/src/kernel/types/browser_create_params.py +++ b/src/kernel/types/browser_create_params.py @@ -23,7 +23,7 @@ class BrowserCreateParams(TypedDict, total=False): gpu: bool """If true, enables GPU acceleration for the browser session. - Requires Start-Up or Enterprise plan. + Requires Start-Up or Enterprise plan and headless=false. """ headless: bool diff --git a/src/kernel/types/browser_create_response.py b/src/kernel/types/browser_create_response.py index f1f8c781..d59a3d0d 100644 --- a/src/kernel/types/browser_create_response.py +++ b/src/kernel/types/browser_create_response.py @@ -45,7 +45,10 @@ class BrowserCreateResponse(BaseModel): """When the browser session was soft-deleted. Only present for deleted sessions.""" gpu: Optional[bool] = None - """Whether GPU acceleration is enabled for the browser session.""" + """ + Whether GPU acceleration is enabled for the browser session (only supported for + headful sessions). + """ kiosk_mode: Optional[bool] = None """Whether the browser session is running in kiosk mode.""" diff --git a/src/kernel/types/browser_list_response.py b/src/kernel/types/browser_list_response.py index 8dbaf1dd..708caa97 100644 --- a/src/kernel/types/browser_list_response.py +++ b/src/kernel/types/browser_list_response.py @@ -45,7 +45,10 @@ class BrowserListResponse(BaseModel): """When the browser session was soft-deleted. Only present for deleted sessions.""" gpu: Optional[bool] = None - """Whether GPU acceleration is enabled for the browser session.""" + """ + Whether GPU acceleration is enabled for the browser session (only supported for + headful sessions). + """ kiosk_mode: Optional[bool] = None """Whether the browser session is running in kiosk mode.""" diff --git a/src/kernel/types/browser_pool_acquire_response.py b/src/kernel/types/browser_pool_acquire_response.py index 24e436ef..5ab52b58 100644 --- a/src/kernel/types/browser_pool_acquire_response.py +++ b/src/kernel/types/browser_pool_acquire_response.py @@ -45,7 +45,10 @@ class BrowserPoolAcquireResponse(BaseModel): """When the browser session was soft-deleted. Only present for deleted sessions.""" gpu: Optional[bool] = None - """Whether GPU acceleration is enabled for the browser session.""" + """ + Whether GPU acceleration is enabled for the browser session (only supported for + headful sessions). + """ kiosk_mode: Optional[bool] = None """Whether the browser session is running in kiosk mode.""" diff --git a/src/kernel/types/browser_retrieve_response.py b/src/kernel/types/browser_retrieve_response.py index 8b8353f5..221eab52 100644 --- a/src/kernel/types/browser_retrieve_response.py +++ b/src/kernel/types/browser_retrieve_response.py @@ -45,7 +45,10 @@ class BrowserRetrieveResponse(BaseModel): """When the browser session was soft-deleted. Only present for deleted sessions.""" gpu: Optional[bool] = None - """Whether GPU acceleration is enabled for the browser session.""" + """ + Whether GPU acceleration is enabled for the browser session (only supported for + headful sessions). + """ kiosk_mode: Optional[bool] = None """Whether the browser session is running in kiosk mode.""" diff --git a/src/kernel/types/browser_update_response.py b/src/kernel/types/browser_update_response.py index 5b90fa43..c8a85c3b 100644 --- a/src/kernel/types/browser_update_response.py +++ b/src/kernel/types/browser_update_response.py @@ -45,7 +45,10 @@ class BrowserUpdateResponse(BaseModel): """When the browser session was soft-deleted. Only present for deleted sessions.""" gpu: Optional[bool] = None - """Whether GPU acceleration is enabled for the browser session.""" + """ + Whether GPU acceleration is enabled for the browser session (only supported for + headful sessions). + """ kiosk_mode: Optional[bool] = None """Whether the browser session is running in kiosk mode.""" diff --git a/src/kernel/types/invocation_list_browsers_response.py b/src/kernel/types/invocation_list_browsers_response.py index 7e4225ec..a0fed9a2 100644 --- a/src/kernel/types/invocation_list_browsers_response.py +++ b/src/kernel/types/invocation_list_browsers_response.py @@ -45,7 +45,10 @@ class Browser(BaseModel): """When the browser session was soft-deleted. Only present for deleted sessions.""" gpu: Optional[bool] = None - """Whether GPU acceleration is enabled for the browser session.""" + """ + Whether GPU acceleration is enabled for the browser session (only supported for + headful sessions). + """ kiosk_mode: Optional[bool] = None """Whether the browser session is running in kiosk mode.""" From 6510e04339faf5d909228c282855d7333bd26646 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Tue, 17 Mar 2026 17:15:18 +0000 Subject: [PATCH 9/9] release: 0.44.0 --- .release-please-manifest.json | 2 +- CHANGELOG.md | 23 +++++++++++++++++++++++ pyproject.toml | 2 +- src/kernel/_version.py | 2 +- 4 files changed, 26 insertions(+), 3 deletions(-) diff --git a/.release-please-manifest.json b/.release-please-manifest.json index fe87cd91..cc51f6f8 100644 --- a/.release-please-manifest.json +++ b/.release-please-manifest.json @@ -1,3 +1,3 @@ { - ".": "0.43.0" + ".": "0.44.0" } \ No newline at end of file diff --git a/CHANGELOG.md b/CHANGELOG.md index 3cf89701..97a948ec 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,28 @@ # Changelog +## 0.44.0 (2026-03-17) + +Full Changelog: [v0.43.0...v0.44.0](https://github.com/kernel/kernel-python-sdk/compare/v0.43.0...v0.44.0) + +### Features + +* Add GPU viewport presets and GPU encoder defaults ([0735b45](https://github.com/kernel/kernel-python-sdk/commit/0735b45fc92950cef3afea92a879712ea0ebdf0f)) +* Adds description to OAS spec for docs about delta_x, delta_y ([9841aac](https://github.com/kernel/kernel-python-sdk/commit/9841aac21588beb0c6a22baf5c5b0bf8e8cdd024)) +* Drop headless GPU support and disable pooling ([cda8f94](https://github.com/kernel/kernel-python-sdk/commit/cda8f94f6cebabc3b3b6f95aff765816255a9270)) +* expose smooth drag mouse movement via public API ([c6f6862](https://github.com/kernel/kernel-python-sdk/commit/c6f6862d03620bb218a99c85431e384c5c8e5e4c)) +* Rename hardware acceleration UI/docs wording to GPU acceleration ([9ee4d0c](https://github.com/kernel/kernel-python-sdk/commit/9ee4d0c080da7f649a3bde63640593f33d5d0f6b)) + + +### Bug Fixes + +* **deps:** bump minimum typing-extensions version ([fd55947](https://github.com/kernel/kernel-python-sdk/commit/fd55947f1776b43cca804622d0c771ebe99ead60)) +* **pydantic:** do not pass `by_alias` unless set ([a815a82](https://github.com/kernel/kernel-python-sdk/commit/a815a8237cce2098b2f5d6a8ad5def400d418fbb)) + + +### Chores + +* **internal:** tweak CI branches ([8781c7d](https://github.com/kernel/kernel-python-sdk/commit/8781c7d9aa8759e487e5d86cbb82bfb7eb3d314e)) + ## 0.43.0 (2026-03-10) Full Changelog: [v0.42.1...v0.43.0](https://github.com/kernel/kernel-python-sdk/compare/v0.42.1...v0.43.0) diff --git a/pyproject.toml b/pyproject.toml index 62a14748..62ca8334 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [project] name = "kernel" -version = "0.43.0" +version = "0.44.0" description = "The official Python library for the kernel API" dynamic = ["readme"] license = "Apache-2.0" diff --git a/src/kernel/_version.py b/src/kernel/_version.py index 068f52c7..2c4ce41e 100644 --- a/src/kernel/_version.py +++ b/src/kernel/_version.py @@ -1,4 +1,4 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. __title__ = "kernel" -__version__ = "0.43.0" # x-release-please-version +__version__ = "0.44.0" # x-release-please-version