Skip to content

release: 0.7.1 #31

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 8 commits into from
Jul 8, 2025
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
22 changes: 19 additions & 3 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ jobs:
timeout-minutes: 10
name: lint
runs-on: ${{ github.repository == 'stainless-sdks/kernel-python' && 'depot-ubuntu-24.04' || 'ubuntu-latest' }}
if: github.event_name == 'push' || github.event.pull_request.head.repo.fork
steps:
- uses: actions/checkout@v4

Expand All @@ -34,17 +35,31 @@ jobs:
- name: Run lints
run: ./scripts/lint

upload:
if: github.repository == 'stainless-sdks/kernel-python'
build:
if: github.repository == 'stainless-sdks/kernel-python' && (github.event_name == 'push' || github.event.pull_request.head.repo.fork)
timeout-minutes: 10
name: upload
name: build
permissions:
contents: read
id-token: write
runs-on: depot-ubuntu-24.04
steps:
- uses: actions/checkout@v4

- name: Install Rye
run: |
curl -sSf https://rye.astral.sh/get | bash
echo "$HOME/.rye/shims" >> $GITHUB_PATH
env:
RYE_VERSION: '0.44.0'
RYE_INSTALL_OPTION: '--yes'

- name: Install dependencies
run: rye sync --all-features

- name: Run build
run: rye build

- name: Get GitHub OIDC Token
id: github-oidc
uses: actions/github-script@v6
Expand All @@ -62,6 +77,7 @@ jobs:
timeout-minutes: 10
name: test
runs-on: ${{ github.repository == 'stainless-sdks/kernel-python' && 'depot-ubuntu-24.04' || 'ubuntu-latest' }}
if: github.event_name == 'push' || github.event.pull_request.head.repo.fork
steps:
- uses: actions/checkout@v4

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.6.4"
".": "0.7.1"
}
8 changes: 4 additions & 4 deletions .stats.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
configured_endpoints: 17
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/kernel%2Fkernel-2eeb61205775c5997abf8154cd6f6fe81a1e83870eff10050b17ed415aa7860b.yml
openapi_spec_hash: 63405add4a3f53718f8183cbb8c1a22f
config_hash: 00ec9df250b9dc077f8d3b93a442d252
configured_endpoints: 18
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/kernel%2Fkernel-d173129101e26f450c200e84430d993479c034700cf826917425d513b88912e6.yml
openapi_spec_hash: 150b86da7588979d7619b1a894e4720c
config_hash: eaeed470b1070b34df69c49d68e67355
21 changes: 21 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,26 @@
# Changelog

## 0.7.1 (2025-07-08)

Full Changelog: [v0.6.4...v0.7.1](https://github.com/onkernel/kernel-python-sdk/compare/v0.6.4...v0.7.1)

### Features

* **api:** headless browsers ([de0b235](https://github.com/onkernel/kernel-python-sdk/commit/de0b235998be2299459b54df15e83dd9dc8c0b7f))
* **api:** manual updates ([7d0a2bd](https://github.com/onkernel/kernel-python-sdk/commit/7d0a2bd8dd25bac6d688e2b5f5076c916d80f800))


### Bug Fixes

* **ci:** correct conditional ([1167795](https://github.com/onkernel/kernel-python-sdk/commit/116779521b08014f5be7588f1e0a7975c13e8e05))


### Chores

* **ci:** change upload type ([dabede0](https://github.com/onkernel/kernel-python-sdk/commit/dabede0456032d69d0c4b05c740d04002fc900a9))
* **ci:** only run for pushes and fork pull requests ([e9a45fd](https://github.com/onkernel/kernel-python-sdk/commit/e9a45fd655812a9bf2c3edec3cccdbde3ab89f73))
* **internal:** codegen related update ([2c50b08](https://github.com/onkernel/kernel-python-sdk/commit/2c50b08edb7f73a7c20a459f2ffeb52f56583e5f))

## 0.6.4 (2025-06-27)

Full Changelog: [v0.6.3...v0.6.4](https://github.com/onkernel/kernel-python-sdk/compare/v0.6.3...v0.6.4)
Expand Down
1 change: 1 addition & 0 deletions api.md
Original file line number Diff line number Diff line change
Expand Up @@ -92,3 +92,4 @@ Methods:
- <code title="get /browsers">client.browsers.<a href="./src/kernel/resources/browsers.py">list</a>() -> <a href="./src/kernel/types/browser_list_response.py">BrowserListResponse</a></code>
- <code title="delete /browsers">client.browsers.<a href="./src/kernel/resources/browsers.py">delete</a>(\*\*<a href="src/kernel/types/browser_delete_params.py">params</a>) -> None</code>
- <code title="delete /browsers/{id}">client.browsers.<a href="./src/kernel/resources/browsers.py">delete_by_id</a>(id) -> None</code>
- <code title="get /browsers/{id}/replay">client.browsers.<a href="./src/kernel/resources/browsers.py">retrieve_replay</a>(id) -> BinaryAPIResponse</code>
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.6.4"
version = "0.7.1"
description = "The official Python library for the kernel API"
dynamic = ["readme"]
license = "Apache-2.0"
Expand Down
2 changes: 1 addition & 1 deletion requirements-dev.lock
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ httpx==0.28.1
# via httpx-aiohttp
# via kernel
# via respx
httpx-aiohttp==0.1.6
httpx-aiohttp==0.1.8
# via kernel
idna==3.4
# via anyio
Expand Down
2 changes: 1 addition & 1 deletion requirements.lock
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ httpcore==1.0.2
httpx==0.28.1
# via httpx-aiohttp
# via kernel
httpx-aiohttp==0.1.6
httpx-aiohttp==0.1.8
# via kernel
idna==3.4
# via anyio
Expand Down
12 changes: 7 additions & 5 deletions scripts/utils/upload-artifact.sh
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
#!/usr/bin/env bash
set -exuo pipefail

RESPONSE=$(curl -X POST "$URL" \
FILENAME=$(basename dist/*.whl)

RESPONSE=$(curl -X POST "$URL?filename=$FILENAME" \
-H "Authorization: Bearer $AUTH" \
-H "Content-Type: application/json")

Expand All @@ -12,13 +14,13 @@ if [[ "$SIGNED_URL" == "null" ]]; then
exit 1
fi

UPLOAD_RESPONSE=$(tar -cz . | curl -v -X PUT \
-H "Content-Type: application/gzip" \
--data-binary @- "$SIGNED_URL" 2>&1)
UPLOAD_RESPONSE=$(curl -v -X PUT \
-H "Content-Type: binary/octet-stream" \
--data-binary "@dist/$FILENAME" "$SIGNED_URL" 2>&1)

if echo "$UPLOAD_RESPONSE" | grep -q "HTTP/[0-9.]* 200"; then
echo -e "\033[32mUploaded build to Stainless storage.\033[0m"
echo -e "\033[32mInstallation: pip install 'https://pkg.stainless.com/s/kernel-python/$SHA'\033[0m"
echo -e "\033[32mInstallation: pip install 'https://pkg.stainless.com/s/kernel-python/$SHA/$FILENAME'\033[0m"
else
echo -e "\033[31mFailed to upload artifact.\033[0m"
exit 1
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.6.4" # x-release-please-version
__version__ = "0.7.1" # x-release-please-version
110 changes: 110 additions & 0 deletions src/kernel/resources/browsers.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,18 @@
from .._compat import cached_property
from .._resource import SyncAPIResource, AsyncAPIResource
from .._response import (
BinaryAPIResponse,
AsyncBinaryAPIResponse,
StreamedBinaryAPIResponse,
AsyncStreamedBinaryAPIResponse,
to_raw_response_wrapper,
to_streamed_response_wrapper,
async_to_raw_response_wrapper,
to_custom_raw_response_wrapper,
async_to_streamed_response_wrapper,
to_custom_streamed_response_wrapper,
async_to_custom_raw_response_wrapper,
async_to_custom_streamed_response_wrapper,
)
from .._base_client import make_request_options
from ..types.browser_list_response import BrowserListResponse
Expand Down Expand Up @@ -47,8 +55,10 @@ def with_streaming_response(self) -> BrowsersResourceWithStreamingResponse:
def create(
self,
*,
headless: bool | NotGiven = NOT_GIVEN,
invocation_id: str | NotGiven = NOT_GIVEN,
persistence: BrowserPersistenceParam | NotGiven = NOT_GIVEN,
replay: bool | NotGiven = NOT_GIVEN,
stealth: bool | NotGiven = NOT_GIVEN,
# 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.
Expand All @@ -61,10 +71,15 @@ def create(
Create a new browser session from within an action.

Args:
headless: If true, launches the browser using a headless image (no VNC/GUI). Defaults to
false.

invocation_id: action invocation ID

persistence: Optional persistence configuration for the browser session.

replay: If true, enables replay recording of the browser session. Defaults to false.

stealth: If true, launches the browser in stealth mode to reduce detection by anti-bot
mechanisms.

Expand All @@ -80,8 +95,10 @@ def create(
"/browsers",
body=maybe_transform(
{
"headless": headless,
"invocation_id": invocation_id,
"persistence": persistence,
"replay": replay,
"stealth": stealth,
},
browser_create_params.BrowserCreateParams,
Expand Down Expand Up @@ -216,6 +233,40 @@ def delete_by_id(
cast_to=NoneType,
)

def retrieve_replay(
self,
id: str,
*,
# 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,
) -> BinaryAPIResponse:
"""
Get browser session replay.

Args:
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
"""
if not id:
raise ValueError(f"Expected a non-empty value for `id` but received {id!r}")
extra_headers = {"Accept": "video/mp4", **(extra_headers or {})}
return self._get(
f"/browsers/{id}/replay",
options=make_request_options(
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
),
cast_to=BinaryAPIResponse,
)


class AsyncBrowsersResource(AsyncAPIResource):
@cached_property
Expand All @@ -240,8 +291,10 @@ def with_streaming_response(self) -> AsyncBrowsersResourceWithStreamingResponse:
async def create(
self,
*,
headless: bool | NotGiven = NOT_GIVEN,
invocation_id: str | NotGiven = NOT_GIVEN,
persistence: BrowserPersistenceParam | NotGiven = NOT_GIVEN,
replay: bool | NotGiven = NOT_GIVEN,
stealth: bool | NotGiven = NOT_GIVEN,
# 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.
Expand All @@ -254,10 +307,15 @@ async def create(
Create a new browser session from within an action.

Args:
headless: If true, launches the browser using a headless image (no VNC/GUI). Defaults to
false.

invocation_id: action invocation ID

persistence: Optional persistence configuration for the browser session.

replay: If true, enables replay recording of the browser session. Defaults to false.

stealth: If true, launches the browser in stealth mode to reduce detection by anti-bot
mechanisms.

Expand All @@ -273,8 +331,10 @@ async def create(
"/browsers",
body=await async_maybe_transform(
{
"headless": headless,
"invocation_id": invocation_id,
"persistence": persistence,
"replay": replay,
"stealth": stealth,
},
browser_create_params.BrowserCreateParams,
Expand Down Expand Up @@ -411,6 +471,40 @@ async def delete_by_id(
cast_to=NoneType,
)

async def retrieve_replay(
self,
id: str,
*,
# 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,
) -> AsyncBinaryAPIResponse:
"""
Get browser session replay.

Args:
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
"""
if not id:
raise ValueError(f"Expected a non-empty value for `id` but received {id!r}")
extra_headers = {"Accept": "video/mp4", **(extra_headers or {})}
return await self._get(
f"/browsers/{id}/replay",
options=make_request_options(
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
),
cast_to=AsyncBinaryAPIResponse,
)


class BrowsersResourceWithRawResponse:
def __init__(self, browsers: BrowsersResource) -> None:
Expand All @@ -431,6 +525,10 @@ def __init__(self, browsers: BrowsersResource) -> None:
self.delete_by_id = to_raw_response_wrapper(
browsers.delete_by_id,
)
self.retrieve_replay = to_custom_raw_response_wrapper(
browsers.retrieve_replay,
BinaryAPIResponse,
)


class AsyncBrowsersResourceWithRawResponse:
Expand All @@ -452,6 +550,10 @@ def __init__(self, browsers: AsyncBrowsersResource) -> None:
self.delete_by_id = async_to_raw_response_wrapper(
browsers.delete_by_id,
)
self.retrieve_replay = async_to_custom_raw_response_wrapper(
browsers.retrieve_replay,
AsyncBinaryAPIResponse,
)


class BrowsersResourceWithStreamingResponse:
Expand All @@ -473,6 +575,10 @@ def __init__(self, browsers: BrowsersResource) -> None:
self.delete_by_id = to_streamed_response_wrapper(
browsers.delete_by_id,
)
self.retrieve_replay = to_custom_streamed_response_wrapper(
browsers.retrieve_replay,
StreamedBinaryAPIResponse,
)


class AsyncBrowsersResourceWithStreamingResponse:
Expand All @@ -494,3 +600,7 @@ def __init__(self, browsers: AsyncBrowsersResource) -> None:
self.delete_by_id = async_to_streamed_response_wrapper(
browsers.delete_by_id,
)
self.retrieve_replay = async_to_custom_streamed_response_wrapper(
browsers.retrieve_replay,
AsyncStreamedBinaryAPIResponse,
)
9 changes: 9 additions & 0 deletions src/kernel/types/browser_create_params.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,21 @@


class BrowserCreateParams(TypedDict, total=False):
headless: bool
"""If true, launches the browser using a headless image (no VNC/GUI).

Defaults to false.
"""

invocation_id: str
"""action invocation ID"""

persistence: BrowserPersistenceParam
"""Optional persistence configuration for the browser session."""

replay: bool
"""If true, enables replay recording of the browser session. Defaults to false."""

stealth: bool
"""
If true, launches the browser in stealth mode to reduce detection by anti-bot
Expand Down
Loading