diff --git a/README.md b/README.md index 4ae4a096..96bfd12c 100644 --- a/README.md +++ b/README.md @@ -287,11 +287,16 @@ kernel search contents srch_01jsearchresult --limit 3 --content-source browser - `--telemetry-storage on|off` - Whether to persist captured telemetry to Kernel storage (default on). `off` requires `--telemetry-export-otlp ` in the same command, so events are only available on the live stream and through the export. Cannot be changed after the browser is created. - `--chrome-policy ` - Custom Chrome enterprise policy as a JSON object. Kernel-managed policies (extensions, proxy, automation) are rejected server-side. - `--chrome-policy-file ` - Read the Chrome enterprise policy from a file (use `-` for stdin). Mutually exclusive with `--chrome-policy`. + - `--start-replay` - Start replay recording when the browser is created. With `--pool-id` or `--pool-name`, overrides the pool's default for this acquisition; use `--start-replay=false` to disable it - `--output json`, `-o json` - Output raw JSON object - _Note: When a pool is specified, omit other session configuration flags—pool settings determine profile, proxy, viewport, etc._ - `kernel browsers delete ` - Delete a browser by ID or name - `kernel browsers view ` - Get live view URL for a browser by ID or name - `--output json`, `-o json` - Output JSON with liveViewUrl +- `kernel browsers live-view create ` - Create a live view URL with read-only or control access to a headful browser. The URL opens only the live view (not CDP, WebDriver, or other browser endpoints) and cannot be revoked before it expires, so treat it as a credential + - `--scope read|control` - `read` shows the browser without accepting input; `control` also lets the viewer drive it (default: `read`) + - `--ttl-seconds ` - Seconds until the URL expires (1-31536000). Omit to keep it valid until the browser is deleted or, for a pooled browser, released + - `--output json`, `-o json` - Output raw JSON object - `kernel browsers get ` - Get detailed browser session info by ID or name - `--output json`, `-o json` - Output raw JSON object - `kernel browsers update ` - Update a running browser session by ID or name @@ -984,11 +989,13 @@ exists. - `--profile-id`, `--profile-name`, `--proxy-id`, `--region`, `--start-url`, `--extension`, `--viewport`, `--private-host`, `--proxy-route`, `--allowed-host` - Same semantics as `kernel browsers create` (proxy routes and the egress allowlist apply to every browser warmed into the pool). Leased browsers can replace or remove the allowlist with `kernel browsers update`; per-lease changes are reset to the pool's allowlist on release, or the browser is replaced - `--chrome-policy ` / `--chrome-policy-file ` - Custom Chrome enterprise policy applied to every browser in the pool, as a JSON object or from a file (`-` for stdin). Same semantics as `kernel browsers create`. - `--telemetry=all` / `--telemetry=off` / `--telemetry=` - Telemetry applied to browsers warmed into the pool. Same semantics as `kernel browsers create`. + - `--start-replay` - Start replay recording automatically whenever a browser is acquired from the pool - `--output json`, `-o json` - Output raw JSON object - `kernel browser-pools get ` - Get pool details - `--output json`, `-o json` - Output raw JSON object - `kernel browser-pools update ` - Update pool configuration - Same flags as create (except `--region`, which is fixed at creation and cannot be updated) plus `--clear-profile`, `--clear-proxy`, `--clear-start-url`, `--clear-extensions`, `--clear-chrome-policy`, `--clear-private-hosts`, `--clear-proxy-routes`, and `--clear-allowed-hosts` for removing durable configuration. `--clear-private-hosts` removes the whole network configuration (restoring the default private IP ranges and dropping proxy routes and the allowlist). `--private-host`, `--proxy-route`, `--allowed-host`, `--clear-proxy-routes`, and `--clear-allowed-hosts` replace the pool's whole network configuration, so pass the other network flags to keep them; any network update without `--allowed-host` removes the pool's allowlist. Any change to the pool's allowlist, including removing it, automatically replaces idle browsers; leased browsers keep their allowlist until release, when it is reset to the new list or the browser is replaced. `--fill-rate 0` pauses automatic filling. `--discard-all-idle` discards all idle browsers and refills the pool. `--telemetry`, `--memory`, and other network updates only apply to browsers warmed after the update. + - `--start-replay` - Set whether replay recording starts automatically for browsers acquired after the update; use `--start-replay=false` to disable - `--output json`, `-o json` - Output raw JSON object - `kernel browser-pools delete ` - Delete a pool - `--force` - Force delete even if browsers are leased @@ -997,6 +1004,7 @@ exists. - `--name ` - Optional name for the acquired session (applies to this lease; cleared on release) - `--tag ` - Set a tag on the acquired session, repeatable; applies to this lease - `--telemetry=all` / `--telemetry=off` / `--telemetry=` - Telemetry override for this lease only, merged onto the pool's config + - `--start-replay` - Start replay recording for this lease. Omit to use the pool's default; use `--start-replay=false` to disable it for this lease - `--output json`, `-o json` - Output raw JSON object - `kernel browser-pools release ` - Release a browser back to the pool - `--session-id ` - Browser session ID to release (required) @@ -1375,6 +1383,7 @@ Managed auth connections (`kernel auth connections`). The commands below are new - `--telemetry=all` / `--telemetry=off` / `--telemetry=` - Default telemetry for this connection's browser sessions. Same semantics as `kernel browsers create` - `--telemetry-export-otlp ` - Export this connection's captured telemetry over OTLP to one of the org's configured destinations. Implies `--telemetry=all` when `--telemetry` is not set. Use `=off` to disable export. - `--telemetry-storage on|off` - Whether this connection's sessions persist captured telemetry to Kernel storage (default on). `off` requires `--telemetry-export-otlp ` in the same command. + - `--locale ` - Browser locale for this connection's login, reauth, and health-check browser sessions (canonical BCP 47, e.g. `sv-SE`). Omit to use the browser region's default - `kernel auth connections update ` - New flags: - `--region us-east|us-west|eu-west|ap-southeast` - Update the region for browser sessions created after this command. Active sessions don't move. - `--proxy-id ` / `--proxy-name ` / `--proxy-mode direct|default` - Proxy configuration for future browser sessions (mutually exclusive). Use `--proxy-mode=default` to drop a selected proxy rather than passing an empty value. @@ -1382,6 +1391,8 @@ Managed auth connections (`kernel auth connections`). The commands below are new - `--telemetry=all` / `--telemetry=off` / `--telemetry=` - Update telemetry for future browser sessions - `--telemetry-export-otlp ` - Update where future sessions export captured telemetry. Naming a destination requires passing `--telemetry` in the same command, since the API validates capture and export together and enabling capture here would replace the connection's current category selection. Use `=off` to disable export. - `--telemetry-storage on|off` - Update whether future sessions persist captured telemetry to Kernel storage. Requires `--telemetry` in the same command; `off` also requires an export destination. + - `--locale ` - Set the browser locale for future browser sessions (canonical BCP 47, e.g. `sv-SE`). Mutually exclusive with `--clear-locale` + - `--clear-locale` - Clear the locale override so future sessions use the browser region's default - `kernel auth connections login ` - New flags: - `--region us-east|us-west|eu-west|ap-southeast` - Region override for this login only. Omit it to inherit the connection region. - `--proxy-id ` / `--proxy-name ` / `--proxy-mode direct|default` - Proxy override for this login's browser session (mutually exclusive); omitted properties inherit the connection defaults diff --git a/cmd/browsers.go b/cmd/browsers.go index d5908909..c465dfdc 100644 --- a/cmd/browsers.go +++ b/cmd/browsers.go @@ -1148,7 +1148,9 @@ func (b BrowsersCmd) LiveViewCreate(ctx context.Context, in BrowsersLiveViewCrea params.BrowserLiveViewRequest.TtlSeconds = kernel.Opt(in.TtlSeconds) } - liveView, err := b.liveView.New(ctx, in.Identifier, params) + // Each call mints a URL that cannot be revoked, so never retry a request + // whose response may have been lost. + liveView, err := b.liveView.New(ctx, in.Identifier, params, option.WithMaxRetries(0)) if err != nil { return util.CleanedUpSdkError{Err: err} } diff --git a/cmd/browsers_test.go b/cmd/browsers_test.go index 25417294..03188dc5 100644 --- a/cmd/browsers_test.go +++ b/cmd/browsers_test.go @@ -12,6 +12,7 @@ import ( "os" "path/filepath" "strings" + "sync/atomic" "testing" "time" @@ -226,6 +227,20 @@ func TestBrowsersLiveViewCreateCommand(t *testing.T) { assert.Contains(t, outBuf.String(), util.FormatLocal(expiresAt)) } +func TestBrowsersLiveViewCreateDoesNotRetry(t *testing.T) { + var requests atomic.Int32 + server := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { + requests.Add(1) + w.WriteHeader(http.StatusInternalServerError) + })) + t.Cleanup(server.Close) + + client := kernel.NewClient(option.WithBaseURL(server.URL), option.WithAPIKey("test")) + b := BrowsersCmd{liveView: &client.Browsers.LiveView} + require.Error(t, b.LiveViewCreate(context.Background(), BrowsersLiveViewCreateInput{Identifier: "browser-one"})) + assert.Equal(t, int32(1), requests.Load()) +} + func TestBrowsersLiveViewCreateDefaultsAndValidation(t *testing.T) { setupStdoutCapture(t) var captured kernel.BrowserLiveViewNewParams diff --git a/cmd/vaults_commands.go b/cmd/vaults_commands.go index f89e7ea3..d7e7c51c 100644 --- a/cmd/vaults_commands.go +++ b/cmd/vaults_commands.go @@ -330,7 +330,7 @@ and never retry automatically. 400/403/404/409 rejections mean the tool was not or later may append &return_url=. invoke it once per advertised request and never request another link automatically. 1pw_access_request_status: no browser needed; optional timeout_seconds 0-120 (default 10) - controls how long to keep checking. Kernel checks immediately, then every 2 seconds, + controls how long to keep checking. KERNEL checks immediately, then every 2 seconds, slowing to 10- and 20-second intervals. each call reads fresh status and may wait up to 20 seconds for its first scheduled check even when timeout_seconds is shorter. honor a 429 Retry-After. after 3 minutes the approval prompt closes: ask whether the diff --git a/cmd/vaults_credentials.go b/cmd/vaults_credentials.go index 48efbe77..e2f79529 100644 --- a/cmd/vaults_credentials.go +++ b/cmd/vaults_credentials.go @@ -58,7 +58,7 @@ const vaultOnePasswordCredentialHelp = `1Password flow: present the returned onepassword:// approval link and instructions to the account owner unchanged. native iOS, Android, and desktop apps running 1Password 8.12.46 or later may append &return_url=. -4. invoke 1pw_access_request_status with timeout_seconds 0-120 (default 10). Kernel +4. invoke 1pw_access_request_status with timeout_seconds 0-120 (default 10). KERNEL checks immediately, then every 2 seconds, slowing to 10- and 20-second intervals. each call reads fresh status and may wait up to 20 seconds for its first scheduled check even when timeout_seconds is shorter; honor a 429 Retry-After. after 3 minutes