Skip to content
Merged
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
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.147.0"
".": "0.148.0"
}
2 changes: 1 addition & 1 deletion .stats.yml
Original file line number Diff line number Diff line change
@@ -1 +1 @@
configured_endpoints: 178
configured_endpoints: 179
9 changes: 9 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,14 @@
# Changelog

## [0.148.0](https://github.com/kernel/kernel-python-sdk/compare/v0.147.0...v0.148.0) (2026-11-12)


### Features

* Add scoped live view URLs ([aeabbe3](https://github.com/kernel/kernel-python-sdk/commit/aeabbe3c29e4d51e8b9a6cc3d77497da6a655f32))
* Pace 1Password status checks on the partner schedule ([aeabbe3](https://github.com/kernel/kernel-python-sdk/commit/aeabbe3c29e4d51e8b9a6cc3d77497da6a655f32))
* Return the 1Password access request reference on the approval action ([aeabbe3](https://github.com/kernel/kernel-python-sdk/commit/aeabbe3c29e4d51e8b9a6cc3d77497da6a655f32))

## [0.147.0](https://github.com/kernel/kernel-python-sdk/compare/v0.146.0...v0.147.0) (2026-11-12)


Expand Down
12 changes: 12 additions & 0 deletions api.md
Original file line number Diff line number Diff line change
Expand Up @@ -228,6 +228,18 @@ Methods:
- <code title="get /browsers/{id_or_name}/telemetry/events">client.browsers.telemetry.<a href="./src/kernel/resources/browsers/telemetry.py">events</a>(id_or_name, \*\*<a href="src/kernel/types/browsers/telemetry_events_params.py">params</a>) -> <a href="./src/kernel/types/browsers/telemetry_events_response.py">SyncOffsetPagination[TelemetryEventsResponse]</a></code>
- <code title="get /browsers/{id_or_name}/telemetry/stream">client.browsers.telemetry.<a href="./src/kernel/resources/browsers/telemetry.py">stream</a>(id_or_name, \*\*<a href="src/kernel/types/browsers/telemetry_stream_params.py">params</a>) -> <a href="./src/kernel/types/browsers/telemetry_stream_response.py">TelemetryStreamResponse</a></code>

## LiveView

Types:

```python
from kernel.types.browsers import BrowserLiveView, BrowserLiveViewRequest, BrowserLiveViewScope
```

Methods:

- <code title="post /browsers/{id_or_name}/live_view">client.browsers.live_view.<a href="./src/kernel/resources/browsers/live_view.py">create</a>(id_or_name, \*\*<a href="src/kernel/types/browsers/live_view_create_params.py">params</a>) -> <a href="./src/kernel/types/browsers/browser_live_view.py">BrowserLiveView</a></code>

## Replays

Types:
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[project]
name = "kernel"
version = "0.147.0"
version = "0.148.0"
description = "The official Python library for the kernel API"
dynamic = ["readme"]
license = "Apache-2.0"
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.147.0" # x-release-please-version
__version__ = "0.148.0" # x-release-please-version
14 changes: 14 additions & 0 deletions src/kernel/resources/browsers/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,14 @@
ComputerResourceWithStreamingResponse,
AsyncComputerResourceWithStreamingResponse,
)
from .live_view import (
LiveViewResource,
AsyncLiveViewResource,
LiveViewResourceWithRawResponse,
AsyncLiveViewResourceWithRawResponse,
LiveViewResourceWithStreamingResponse,
AsyncLiveViewResourceWithStreamingResponse,
)
from .telemetry import (
TelemetryResource,
AsyncTelemetryResource,
Expand All @@ -80,6 +88,12 @@
"AsyncTelemetryResourceWithRawResponse",
"TelemetryResourceWithStreamingResponse",
"AsyncTelemetryResourceWithStreamingResponse",
"LiveViewResource",
"AsyncLiveViewResource",
"LiveViewResourceWithRawResponse",
"AsyncLiveViewResourceWithRawResponse",
"LiveViewResourceWithStreamingResponse",
"AsyncLiveViewResourceWithStreamingResponse",
"ReplaysResource",
"AsyncReplaysResource",
"ReplaysResourceWithRawResponse",
Expand Down
38 changes: 38 additions & 0 deletions src/kernel/resources/browsers/browsers.py
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,14 @@
AsyncComputerResourceWithStreamingResponse,
)
from ..._compat import cached_property
from .live_view import (
LiveViewResource,
AsyncLiveViewResource,
LiveViewResourceWithRawResponse,
AsyncLiveViewResourceWithRawResponse,
LiveViewResourceWithStreamingResponse,
AsyncLiveViewResourceWithStreamingResponse,
)
from .telemetry import (
TelemetryResource,
AsyncTelemetryResource,
Expand Down Expand Up @@ -135,6 +143,11 @@ def telemetry(self) -> TelemetryResource:
"""
return TelemetryResource(self._client)

@cached_property
def live_view(self) -> LiveViewResource:
"""Create and manage browser sessions."""
return LiveViewResource(self._client)

@cached_property
def replays(self) -> ReplaysResource:
"""Record and manage browser session video replays."""
Expand Down Expand Up @@ -1000,6 +1013,11 @@ def telemetry(self) -> AsyncTelemetryResource:
"""
return AsyncTelemetryResource(self._client)

@cached_property
def live_view(self) -> AsyncLiveViewResource:
"""Create and manage browser sessions."""
return AsyncLiveViewResource(self._client)

@cached_property
def replays(self) -> AsyncReplaysResource:
"""Record and manage browser session video replays."""
Expand Down Expand Up @@ -1896,6 +1914,11 @@ def telemetry(self) -> TelemetryResourceWithRawResponse:
"""
return TelemetryResourceWithRawResponse(self._browsers.telemetry)

@cached_property
def live_view(self) -> LiveViewResourceWithRawResponse:
"""Create and manage browser sessions."""
return LiveViewResourceWithRawResponse(self._browsers.live_view)

@cached_property
def replays(self) -> ReplaysResourceWithRawResponse:
"""Record and manage browser session video replays."""
Expand Down Expand Up @@ -1973,6 +1996,11 @@ def telemetry(self) -> AsyncTelemetryResourceWithRawResponse:
"""
return AsyncTelemetryResourceWithRawResponse(self._browsers.telemetry)

@cached_property
def live_view(self) -> AsyncLiveViewResourceWithRawResponse:
"""Create and manage browser sessions."""
return AsyncLiveViewResourceWithRawResponse(self._browsers.live_view)

@cached_property
def replays(self) -> AsyncReplaysResourceWithRawResponse:
"""Record and manage browser session video replays."""
Expand Down Expand Up @@ -2050,6 +2078,11 @@ def telemetry(self) -> TelemetryResourceWithStreamingResponse:
"""
return TelemetryResourceWithStreamingResponse(self._browsers.telemetry)

@cached_property
def live_view(self) -> LiveViewResourceWithStreamingResponse:
"""Create and manage browser sessions."""
return LiveViewResourceWithStreamingResponse(self._browsers.live_view)

@cached_property
def replays(self) -> ReplaysResourceWithStreamingResponse:
"""Record and manage browser session video replays."""
Expand Down Expand Up @@ -2127,6 +2160,11 @@ def telemetry(self) -> AsyncTelemetryResourceWithStreamingResponse:
"""
return AsyncTelemetryResourceWithStreamingResponse(self._browsers.telemetry)

@cached_property
def live_view(self) -> AsyncLiveViewResourceWithStreamingResponse:
"""Create and manage browser sessions."""
return AsyncLiveViewResourceWithStreamingResponse(self._browsers.live_view)

@cached_property
def replays(self) -> AsyncReplaysResourceWithStreamingResponse:
"""Record and manage browser session video replays."""
Expand Down
226 changes: 226 additions & 0 deletions src/kernel/resources/browsers/live_view.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,226 @@
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.

from __future__ import annotations

import httpx

from ..._types import Body, Omit, Query, Headers, NotGiven, omit, not_given
from ..._utils import path_template, maybe_transform, async_maybe_transform
from ..._compat import cached_property
from ..._resource import SyncAPIResource, AsyncAPIResource
from ..._response import (
to_raw_response_wrapper,
to_streamed_response_wrapper,
async_to_raw_response_wrapper,
async_to_streamed_response_wrapper,
)
from ..._base_client import make_request_options
from ...types.browsers import BrowserLiveViewScope, live_view_create_params
from ...types.browsers.browser_live_view import BrowserLiveView
from ...types.browsers.browser_live_view_scope import BrowserLiveViewScope

__all__ = ["LiveViewResource", "AsyncLiveViewResource"]


class LiveViewResource(SyncAPIResource):
"""Create and manage browser sessions."""

@cached_property
def with_raw_response(self) -> LiveViewResourceWithRawResponse:
"""
This property can be used as a prefix for any HTTP method call to return
the raw response object instead of the parsed content.

For more information, see https://www.github.com/kernel/kernel-python-sdk#accessing-raw-response-data-eg-headers
"""
return LiveViewResourceWithRawResponse(self)

@cached_property
def with_streaming_response(self) -> LiveViewResourceWithStreamingResponse:
"""
An alternative to `.with_raw_response` that doesn't eagerly read the response body.

For more information, see https://www.github.com/kernel/kernel-python-sdk#with_streaming_response
"""
return LiveViewResourceWithStreamingResponse(self)

def create(
self,
id_or_name: str,
*,
scope: BrowserLiveViewScope | Omit = omit,
ttl_seconds: int | 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.
extra_headers: Headers | None = None,
extra_query: Query | None = None,
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = not_given,
idempotency_key: str | None = None,
) -> BrowserLiveView:
"""
Creates a live view URL for a headful browser that grants either read-only or
control access. The URL works only for the live view: it cannot connect to CDP,
WebDriver, or any other browser endpoint. A read-only URL shows the browser but
cannot send input, regardless of query parameters. The URL stays valid until the
browser is deleted, or until `ttl_seconds` elapse when set. For a browser
acquired from a pool, it stops working when the browser is released. Nothing is
stored, so a URL cannot be revoked before then.

Args:
scope: `read` shows the browser without accepting input. `control` also lets the viewer
drive the browser through the live view.

ttl_seconds: Seconds until the URL expires. Omit to keep it valid until the browser is
deleted.

extra_headers: Send extra headers

extra_query: Add additional query parameters to the request

extra_body: Add additional JSON properties to the request

timeout: Override the client-level default timeout for this request, in seconds

idempotency_key: Specify a custom idempotency key for this request
"""
if not id_or_name:
raise ValueError(f"Expected a non-empty value for `id_or_name` but received {id_or_name!r}")
return self._post(
path_template("/browsers/{id_or_name}/live_view", id_or_name=id_or_name),
body=maybe_transform(
{
"scope": scope,
"ttl_seconds": ttl_seconds,
},
live_view_create_params.LiveViewCreateParams,
),
options=make_request_options(
extra_headers=extra_headers,
extra_query=extra_query,
extra_body=extra_body,
timeout=timeout,
idempotency_key=idempotency_key,
),
cast_to=BrowserLiveView,
)


class AsyncLiveViewResource(AsyncAPIResource):
"""Create and manage browser sessions."""

@cached_property
def with_raw_response(self) -> AsyncLiveViewResourceWithRawResponse:
"""
This property can be used as a prefix for any HTTP method call to return
the raw response object instead of the parsed content.

For more information, see https://www.github.com/kernel/kernel-python-sdk#accessing-raw-response-data-eg-headers
"""
return AsyncLiveViewResourceWithRawResponse(self)

@cached_property
def with_streaming_response(self) -> AsyncLiveViewResourceWithStreamingResponse:
"""
An alternative to `.with_raw_response` that doesn't eagerly read the response body.

For more information, see https://www.github.com/kernel/kernel-python-sdk#with_streaming_response
"""
return AsyncLiveViewResourceWithStreamingResponse(self)

async def create(
self,
id_or_name: str,
*,
scope: BrowserLiveViewScope | Omit = omit,
ttl_seconds: int | 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.
extra_headers: Headers | None = None,
extra_query: Query | None = None,
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = not_given,
idempotency_key: str | None = None,
) -> BrowserLiveView:
"""
Creates a live view URL for a headful browser that grants either read-only or
control access. The URL works only for the live view: it cannot connect to CDP,
WebDriver, or any other browser endpoint. A read-only URL shows the browser but
cannot send input, regardless of query parameters. The URL stays valid until the
browser is deleted, or until `ttl_seconds` elapse when set. For a browser
acquired from a pool, it stops working when the browser is released. Nothing is
stored, so a URL cannot be revoked before then.

Args:
scope: `read` shows the browser without accepting input. `control` also lets the viewer
drive the browser through the live view.

ttl_seconds: Seconds until the URL expires. Omit to keep it valid until the browser is
deleted.

extra_headers: Send extra headers

extra_query: Add additional query parameters to the request

extra_body: Add additional JSON properties to the request

timeout: Override the client-level default timeout for this request, in seconds

idempotency_key: Specify a custom idempotency key for this request
"""
if not id_or_name:
raise ValueError(f"Expected a non-empty value for `id_or_name` but received {id_or_name!r}")
return await self._post(
path_template("/browsers/{id_or_name}/live_view", id_or_name=id_or_name),
body=await async_maybe_transform(
{
"scope": scope,
"ttl_seconds": ttl_seconds,
},
live_view_create_params.LiveViewCreateParams,
),
options=make_request_options(
extra_headers=extra_headers,
extra_query=extra_query,
extra_body=extra_body,
timeout=timeout,
idempotency_key=idempotency_key,
),
cast_to=BrowserLiveView,
)


class LiveViewResourceWithRawResponse:
def __init__(self, live_view: LiveViewResource) -> None:
self._live_view = live_view

self.create = to_raw_response_wrapper(
live_view.create,
)


class AsyncLiveViewResourceWithRawResponse:
def __init__(self, live_view: AsyncLiveViewResource) -> None:
self._live_view = live_view

self.create = async_to_raw_response_wrapper(
live_view.create,
)


class LiveViewResourceWithStreamingResponse:
def __init__(self, live_view: LiveViewResource) -> None:
self._live_view = live_view

self.create = to_streamed_response_wrapper(
live_view.create,
)


class AsyncLiveViewResourceWithStreamingResponse:
def __init__(self, live_view: AsyncLiveViewResource) -> None:
self._live_view = live_view

self.create = async_to_streamed_response_wrapper(
live_view.create,
)
Loading
Loading