Skip to content

Commit 82a475d

Browse files
feat: Add start_url to browser session updates
Stainless-Generated-From: 245527a0a5fccc56447f7227e933bc235a78cfe4
1 parent afe2fea commit 82a475d

13 files changed

Lines changed: 46 additions & 12 deletions

src/kernel/resources/browsers/browsers.py

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -394,6 +394,7 @@ def update(
394394
profile: BrowserProfile | Omit = omit,
395395
proxy: BrowserProxyConfigParam | Omit = omit,
396396
proxy_id: Optional[str] | Omit = omit,
397+
start_url: str | Omit = omit,
397398
tags: Optional[TagsParam] | Omit = omit,
398399
telemetry: Optional[browser_update_params.Telemetry] | Omit = omit,
399400
viewport: browser_update_params.Viewport | Omit = omit,
@@ -428,6 +429,11 @@ def update(
428429
proxy_id: ID of the proxy to use. Omit to leave unchanged, set to empty string to remove
429430
proxy. Deprecated in favor of proxy.
430431
432+
start_url: Optional URL to navigate the browser to after applying this update. When a
433+
profile is loaded in the same update, this overrides the profile's restored
434+
tabs. Navigation is best-effort, so failures do not fail the update. Omit or set
435+
to an empty string to leave the current page unchanged.
436+
431437
tags: User-defined key-value tags for the browser session. Omit to leave unchanged.
432438
Provide a map to replace the entire tag set (full replace, not a merge). Set to
433439
an empty object ({}) to clear all tags. Up to 50 pairs.
@@ -459,6 +465,7 @@ def update(
459465
"profile": profile,
460466
"proxy": proxy,
461467
"proxy_id": proxy_id,
468+
"start_url": start_url,
462469
"tags": tags,
463470
"telemetry": telemetry,
464471
"viewport": viewport,
@@ -1024,6 +1031,7 @@ async def update(
10241031
profile: BrowserProfile | Omit = omit,
10251032
proxy: BrowserProxyConfigParam | Omit = omit,
10261033
proxy_id: Optional[str] | Omit = omit,
1034+
start_url: str | Omit = omit,
10271035
tags: Optional[TagsParam] | Omit = omit,
10281036
telemetry: Optional[browser_update_params.Telemetry] | Omit = omit,
10291037
viewport: browser_update_params.Viewport | Omit = omit,
@@ -1058,6 +1066,11 @@ async def update(
10581066
proxy_id: ID of the proxy to use. Omit to leave unchanged, set to empty string to remove
10591067
proxy. Deprecated in favor of proxy.
10601068
1069+
start_url: Optional URL to navigate the browser to after applying this update. When a
1070+
profile is loaded in the same update, this overrides the profile's restored
1071+
tabs. Navigation is best-effort, so failures do not fail the update. Omit or set
1072+
to an empty string to leave the current page unchanged.
1073+
10611074
tags: User-defined key-value tags for the browser session. Omit to leave unchanged.
10621075
Provide a map to replace the entire tag set (full replace, not a merge). Set to
10631076
an empty object ({}) to clear all tags. Up to 50 pairs.
@@ -1089,6 +1102,7 @@ async def update(
10891102
"profile": profile,
10901103
"proxy": proxy,
10911104
"proxy_id": proxy_id,
1105+
"start_url": start_url,
10921106
"tags": tags,
10931107
"telemetry": telemetry,
10941108
"viewport": viewport,

src/kernel/types/browser_create_response.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,7 @@ class BrowserCreateResponse(BaseModel):
106106
"""
107107

108108
start_url: Optional[str] = None
109-
"""URL the session was asked to navigate to on creation, if any.
109+
"""URL the session was most recently asked to navigate to, if any.
110110
111111
Recorded for debugging. Navigation is fire-and-forget — the URL is dispatched to
112112
the browser without waiting for it to load, and any errors (DNS failure, bad

src/kernel/types/browser_list_response.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,7 @@ class BrowserListResponse(BaseModel):
106106
"""
107107

108108
start_url: Optional[str] = None
109-
"""URL the session was asked to navigate to on creation, if any.
109+
"""URL the session was most recently asked to navigate to, if any.
110110
111111
Recorded for debugging. Navigation is fire-and-forget — the URL is dispatched to
112112
the browser without waiting for it to load, and any errors (DNS failure, bad

src/kernel/types/browser_pool_acquire_response.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,7 @@ class BrowserPoolAcquireResponse(BaseModel):
106106
"""
107107

108108
start_url: Optional[str] = None
109-
"""URL the session was asked to navigate to on creation, if any.
109+
"""URL the session was most recently asked to navigate to, if any.
110110
111111
Recorded for debugging. Navigation is fire-and-forget — the URL is dispatched to
112112
the browser without waiting for it to load, and any errors (DNS failure, bad

src/kernel/types/browser_retrieve_response.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,7 @@ class BrowserRetrieveResponse(BaseModel):
106106
"""
107107

108108
start_url: Optional[str] = None
109-
"""URL the session was asked to navigate to on creation, if any.
109+
"""URL the session was most recently asked to navigate to, if any.
110110
111111
Recorded for debugging. Navigation is fire-and-forget — the URL is dispatched to
112112
the browser without waiting for it to load, and any errors (DNS failure, bad

src/kernel/types/browser_update_params.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,14 @@ class BrowserUpdateParams(TypedDict, total=False):
5959
favor of proxy.
6060
"""
6161

62+
start_url: str
63+
"""Optional URL to navigate the browser to after applying this update.
64+
65+
When a profile is loaded in the same update, this overrides the profile's
66+
restored tabs. Navigation is best-effort, so failures do not fail the update.
67+
Omit or set to an empty string to leave the current page unchanged.
68+
"""
69+
6270
tags: Optional[TagsParam]
6371
"""User-defined key-value tags for the browser session.
6472

src/kernel/types/browser_update_response.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,7 @@ class BrowserUpdateResponse(BaseModel):
106106
"""
107107

108108
start_url: Optional[str] = None
109-
"""URL the session was asked to navigate to on creation, if any.
109+
"""URL the session was most recently asked to navigate to, if any.
110110
111111
Recorded for debugging. Navigation is fire-and-forget — the URL is dispatched to
112112
the browser without waiting for it to load, and any errors (DNS failure, bad

src/kernel/types/invocation_list_browsers_response.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,7 @@ class Browser(BaseModel):
106106
"""
107107

108108
start_url: Optional[str] = None
109-
"""URL the session was asked to navigate to on creation, if any.
109+
"""URL the session was most recently asked to navigate to, if any.
110110
111111
Recorded for debugging. Navigation is fire-and-forget — the URL is dispatched to
112112
the browser without waiting for it to load, and any errors (DNS failure, bad

src/kernel/types/vaults/card_vault_item_state.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,11 @@ def __getattr__(self, attr: str) -> str: ...
3333

3434

3535
class LinkCardState(BaseModel):
36+
"""Issued Link cards retain encrypted card material for the fill operation.
37+
38+
Link cards do not expose aliases or support egress substitution.
39+
"""
40+
3641
provider: Literal["link"]
3742

3843
status: Literal[
@@ -47,8 +52,6 @@ class LinkCardState(BaseModel):
4752
caller-asserted reconciliation operation.
4853
"""
4954

50-
aliases: Optional[VaultCardAliases] = None
51-
5255
domains: Optional[List[str]] = None
5356

5457
masks: Optional[LinkCardStateMasks] = None

src/kernel/types/vaults/fill_vault_item_operation_request_param.py

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -34,10 +34,9 @@ class FillVaultItemOperationRequestParam(TypedDict, total=False):
3434
Fill in request order and stop on the first failure. This operation is
3535
not atomic: previously filled fields are not rolled back. Never submit
3636
the form or click buttons, though input/change events may trigger site
37-
behavior. Fill is the preferred browser-checkout path. Aliases remain an
38-
alternative for explicitly chosen egress-substitution integrations. Do not
39-
automatically retry or fall back to aliases after a failed or indeterminate
40-
operation.
37+
behavior. Link cards use fill for browser checkout and do not expose
38+
aliases or support egress substitution. Do not automatically retry a
39+
failed or indeterminate operation.
4140
4241
Secret values are never returned or included in operation logs, traces,
4342
audit events, or error details. This does not prevent an agent with

0 commit comments

Comments
 (0)