From 13a30a650ea08fdcdaaebb3f7a75e6f4a6b4fb34 Mon Sep 17 00:00:00 2001 From: "kernel-internal[bot]" <260533166+kernel-internal[bot]@users.noreply.github.com> Date: Thu, 12 Nov 2026 00:08:33 +0000 Subject: [PATCH 1/2] feat: Prepare native OAuth for MCP: path resource, exchange targets, static exchange client, retention, Clerk OAuth cutoff Stainless-Generated-From: bfe272b3a15ee7b022de236d73040675c0d1d3ce --- api.md | 2 + authconnection.go | 56 +++++++++++++++++ authconnection_test.go | 9 +++ browser.go | 136 +++++++++++++++++++++++++++++++++++++++++ browserpool.go | 34 +++++++++++ invocation.go | 34 +++++++++++ 6 files changed, 271 insertions(+) diff --git a/api.md b/api.md index a12723e..414f7b4 100644 --- a/api.md +++ b/api.md @@ -419,6 +419,7 @@ Methods: Params Types: - kernel.ManagedAuthBrowserConfigParam +- kernel.ManagedAuthBrowserLocationParam - kernel.ManagedAuthCreateRequestParam - kernel.ManagedAuthUpdateRequestParam - kernel.SubmitFieldsRequestParam @@ -428,6 +429,7 @@ Response Types: - kernel.LoginResponse - kernel.ManagedAuth - kernel.ManagedAuthBrowserConfig +- kernel.ManagedAuthBrowserLocation - kernel.ManagedAuthTimelineEvent - kernel.SubmitFieldsResponse - kernel.AuthConnectionFollowResponseUnion diff --git a/authconnection.go b/authconnection.go index 64fa47c..6351662 100644 --- a/authconnection.go +++ b/authconnection.go @@ -1012,6 +1012,9 @@ func (r *ManagedAuthSignInOption) UnmarshalJSON(data []byte) error { // connection. Managed auth controls the profile, headless mode, timeout, start // URL, kiosk mode, and viewport. type ManagedAuthBrowserConfig struct { + // Browser locale for the connection's login, reauthentication, and health-check + // sessions. Set on create or update; not supported on login. + Location ManagedAuthBrowserLocation `json:"location"` // Proxy configuration for managed auth browser sessions. Omit on create to derive // the default from stealth, or on update and login to preserve or inherit the // connection default. @@ -1029,6 +1032,7 @@ type ManagedAuthBrowserConfig struct { Telemetry ManagedAuthBrowserConfigTelemetry `json:"telemetry" api:"nullable"` // JSON contains metadata for fields, check presence with [respjson.Field.Valid]. JSON struct { + Location respjson.Field Proxy respjson.Field Region respjson.Field Stealth respjson.Field @@ -1203,6 +1207,9 @@ type ManagedAuthBrowserConfigParam struct { Stealth param.Opt[bool] `json:"stealth,omitzero"` // Browser telemetry configuration using the same semantics as browser create. Telemetry ManagedAuthBrowserConfigTelemetryParam `json:"telemetry,omitzero"` + // Browser locale for the connection's login, reauthentication, and health-check + // sessions. Set on create or update; not supported on login. + Location ManagedAuthBrowserLocationParam `json:"location,omitzero"` // Proxy configuration for managed auth browser sessions. Omit on create to derive // the default from stealth, or on update and login to preserve or inherit the // connection default. @@ -1332,6 +1339,55 @@ func (r *ManagedAuthBrowserConfigTelemetryStorageParam) UnmarshalJSON(data []byt return apijson.UnmarshalRoot(data, r) } +// Browser locale applied to browser sessions created for a managed auth +// connection. +type ManagedAuthBrowserLocation struct { + // Supported canonical BCP 47 locale for the browser's language and Accept-Language + // header. Omit to use the default for the browser's region, or omit on update to + // keep the current locale. Null clears it on update. + Locale string `json:"locale" api:"nullable"` + // JSON contains metadata for fields, check presence with [respjson.Field.Valid]. + JSON struct { + Locale respjson.Field + ExtraFields map[string]respjson.Field + raw string + } `json:"-"` +} + +// Returns the unmodified JSON received from the API +func (r ManagedAuthBrowserLocation) RawJSON() string { return r.JSON.raw } +func (r *ManagedAuthBrowserLocation) UnmarshalJSON(data []byte) error { + return apijson.UnmarshalRoot(data, r) +} + +// ToParam converts this ManagedAuthBrowserLocation to a +// ManagedAuthBrowserLocationParam. +// +// Warning: the fields of the param type will not be present. ToParam should only +// be used at the last possible moment before sending a request. Test for this with +// ManagedAuthBrowserLocationParam.Overrides() +func (r ManagedAuthBrowserLocation) ToParam() ManagedAuthBrowserLocationParam { + return param.Override[ManagedAuthBrowserLocationParam](json.RawMessage(r.RawJSON())) +} + +// Browser locale applied to browser sessions created for a managed auth +// connection. +type ManagedAuthBrowserLocationParam struct { + // Supported canonical BCP 47 locale for the browser's language and Accept-Language + // header. Omit to use the default for the browser's region, or omit on update to + // keep the current locale. Null clears it on update. + Locale param.Opt[string] `json:"locale,omitzero"` + paramObj +} + +func (r ManagedAuthBrowserLocationParam) MarshalJSON() (data []byte, err error) { + type shadow ManagedAuthBrowserLocationParam + return param.MarshalObject(r, (*shadow)(&r)) +} +func (r *ManagedAuthBrowserLocationParam) UnmarshalJSON(data []byte) error { + return apijson.UnmarshalRoot(data, r) +} + // Request to create an auth connection for a profile and domain // // The properties Domain, ProfileName are required. diff --git a/authconnection_test.go b/authconnection_test.go index 6c4a585..0a813be 100644 --- a/authconnection_test.go +++ b/authconnection_test.go @@ -33,6 +33,9 @@ func TestAuthConnectionNewWithOptionalParams(t *testing.T) { AllowedDomains: []string{"login.netflix.com", "auth.netflix.com"}, AutoReauth: kernel.Bool(true), Browser: kernel.ManagedAuthBrowserConfigParam{ + Location: kernel.ManagedAuthBrowserLocationParam{ + Locale: kernel.String("sv-SE"), + }, Proxy: kernel.BrowserProxyConfigParam{ ID: kernel.String("x"), Mode: kernel.BrowserProxyModeDirect, @@ -212,6 +215,9 @@ func TestAuthConnectionUpdateWithOptionalParams(t *testing.T) { AllowedDomains: []string{"login.netflix.com", "auth.netflix.com"}, AutoReauth: kernel.Bool(true), Browser: kernel.ManagedAuthBrowserConfigParam{ + Location: kernel.ManagedAuthBrowserLocationParam{ + Locale: kernel.String("sv-SE"), + }, Proxy: kernel.BrowserProxyConfigParam{ ID: kernel.String("x"), Mode: kernel.BrowserProxyModeDirect, @@ -418,6 +424,9 @@ func TestAuthConnectionLoginWithOptionalParams(t *testing.T) { "id", kernel.AuthConnectionLoginParams{ Browser: kernel.ManagedAuthBrowserConfigParam{ + Location: kernel.ManagedAuthBrowserLocationParam{ + Locale: kernel.String("sv-SE"), + }, Proxy: kernel.BrowserProxyConfigParam{ ID: kernel.String("x"), Mode: kernel.BrowserProxyModeDirect, diff --git a/browser.go b/browser.go index 9679a48..a00d010 100644 --- a/browser.go +++ b/browser.go @@ -1247,6 +1247,10 @@ type BrowserNewResponse struct { // // Deprecated: deprecated ProxyID string `json:"proxy_id"` + // Replay recording started by `start_replay` when this browser was created or + // acquired. Omitted otherwise; list replays with + // `GET /browsers/{id_or_name}/replays`. + Replay BrowserNewResponseReplay `json:"replay"` // URL the session was most recently asked to navigate to, if any. Recorded for // debugging. Navigation is fire-and-forget — the URL is dispatched to the browser // without waiting for it to load, and any errors (DNS failure, bad status, @@ -1310,6 +1314,7 @@ type BrowserNewResponse struct { ProfileSaveChanges respjson.Field Proxy respjson.Field ProxyID respjson.Field + Replay respjson.Field StartURL respjson.Field Tags respjson.Field Telemetry respjson.Field @@ -1339,6 +1344,35 @@ const ( BrowserNewResponseRegionApSoutheast BrowserNewResponseRegion = "ap-southeast" ) +// Replay recording started by `start_replay` when this browser was created or +// acquired. Omitted otherwise; list replays with +// `GET /browsers/{id_or_name}/replays`. +type BrowserNewResponseReplay struct { + // Unique identifier for the replay recording. + ReplayID string `json:"replay_id" api:"required"` + // Timestamp when replay finished + FinishedAt time.Time `json:"finished_at" api:"nullable" format:"date-time"` + // URL for viewing the replay recording. + ReplayViewURL string `json:"replay_view_url"` + // Timestamp when replay started + StartedAt time.Time `json:"started_at" api:"nullable" format:"date-time"` + // JSON contains metadata for fields, check presence with [respjson.Field.Valid]. + JSON struct { + ReplayID respjson.Field + FinishedAt respjson.Field + ReplayViewURL respjson.Field + StartedAt respjson.Field + ExtraFields map[string]respjson.Field + raw string + } `json:"-"` +} + +// Returns the unmodified JSON received from the API +func (r BrowserNewResponseReplay) RawJSON() string { return r.JSON.raw } +func (r *BrowserNewResponseReplay) UnmarshalJSON(data []byte) error { + return apijson.UnmarshalRoot(data, r) +} + // Whether final usage billing is still pending or complete. Only present for // deleted sessions. type BrowserNewResponseUsageStatus string @@ -1411,6 +1445,10 @@ type BrowserGetResponse struct { // // Deprecated: deprecated ProxyID string `json:"proxy_id"` + // Replay recording started by `start_replay` when this browser was created or + // acquired. Omitted otherwise; list replays with + // `GET /browsers/{id_or_name}/replays`. + Replay BrowserGetResponseReplay `json:"replay"` // URL the session was most recently asked to navigate to, if any. Recorded for // debugging. Navigation is fire-and-forget — the URL is dispatched to the browser // without waiting for it to load, and any errors (DNS failure, bad status, @@ -1474,6 +1512,7 @@ type BrowserGetResponse struct { ProfileSaveChanges respjson.Field Proxy respjson.Field ProxyID respjson.Field + Replay respjson.Field StartURL respjson.Field Tags respjson.Field Telemetry respjson.Field @@ -1503,6 +1542,35 @@ const ( BrowserGetResponseRegionApSoutheast BrowserGetResponseRegion = "ap-southeast" ) +// Replay recording started by `start_replay` when this browser was created or +// acquired. Omitted otherwise; list replays with +// `GET /browsers/{id_or_name}/replays`. +type BrowserGetResponseReplay struct { + // Unique identifier for the replay recording. + ReplayID string `json:"replay_id" api:"required"` + // Timestamp when replay finished + FinishedAt time.Time `json:"finished_at" api:"nullable" format:"date-time"` + // URL for viewing the replay recording. + ReplayViewURL string `json:"replay_view_url"` + // Timestamp when replay started + StartedAt time.Time `json:"started_at" api:"nullable" format:"date-time"` + // JSON contains metadata for fields, check presence with [respjson.Field.Valid]. + JSON struct { + ReplayID respjson.Field + FinishedAt respjson.Field + ReplayViewURL respjson.Field + StartedAt respjson.Field + ExtraFields map[string]respjson.Field + raw string + } `json:"-"` +} + +// Returns the unmodified JSON received from the API +func (r BrowserGetResponseReplay) RawJSON() string { return r.JSON.raw } +func (r *BrowserGetResponseReplay) UnmarshalJSON(data []byte) error { + return apijson.UnmarshalRoot(data, r) +} + // Whether final usage billing is still pending or complete. Only present for // deleted sessions. type BrowserGetResponseUsageStatus string @@ -1575,6 +1643,10 @@ type BrowserUpdateResponse struct { // // Deprecated: deprecated ProxyID string `json:"proxy_id"` + // Replay recording started by `start_replay` when this browser was created or + // acquired. Omitted otherwise; list replays with + // `GET /browsers/{id_or_name}/replays`. + Replay BrowserUpdateResponseReplay `json:"replay"` // URL the session was most recently asked to navigate to, if any. Recorded for // debugging. Navigation is fire-and-forget — the URL is dispatched to the browser // without waiting for it to load, and any errors (DNS failure, bad status, @@ -1638,6 +1710,7 @@ type BrowserUpdateResponse struct { ProfileSaveChanges respjson.Field Proxy respjson.Field ProxyID respjson.Field + Replay respjson.Field StartURL respjson.Field Tags respjson.Field Telemetry respjson.Field @@ -1667,6 +1740,35 @@ const ( BrowserUpdateResponseRegionApSoutheast BrowserUpdateResponseRegion = "ap-southeast" ) +// Replay recording started by `start_replay` when this browser was created or +// acquired. Omitted otherwise; list replays with +// `GET /browsers/{id_or_name}/replays`. +type BrowserUpdateResponseReplay struct { + // Unique identifier for the replay recording. + ReplayID string `json:"replay_id" api:"required"` + // Timestamp when replay finished + FinishedAt time.Time `json:"finished_at" api:"nullable" format:"date-time"` + // URL for viewing the replay recording. + ReplayViewURL string `json:"replay_view_url"` + // Timestamp when replay started + StartedAt time.Time `json:"started_at" api:"nullable" format:"date-time"` + // JSON contains metadata for fields, check presence with [respjson.Field.Valid]. + JSON struct { + ReplayID respjson.Field + FinishedAt respjson.Field + ReplayViewURL respjson.Field + StartedAt respjson.Field + ExtraFields map[string]respjson.Field + raw string + } `json:"-"` +} + +// Returns the unmodified JSON received from the API +func (r BrowserUpdateResponseReplay) RawJSON() string { return r.JSON.raw } +func (r *BrowserUpdateResponseReplay) UnmarshalJSON(data []byte) error { + return apijson.UnmarshalRoot(data, r) +} + // Whether final usage billing is still pending or complete. Only present for // deleted sessions. type BrowserUpdateResponseUsageStatus string @@ -1739,6 +1841,10 @@ type BrowserListResponse struct { // // Deprecated: deprecated ProxyID string `json:"proxy_id"` + // Replay recording started by `start_replay` when this browser was created or + // acquired. Omitted otherwise; list replays with + // `GET /browsers/{id_or_name}/replays`. + Replay BrowserListResponseReplay `json:"replay"` // URL the session was most recently asked to navigate to, if any. Recorded for // debugging. Navigation is fire-and-forget — the URL is dispatched to the browser // without waiting for it to load, and any errors (DNS failure, bad status, @@ -1802,6 +1908,7 @@ type BrowserListResponse struct { ProfileSaveChanges respjson.Field Proxy respjson.Field ProxyID respjson.Field + Replay respjson.Field StartURL respjson.Field Tags respjson.Field Telemetry respjson.Field @@ -1831,6 +1938,35 @@ const ( BrowserListResponseRegionApSoutheast BrowserListResponseRegion = "ap-southeast" ) +// Replay recording started by `start_replay` when this browser was created or +// acquired. Omitted otherwise; list replays with +// `GET /browsers/{id_or_name}/replays`. +type BrowserListResponseReplay struct { + // Unique identifier for the replay recording. + ReplayID string `json:"replay_id" api:"required"` + // Timestamp when replay finished + FinishedAt time.Time `json:"finished_at" api:"nullable" format:"date-time"` + // URL for viewing the replay recording. + ReplayViewURL string `json:"replay_view_url"` + // Timestamp when replay started + StartedAt time.Time `json:"started_at" api:"nullable" format:"date-time"` + // JSON contains metadata for fields, check presence with [respjson.Field.Valid]. + JSON struct { + ReplayID respjson.Field + FinishedAt respjson.Field + ReplayViewURL respjson.Field + StartedAt respjson.Field + ExtraFields map[string]respjson.Field + raw string + } `json:"-"` +} + +// Returns the unmodified JSON received from the API +func (r BrowserListResponseReplay) RawJSON() string { return r.JSON.raw } +func (r *BrowserListResponseReplay) UnmarshalJSON(data []byte) error { + return apijson.UnmarshalRoot(data, r) +} + // Whether final usage billing is still pending or complete. Only present for // deleted sessions. type BrowserListResponseUsageStatus string diff --git a/browserpool.go b/browserpool.go index 42db92b..94ba7f7 100644 --- a/browserpool.go +++ b/browserpool.go @@ -413,6 +413,10 @@ type BrowserPoolAcquireResponse struct { // // Deprecated: deprecated ProxyID string `json:"proxy_id"` + // Replay recording started by `start_replay` when this browser was created or + // acquired. Omitted otherwise; list replays with + // `GET /browsers/{id_or_name}/replays`. + Replay BrowserPoolAcquireResponseReplay `json:"replay"` // URL the session was most recently asked to navigate to, if any. Recorded for // debugging. Navigation is fire-and-forget — the URL is dispatched to the browser // without waiting for it to load, and any errors (DNS failure, bad status, @@ -476,6 +480,7 @@ type BrowserPoolAcquireResponse struct { ProfileSaveChanges respjson.Field Proxy respjson.Field ProxyID respjson.Field + Replay respjson.Field StartURL respjson.Field Tags respjson.Field Telemetry respjson.Field @@ -505,6 +510,35 @@ const ( BrowserPoolAcquireResponseRegionApSoutheast BrowserPoolAcquireResponseRegion = "ap-southeast" ) +// Replay recording started by `start_replay` when this browser was created or +// acquired. Omitted otherwise; list replays with +// `GET /browsers/{id_or_name}/replays`. +type BrowserPoolAcquireResponseReplay struct { + // Unique identifier for the replay recording. + ReplayID string `json:"replay_id" api:"required"` + // Timestamp when replay finished + FinishedAt time.Time `json:"finished_at" api:"nullable" format:"date-time"` + // URL for viewing the replay recording. + ReplayViewURL string `json:"replay_view_url"` + // Timestamp when replay started + StartedAt time.Time `json:"started_at" api:"nullable" format:"date-time"` + // JSON contains metadata for fields, check presence with [respjson.Field.Valid]. + JSON struct { + ReplayID respjson.Field + FinishedAt respjson.Field + ReplayViewURL respjson.Field + StartedAt respjson.Field + ExtraFields map[string]respjson.Field + raw string + } `json:"-"` +} + +// Returns the unmodified JSON received from the API +func (r BrowserPoolAcquireResponseReplay) RawJSON() string { return r.JSON.raw } +func (r *BrowserPoolAcquireResponseReplay) UnmarshalJSON(data []byte) error { + return apijson.UnmarshalRoot(data, r) +} + // Whether final usage billing is still pending or complete. Only present for // deleted sessions. type BrowserPoolAcquireResponseUsageStatus string diff --git a/invocation.go b/invocation.go index baa1aec..2463aab 100644 --- a/invocation.go +++ b/invocation.go @@ -629,6 +629,10 @@ type InvocationListBrowsersResponseBrowser struct { // // Deprecated: deprecated ProxyID string `json:"proxy_id"` + // Replay recording started by `start_replay` when this browser was created or + // acquired. Omitted otherwise; list replays with + // `GET /browsers/{id_or_name}/replays`. + Replay InvocationListBrowsersResponseBrowserReplay `json:"replay"` // URL the session was most recently asked to navigate to, if any. Recorded for // debugging. Navigation is fire-and-forget — the URL is dispatched to the browser // without waiting for it to load, and any errors (DNS failure, bad status, @@ -692,6 +696,7 @@ type InvocationListBrowsersResponseBrowser struct { ProfileSaveChanges respjson.Field Proxy respjson.Field ProxyID respjson.Field + Replay respjson.Field StartURL respjson.Field Tags respjson.Field Telemetry respjson.Field @@ -711,6 +716,35 @@ func (r *InvocationListBrowsersResponseBrowser) UnmarshalJSON(data []byte) error return apijson.UnmarshalRoot(data, r) } +// Replay recording started by `start_replay` when this browser was created or +// acquired. Omitted otherwise; list replays with +// `GET /browsers/{id_or_name}/replays`. +type InvocationListBrowsersResponseBrowserReplay struct { + // Unique identifier for the replay recording. + ReplayID string `json:"replay_id" api:"required"` + // Timestamp when replay finished + FinishedAt time.Time `json:"finished_at" api:"nullable" format:"date-time"` + // URL for viewing the replay recording. + ReplayViewURL string `json:"replay_view_url"` + // Timestamp when replay started + StartedAt time.Time `json:"started_at" api:"nullable" format:"date-time"` + // JSON contains metadata for fields, check presence with [respjson.Field.Valid]. + JSON struct { + ReplayID respjson.Field + FinishedAt respjson.Field + ReplayViewURL respjson.Field + StartedAt respjson.Field + ExtraFields map[string]respjson.Field + raw string + } `json:"-"` +} + +// Returns the unmodified JSON received from the API +func (r InvocationListBrowsersResponseBrowserReplay) RawJSON() string { return r.JSON.raw } +func (r *InvocationListBrowsersResponseBrowserReplay) UnmarshalJSON(data []byte) error { + return apijson.UnmarshalRoot(data, r) +} + type InvocationNewParams struct { // Name of the action to invoke ActionName string `json:"action_name" api:"required"` From f0cd3fd87ea57f016be6aa9cb07fd35361316b35 Mon Sep 17 00:00:00 2001 From: "kernel-internal[bot]" <260533166+kernel-internal[bot]@users.noreply.github.com> Date: Thu, 12 Nov 2026 00:12:44 +0000 Subject: [PATCH 2/2] release: 0.147.0 --- .release-please-manifest.json | 2 +- CHANGELOG.md | 7 +++++++ README.md | 2 +- internal/version.go | 2 +- 4 files changed, 10 insertions(+), 3 deletions(-) diff --git a/.release-please-manifest.json b/.release-please-manifest.json index 123a549..e205138 100644 --- a/.release-please-manifest.json +++ b/.release-please-manifest.json @@ -1,3 +1,3 @@ { - ".": "0.146.0" + ".": "0.147.0" } \ No newline at end of file diff --git a/CHANGELOG.md b/CHANGELOG.md index d8c7119..34545e1 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,12 @@ # Changelog +## [0.147.0](https://github.com/kernel/kernel-go-sdk/compare/v0.146.0...v0.147.0) (2026-11-12) + + +### Features + +* Prepare native OAuth for MCP: path resource, exchange targets, static exchange client, retention, Clerk OAuth cutoff ([13a30a6](https://github.com/kernel/kernel-go-sdk/commit/13a30a650ea08fdcdaaebb3f7a75e6f4a6b4fb34)) + ## [0.146.0](https://github.com/kernel/kernel-go-sdk/compare/v0.145.0...v0.146.0) (2026-11-10) diff --git a/README.md b/README.md index 26d6a5d..29bd833 100644 --- a/README.md +++ b/README.md @@ -28,7 +28,7 @@ Or to pin the version: ```sh -go get -u 'github.com/kernel/kernel-go-sdk@v0.146.0' +go get -u 'github.com/kernel/kernel-go-sdk@v0.147.0' ``` diff --git a/internal/version.go b/internal/version.go index 2991db5..489e078 100644 --- a/internal/version.go +++ b/internal/version.go @@ -2,4 +2,4 @@ package internal -const PackageVersion = "0.146.0" // x-release-please-version +const PackageVersion = "0.147.0" // x-release-please-version