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
6 changes: 4 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,13 +36,13 @@ jobs:
run: ./scripts/lint

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

Expand All @@ -61,12 +61,14 @@ jobs:
run: rye build

- name: Get GitHub OIDC Token
if: github.repository == 'stainless-sdks/kernel-python'
id: github-oidc
uses: actions/github-script@v6
with:
script: core.setOutput('github_token', await core.getIDToken());

- name: Upload tarball
if: github.repository == 'stainless-sdks/kernel-python'
env:
URL: https://pkg.stainless.com/s
AUTH: ${{ steps.github-oidc.outputs.github_token }}
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.9.1"
".": "0.10.0"
}
8 changes: 4 additions & 4 deletions .stats.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
configured_endpoints: 31
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/kernel%2Fkernel-b55c3e0424fa7733487139488b9fff00ad8949ff02ee3160ee36b9334e84b134.yml
openapi_spec_hash: 17f36677e3dc0a3aeb419654c8d5cae3
config_hash: f67e4b33b2fb30c1405ee2fff8096320
configured_endpoints: 41
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/kernel%2Fkernel-a7c1df5070fe59642d7a1f168aa902a468227752bfc930cbf38930f7c205dbb6.yml
openapi_spec_hash: eab65e39aef4f0a0952b82adeecf6b5b
config_hash: 5de78bc29ac060562575cb54bb26826c
20 changes: 20 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,25 @@
# Changelog

## 0.10.0 (2025-08-27)

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

### Features

* **api:** new process, fs, and log endpoints ([48a39b4](https://github.com/onkernel/kernel-python-sdk/commit/48a39b4cc1ab32b4375ad4e33e5f9e4349502072))


### Bug Fixes

* avoid newer type syntax ([9ec7c40](https://github.com/onkernel/kernel-python-sdk/commit/9ec7c40b34b264709b904f36e309624bd1161413))


### Chores

* **internal:** change ci workflow machines ([3a2969d](https://github.com/onkernel/kernel-python-sdk/commit/3a2969d035b9e0bb4fa39dc27de2db6d4edad6dd))
* **internal:** update pyright exclude list ([39439aa](https://github.com/onkernel/kernel-python-sdk/commit/39439aaad72c92aa9f4bb74ac055b929c93b6060))
* update github action ([fff64d0](https://github.com/onkernel/kernel-python-sdk/commit/fff64d001d2c759967f08e7a1932e1fb7d84b126))

## 0.9.1 (2025-08-15)

Full Changelog: [v0.9.0...v0.9.1](https://github.com/onkernel/kernel-python-sdk/compare/v0.9.0...v0.9.1)
Expand Down
33 changes: 33 additions & 0 deletions api.md
Original file line number Diff line number Diff line change
Expand Up @@ -108,11 +108,14 @@ Methods:
- <code title="put /browsers/{id}/fs/create_directory">client.browsers.fs.<a href="./src/kernel/resources/browsers/fs/fs.py">create_directory</a>(id, \*\*<a href="src/kernel/types/browsers/f_create_directory_params.py">params</a>) -> None</code>
- <code title="put /browsers/{id}/fs/delete_directory">client.browsers.fs.<a href="./src/kernel/resources/browsers/fs/fs.py">delete_directory</a>(id, \*\*<a href="src/kernel/types/browsers/f_delete_directory_params.py">params</a>) -> None</code>
- <code title="put /browsers/{id}/fs/delete_file">client.browsers.fs.<a href="./src/kernel/resources/browsers/fs/fs.py">delete_file</a>(id, \*\*<a href="src/kernel/types/browsers/f_delete_file_params.py">params</a>) -> None</code>
- <code title="get /browsers/{id}/fs/download_dir_zip">client.browsers.fs.<a href="./src/kernel/resources/browsers/fs/fs.py">download_dir_zip</a>(id, \*\*<a href="src/kernel/types/browsers/f_download_dir_zip_params.py">params</a>) -> BinaryAPIResponse</code>
- <code title="get /browsers/{id}/fs/file_info">client.browsers.fs.<a href="./src/kernel/resources/browsers/fs/fs.py">file_info</a>(id, \*\*<a href="src/kernel/types/browsers/f_file_info_params.py">params</a>) -> <a href="./src/kernel/types/browsers/f_file_info_response.py">FFileInfoResponse</a></code>
- <code title="get /browsers/{id}/fs/list_files">client.browsers.fs.<a href="./src/kernel/resources/browsers/fs/fs.py">list_files</a>(id, \*\*<a href="src/kernel/types/browsers/f_list_files_params.py">params</a>) -> <a href="./src/kernel/types/browsers/f_list_files_response.py">FListFilesResponse</a></code>
- <code title="put /browsers/{id}/fs/move">client.browsers.fs.<a href="./src/kernel/resources/browsers/fs/fs.py">move</a>(id, \*\*<a href="src/kernel/types/browsers/f_move_params.py">params</a>) -> None</code>
- <code title="get /browsers/{id}/fs/read_file">client.browsers.fs.<a href="./src/kernel/resources/browsers/fs/fs.py">read_file</a>(id, \*\*<a href="src/kernel/types/browsers/f_read_file_params.py">params</a>) -> BinaryAPIResponse</code>
- <code title="put /browsers/{id}/fs/set_file_permissions">client.browsers.fs.<a href="./src/kernel/resources/browsers/fs/fs.py">set_file_permissions</a>(id, \*\*<a href="src/kernel/types/browsers/f_set_file_permissions_params.py">params</a>) -> None</code>
- <code title="post /browsers/{id}/fs/upload">client.browsers.fs.<a href="./src/kernel/resources/browsers/fs/fs.py">upload</a>(id, \*\*<a href="src/kernel/types/browsers/f_upload_params.py">params</a>) -> None</code>
- <code title="post /browsers/{id}/fs/upload_zip">client.browsers.fs.<a href="./src/kernel/resources/browsers/fs/fs.py">upload_zip</a>(id, \*\*<a href="src/kernel/types/browsers/f_upload_zip_params.py">params</a>) -> None</code>
- <code title="put /browsers/{id}/fs/write_file">client.browsers.fs.<a href="./src/kernel/resources/browsers/fs/fs.py">write_file</a>(id, contents, \*\*<a href="src/kernel/types/browsers/f_write_file_params.py">params</a>) -> None</code>

### Watch
Expand All @@ -128,3 +131,33 @@ Methods:
- <code title="get /browsers/{id}/fs/watch/{watch_id}/events">client.browsers.fs.watch.<a href="./src/kernel/resources/browsers/fs/watch.py">events</a>(watch_id, \*, id) -> <a href="./src/kernel/types/browsers/fs/watch_events_response.py">WatchEventsResponse</a></code>
- <code title="post /browsers/{id}/fs/watch">client.browsers.fs.watch.<a href="./src/kernel/resources/browsers/fs/watch.py">start</a>(id, \*\*<a href="src/kernel/types/browsers/fs/watch_start_params.py">params</a>) -> <a href="./src/kernel/types/browsers/fs/watch_start_response.py">WatchStartResponse</a></code>
- <code title="delete /browsers/{id}/fs/watch/{watch_id}">client.browsers.fs.watch.<a href="./src/kernel/resources/browsers/fs/watch.py">stop</a>(watch_id, \*, id) -> None</code>

## Process

Types:

```python
from kernel.types.browsers import (
ProcessExecResponse,
ProcessKillResponse,
ProcessSpawnResponse,
ProcessStatusResponse,
ProcessStdinResponse,
ProcessStdoutStreamResponse,
)
```

Methods:

- <code title="post /browsers/{id}/process/exec">client.browsers.process.<a href="./src/kernel/resources/browsers/process.py">exec</a>(id, \*\*<a href="src/kernel/types/browsers/process_exec_params.py">params</a>) -> <a href="./src/kernel/types/browsers/process_exec_response.py">ProcessExecResponse</a></code>
- <code title="post /browsers/{id}/process/{process_id}/kill">client.browsers.process.<a href="./src/kernel/resources/browsers/process.py">kill</a>(process_id, \*, id, \*\*<a href="src/kernel/types/browsers/process_kill_params.py">params</a>) -> <a href="./src/kernel/types/browsers/process_kill_response.py">ProcessKillResponse</a></code>
- <code title="post /browsers/{id}/process/spawn">client.browsers.process.<a href="./src/kernel/resources/browsers/process.py">spawn</a>(id, \*\*<a href="src/kernel/types/browsers/process_spawn_params.py">params</a>) -> <a href="./src/kernel/types/browsers/process_spawn_response.py">ProcessSpawnResponse</a></code>
- <code title="get /browsers/{id}/process/{process_id}/status">client.browsers.process.<a href="./src/kernel/resources/browsers/process.py">status</a>(process_id, \*, id) -> <a href="./src/kernel/types/browsers/process_status_response.py">ProcessStatusResponse</a></code>
- <code title="post /browsers/{id}/process/{process_id}/stdin">client.browsers.process.<a href="./src/kernel/resources/browsers/process.py">stdin</a>(process_id, \*, id, \*\*<a href="src/kernel/types/browsers/process_stdin_params.py">params</a>) -> <a href="./src/kernel/types/browsers/process_stdin_response.py">ProcessStdinResponse</a></code>
- <code title="get /browsers/{id}/process/{process_id}/stdout/stream">client.browsers.process.<a href="./src/kernel/resources/browsers/process.py">stdout_stream</a>(process_id, \*, id) -> <a href="./src/kernel/types/browsers/process_stdout_stream_response.py">ProcessStdoutStreamResponse</a></code>

## Logs

Methods:

- <code title="get /browsers/{id}/logs/stream">client.browsers.logs.<a href="./src/kernel/resources/browsers/logs.py">stream</a>(id, \*\*<a href="src/kernel/types/browsers/log_stream_params.py">params</a>) -> <a href="./src/kernel/types/shared/log_event.py">LogEvent</a></code>
3 changes: 2 additions & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[project]
name = "kernel"
version = "0.9.1"
version = "0.10.0"
description = "The official Python library for the kernel API"
dynamic = ["readme"]
license = "Apache-2.0"
Expand Down Expand Up @@ -148,6 +148,7 @@ exclude = [
"_dev",
".venv",
".nox",
".git",
]

reportImplicitOverride = true
Expand Down
2 changes: 1 addition & 1 deletion src/kernel/_models.py
Original file line number Diff line number Diff line change
Expand Up @@ -304,7 +304,7 @@ def model_dump(
exclude_none=exclude_none,
)

return cast(dict[str, Any], json_safe(dumped)) if mode == "json" else dumped
return cast("dict[str, Any]", json_safe(dumped)) if mode == "json" else dumped

@override
def model_dump_json(
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.9.1" # x-release-please-version
__version__ = "0.10.0" # x-release-please-version
28 changes: 28 additions & 0 deletions src/kernel/resources/browsers/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,22 @@
FsResourceWithStreamingResponse,
AsyncFsResourceWithStreamingResponse,
)
from .logs import (
LogsResource,
AsyncLogsResource,
LogsResourceWithRawResponse,
AsyncLogsResourceWithRawResponse,
LogsResourceWithStreamingResponse,
AsyncLogsResourceWithStreamingResponse,
)
from .process import (
ProcessResource,
AsyncProcessResource,
ProcessResourceWithRawResponse,
AsyncProcessResourceWithRawResponse,
ProcessResourceWithStreamingResponse,
AsyncProcessResourceWithStreamingResponse,
)
from .replays import (
ReplaysResource,
AsyncReplaysResource,
Expand Down Expand Up @@ -38,6 +54,18 @@
"AsyncFsResourceWithRawResponse",
"FsResourceWithStreamingResponse",
"AsyncFsResourceWithStreamingResponse",
"ProcessResource",
"AsyncProcessResource",
"ProcessResourceWithRawResponse",
"AsyncProcessResourceWithRawResponse",
"ProcessResourceWithStreamingResponse",
"AsyncProcessResourceWithStreamingResponse",
"LogsResource",
"AsyncLogsResource",
"LogsResourceWithRawResponse",
"AsyncLogsResourceWithRawResponse",
"LogsResourceWithStreamingResponse",
"AsyncLogsResourceWithStreamingResponse",
"BrowsersResource",
"AsyncBrowsersResource",
"BrowsersResourceWithRawResponse",
Expand Down
64 changes: 64 additions & 0 deletions src/kernel/resources/browsers/browsers.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,14 @@

import httpx

from .logs import (
LogsResource,
AsyncLogsResource,
LogsResourceWithRawResponse,
AsyncLogsResourceWithRawResponse,
LogsResourceWithStreamingResponse,
AsyncLogsResourceWithStreamingResponse,
)
from .fs.fs import (
FsResource,
AsyncFsResource,
Expand All @@ -13,6 +21,14 @@
AsyncFsResourceWithStreamingResponse,
)
from ...types import browser_create_params, browser_delete_params
from .process import (
ProcessResource,
AsyncProcessResource,
ProcessResourceWithRawResponse,
AsyncProcessResourceWithRawResponse,
ProcessResourceWithStreamingResponse,
AsyncProcessResourceWithStreamingResponse,
)
from .replays import (
ReplaysResource,
AsyncReplaysResource,
Expand Down Expand Up @@ -49,6 +65,14 @@ def replays(self) -> ReplaysResource:
def fs(self) -> FsResource:
return FsResource(self._client)

@cached_property
def process(self) -> ProcessResource:
return ProcessResource(self._client)

@cached_property
def logs(self) -> LogsResource:
return LogsResource(self._client)

@cached_property
def with_raw_response(self) -> BrowsersResourceWithRawResponse:
"""
Expand Down Expand Up @@ -261,6 +285,14 @@ def replays(self) -> AsyncReplaysResource:
def fs(self) -> AsyncFsResource:
return AsyncFsResource(self._client)

@cached_property
def process(self) -> AsyncProcessResource:
return AsyncProcessResource(self._client)

@cached_property
def logs(self) -> AsyncLogsResource:
return AsyncLogsResource(self._client)

@cached_property
def with_raw_response(self) -> AsyncBrowsersResourceWithRawResponse:
"""
Expand Down Expand Up @@ -494,6 +526,14 @@ def replays(self) -> ReplaysResourceWithRawResponse:
def fs(self) -> FsResourceWithRawResponse:
return FsResourceWithRawResponse(self._browsers.fs)

@cached_property
def process(self) -> ProcessResourceWithRawResponse:
return ProcessResourceWithRawResponse(self._browsers.process)

@cached_property
def logs(self) -> LogsResourceWithRawResponse:
return LogsResourceWithRawResponse(self._browsers.logs)


class AsyncBrowsersResourceWithRawResponse:
def __init__(self, browsers: AsyncBrowsersResource) -> None:
Expand Down Expand Up @@ -523,6 +563,14 @@ def replays(self) -> AsyncReplaysResourceWithRawResponse:
def fs(self) -> AsyncFsResourceWithRawResponse:
return AsyncFsResourceWithRawResponse(self._browsers.fs)

@cached_property
def process(self) -> AsyncProcessResourceWithRawResponse:
return AsyncProcessResourceWithRawResponse(self._browsers.process)

@cached_property
def logs(self) -> AsyncLogsResourceWithRawResponse:
return AsyncLogsResourceWithRawResponse(self._browsers.logs)


class BrowsersResourceWithStreamingResponse:
def __init__(self, browsers: BrowsersResource) -> None:
Expand Down Expand Up @@ -552,6 +600,14 @@ def replays(self) -> ReplaysResourceWithStreamingResponse:
def fs(self) -> FsResourceWithStreamingResponse:
return FsResourceWithStreamingResponse(self._browsers.fs)

@cached_property
def process(self) -> ProcessResourceWithStreamingResponse:
return ProcessResourceWithStreamingResponse(self._browsers.process)

@cached_property
def logs(self) -> LogsResourceWithStreamingResponse:
return LogsResourceWithStreamingResponse(self._browsers.logs)


class AsyncBrowsersResourceWithStreamingResponse:
def __init__(self, browsers: AsyncBrowsersResource) -> None:
Expand Down Expand Up @@ -580,3 +636,11 @@ def replays(self) -> AsyncReplaysResourceWithStreamingResponse:
@cached_property
def fs(self) -> AsyncFsResourceWithStreamingResponse:
return AsyncFsResourceWithStreamingResponse(self._browsers.fs)

@cached_property
def process(self) -> AsyncProcessResourceWithStreamingResponse:
return AsyncProcessResourceWithStreamingResponse(self._browsers.process)

@cached_property
def logs(self) -> AsyncLogsResourceWithStreamingResponse:
return AsyncLogsResourceWithStreamingResponse(self._browsers.logs)
Loading