From 848805abcfa585e4299742cd8f7a3ff0306febfe Mon Sep 17 00:00:00 2001 From: "kernel-internal[bot]" <260533166+kernel-internal[bot]@users.noreply.github.com> Date: Tue, 22 Sep 2026 19:10:24 +0000 Subject: [PATCH 1/5] feat: Publish iframe and worker browser target types Stainless-Generated-From: a2f1ad1397e88859def542150105c6048160757d --- src/kernel/types/browsers/browser_event_context.py | 4 +++- src/kernel/types/browsers/browser_page_crashed_event.py | 2 +- src/kernel/types/browsers/browser_page_navigation_event.py | 4 +++- src/kernel/types/browsers/browser_page_tab_opened_event.py | 4 +++- 4 files changed, 10 insertions(+), 4 deletions(-) diff --git a/src/kernel/types/browsers/browser_event_context.py b/src/kernel/types/browsers/browser_event_context.py index 6f2e9549..1342799e 100644 --- a/src/kernel/types/browsers/browser_event_context.py +++ b/src/kernel/types/browsers/browser_event_context.py @@ -32,7 +32,9 @@ class BrowserEventContext(BaseModel): target_id: Optional[str] = None """Browser target identifier (stable across navigations within a tab).""" - target_type: Optional[Literal["page", "background_page", "service_worker", "shared_worker", "other"]] = None + target_type: Optional[ + Literal["page", "iframe", "worker", "background_page", "service_worker", "shared_worker", "other"] + ] = None """CDP target type of the page that produced the event.""" url: Optional[str] = None diff --git a/src/kernel/types/browsers/browser_page_crashed_event.py b/src/kernel/types/browsers/browser_page_crashed_event.py index 46e84f32..86c31400 100644 --- a/src/kernel/types/browsers/browser_page_crashed_event.py +++ b/src/kernel/types/browsers/browser_page_crashed_event.py @@ -13,7 +13,7 @@ class Data(BaseModel): target_id: str """CDP target identifier of the crashed page.""" - target_type: Literal["page", "background_page", "service_worker", "shared_worker", "other"] + target_type: Literal["page", "iframe", "worker", "background_page", "service_worker", "shared_worker", "other"] """CDP target type of the page that produced the event.""" url: str diff --git a/src/kernel/types/browsers/browser_page_navigation_event.py b/src/kernel/types/browsers/browser_page_navigation_event.py index 5835d6d4..b4504ef5 100644 --- a/src/kernel/types/browsers/browser_page_navigation_event.py +++ b/src/kernel/types/browsers/browser_page_navigation_event.py @@ -28,7 +28,9 @@ class Data(BaseModel): target_id: Optional[str] = None """Browser target identifier.""" - target_type: Optional[Literal["page", "background_page", "service_worker", "shared_worker", "other"]] = None + target_type: Optional[ + Literal["page", "iframe", "worker", "background_page", "service_worker", "shared_worker", "other"] + ] = None """CDP target type of the page that produced the event.""" url: Optional[str] = None diff --git a/src/kernel/types/browsers/browser_page_tab_opened_event.py b/src/kernel/types/browsers/browser_page_tab_opened_event.py index 144be476..9fcac2b4 100644 --- a/src/kernel/types/browsers/browser_page_tab_opened_event.py +++ b/src/kernel/types/browsers/browser_page_tab_opened_event.py @@ -16,7 +16,9 @@ class Data(BaseModel): target_id: Optional[str] = None """CDP target identifier for the newly opened tab.""" - target_type: Optional[Literal["page", "background_page", "service_worker", "shared_worker", "other"]] = None + target_type: Optional[ + Literal["page", "iframe", "worker", "background_page", "service_worker", "shared_worker", "other"] + ] = None """CDP target type of the page that produced the event.""" title: Optional[str] = None From 2b637f562b34ad0963b8ba4d0ecca73fa1dd6349 Mon Sep 17 00:00:00 2001 From: "kernel-internal[bot]" <260533166+kernel-internal[bot]@users.noreply.github.com> Date: Tue, 22 Sep 2026 23:05:37 +0000 Subject: [PATCH 2/5] feat: Correct monitor_disconnected description on computed state Stainless-Generated-From: d46c162f2516eacd33943461f190394ae3dbac42 --- src/kernel/types/browsers/browser_monitor_disconnected_event.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/kernel/types/browsers/browser_monitor_disconnected_event.py b/src/kernel/types/browsers/browser_monitor_disconnected_event.py index 2ea3afeb..de4afe5e 100644 --- a/src/kernel/types/browsers/browser_monitor_disconnected_event.py +++ b/src/kernel/types/browsers/browser_monitor_disconnected_event.py @@ -17,7 +17,7 @@ class Data(BaseModel): class BrowserMonitorDisconnectedEvent(BaseModel): """The CDP connection to Chrome was lost. - Telemetry events may be dropped until monitor_reconnected arrives. Treat any in-progress computed state (network_idle, page_layout_settled) as unreliable until then. + Telemetry events may be dropped until monitor_reconnected arrives. In-progress computed state is discarded rather than paused, so computed events still pending for the current navigation (network_idle, page_layout_settled, page_navigation_settled) never fire. monitor_reconnected does not restore them. After reattachment a fresh state machine starts, so computed events can resume before the next navigation and carry empty navigation context until one occurs. """ category: Literal["monitor"] From 1fdfce2a3b05c5af330c93cd8e37a217f4d0f99b Mon Sep 17 00:00:00 2001 From: "kernel-internal[bot]" <260533166+kernel-internal[bot]@users.noreply.github.com> Date: Wed, 23 Sep 2026 19:10:18 +0000 Subject: [PATCH 3/5] feat: Filter archived telemetry events by type Stainless-Generated-From: 2a917c5ccb5838e9bdd96775019f433535c381e8 --- src/kernel/resources/browsers/telemetry.py | 32 ++++++++++++------- .../types/browsers/telemetry_events_params.py | 13 ++++++-- .../api_resources/browsers/test_telemetry.py | 2 ++ 3 files changed, 33 insertions(+), 14 deletions(-) diff --git a/src/kernel/resources/browsers/telemetry.py b/src/kernel/resources/browsers/telemetry.py index 367ac734..45cc3516 100644 --- a/src/kernel/resources/browsers/telemetry.py +++ b/src/kernel/resources/browsers/telemetry.py @@ -7,7 +7,7 @@ import httpx -from ..._types import Body, Omit, Query, Headers, NotGiven, omit, not_given +from ..._types import Body, Omit, Query, Headers, NotGiven, SequenceNotStr, omit, not_given from ..._utils import path_template, maybe_transform, strip_not_given, async_maybe_transform from ..._compat import cached_property from ..._resource import SyncAPIResource, AsyncAPIResource @@ -75,6 +75,7 @@ def events( offset: int | Omit = omit, order: str | Omit = omit, since: str | Omit = omit, + type: SequenceNotStr[str] | Omit = omit, until: str | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. @@ -87,8 +88,9 @@ def events( To page through results, pass the X-Next-Offset value from the previous response as offset and - repeat while X-Has-More is true. Returns an empty list when telemetry data is - unavailable. + repeat while X-Has-More is true. The category and type filters apply within each + page, so a filtered page may be empty while X-Has-More is true. Returns an empty + list when telemetry data is unavailable. Args: category: Restrict results to these event categories. Repeat the parameter for multiple @@ -104,13 +106,15 @@ def events( order: Read direction. asc (default) reads oldest first, starting from since or the offset cursor. desc reads newest first: each request returns one page of up to limit records ending at the offset cursor (or until, or the newest archived - event); combining desc with since is rejected with a 400. In either direction - the category filter applies within the page, so a filtered page may be empty - while X-Has-More is true. + event); combining desc with since is rejected with a 400. since: Start of the window: an RFC-3339 timestamp, or a duration like 5m meaning that long ago. Defaults to 5m. Ignored when offset is set. + type: Restrict results to these event types, such as page_crashed or + captcha_challenge_result. Repeat the parameter for multiple values. Combines + with category: when both are set an event must match both. + until: End of the window (exclusive): an RFC-3339 timestamp, or a duration like 5m meaning that long ago. @@ -139,6 +143,7 @@ def events( "offset": offset, "order": order, "since": since, + "type": type, "until": until, }, telemetry_events_params.TelemetryEventsParams, @@ -252,6 +257,7 @@ def events( offset: int | Omit = omit, order: str | Omit = omit, since: str | Omit = omit, + type: SequenceNotStr[str] | Omit = omit, until: str | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. @@ -264,8 +270,9 @@ def events( To page through results, pass the X-Next-Offset value from the previous response as offset and - repeat while X-Has-More is true. Returns an empty list when telemetry data is - unavailable. + repeat while X-Has-More is true. The category and type filters apply within each + page, so a filtered page may be empty while X-Has-More is true. Returns an empty + list when telemetry data is unavailable. Args: category: Restrict results to these event categories. Repeat the parameter for multiple @@ -281,13 +288,15 @@ def events( order: Read direction. asc (default) reads oldest first, starting from since or the offset cursor. desc reads newest first: each request returns one page of up to limit records ending at the offset cursor (or until, or the newest archived - event); combining desc with since is rejected with a 400. In either direction - the category filter applies within the page, so a filtered page may be empty - while X-Has-More is true. + event); combining desc with since is rejected with a 400. since: Start of the window: an RFC-3339 timestamp, or a duration like 5m meaning that long ago. Defaults to 5m. Ignored when offset is set. + type: Restrict results to these event types, such as page_crashed or + captcha_challenge_result. Repeat the parameter for multiple values. Combines + with category: when both are set an event must match both. + until: End of the window (exclusive): an RFC-3339 timestamp, or a duration like 5m meaning that long ago. @@ -316,6 +325,7 @@ def events( "offset": offset, "order": order, "since": since, + "type": type, "until": until, }, telemetry_events_params.TelemetryEventsParams, diff --git a/src/kernel/types/browsers/telemetry_events_params.py b/src/kernel/types/browsers/telemetry_events_params.py index ec385bb5..1253aa1a 100644 --- a/src/kernel/types/browsers/telemetry_events_params.py +++ b/src/kernel/types/browsers/telemetry_events_params.py @@ -5,6 +5,8 @@ from typing import List from typing_extensions import Literal, TypedDict +from ..._types import SequenceNotStr + __all__ = ["TelemetryEventsParams"] @@ -46,9 +48,7 @@ class TelemetryEventsParams(TypedDict, total=False): asc (default) reads oldest first, starting from since or the offset cursor. desc reads newest first: each request returns one page of up to limit records ending at the offset cursor (or until, or the newest archived event); combining desc - with since is rejected with a 400. In either direction the category filter - applies within the page, so a filtered page may be empty while X-Has-More is - true. + with since is rejected with a 400. """ since: str @@ -57,6 +57,13 @@ class TelemetryEventsParams(TypedDict, total=False): long ago. Defaults to 5m. Ignored when offset is set. """ + type: SequenceNotStr[str] + """ + Restrict results to these event types, such as page_crashed or + captcha_challenge_result. Repeat the parameter for multiple values. Combines + with category: when both are set an event must match both. + """ + until: str """ End of the window (exclusive): an RFC-3339 timestamp, or a duration like 5m diff --git a/tests/api_resources/browsers/test_telemetry.py b/tests/api_resources/browsers/test_telemetry.py index b54dfbc1..6bf65cc9 100644 --- a/tests/api_resources/browsers/test_telemetry.py +++ b/tests/api_resources/browsers/test_telemetry.py @@ -36,6 +36,7 @@ def test_method_events_with_all_params(self, client: Kernel) -> None: offset=0, order="order", since="since", + type=["string"], until="until", ) assert_matches_type(SyncOffsetPagination[TelemetryEventsResponse], telemetry, path=["response"]) @@ -149,6 +150,7 @@ async def test_method_events_with_all_params(self, async_client: AsyncKernel) -> offset=0, order="order", since="since", + type=["string"], until="until", ) assert_matches_type(AsyncOffsetPagination[TelemetryEventsResponse], telemetry, path=["response"]) From f5c540cdd1b0cee422cf47825dbc2212a5b6532f Mon Sep 17 00:00:00 2001 From: "kernel-internal[bot]" <260533166+kernel-internal[bot]@users.noreply.github.com> Date: Wed, 23 Sep 2026 22:24:58 +0000 Subject: [PATCH 4/5] feat: Add profiles to browser pool acquire Stainless-Generated-From: 5176ec1d8f90acc70434a055166d8e9366218443 --- src/kernel/resources/browser_pools.py | 19 +++++++++++++++++-- .../types/browser_pool_acquire_params.py | 8 ++++++++ .../types/browser_pool_release_params.py | 3 ++- tests/api_resources/test_browser_pools.py | 10 ++++++++++ 4 files changed, 37 insertions(+), 3 deletions(-) diff --git a/src/kernel/resources/browser_pools.py b/src/kernel/resources/browser_pools.py index 5351d638..13dbceca 100644 --- a/src/kernel/resources/browser_pools.py +++ b/src/kernel/resources/browser_pools.py @@ -31,6 +31,7 @@ from ..types.browser_pool import BrowserPool from ..types.browser_network_config_param import BrowserNetworkConfigParam from ..types.browser_pool_acquire_response import BrowserPoolAcquireResponse +from ..types.shared_params.browser_profile import BrowserProfile from ..types.shared_params.browser_viewport import BrowserViewport from ..types.shared_params.browser_extension import BrowserExtension @@ -509,6 +510,7 @@ def acquire( *, acquire_timeout_seconds: int | Omit = omit, name: str | Omit = omit, + profile: BrowserProfile | Omit = omit, start_url: str | Omit = omit, tags: TagsParam | Omit = omit, telemetry: Optional[browser_pool_acquire_params.Telemetry] | Omit = omit, @@ -536,6 +538,10 @@ def acquire( project. Applies to this lease only and is cleared when the browser is released back to the pool. + profile: Profile selection for the browser session. Provide either id or name. If + specified, the matching profile will be loaded into the browser session. + Profiles must be created beforehand. + start_url: Optional URL to navigate the acquired browser to. Overrides the pool's start_url for this acquire only. Best-effort: failures to navigate do not fail the acquire. @@ -569,6 +575,7 @@ def acquire( { "acquire_timeout_seconds": acquire_timeout_seconds, "name": name, + "profile": profile, "start_url": start_url, "tags": tags, "telemetry": telemetry, @@ -638,7 +645,8 @@ def release( Defaults to true. A reused browser keeps the configuration it was created with, so it does not pick up pool configuration changes made while it was in use. Release with `reuse: false`, or flush the pool afterward, to rebuild it with the - current configuration. + current configuration. Browsers loaded with an acquire-time profile are always + destroyed and replaced, even when reuse is true. extra_headers: Send extra headers @@ -1139,6 +1147,7 @@ async def acquire( *, acquire_timeout_seconds: int | Omit = omit, name: str | Omit = omit, + profile: BrowserProfile | Omit = omit, start_url: str | Omit = omit, tags: TagsParam | Omit = omit, telemetry: Optional[browser_pool_acquire_params.Telemetry] | Omit = omit, @@ -1166,6 +1175,10 @@ async def acquire( project. Applies to this lease only and is cleared when the browser is released back to the pool. + profile: Profile selection for the browser session. Provide either id or name. If + specified, the matching profile will be loaded into the browser session. + Profiles must be created beforehand. + start_url: Optional URL to navigate the acquired browser to. Overrides the pool's start_url for this acquire only. Best-effort: failures to navigate do not fail the acquire. @@ -1199,6 +1212,7 @@ async def acquire( { "acquire_timeout_seconds": acquire_timeout_seconds, "name": name, + "profile": profile, "start_url": start_url, "tags": tags, "telemetry": telemetry, @@ -1268,7 +1282,8 @@ async def release( Defaults to true. A reused browser keeps the configuration it was created with, so it does not pick up pool configuration changes made while it was in use. Release with `reuse: false`, or flush the pool afterward, to rebuild it with the - current configuration. + current configuration. Browsers loaded with an acquire-time profile are always + destroyed and replaced, even when reuse is true. extra_headers: Send extra headers diff --git a/src/kernel/types/browser_pool_acquire_params.py b/src/kernel/types/browser_pool_acquire_params.py index b5bd708d..823d05b9 100644 --- a/src/kernel/types/browser_pool_acquire_params.py +++ b/src/kernel/types/browser_pool_acquire_params.py @@ -6,6 +6,7 @@ from typing_extensions import TypedDict from .tags_param import TagsParam +from .shared_params.browser_profile import BrowserProfile from .browsers.browser_telemetry_categories_config_param import BrowserTelemetryCategoriesConfigParam __all__ = [ @@ -33,6 +34,13 @@ class BrowserPoolAcquireParams(TypedDict, total=False): back to the pool. """ + profile: BrowserProfile + """Profile selection for the browser session. + + Provide either id or name. If specified, the matching profile will be loaded + into the browser session. Profiles must be created beforehand. + """ + start_url: str """Optional URL to navigate the acquired browser to. diff --git a/src/kernel/types/browser_pool_release_params.py b/src/kernel/types/browser_pool_release_params.py index 944e734b..5d5e6655 100644 --- a/src/kernel/types/browser_pool_release_params.py +++ b/src/kernel/types/browser_pool_release_params.py @@ -17,5 +17,6 @@ class BrowserPoolReleaseParams(TypedDict, total=False): Defaults to true. A reused browser keeps the configuration it was created with, so it does not pick up pool configuration changes made while it was in use. Release with `reuse: false`, or flush the pool afterward, to rebuild it with the - current configuration. + current configuration. Browsers loaded with an acquire-time profile are always + destroyed and replaced, even when reuse is true. """ diff --git a/tests/api_resources/test_browser_pools.py b/tests/api_resources/test_browser_pools.py index 1f541959..1ba72158 100644 --- a/tests/api_resources/test_browser_pools.py +++ b/tests/api_resources/test_browser_pools.py @@ -370,6 +370,11 @@ def test_method_acquire_with_all_params(self, client: Kernel) -> None: id_or_name="id_or_name", acquire_timeout_seconds=0, name="checkout-flow-1", + profile={ + "id": "id", + "name": "name", + "save_changes": True, + }, start_url="https://example.com", tags={ "team": "backend", @@ -892,6 +897,11 @@ async def test_method_acquire_with_all_params(self, async_client: AsyncKernel) - id_or_name="id_or_name", acquire_timeout_seconds=0, name="checkout-flow-1", + profile={ + "id": "id", + "name": "name", + "save_changes": True, + }, start_url="https://example.com", tags={ "team": "backend", From 19cbf8f361b8af01547dce7eb1e4ebf715819aa1 Mon Sep 17 00:00:00 2001 From: "kernel-internal[bot]" <260533166+kernel-internal[bot]@users.noreply.github.com> Date: Wed, 23 Sep 2026 22:29:19 +0000 Subject: [PATCH 5/5] release: 0.112.0 --- .release-please-manifest.json | 2 +- CHANGELOG.md | 10 ++++++++++ pyproject.toml | 2 +- src/kernel/_version.py | 2 +- 4 files changed, 13 insertions(+), 3 deletions(-) diff --git a/.release-please-manifest.json b/.release-please-manifest.json index 2969a756..820b5c1a 100644 --- a/.release-please-manifest.json +++ b/.release-please-manifest.json @@ -1,3 +1,3 @@ { - ".": "0.111.0" + ".": "0.112.0" } \ No newline at end of file diff --git a/CHANGELOG.md b/CHANGELOG.md index 587846b9..12c2e408 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,15 @@ # Changelog +## [0.112.0](https://github.com/kernel/kernel-python-sdk/compare/v0.111.0...v0.112.0) (2026-09-23) + + +### Features + +* Add profiles to browser pool acquire ([f5c540c](https://github.com/kernel/kernel-python-sdk/commit/f5c540cdd1b0cee422cf47825dbc2212a5b6532f)) +* Correct monitor_disconnected description on computed state ([2b637f5](https://github.com/kernel/kernel-python-sdk/commit/2b637f562b34ad0963b8ba4d0ecca73fa1dd6349)) +* Filter archived telemetry events by type ([1fdfce2](https://github.com/kernel/kernel-python-sdk/commit/1fdfce2a3b05c5af330c93cd8e37a217f4d0f99b)) +* Publish iframe and worker browser target types ([848805a](https://github.com/kernel/kernel-python-sdk/commit/848805abcfa585e4299742cd8f7a3ff0306febfe)) + ## [0.111.0](https://github.com/kernel/kernel-python-sdk/compare/v0.110.0...v0.111.0) (2026-09-22) diff --git a/pyproject.toml b/pyproject.toml index c8bc1630..55d2a163 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [project] name = "kernel" -version = "0.111.0" +version = "0.112.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 bd2462d5..8211aa6c 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.111.0" # x-release-please-version +__version__ = "0.112.0" # x-release-please-version