Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 8 additions & 6 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -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/**'
Expand Down
2 changes: 1 addition & 1 deletion .release-please-manifest.json
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
{
".": "0.43.0"
".": "0.44.0"
}
4 changes: 2 additions & 2 deletions .stats.yml
Original file line number Diff line number Diff line change
@@ -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-17e50cf93d8052ff655c160fc0f156621d9029b041526d4e2e3317b13f80822f.yml
openapi_spec_hash: f7dadc8d93e77983936eb18a8080ce15
config_hash: cff4d43372b6fa66b64e2d4150f6aa76
23 changes: 23 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -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)
Expand Down
4 changes: 2 additions & 2 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -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"
Expand All @@ -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",
Expand Down
11 changes: 9 additions & 2 deletions src/kernel/_compat.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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,
*,
Expand All @@ -142,14 +146,17 @@ 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,
exclude_unset=exclude_unset,
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]",
Expand Down
2 changes: 1 addition & 1 deletion src/kernel/_version.py
Original file line number Diff line number Diff line change
@@ -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
40 changes: 28 additions & 12 deletions src/kernel/resources/browser_pools.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down
28 changes: 18 additions & 10 deletions src/kernel/resources/browsers/browsers.py
Original file line number Diff line number Diff line change
Expand Up @@ -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 and headless=false.

headless: If true, launches the browser using a headless image (no VNC/GUI). Defaults to
false.
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -593,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 and headless=false.

headless: If true, launches the browser using a headless image (no VNC/GUI). Defaults to
false.
Expand Down Expand Up @@ -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
Expand Down
32 changes: 28 additions & 4 deletions src/kernel/resources/browsers/computer.py
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand All @@ -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).

Expand All @@ -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,
},
Expand Down Expand Up @@ -476,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

Expand Down Expand Up @@ -804,7 +816,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.
Expand All @@ -825,8 +839,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).

Expand All @@ -850,7 +870,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,
},
Expand Down Expand Up @@ -1067,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

Expand Down
Loading