diff --git a/.release-please-manifest.json b/.release-please-manifest.json index 2fb68e4d..123a5490 100644 --- a/.release-please-manifest.json +++ b/.release-please-manifest.json @@ -1,3 +1,3 @@ { - ".": "0.145.0" + ".": "0.146.0" } \ No newline at end of file diff --git a/CHANGELOG.md b/CHANGELOG.md index 4f8a7241..f505b6c7 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,12 @@ # Changelog +## [0.146.0](https://github.com/kernel/kernel-python-sdk/compare/v0.145.0...v0.146.0) (2026-11-10) + + +### Features + +* Allow auto-starting replays during browser creation and pool acquire ([8c46a0d](https://github.com/kernel/kernel-python-sdk/commit/8c46a0dc889d19867400a5eeb26812658790c1cb)) + ## [0.145.0](https://github.com/kernel/kernel-python-sdk/compare/v0.144.0...v0.145.0) (2026-11-10) diff --git a/pyproject.toml b/pyproject.toml index e6e3a686..2aaa0c60 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [project] name = "kernel" -version = "0.145.0" +version = "0.146.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 41491b0b..9ab4c49c 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.145.0" # x-release-please-version +__version__ = "0.146.0" # x-release-please-version diff --git a/src/kernel/resources/browser_pools.py b/src/kernel/resources/browser_pools.py index afe64616..e061a3b9 100644 --- a/src/kernel/resources/browser_pools.py +++ b/src/kernel/resources/browser_pools.py @@ -78,6 +78,7 @@ def create( proxy_id: str | Omit = omit, refresh_on_profile_update: bool | Omit = omit, region: Literal["us-east", "us-west", "eu-west", "ap-southeast"] | Omit = omit, + start_replay: bool | Omit = omit, start_url: str | Omit = omit, stealth: bool | Omit = omit, telemetry: Optional[browser_pool_create_params.Telemetry] | Omit = omit, @@ -146,6 +147,8 @@ def create( Region selection requires a Start-Up or Enterprise plan, defaults to us-east when omitted on create. + start_replay: Start replay recording automatically when a browser is acquired from this pool. + start_url: Optional URL to navigate to when a new browser is warmed into the pool. Best-effort: failures to navigate do not fail pool fill. Only applied to newly-warmed browsers; browsers reused via release/acquire keep whatever URL the @@ -205,6 +208,7 @@ def create( "proxy_id": proxy_id, "refresh_on_profile_update": refresh_on_profile_update, "region": region, + "start_replay": start_replay, "start_url": start_url, "stealth": stealth, "telemetry": telemetry, @@ -274,6 +278,7 @@ def update( proxy_id: str | Omit = omit, refresh_on_profile_update: bool | Omit = omit, size: int | Omit = omit, + start_replay: bool | Omit = omit, start_url: str | Omit = omit, stealth: bool | Omit = omit, telemetry: Optional[browser_pool_update_params.Telemetry] | Omit = omit, @@ -368,6 +373,9 @@ def update( maximum size is determined by your organization's pooled sessions limit (the sum of all pool sizes cannot exceed your limit). + start_replay: If provided, replaces whether replay recording starts automatically for future + acquired browsers. + start_url: If provided, replaces the URL to navigate to when a new browser is warmed into the pool. Empty string clears the previously-set URL. Omit this field to leave it unchanged. @@ -428,6 +436,7 @@ def update( "proxy_id": proxy_id, "refresh_on_profile_update": refresh_on_profile_update, "size": size, + "start_replay": start_replay, "start_url": start_url, "stealth": stealth, "telemetry": telemetry, @@ -564,6 +573,7 @@ def acquire( acquire_timeout_seconds: int | Omit = omit, name: str | Omit = omit, profile: BrowserProfile | Omit = omit, + start_replay: bool | Omit = omit, start_url: str | Omit = omit, tags: TagsParam | Omit = omit, telemetry: Optional[browser_pool_acquire_params.Telemetry] | Omit = omit, @@ -596,6 +606,9 @@ def acquire( specified, the matching profile will be loaded into the browser session. Profiles must be created beforehand. + start_replay: Start replay recording immediately for the acquired browser. Omit to use the + pool's configured default. + 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. @@ -632,6 +645,7 @@ def acquire( "acquire_timeout_seconds": acquire_timeout_seconds, "name": name, "profile": profile, + "start_replay": start_replay, "start_url": start_url, "tags": tags, "telemetry": telemetry, @@ -787,6 +801,7 @@ async def create( proxy_id: str | Omit = omit, refresh_on_profile_update: bool | Omit = omit, region: Literal["us-east", "us-west", "eu-west", "ap-southeast"] | Omit = omit, + start_replay: bool | Omit = omit, start_url: str | Omit = omit, stealth: bool | Omit = omit, telemetry: Optional[browser_pool_create_params.Telemetry] | Omit = omit, @@ -855,6 +870,8 @@ async def create( Region selection requires a Start-Up or Enterprise plan, defaults to us-east when omitted on create. + start_replay: Start replay recording automatically when a browser is acquired from this pool. + start_url: Optional URL to navigate to when a new browser is warmed into the pool. Best-effort: failures to navigate do not fail pool fill. Only applied to newly-warmed browsers; browsers reused via release/acquire keep whatever URL the @@ -914,6 +931,7 @@ async def create( "proxy_id": proxy_id, "refresh_on_profile_update": refresh_on_profile_update, "region": region, + "start_replay": start_replay, "start_url": start_url, "stealth": stealth, "telemetry": telemetry, @@ -983,6 +1001,7 @@ async def update( proxy_id: str | Omit = omit, refresh_on_profile_update: bool | Omit = omit, size: int | Omit = omit, + start_replay: bool | Omit = omit, start_url: str | Omit = omit, stealth: bool | Omit = omit, telemetry: Optional[browser_pool_update_params.Telemetry] | Omit = omit, @@ -1077,6 +1096,9 @@ async def update( maximum size is determined by your organization's pooled sessions limit (the sum of all pool sizes cannot exceed your limit). + start_replay: If provided, replaces whether replay recording starts automatically for future + acquired browsers. + start_url: If provided, replaces the URL to navigate to when a new browser is warmed into the pool. Empty string clears the previously-set URL. Omit this field to leave it unchanged. @@ -1137,6 +1159,7 @@ async def update( "proxy_id": proxy_id, "refresh_on_profile_update": refresh_on_profile_update, "size": size, + "start_replay": start_replay, "start_url": start_url, "stealth": stealth, "telemetry": telemetry, @@ -1273,6 +1296,7 @@ async def acquire( acquire_timeout_seconds: int | Omit = omit, name: str | Omit = omit, profile: BrowserProfile | Omit = omit, + start_replay: bool | Omit = omit, start_url: str | Omit = omit, tags: TagsParam | Omit = omit, telemetry: Optional[browser_pool_acquire_params.Telemetry] | Omit = omit, @@ -1305,6 +1329,9 @@ async def acquire( specified, the matching profile will be loaded into the browser session. Profiles must be created beforehand. + start_replay: Start replay recording immediately for the acquired browser. Omit to use the + pool's configured default. + 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. @@ -1341,6 +1368,7 @@ async def acquire( "acquire_timeout_seconds": acquire_timeout_seconds, "name": name, "profile": profile, + "start_replay": start_replay, "start_url": start_url, "tags": tags, "telemetry": telemetry, diff --git a/src/kernel/resources/browsers/browsers.py b/src/kernel/resources/browsers/browsers.py index 19686c20..c1340c2a 100644 --- a/src/kernel/resources/browsers/browsers.py +++ b/src/kernel/resources/browsers/browsers.py @@ -209,6 +209,7 @@ def create( proxy: BrowserProxyConfigParam | Omit = omit, proxy_id: str | Omit = omit, region: Literal["us-east", "us-west", "eu-west", "ap-southeast"] | Omit = omit, + start_replay: bool | Omit = omit, start_url: str | Omit = omit, stealth: bool | Omit = omit, tags: TagsParam | Omit = omit, @@ -285,6 +286,8 @@ def create( created. Region selection requires a Start-Up or Enterprise plan, defaults to us-east when omitted on create. + start_replay: Start replay recording as part of creating this browser session. + start_url: Optional URL to open when the browser session is created. Navigation is best-effort, so navigation failures do not prevent the session from being created. @@ -360,6 +363,7 @@ def create( "proxy": proxy, "proxy_id": proxy_id, "region": region, + "start_replay": start_replay, "start_url": start_url, "stealth": stealth, "tags": tags, @@ -1070,6 +1074,7 @@ async def create( proxy: BrowserProxyConfigParam | Omit = omit, proxy_id: str | Omit = omit, region: Literal["us-east", "us-west", "eu-west", "ap-southeast"] | Omit = omit, + start_replay: bool | Omit = omit, start_url: str | Omit = omit, stealth: bool | Omit = omit, tags: TagsParam | Omit = omit, @@ -1146,6 +1151,8 @@ async def create( created. Region selection requires a Start-Up or Enterprise plan, defaults to us-east when omitted on create. + start_replay: Start replay recording as part of creating this browser session. + start_url: Optional URL to open when the browser session is created. Navigation is best-effort, so navigation failures do not prevent the session from being created. @@ -1221,6 +1228,7 @@ async def create( "proxy": proxy, "proxy_id": proxy_id, "region": region, + "start_replay": start_replay, "start_url": start_url, "stealth": stealth, "tags": tags, diff --git a/src/kernel/types/browser_create_params.py b/src/kernel/types/browser_create_params.py index c7269ab7..32186bf1 100644 --- a/src/kernel/types/browser_create_params.py +++ b/src/kernel/types/browser_create_params.py @@ -132,6 +132,9 @@ class BrowserCreateParams(TypedDict, total=False): Enterprise plan, defaults to us-east when omitted on create. """ + start_replay: bool + """Start replay recording as part of creating this browser session.""" + start_url: str """Optional URL to open when the browser session is created. diff --git a/src/kernel/types/browser_pool.py b/src/kernel/types/browser_pool.py index 035b5722..42bbf8a9 100644 --- a/src/kernel/types/browser_pool.py +++ b/src/kernel/types/browser_pool.py @@ -108,6 +108,9 @@ class BrowserPoolConfig(BaseModel): creation, this defaults to true. Requires a profile to be set on the pool. """ + start_replay: Optional[bool] = None + """Start replay recording automatically when a browser is acquired from this pool.""" + start_url: Optional[str] = None """Optional URL to navigate to when a new browser is warmed into the pool. diff --git a/src/kernel/types/browser_pool_acquire_params.py b/src/kernel/types/browser_pool_acquire_params.py index 0a74c176..140f8ecf 100644 --- a/src/kernel/types/browser_pool_acquire_params.py +++ b/src/kernel/types/browser_pool_acquire_params.py @@ -42,6 +42,12 @@ class BrowserPoolAcquireParams(TypedDict, total=False): into the browser session. Profiles must be created beforehand. """ + start_replay: bool + """Start replay recording immediately for the acquired browser. + + Omit to use the pool's configured default. + """ + start_url: str """Optional URL to navigate the acquired browser to. diff --git a/src/kernel/types/browser_pool_create_params.py b/src/kernel/types/browser_pool_create_params.py index bf05dd92..25700ace 100644 --- a/src/kernel/types/browser_pool_create_params.py +++ b/src/kernel/types/browser_pool_create_params.py @@ -106,6 +106,9 @@ class BrowserPoolCreateParams(TypedDict, total=False): Enterprise plan, defaults to us-east when omitted on create. """ + start_replay: bool + """Start replay recording automatically when a browser is acquired from this pool.""" + start_url: str """Optional URL to navigate to when a new browser is warmed into the pool. diff --git a/src/kernel/types/browser_pool_update_params.py b/src/kernel/types/browser_pool_update_params.py index 4b5c6a0f..7f82cf6d 100644 --- a/src/kernel/types/browser_pool_update_params.py +++ b/src/kernel/types/browser_pool_update_params.py @@ -135,6 +135,12 @@ class BrowserPoolUpdateParams(TypedDict, total=False): sum of all pool sizes cannot exceed your limit). """ + start_replay: bool + """ + If provided, replaces whether replay recording starts automatically for future + acquired browsers. + """ + start_url: str """ If provided, replaces the URL to navigate to when a new browser is warmed into diff --git a/tests/api_resources/test_browser_pools.py b/tests/api_resources/test_browser_pools.py index 04734119..c48b46e1 100644 --- a/tests/api_resources/test_browser_pools.py +++ b/tests/api_resources/test_browser_pools.py @@ -66,6 +66,7 @@ def test_method_create_with_all_params(self, client: Kernel) -> None: proxy_id="proxy_id", refresh_on_profile_update=True, region="us-east", + start_replay=True, start_url="https://example.com", stealth=True, telemetry={ @@ -232,6 +233,7 @@ def test_method_update_with_all_params(self, client: Kernel) -> None: proxy_id="proxy_id", refresh_on_profile_update=True, size=10, + start_replay=True, start_url="https://example.com", stealth=True, telemetry={ @@ -416,6 +418,7 @@ def test_method_acquire_with_all_params(self, client: Kernel) -> None: "name": "name", "save_changes": True, }, + start_replay=True, start_url="https://example.com", tags={ "team": "backend", @@ -635,6 +638,7 @@ async def test_method_create_with_all_params(self, async_client: AsyncKernel) -> proxy_id="proxy_id", refresh_on_profile_update=True, region="us-east", + start_replay=True, start_url="https://example.com", stealth=True, telemetry={ @@ -801,6 +805,7 @@ async def test_method_update_with_all_params(self, async_client: AsyncKernel) -> proxy_id="proxy_id", refresh_on_profile_update=True, size=10, + start_replay=True, start_url="https://example.com", stealth=True, telemetry={ @@ -985,6 +990,7 @@ async def test_method_acquire_with_all_params(self, async_client: AsyncKernel) - "name": "name", "save_changes": True, }, + start_replay=True, start_url="https://example.com", tags={ "team": "backend", diff --git a/tests/api_resources/test_browsers.py b/tests/api_resources/test_browsers.py index d28d9168..b8364379 100644 --- a/tests/api_resources/test_browsers.py +++ b/tests/api_resources/test_browsers.py @@ -79,6 +79,7 @@ def test_method_create_with_all_params(self, client: Kernel) -> None: }, proxy_id="proxy_id", region="us-east", + start_replay=True, start_url="https://example.com", stealth=True, tags={ @@ -691,6 +692,7 @@ async def test_method_create_with_all_params(self, async_client: AsyncKernel) -> }, proxy_id="proxy_id", region="us-east", + start_replay=True, start_url="https://example.com", stealth=True, tags={