From be376e843484cf6aee031b8ace289f166cd181e1 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Tue, 4 Nov 2025 03:51:41 +0000 Subject: [PATCH 1/5] chore(internal): grammar fix (it's -> its) --- README.md | 2 +- packages/respjson/respjson.go | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 74d456f..29efa90 100644 --- a/README.md +++ b/README.md @@ -130,7 +130,7 @@ custom := param.Override[kernel.FooParams](12) ### Request unions -Unions are represented as a struct with fields prefixed by "Of" for each of it's variants, +Unions are represented as a struct with fields prefixed by "Of" for each of its variants, only one field can be non-zero. The non-zero field will be serialized. Sub-properties of the union can be accessed via methods on the union struct. diff --git a/packages/respjson/respjson.go b/packages/respjson/respjson.go index cc0088c..9e61c5c 100644 --- a/packages/respjson/respjson.go +++ b/packages/respjson/respjson.go @@ -5,7 +5,7 @@ package respjson // Use [Field.Valid] to check if an optional value was null or omitted. // // A Field will always occur in the following structure, where it -// mirrors the original field in it's parent struct: +// mirrors the original field in its parent struct: // // type ExampleObject struct { // Foo bool `json:"foo"` From 131fda473e619b41bf8df8a0c461e5594142b474 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Fri, 7 Nov 2025 21:17:42 +0000 Subject: [PATCH 2/5] feat: Remove price gating on computer endpoints --- .stats.yml | 4 ++-- app.go | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/.stats.yml b/.stats.yml index 9e4dbe6..0080fd6 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 65 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/kernel%2Fkernel-015c11efc34c81d4d82a937c017f5eb789ea3ca21a05b70e2ed31c069b839293.yml -openapi_spec_hash: 3dcab2044da305f376cecf4eca38caee +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/kernel%2Fkernel-8c7e0b9069a18bc9437269618cde251ba15568771f2b4811d57f0d5f0fd5692d.yml +openapi_spec_hash: aa2544d0bf0e7e875939aaa8e2e114d3 config_hash: 0fbdda3a736cc2748ca33371871e61b3 diff --git a/app.go b/app.go index 32bed97..7709d47 100644 --- a/app.go +++ b/app.go @@ -100,9 +100,9 @@ func (r *AppListResponse) UnmarshalJSON(data []byte) error { type AppListParams struct { // Filter results by application name. AppName param.Opt[string] `query:"app_name,omitzero" json:"-"` - // Limit the number of app to return. + // Limit the number of apps to return. Limit param.Opt[int64] `query:"limit,omitzero" json:"-"` - // Offset the number of app to return. + // Offset the number of apps to return. Offset param.Opt[int64] `query:"offset,omitzero" json:"-"` // Filter results by version label. Version param.Opt[string] `query:"version,omitzero" json:"-"` From 666f4924d4ec1b8ebe5e083a8df701c19ee414be Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Wed, 12 Nov 2025 03:40:43 +0000 Subject: [PATCH 3/5] chore: bump gjson version --- go.mod | 2 +- go.sum | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/go.mod b/go.mod index 032445a..41fde45 100644 --- a/go.mod +++ b/go.mod @@ -3,7 +3,7 @@ module github.com/onkernel/kernel-go-sdk go 1.22 require ( - github.com/tidwall/gjson v1.14.4 + github.com/tidwall/gjson v1.18.0 github.com/tidwall/sjson v1.2.5 ) diff --git a/go.sum b/go.sum index a70a5e0..32ba293 100644 --- a/go.sum +++ b/go.sum @@ -1,6 +1,6 @@ github.com/tidwall/gjson v1.14.2/go.mod h1:/wbyibRr2FHMks5tjHJ5F8dMZh3AcwJEMf5vlfC0lxk= -github.com/tidwall/gjson v1.14.4 h1:uo0p8EbA09J7RQaflQ1aBRffTR7xedD2bcIVSYxLnkM= -github.com/tidwall/gjson v1.14.4/go.mod h1:/wbyibRr2FHMks5tjHJ5F8dMZh3AcwJEMf5vlfC0lxk= +github.com/tidwall/gjson v1.18.0 h1:FIDeeyB800efLX89e5a8Y0BNH+LOngJyGrIWxG2FKQY= +github.com/tidwall/gjson v1.18.0/go.mod h1:/wbyibRr2FHMks5tjHJ5F8dMZh3AcwJEMf5vlfC0lxk= github.com/tidwall/match v1.1.1 h1:+Ho715JplO36QYgwN9PGYNhgZvoUSc9X2c80KVTi+GA= github.com/tidwall/match v1.1.1/go.mod h1:eRSPERbgtNPcGhD8UCthc6PmLEQXEWd3PRB5JTxsfmM= github.com/tidwall/pretty v1.2.0/go.mod h1:ITEVvHYasfjBbM0u2Pg8T2nJnzm8xPwvNhhsoaGGjNU= From 83ccf6eeaf25d7257cf6992af5b856b1c82fa8c6 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Wed, 12 Nov 2025 16:43:14 +0000 Subject: [PATCH 4/5] feat: feat hide cursor v2 --- .stats.yml | 8 ++++---- api.md | 5 +++++ browsercomputer.go | 45 +++++++++++++++++++++++++++++++++++++++++ browsercomputer_test.go | 29 ++++++++++++++++++++++++++ 4 files changed, 83 insertions(+), 4 deletions(-) diff --git a/.stats.yml b/.stats.yml index 0080fd6..125a84b 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ -configured_endpoints: 65 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/kernel%2Fkernel-8c7e0b9069a18bc9437269618cde251ba15568771f2b4811d57f0d5f0fd5692d.yml -openapi_spec_hash: aa2544d0bf0e7e875939aaa8e2e114d3 -config_hash: 0fbdda3a736cc2748ca33371871e61b3 +configured_endpoints: 66 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/kernel%2Fkernel-86854c41729a6b26f71e26c906f665f69939f23e2d7adcc43380aee64cf6d056.yml +openapi_spec_hash: 270a40c8af29e83cbda77d3700fd456a +config_hash: 9421eb86b7f3f4b274f123279da3858e diff --git a/api.md b/api.md index 495591c..f37c010 100644 --- a/api.md +++ b/api.md @@ -154,6 +154,10 @@ Methods: ## Computer +Response Types: + +- kernel.BrowserComputerSetCursorVisibilityResponse + Methods: - client.Browsers.Computer.CaptureScreenshot(ctx context.Context, id string, body kernel.BrowserComputerCaptureScreenshotParams) (http.Response, error) @@ -162,6 +166,7 @@ Methods: - client.Browsers.Computer.MoveMouse(ctx context.Context, id string, body kernel.BrowserComputerMoveMouseParams) error - client.Browsers.Computer.PressKey(ctx context.Context, id string, body kernel.BrowserComputerPressKeyParams) error - client.Browsers.Computer.Scroll(ctx context.Context, id string, body kernel.BrowserComputerScrollParams) error +- client.Browsers.Computer.SetCursorVisibility(ctx context.Context, id string, body kernel.BrowserComputerSetCursorVisibilityParams) (kernel.BrowserComputerSetCursorVisibilityResponse, error) - client.Browsers.Computer.TypeText(ctx context.Context, id string, body kernel.BrowserComputerTypeTextParams) error ## Playwright diff --git a/browsercomputer.go b/browsercomputer.go index 4158a7c..321830f 100644 --- a/browsercomputer.go +++ b/browsercomputer.go @@ -13,6 +13,7 @@ import ( "github.com/onkernel/kernel-go-sdk/internal/requestconfig" "github.com/onkernel/kernel-go-sdk/option" "github.com/onkernel/kernel-go-sdk/packages/param" + "github.com/onkernel/kernel-go-sdk/packages/respjson" ) // BrowserComputerService contains methods and other services that help with @@ -112,6 +113,18 @@ func (r *BrowserComputerService) Scroll(ctx context.Context, id string, body Bro return } +// Set cursor visibility +func (r *BrowserComputerService) SetCursorVisibility(ctx context.Context, id string, body BrowserComputerSetCursorVisibilityParams, opts ...option.RequestOption) (res *BrowserComputerSetCursorVisibilityResponse, err error) { + opts = slices.Concat(r.Options, opts) + if id == "" { + err = errors.New("missing required id parameter") + return + } + path := fmt.Sprintf("browsers/%s/computer/cursor", id) + err = requestconfig.ExecuteNewRequest(ctx, http.MethodPost, path, body, &res, opts...) + return +} + // Type text on the browser instance func (r *BrowserComputerService) TypeText(ctx context.Context, id string, body BrowserComputerTypeTextParams, opts ...option.RequestOption) (err error) { opts = slices.Concat(r.Options, opts) @@ -125,6 +138,24 @@ func (r *BrowserComputerService) TypeText(ctx context.Context, id string, body B return } +// Generic OK response. +type BrowserComputerSetCursorVisibilityResponse struct { + // Indicates success. + Ok bool `json:"ok,required"` + // JSON contains metadata for fields, check presence with [respjson.Field.Valid]. + JSON struct { + Ok respjson.Field + ExtraFields map[string]respjson.Field + raw string + } `json:"-"` +} + +// Returns the unmodified JSON received from the API +func (r BrowserComputerSetCursorVisibilityResponse) RawJSON() string { return r.JSON.raw } +func (r *BrowserComputerSetCursorVisibilityResponse) UnmarshalJSON(data []byte) error { + return apijson.UnmarshalRoot(data, r) +} + type BrowserComputerCaptureScreenshotParams struct { Region BrowserComputerCaptureScreenshotParamsRegion `json:"region,omitzero"` paramObj @@ -306,6 +337,20 @@ func (r *BrowserComputerScrollParams) UnmarshalJSON(data []byte) error { return apijson.UnmarshalRoot(data, r) } +type BrowserComputerSetCursorVisibilityParams struct { + // Whether the cursor should be hidden or visible + Hidden bool `json:"hidden,required"` + paramObj +} + +func (r BrowserComputerSetCursorVisibilityParams) MarshalJSON() (data []byte, err error) { + type shadow BrowserComputerSetCursorVisibilityParams + return param.MarshalObject(r, (*shadow)(&r)) +} +func (r *BrowserComputerSetCursorVisibilityParams) UnmarshalJSON(data []byte) error { + return apijson.UnmarshalRoot(data, r) +} + type BrowserComputerTypeTextParams struct { // Text to type on the browser instance Text string `json:"text,required"` diff --git a/browsercomputer_test.go b/browsercomputer_test.go index 0391cd9..7af643a 100644 --- a/browsercomputer_test.go +++ b/browsercomputer_test.go @@ -225,6 +225,35 @@ func TestBrowserComputerScrollWithOptionalParams(t *testing.T) { } } +func TestBrowserComputerSetCursorVisibility(t *testing.T) { + t.Skip("Prism tests are disabled") + baseURL := "http://localhost:4010" + if envURL, ok := os.LookupEnv("TEST_API_BASE_URL"); ok { + baseURL = envURL + } + if !testutil.CheckTestServer(t, baseURL) { + return + } + client := kernel.NewClient( + option.WithBaseURL(baseURL), + option.WithAPIKey("My API Key"), + ) + _, err := client.Browsers.Computer.SetCursorVisibility( + context.TODO(), + "id", + kernel.BrowserComputerSetCursorVisibilityParams{ + Hidden: true, + }, + ) + if err != nil { + var apierr *kernel.Error + if errors.As(err, &apierr) { + t.Log(string(apierr.DumpRequest(true))) + } + t.Fatalf("err should be nil: %s", err.Error()) + } +} + func TestBrowserComputerTypeTextWithOptionalParams(t *testing.T) { t.Skip("Prism tests are disabled") baseURL := "http://localhost:4010" From e6f886c1432f6017d2748085cb46f5b3097c35e3 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Wed, 12 Nov 2025 16:43:38 +0000 Subject: [PATCH 5/5] release: 0.19.0 --- .release-please-manifest.json | 2 +- CHANGELOG.md | 15 +++++++++++++++ README.md | 2 +- internal/version.go | 2 +- 4 files changed, 18 insertions(+), 3 deletions(-) diff --git a/.release-please-manifest.json b/.release-please-manifest.json index 4ad3fef..e756293 100644 --- a/.release-please-manifest.json +++ b/.release-please-manifest.json @@ -1,3 +1,3 @@ { - ".": "0.18.0" + ".": "0.19.0" } \ No newline at end of file diff --git a/CHANGELOG.md b/CHANGELOG.md index 71fed8b..f2b05da 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,20 @@ # Changelog +## 0.19.0 (2025-11-12) + +Full Changelog: [v0.18.0...v0.19.0](https://github.com/onkernel/kernel-go-sdk/compare/v0.18.0...v0.19.0) + +### Features + +* feat hide cursor v2 ([83ccf6e](https://github.com/onkernel/kernel-go-sdk/commit/83ccf6eeaf25d7257cf6992af5b856b1c82fa8c6)) +* Remove price gating on computer endpoints ([131fda4](https://github.com/onkernel/kernel-go-sdk/commit/131fda473e619b41bf8df8a0c461e5594142b474)) + + +### Chores + +* bump gjson version ([666f492](https://github.com/onkernel/kernel-go-sdk/commit/666f4924d4ec1b8ebe5e083a8df701c19ee414be)) +* **internal:** grammar fix (it's -> its) ([be376e8](https://github.com/onkernel/kernel-go-sdk/commit/be376e843484cf6aee031b8ace289f166cd181e1)) + ## 0.18.0 (2025-10-30) Full Changelog: [v0.17.0...v0.18.0](https://github.com/onkernel/kernel-go-sdk/compare/v0.17.0...v0.18.0) diff --git a/README.md b/README.md index 29efa90..0a1a155 100644 --- a/README.md +++ b/README.md @@ -28,7 +28,7 @@ Or to pin the version: ```sh -go get -u 'github.com/onkernel/kernel-go-sdk@v0.18.0' +go get -u 'github.com/onkernel/kernel-go-sdk@v0.19.0' ``` diff --git a/internal/version.go b/internal/version.go index 8dc40e7..1117f72 100644 --- a/internal/version.go +++ b/internal/version.go @@ -2,4 +2,4 @@ package internal -const PackageVersion = "0.18.0" // x-release-please-version +const PackageVersion = "0.19.0" // x-release-please-version