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.9.0"
".": "0.9.1"
}
4 changes: 2 additions & 2 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-e907afeabfeea49dedd783112ac3fd29267bc86f3d594f89ba9a2abf2bcbc9d8.yml
openapi_spec_hash: 060ca6288c1a09b6d1bdf207a0011165
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/kernel%2Fkernel-b55c3e0424fa7733487139488b9fff00ad8949ff02ee3160ee36b9334e84b134.yml
openapi_spec_hash: 17f36677e3dc0a3aeb419654c8d5cae3
config_hash: f67e4b33b2fb30c1405ee2fff8096320
14 changes: 14 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,19 @@
# Changelog

## 0.9.1 (2025-08-15)

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

### Features

* **api:** add browser timeouts ([6c7b47f](https://github.com/onkernel/kernel-go-sdk/commit/6c7b47f69ccc4e12d9e21340c543d57b7fc6d314))

### Chores

* **internal:** codegen related update ([e4ca558](https://github.com/onkernel/kernel-go-sdk/commit/e4ca55843e4dbb9b7e71821ca58080a5bf25f025))
* **internal:** update comment in script ([9542333](https://github.com/onkernel/kernel-go-sdk/commit/9542333108abb522bae00b266c89cc3917884b35))
* update @stainless-api/prism-cli to v5.15.0 ([625476c](https://github.com/onkernel/kernel-go-sdk/commit/625476c16f8298f7fa1c18318f67231906d89a56))

## 0.9.0 (2025-08-07)

Full Changelog: [v0.8.2...v0.9.0](https://github.com/onkernel/kernel-go-sdk/compare/v0.8.2...v0.9.0)
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ Or to pin the version:
<!-- x-release-please-start-version -->

```sh
go get -u 'github.com/onkernel/[email protected].0'
go get -u 'github.com/onkernel/[email protected].1'
```

<!-- x-release-please-end -->
Expand Down
2 changes: 1 addition & 1 deletion app_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ import (
)

func TestAppListWithOptionalParams(t *testing.T) {
t.Skip("skipped: tests are disabled for the time being")
t.Skip("Prism tests are disabled")
baseURL := "http://localhost:4010"
if envURL, ok := os.LookupEnv("TEST_API_BASE_URL"); ok {
baseURL = envURL
Expand Down
41 changes: 41 additions & 0 deletions browser.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import (
"fmt"
"net/http"
"net/url"
"time"

"github.com/onkernel/kernel-go-sdk/internal/apijson"
"github.com/onkernel/kernel-go-sdk/internal/apiquery"
Expand Down Expand Up @@ -138,8 +139,16 @@ func (r *BrowserPersistenceParam) UnmarshalJSON(data []byte) error {
type BrowserNewResponse struct {
// Websocket URL for Chrome DevTools Protocol connections to the browser session
CdpWsURL string `json:"cdp_ws_url,required"`
// When the browser session was created.
CreatedAt time.Time `json:"created_at,required" format:"date-time"`
// Whether the browser session is running in headless mode.
Headless bool `json:"headless,required"`
// Unique identifier for the browser session
SessionID string `json:"session_id,required"`
// Whether the browser session is running in stealth mode.
Stealth bool `json:"stealth,required"`
// The number of seconds of inactivity before the browser session is terminated.
TimeoutSeconds int64 `json:"timeout_seconds,required"`
// Remote URL for live viewing the browser session. Only available for non-headless
// browsers.
BrowserLiveViewURL string `json:"browser_live_view_url"`
Expand All @@ -148,7 +157,11 @@ type BrowserNewResponse struct {
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
CdpWsURL respjson.Field
CreatedAt respjson.Field
Headless respjson.Field
SessionID respjson.Field
Stealth respjson.Field
TimeoutSeconds respjson.Field
BrowserLiveViewURL respjson.Field
Persistence respjson.Field
ExtraFields map[string]respjson.Field
Expand All @@ -165,8 +178,16 @@ func (r *BrowserNewResponse) UnmarshalJSON(data []byte) error {
type BrowserGetResponse struct {
// Websocket URL for Chrome DevTools Protocol connections to the browser session
CdpWsURL string `json:"cdp_ws_url,required"`
// When the browser session was created.
CreatedAt time.Time `json:"created_at,required" format:"date-time"`
// Whether the browser session is running in headless mode.
Headless bool `json:"headless,required"`
// Unique identifier for the browser session
SessionID string `json:"session_id,required"`
// Whether the browser session is running in stealth mode.
Stealth bool `json:"stealth,required"`
// The number of seconds of inactivity before the browser session is terminated.
TimeoutSeconds int64 `json:"timeout_seconds,required"`
// Remote URL for live viewing the browser session. Only available for non-headless
// browsers.
BrowserLiveViewURL string `json:"browser_live_view_url"`
Expand All @@ -175,7 +196,11 @@ type BrowserGetResponse struct {
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
CdpWsURL respjson.Field
CreatedAt respjson.Field
Headless respjson.Field
SessionID respjson.Field
Stealth respjson.Field
TimeoutSeconds respjson.Field
BrowserLiveViewURL respjson.Field
Persistence respjson.Field
ExtraFields map[string]respjson.Field
Expand All @@ -192,8 +217,16 @@ func (r *BrowserGetResponse) UnmarshalJSON(data []byte) error {
type BrowserListResponse struct {
// Websocket URL for Chrome DevTools Protocol connections to the browser session
CdpWsURL string `json:"cdp_ws_url,required"`
// When the browser session was created.
CreatedAt time.Time `json:"created_at,required" format:"date-time"`
// Whether the browser session is running in headless mode.
Headless bool `json:"headless,required"`
// Unique identifier for the browser session
SessionID string `json:"session_id,required"`
// Whether the browser session is running in stealth mode.
Stealth bool `json:"stealth,required"`
// The number of seconds of inactivity before the browser session is terminated.
TimeoutSeconds int64 `json:"timeout_seconds,required"`
// Remote URL for live viewing the browser session. Only available for non-headless
// browsers.
BrowserLiveViewURL string `json:"browser_live_view_url"`
Expand All @@ -202,7 +235,11 @@ type BrowserListResponse struct {
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
CdpWsURL respjson.Field
CreatedAt respjson.Field
Headless respjson.Field
SessionID respjson.Field
Stealth respjson.Field
TimeoutSeconds respjson.Field
BrowserLiveViewURL respjson.Field
Persistence respjson.Field
ExtraFields map[string]respjson.Field
Expand All @@ -225,6 +262,10 @@ type BrowserNewParams struct {
// If true, launches the browser in stealth mode to reduce detection by anti-bot
// mechanisms.
Stealth param.Opt[bool] `json:"stealth,omitzero"`
// The number of seconds of inactivity before the browser session is terminated.
// Only applicable to non-persistent browsers. Activity includes CDP connections
// and live view connections. Defaults to 60 seconds.
TimeoutSeconds param.Opt[int64] `json:"timeout_seconds,omitzero"`
// Optional persistence configuration for the browser session.
Persistence BrowserPersistenceParam `json:"persistence,omitzero"`
paramObj
Expand Down
13 changes: 7 additions & 6 deletions browser_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ import (
)

func TestBrowserNewWithOptionalParams(t *testing.T) {
t.Skip("skipped: tests are disabled for the time being")
t.Skip("Prism tests are disabled")
baseURL := "http://localhost:4010"
if envURL, ok := os.LookupEnv("TEST_API_BASE_URL"); ok {
baseURL = envURL
Expand All @@ -32,7 +32,8 @@ func TestBrowserNewWithOptionalParams(t *testing.T) {
Persistence: kernel.BrowserPersistenceParam{
ID: "my-awesome-browser-for-user-1234",
},
Stealth: kernel.Bool(true),
Stealth: kernel.Bool(true),
TimeoutSeconds: kernel.Int(0),
})
if err != nil {
var apierr *kernel.Error
Expand All @@ -44,7 +45,7 @@ func TestBrowserNewWithOptionalParams(t *testing.T) {
}

func TestBrowserGet(t *testing.T) {
t.Skip("skipped: tests are disabled for the time being")
t.Skip("Prism tests are disabled")
baseURL := "http://localhost:4010"
if envURL, ok := os.LookupEnv("TEST_API_BASE_URL"); ok {
baseURL = envURL
Expand All @@ -67,7 +68,7 @@ func TestBrowserGet(t *testing.T) {
}

func TestBrowserList(t *testing.T) {
t.Skip("skipped: tests are disabled for the time being")
t.Skip("Prism tests are disabled")
baseURL := "http://localhost:4010"
if envURL, ok := os.LookupEnv("TEST_API_BASE_URL"); ok {
baseURL = envURL
Expand All @@ -90,7 +91,7 @@ func TestBrowserList(t *testing.T) {
}

func TestBrowserDelete(t *testing.T) {
t.Skip("skipped: tests are disabled for the time being")
t.Skip("Prism tests are disabled")
baseURL := "http://localhost:4010"
if envURL, ok := os.LookupEnv("TEST_API_BASE_URL"); ok {
baseURL = envURL
Expand All @@ -115,7 +116,7 @@ func TestBrowserDelete(t *testing.T) {
}

func TestBrowserDeleteByID(t *testing.T) {
t.Skip("skipped: tests are disabled for the time being")
t.Skip("Prism tests are disabled")
baseURL := "http://localhost:4010"
if envURL, ok := os.LookupEnv("TEST_API_BASE_URL"); ok {
baseURL = envURL
Expand Down
17 changes: 8 additions & 9 deletions browserf_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ import (
)

func TestBrowserFNewDirectoryWithOptionalParams(t *testing.T) {
t.Skip("skipped: tests are disabled for the time being")
t.Skip("Prism tests are disabled")
baseURL := "http://localhost:4010"
if envURL, ok := os.LookupEnv("TEST_API_BASE_URL"); ok {
baseURL = envURL
Expand Down Expand Up @@ -48,7 +48,7 @@ func TestBrowserFNewDirectoryWithOptionalParams(t *testing.T) {
}

func TestBrowserFDeleteDirectory(t *testing.T) {
t.Skip("skipped: tests are disabled for the time being")
t.Skip("Prism tests are disabled")
baseURL := "http://localhost:4010"
if envURL, ok := os.LookupEnv("TEST_API_BASE_URL"); ok {
baseURL = envURL
Expand Down Expand Up @@ -77,7 +77,7 @@ func TestBrowserFDeleteDirectory(t *testing.T) {
}

func TestBrowserFDeleteFile(t *testing.T) {
t.Skip("skipped: tests are disabled for the time being")
t.Skip("Prism tests are disabled")
baseURL := "http://localhost:4010"
if envURL, ok := os.LookupEnv("TEST_API_BASE_URL"); ok {
baseURL = envURL
Expand Down Expand Up @@ -106,7 +106,7 @@ func TestBrowserFDeleteFile(t *testing.T) {
}

func TestBrowserFFileInfo(t *testing.T) {
t.Skip("skipped: tests are disabled for the time being")
t.Skip("Prism tests are disabled")
baseURL := "http://localhost:4010"
if envURL, ok := os.LookupEnv("TEST_API_BASE_URL"); ok {
baseURL = envURL
Expand Down Expand Up @@ -135,7 +135,7 @@ func TestBrowserFFileInfo(t *testing.T) {
}

func TestBrowserFListFiles(t *testing.T) {
t.Skip("skipped: tests are disabled for the time being")
t.Skip("Prism tests are disabled")
baseURL := "http://localhost:4010"
if envURL, ok := os.LookupEnv("TEST_API_BASE_URL"); ok {
baseURL = envURL
Expand Down Expand Up @@ -164,7 +164,7 @@ func TestBrowserFListFiles(t *testing.T) {
}

func TestBrowserFMove(t *testing.T) {
t.Skip("skipped: tests are disabled for the time being")
t.Skip("Prism tests are disabled")
baseURL := "http://localhost:4010"
if envURL, ok := os.LookupEnv("TEST_API_BASE_URL"); ok {
baseURL = envURL
Expand Down Expand Up @@ -194,7 +194,6 @@ func TestBrowserFMove(t *testing.T) {
}

func TestBrowserFReadFile(t *testing.T) {
t.Skip("skipped: tests are disabled for the time being")
server := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
w.WriteHeader(200)
w.Write([]byte("abc"))
Expand Down Expand Up @@ -235,7 +234,7 @@ func TestBrowserFReadFile(t *testing.T) {
}

func TestBrowserFSetFilePermissionsWithOptionalParams(t *testing.T) {
t.Skip("skipped: tests are disabled for the time being")
t.Skip("Prism tests are disabled")
baseURL := "http://localhost:4010"
if envURL, ok := os.LookupEnv("TEST_API_BASE_URL"); ok {
baseURL = envURL
Expand Down Expand Up @@ -267,7 +266,7 @@ func TestBrowserFSetFilePermissionsWithOptionalParams(t *testing.T) {
}

func TestBrowserFWriteFileWithOptionalParams(t *testing.T) {
t.Skip("skipped: tests are disabled for the time being")
t.Skip("Prism tests are disabled")
baseURL := "http://localhost:4010"
if envURL, ok := os.LookupEnv("TEST_API_BASE_URL"); ok {
baseURL = envURL
Expand Down
4 changes: 2 additions & 2 deletions browserfwatch_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ import (
)

func TestBrowserFWatchStartWithOptionalParams(t *testing.T) {
t.Skip("skipped: tests are disabled for the time being")
t.Skip("Prism tests are disabled")
baseURL := "http://localhost:4010"
if envURL, ok := os.LookupEnv("TEST_API_BASE_URL"); ok {
baseURL = envURL
Expand Down Expand Up @@ -44,7 +44,7 @@ func TestBrowserFWatchStartWithOptionalParams(t *testing.T) {
}

func TestBrowserFWatchStop(t *testing.T) {
t.Skip("skipped: tests are disabled for the time being")
t.Skip("Prism tests are disabled")
baseURL := "http://localhost:4010"
if envURL, ok := os.LookupEnv("TEST_API_BASE_URL"); ok {
baseURL = envURL
Expand Down
7 changes: 3 additions & 4 deletions browserreplay_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ import (
)

func TestBrowserReplayList(t *testing.T) {
t.Skip("skipped: tests are disabled for the time being")
t.Skip("Prism tests are disabled")
baseURL := "http://localhost:4010"
if envURL, ok := os.LookupEnv("TEST_API_BASE_URL"); ok {
baseURL = envURL
Expand All @@ -41,7 +41,6 @@ func TestBrowserReplayList(t *testing.T) {
}

func TestBrowserReplayDownload(t *testing.T) {
t.Skip("skipped: tests are disabled for the time being")
server := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
w.WriteHeader(200)
w.Write([]byte("abc"))
Expand Down Expand Up @@ -82,7 +81,7 @@ func TestBrowserReplayDownload(t *testing.T) {
}

func TestBrowserReplayStartWithOptionalParams(t *testing.T) {
t.Skip("skipped: tests are disabled for the time being")
t.Skip("Prism tests are disabled")
baseURL := "http://localhost:4010"
if envURL, ok := os.LookupEnv("TEST_API_BASE_URL"); ok {
baseURL = envURL
Expand Down Expand Up @@ -112,7 +111,7 @@ func TestBrowserReplayStartWithOptionalParams(t *testing.T) {
}

func TestBrowserReplayStop(t *testing.T) {
t.Skip("skipped: tests are disabled for the time being")
t.Skip("Prism tests are disabled")
baseURL := "http://localhost:4010"
if envURL, ok := os.LookupEnv("TEST_API_BASE_URL"); ok {
baseURL = envURL
Expand Down
6 changes: 3 additions & 3 deletions deployment_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ import (
)

func TestDeploymentNewWithOptionalParams(t *testing.T) {
t.Skip("skipped: tests are disabled for the time being")
t.Skip("Prism tests are disabled")
baseURL := "http://localhost:4010"
if envURL, ok := os.LookupEnv("TEST_API_BASE_URL"); ok {
baseURL = envURL
Expand Down Expand Up @@ -48,7 +48,7 @@ func TestDeploymentNewWithOptionalParams(t *testing.T) {
}

func TestDeploymentGet(t *testing.T) {
t.Skip("skipped: tests are disabled for the time being")
t.Skip("Prism tests are disabled")
baseURL := "http://localhost:4010"
if envURL, ok := os.LookupEnv("TEST_API_BASE_URL"); ok {
baseURL = envURL
Expand All @@ -71,7 +71,7 @@ func TestDeploymentGet(t *testing.T) {
}

func TestDeploymentListWithOptionalParams(t *testing.T) {
t.Skip("skipped: tests are disabled for the time being")
t.Skip("Prism tests are disabled")
baseURL := "http://localhost:4010"
if envURL, ok := os.LookupEnv("TEST_API_BASE_URL"); ok {
baseURL = envURL
Expand Down
2 changes: 1 addition & 1 deletion internal/version.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@

package internal

const PackageVersion = "0.9.0" // x-release-please-version
const PackageVersion = "0.9.1" // x-release-please-version
Loading