diff --git a/.release-please-manifest.json b/.release-please-manifest.json index 51acdaa..8ea07c9 100644 --- a/.release-please-manifest.json +++ b/.release-please-manifest.json @@ -1,3 +1,3 @@ { - ".": "0.37.0" + ".": "0.38.0" } \ No newline at end of file diff --git a/.stats.yml b/.stats.yml index b154e7a..3e385c4 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 101 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/kernel%2Fkernel-fc4a441d80d9a26574ef8af390a0c76265f5d4190daf90a04b6b353b128bbd97.yml -openapi_spec_hash: 192987649d3797c3a80e6ef201667b64 -config_hash: 8af430e19f4af86c05f2987241cae72f +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/kernel%2Fkernel-9462b3d8f055f8bda06da65583f5aa09a17d35254c5983796d8e84ebb3c62c47.yml +openapi_spec_hash: 1914dd35b8e0e5a21ccec91eac2a616d +config_hash: c6b88eea9a15840f26130eb8ed3b42a0 diff --git a/CHANGELOG.md b/CHANGELOG.md index f2e97b3..d9d1953 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,20 @@ # Changelog +## 0.38.0 (2026-02-25) + +Full Changelog: [v0.37.0...v0.38.0](https://github.com/kernel/kernel-python-sdk/compare/v0.37.0...v0.38.0) + +### Features + +* Neil/kernel 1029 past session search ([657da45](https://github.com/kernel/kernel-python-sdk/commit/657da45a969b52a8497efbcd597fe8b705dab370)) + + +### Chores + +* **internal:** add request options to SSE classes ([6287415](https://github.com/kernel/kernel-python-sdk/commit/628741509bbaf2b693afc71cc28ad82a8dc7b231)) +* **internal:** make `test_proxy_environment_variables` more resilient ([3345fc6](https://github.com/kernel/kernel-python-sdk/commit/3345fc63467e18401a501a6df0b71dae46f70113)) +* **internal:** make `test_proxy_environment_variables` more resilient to env ([6a629ee](https://github.com/kernel/kernel-python-sdk/commit/6a629ee6e943bac9b87154ac440c760765185206)) + ## 0.37.0 (2026-02-23) Full Changelog: [v0.36.1...v0.37.0](https://github.com/kernel/kernel-python-sdk/compare/v0.36.1...v0.37.0) diff --git a/pyproject.toml b/pyproject.toml index b3ea5e9..09fdb6b 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [project] name = "kernel" -version = "0.37.0" +version = "0.38.0" description = "The official Python library for the kernel API" dynamic = ["readme"] license = "Apache-2.0" diff --git a/src/kernel/_response.py b/src/kernel/_response.py index 89c72c3..a6c5fa3 100644 --- a/src/kernel/_response.py +++ b/src/kernel/_response.py @@ -152,6 +152,7 @@ def _parse(self, *, to: type[_T] | None = None) -> R | _T: ), response=self.http_response, client=cast(Any, self._client), + options=self._options, ), ) @@ -162,6 +163,7 @@ def _parse(self, *, to: type[_T] | None = None) -> R | _T: cast_to=extract_stream_chunk_type(self._stream_cls), response=self.http_response, client=cast(Any, self._client), + options=self._options, ), ) @@ -175,6 +177,7 @@ def _parse(self, *, to: type[_T] | None = None) -> R | _T: cast_to=cast_to, response=self.http_response, client=cast(Any, self._client), + options=self._options, ), ) diff --git a/src/kernel/_streaming.py b/src/kernel/_streaming.py index 369a3f6..5520edb 100644 --- a/src/kernel/_streaming.py +++ b/src/kernel/_streaming.py @@ -4,7 +4,7 @@ import json import inspect from types import TracebackType -from typing import TYPE_CHECKING, Any, Generic, TypeVar, Iterator, AsyncIterator, cast +from typing import TYPE_CHECKING, Any, Generic, TypeVar, Iterator, Optional, AsyncIterator, cast from typing_extensions import Self, Protocol, TypeGuard, override, get_origin, runtime_checkable import httpx @@ -13,6 +13,7 @@ if TYPE_CHECKING: from ._client import Kernel, AsyncKernel + from ._models import FinalRequestOptions _T = TypeVar("_T") @@ -22,7 +23,7 @@ class Stream(Generic[_T]): """Provides the core interface to iterate over a synchronous stream response.""" response: httpx.Response - + _options: Optional[FinalRequestOptions] = None _decoder: SSEBytesDecoder def __init__( @@ -31,10 +32,12 @@ def __init__( cast_to: type[_T], response: httpx.Response, client: Kernel, + options: Optional[FinalRequestOptions] = None, ) -> None: self.response = response self._cast_to = cast_to self._client = client + self._options = options self._decoder = client._make_sse_decoder() self._iterator = self.__stream__() @@ -85,7 +88,7 @@ class AsyncStream(Generic[_T]): """Provides the core interface to iterate over an asynchronous stream response.""" response: httpx.Response - + _options: Optional[FinalRequestOptions] = None _decoder: SSEDecoder | SSEBytesDecoder def __init__( @@ -94,10 +97,12 @@ def __init__( cast_to: type[_T], response: httpx.Response, client: AsyncKernel, + options: Optional[FinalRequestOptions] = None, ) -> None: self.response = response self._cast_to = cast_to self._client = client + self._options = options self._decoder = client._make_sse_decoder() self._iterator = self.__stream__() diff --git a/src/kernel/_version.py b/src/kernel/_version.py index 01a56b5..c364cf2 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.37.0" # x-release-please-version +__version__ = "0.38.0" # x-release-please-version diff --git a/src/kernel/resources/browsers/browsers.py b/src/kernel/resources/browsers/browsers.py index 58c3e2a..59cecda 100644 --- a/src/kernel/resources/browsers/browsers.py +++ b/src/kernel/resources/browsers/browsers.py @@ -329,6 +329,7 @@ def list( include_deleted: bool | Omit = omit, limit: int | Omit = omit, offset: int | Omit = omit, + query: str | Omit = omit, status: Literal["active", "deleted", "all"] | 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. @@ -350,6 +351,8 @@ def list( offset: Number of results to skip. Defaults to 0. + query: Search browsers by session ID, profile ID, or proxy ID. + status: Filter sessions by status. "active" returns only active sessions (default), "deleted" returns only soft-deleted sessions, "all" returns both. @@ -374,6 +377,7 @@ def list( "include_deleted": include_deleted, "limit": limit, "offset": offset, + "query": query, "status": status, }, browser_list_params.BrowserListParams, @@ -745,6 +749,7 @@ def list( include_deleted: bool | Omit = omit, limit: int | Omit = omit, offset: int | Omit = omit, + query: str | Omit = omit, status: Literal["active", "deleted", "all"] | 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. @@ -766,6 +771,8 @@ def list( offset: Number of results to skip. Defaults to 0. + query: Search browsers by session ID, profile ID, or proxy ID. + status: Filter sessions by status. "active" returns only active sessions (default), "deleted" returns only soft-deleted sessions, "all" returns both. @@ -790,6 +797,7 @@ def list( "include_deleted": include_deleted, "limit": limit, "offset": offset, + "query": query, "status": status, }, browser_list_params.BrowserListParams, diff --git a/src/kernel/types/browser_list_params.py b/src/kernel/types/browser_list_params.py index 02aa97a..4c858e1 100644 --- a/src/kernel/types/browser_list_params.py +++ b/src/kernel/types/browser_list_params.py @@ -21,6 +21,9 @@ class BrowserListParams(TypedDict, total=False): offset: int """Number of results to skip. Defaults to 0.""" + query: str + """Search browsers by session ID, profile ID, or proxy ID.""" + status: Literal["active", "deleted", "all"] """Filter sessions by status. diff --git a/tests/api_resources/test_browsers.py b/tests/api_resources/test_browsers.py index c0319df..2addbb8 100644 --- a/tests/api_resources/test_browsers.py +++ b/tests/api_resources/test_browsers.py @@ -209,6 +209,7 @@ def test_method_list_with_all_params(self, client: Kernel) -> None: include_deleted=True, limit=1, offset=0, + query="query", status="active", ) assert_matches_type(SyncOffsetPagination[BrowserListResponse], browser, path=["response"]) @@ -571,6 +572,7 @@ async def test_method_list_with_all_params(self, async_client: AsyncKernel) -> N include_deleted=True, limit=1, offset=0, + query="query", status="active", ) assert_matches_type(AsyncOffsetPagination[BrowserListResponse], browser, path=["response"]) diff --git a/tests/test_client.py b/tests/test_client.py index 6f4213a..d2eca05 100644 --- a/tests/test_client.py +++ b/tests/test_client.py @@ -957,6 +957,14 @@ def retry_handler(_request: httpx.Request) -> httpx.Response: def test_proxy_environment_variables(self, monkeypatch: pytest.MonkeyPatch) -> None: # Test that the proxy environment variables are set correctly monkeypatch.setenv("HTTPS_PROXY", "https://example.org") + # Delete in case our environment has any proxy env vars set + monkeypatch.delenv("HTTP_PROXY", raising=False) + monkeypatch.delenv("ALL_PROXY", raising=False) + monkeypatch.delenv("NO_PROXY", raising=False) + monkeypatch.delenv("http_proxy", raising=False) + monkeypatch.delenv("https_proxy", raising=False) + monkeypatch.delenv("all_proxy", raising=False) + monkeypatch.delenv("no_proxy", raising=False) client = DefaultHttpxClient() @@ -1873,6 +1881,14 @@ async def test_get_platform(self) -> None: async def test_proxy_environment_variables(self, monkeypatch: pytest.MonkeyPatch) -> None: # Test that the proxy environment variables are set correctly monkeypatch.setenv("HTTPS_PROXY", "https://example.org") + # Delete in case our environment has any proxy env vars set + monkeypatch.delenv("HTTP_PROXY", raising=False) + monkeypatch.delenv("ALL_PROXY", raising=False) + monkeypatch.delenv("NO_PROXY", raising=False) + monkeypatch.delenv("http_proxy", raising=False) + monkeypatch.delenv("https_proxy", raising=False) + monkeypatch.delenv("all_proxy", raising=False) + monkeypatch.delenv("no_proxy", raising=False) client = DefaultAsyncHttpxClient()