diff --git a/.release-please-manifest.json b/.release-please-manifest.json index f3343e21..f38100a4 100644 --- a/.release-please-manifest.json +++ b/.release-please-manifest.json @@ -1,3 +1,3 @@ { - ".": "0.125.0" + ".": "0.126.0" } \ No newline at end of file diff --git a/CHANGELOG.md b/CHANGELOG.md index fa87bc60..d69a64ae 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,12 @@ # Changelog +## [0.126.0](https://github.com/kernel/kernel-python-sdk/compare/v0.125.0...v0.126.0) (2026-10-14) + + +### Features + +* support Link Pay Tokens when authorizing Link cards at checkout ([f081364](https://github.com/kernel/kernel-python-sdk/commit/f08136407428a84fd709d491d38694db026f70c8)) + ## [0.125.0](https://github.com/kernel/kernel-python-sdk/compare/v0.124.0...v0.125.0) (2026-10-13) diff --git a/pyproject.toml b/pyproject.toml index a9a2b552..e13b78ea 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [project] name = "kernel" -version = "0.125.0" +version = "0.126.0" description = "The official Python library for the kernel API" dynamic = ["readme"] license = "Apache-2.0" diff --git a/src/kernel/_version.py b/src/kernel/_version.py index 7bf40e5e..20748255 100644 --- a/src/kernel/_version.py +++ b/src/kernel/_version.py @@ -1,4 +1,4 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. __title__ = "kernel" -__version__ = "0.125.0" # x-release-please-version +__version__ = "0.126.0" # x-release-please-version diff --git a/src/kernel/resources/vaults/items.py b/src/kernel/resources/vaults/items.py index 79ca2ced..0cdc5164 100644 --- a/src/kernel/resources/vaults/items.py +++ b/src/kernel/resources/vaults/items.py @@ -155,10 +155,17 @@ def update( remain unchanged and explicit empty lists clear them. Wallet/provider binding and unsupported fields cannot change after authorization starts. An uncertain update enters recovery_required and must not be retried. Checkout cards may be - edited between authorizations. + edited between authorizations. A Link card authorized with browser_id and + page_url cannot be changed; delete it and create a new card with the updated + details. Args: - spec: Live payment card. Test-mode card creation is not supported. + spec: Live Link card request. Test-mode card creation is not supported. The spec can + be changed with PATCH until the card is authorized at a checkout. Authorize it + with the browser at final checkout: Kernel inspects the checkout through WebMCP + and internally chooses a merchant-bound Link Pay Token when supported or a + virtual card otherwise. Callers never receive or choose how the credential is + delivered. extra_headers: Send extra headers @@ -199,7 +206,9 @@ def update( remain unchanged and explicit empty lists clear them. Wallet/provider binding and unsupported fields cannot change after authorization starts. An uncertain update enters recovery_required and must not be retried. Checkout cards may be - edited between authorizations. + edited between authorizations. A Link card authorized with browser_id and + page_url cannot be changed; delete it and create a new card with the updated + details. Args: version: Expected current item version from the latest read. @@ -400,6 +409,8 @@ def perform_operation( *, id_or_name: str, type: Literal["authorize"], + browser_id: str | Omit = omit, + page_url: str | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -412,10 +423,11 @@ def perform_operation( `available_operations`, following its natural-language description. Availability is rechecked at execution time; unavailable operations return 409. Authorization and preparation may call an external provider and return updated state. Link - cards advertise authorize without checkout context. Eligible unused AgentCard - cards advertise prepare_checkout, which requires checkout context and obtains - device approval before native Square Pay. Keep the returned approval page open, - poll until ready_to_submit, then submit before preparation.expires_at. Unused + cards advertise authorize; pass browser_id and page_url from the final checkout + page so Kernel can inspect the checkout. Eligible unused AgentCard cards + advertise prepare_checkout, which requires checkout context and obtains device + approval before native Square Pay. Keep the returned approval page open, poll + until ready_to_submit, then submit before preparation.expires_at. Unused preparations expire automatically and cannot be reused. If spend-request creation is rejected with a non-retryable provider error, the card item is deleted and the provider's error code and message are returned. Rate limits @@ -430,6 +442,11 @@ def perform_operation( a failure, an `unknown` outcome, or a transport error. Args: + browser_id: Browser session ID, not a reusable browser name. The browser must have this + vault attached. + + page_url: Exact current top-level URL of the final checkout page open in browser_id. + extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -459,10 +476,11 @@ def perform_operation( `available_operations`, following its natural-language description. Availability is rechecked at execution time; unavailable operations return 409. Authorization and preparation may call an external provider and return updated state. Link - cards advertise authorize without checkout context. Eligible unused AgentCard - cards advertise prepare_checkout, which requires checkout context and obtains - device approval before native Square Pay. Keep the returned approval page open, - poll until ready_to_submit, then submit before preparation.expires_at. Unused + cards advertise authorize; pass browser_id and page_url from the final checkout + page so Kernel can inspect the checkout. Eligible unused AgentCard cards + advertise prepare_checkout, which requires checkout context and obtains device + approval before native Square Pay. Keep the returned approval page open, poll + until ready_to_submit, then submit before preparation.expires_at. Unused preparations expire automatically and cannot be reused. If spend-request creation is rejected with a non-retryable provider error, the card item is deleted and the provider's error code and message are returned. Rate limits @@ -513,10 +531,11 @@ def perform_operation( `available_operations`, following its natural-language description. Availability is rechecked at execution time; unavailable operations return 409. Authorization and preparation may call an external provider and return updated state. Link - cards advertise authorize without checkout context. Eligible unused AgentCard - cards advertise prepare_checkout, which requires checkout context and obtains - device approval before native Square Pay. Keep the returned approval page open, - poll until ready_to_submit, then submit before preparation.expires_at. Unused + cards advertise authorize; pass browser_id and page_url from the final checkout + page so Kernel can inspect the checkout. Eligible unused AgentCard cards + advertise prepare_checkout, which requires checkout context and obtains device + approval before native Square Pay. Keep the returned approval page open, poll + until ready_to_submit, then submit before preparation.expires_at. Unused preparations expire automatically and cannot be reused. If spend-request creation is rejected with a non-retryable provider error, the card item is deleted and the provider's error code and message are returned. Rate limits @@ -566,10 +585,11 @@ def perform_operation( `available_operations`, following its natural-language description. Availability is rechecked at execution time; unavailable operations return 409. Authorization and preparation may call an external provider and return updated state. Link - cards advertise authorize without checkout context. Eligible unused AgentCard - cards advertise prepare_checkout, which requires checkout context and obtains - device approval before native Square Pay. Keep the returned approval page open, - poll until ready_to_submit, then submit before preparation.expires_at. Unused + cards advertise authorize; pass browser_id and page_url from the final checkout + page so Kernel can inspect the checkout. Eligible unused AgentCard cards + advertise prepare_checkout, which requires checkout context and obtains device + approval before native Square Pay. Keep the returned approval page open, poll + until ready_to_submit, then submit before preparation.expires_at. Unused preparations expire automatically and cannot be reused. If spend-request creation is rejected with a non-retryable provider error, the card item is deleted and the provider's error code and message are returned. Rate limits @@ -614,10 +634,11 @@ def perform_operation( `available_operations`, following its natural-language description. Availability is rechecked at execution time; unavailable operations return 409. Authorization and preparation may call an external provider and return updated state. Link - cards advertise authorize without checkout context. Eligible unused AgentCard - cards advertise prepare_checkout, which requires checkout context and obtains - device approval before native Square Pay. Keep the returned approval page open, - poll until ready_to_submit, then submit before preparation.expires_at. Unused + cards advertise authorize; pass browser_id and page_url from the final checkout + page so Kernel can inspect the checkout. Eligible unused AgentCard cards + advertise prepare_checkout, which requires checkout context and obtains device + approval before native Square Pay. Keep the returned approval page open, poll + until ready_to_submit, then submit before preparation.expires_at. Unused preparations expire automatically and cannot be reused. If spend-request creation is rejected with a non-retryable provider error, the card item is deleted and the provider's error code and message are returned. Rate limits @@ -655,8 +676,8 @@ def perform_operation( *, id_or_name: str, browser_id: str, - fields: Iterable[VaultFillFieldParam], type: Literal["fill"], + fields: Iterable[VaultFillFieldParam] | Omit = omit, page_url: str | Omit = omit, timeout_ms: int | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. @@ -671,10 +692,11 @@ def perform_operation( `available_operations`, following its natural-language description. Availability is rechecked at execution time; unavailable operations return 409. Authorization and preparation may call an external provider and return updated state. Link - cards advertise authorize without checkout context. Eligible unused AgentCard - cards advertise prepare_checkout, which requires checkout context and obtains - device approval before native Square Pay. Keep the returned approval page open, - poll until ready_to_submit, then submit before preparation.expires_at. Unused + cards advertise authorize; pass browser_id and page_url from the final checkout + page so Kernel can inspect the checkout. Eligible unused AgentCard cards + advertise prepare_checkout, which requires checkout context and obtains device + approval before native Square Pay. Keep the returned approval page open, poll + until ready_to_submit, then submit before preparation.expires_at. Unused preparations expire automatically and cannot be reused. If spend-request creation is rejected with a non-retryable provider error, the card item is deleted and the provider's error code and message are returned. Rate limits @@ -691,13 +713,19 @@ def perform_operation( Args: browser_id: Browser session ID, not a reusable browser name. - fields: Field bindings for this step. No two bindings may resolve to the same element. + fields: Field bindings, when the item's advertised fill operation requires them. Each + selector is searched in the main frame and all descendant frames and must + resolve to exactly one editable input or select, matched directly or through a + containing element; zero or multiple candidates fail, and no two bindings may + resolve to the same element. Select elements match an option by value, not + label. All bindings are validated before any write, then filled in request + order, stopping at the first failure. If the page navigates or a target + disappears, fill stops rather than choosing another page or element. page_url: Exact current top-level page URL, including path, query, and fragment. Must match exactly one open page in the browser; zero or multiple matches fail. No - prefix or glob matching. Required for cards, which must use HTTPS without - embedded credentials. Optional for credentials, where omission requires exactly - one open page. + prefix or glob matching. When an item allows omitting it, the browser must have + exactly one open page. timeout_ms: Total operation deadline in milliseconds, not a per-field timeout. @@ -733,10 +761,11 @@ def perform_operation( `available_operations`, following its natural-language description. Availability is rechecked at execution time; unavailable operations return 409. Authorization and preparation may call an external provider and return updated state. Link - cards advertise authorize without checkout context. Eligible unused AgentCard - cards advertise prepare_checkout, which requires checkout context and obtains - device approval before native Square Pay. Keep the returned approval page open, - poll until ready_to_submit, then submit before preparation.expires_at. Unused + cards advertise authorize; pass browser_id and page_url from the final checkout + page so Kernel can inspect the checkout. Eligible unused AgentCard cards + advertise prepare_checkout, which requires checkout context and obtains device + approval before native Square Pay. Keep the returned approval page open, poll + until ready_to_submit, then submit before preparation.expires_at. Unused preparations expire automatically and cannot be reused. If spend-request creation is rejected with a non-retryable provider error, the card item is deleted and the provider's error code and message are returned. Rate limits @@ -781,10 +810,11 @@ def perform_operation( `available_operations`, following its natural-language description. Availability is rechecked at execution time; unavailable operations return 409. Authorization and preparation may call an external provider and return updated state. Link - cards advertise authorize without checkout context. Eligible unused AgentCard - cards advertise prepare_checkout, which requires checkout context and obtains - device approval before native Square Pay. Keep the returned approval page open, - poll until ready_to_submit, then submit before preparation.expires_at. Unused + cards advertise authorize; pass browser_id and page_url from the final checkout + page so Kernel can inspect the checkout. Eligible unused AgentCard cards + advertise prepare_checkout, which requires checkout context and obtains device + approval before native Square Pay. Keep the returned approval page open, poll + until ready_to_submit, then submit before preparation.expires_at. Unused preparations expire automatically and cannot be reused. If spend-request creation is rejected with a non-retryable provider error, the card item is deleted and the provider's error code and message are returned. Rate limits @@ -832,10 +862,11 @@ def perform_operation( `available_operations`, following its natural-language description. Availability is rechecked at execution time; unavailable operations return 409. Authorization and preparation may call an external provider and return updated state. Link - cards advertise authorize without checkout context. Eligible unused AgentCard - cards advertise prepare_checkout, which requires checkout context and obtains - device approval before native Square Pay. Keep the returned approval page open, - poll until ready_to_submit, then submit before preparation.expires_at. Unused + cards advertise authorize; pass browser_id and page_url from the final checkout + page so Kernel can inspect the checkout. Eligible unused AgentCard cards + advertise prepare_checkout, which requires checkout context and obtains device + approval before native Square Pay. Keep the returned approval page open, poll + until ready_to_submit, then submit before preparation.expires_at. Unused preparations expire automatically and cannot be reused. If spend-request creation is rejected with a non-retryable provider error, the card item is deleted and the provider's error code and message are returned. Rate limits @@ -887,10 +918,11 @@ def perform_operation( `available_operations`, following its natural-language description. Availability is rechecked at execution time; unavailable operations return 409. Authorization and preparation may call an external provider and return updated state. Link - cards advertise authorize without checkout context. Eligible unused AgentCard - cards advertise prepare_checkout, which requires checkout context and obtains - device approval before native Square Pay. Keep the returned approval page open, - poll until ready_to_submit, then submit before preparation.expires_at. Unused + cards advertise authorize; pass browser_id and page_url from the final checkout + page so Kernel can inspect the checkout. Eligible unused AgentCard cards + advertise prepare_checkout, which requires checkout context and obtains device + approval before native Square Pay. Keep the returned approval page open, poll + until ready_to_submit, then submit before preparation.expires_at. Unused preparations expire automatically and cannot be reused. If spend-request creation is rejected with a non-retryable provider error, the card item is deleted and the provider's error code and message are returned. Rate limits @@ -936,10 +968,11 @@ def perform_operation( `available_operations`, following its natural-language description. Availability is rechecked at execution time; unavailable operations return 409. Authorization and preparation may call an external provider and return updated state. Link - cards advertise authorize without checkout context. Eligible unused AgentCard - cards advertise prepare_checkout, which requires checkout context and obtains - device approval before native Square Pay. Keep the returned approval page open, - poll until ready_to_submit, then submit before preparation.expires_at. Unused + cards advertise authorize; pass browser_id and page_url from the final checkout + page so Kernel can inspect the checkout. Eligible unused AgentCard cards + advertise prepare_checkout, which requires checkout context and obtains device + approval before native Square Pay. Keep the returned approval page open, poll + until ready_to_submit, then submit before preparation.expires_at. Unused preparations expire automatically and cannot be reused. If spend-request creation is rejected with a non-retryable provider error, the card item is deleted and the provider's error code and message are returned. Rate limits @@ -991,10 +1024,11 @@ def perform_operation( `available_operations`, following its natural-language description. Availability is rechecked at execution time; unavailable operations return 409. Authorization and preparation may call an external provider and return updated state. Link - cards advertise authorize without checkout context. Eligible unused AgentCard - cards advertise prepare_checkout, which requires checkout context and obtains - device approval before native Square Pay. Keep the returned approval page open, - poll until ready_to_submit, then submit before preparation.expires_at. Unused + cards advertise authorize; pass browser_id and page_url from the final checkout + page so Kernel can inspect the checkout. Eligible unused AgentCard cards + advertise prepare_checkout, which requires checkout context and obtains device + approval before native Square Pay. Keep the returned approval page open, poll + until ready_to_submit, then submit before preparation.expires_at. Unused preparations expire automatically and cannot be reused. If spend-request creation is rejected with a non-retryable provider error, the card item is deleted and the provider's error code and message are returned. Rate limits @@ -1037,7 +1071,7 @@ def perform_operation( ["id_or_name", "type"], ["id_or_name", "amount", "currency", "occurred_at", "status", "transaction_type", "type"], ["id_or_name", "checkout", "type"], - ["id_or_name", "browser_id", "fields", "type"], + ["id_or_name", "browser_id", "type"], ["id_or_name", "browser_id", "page_url", "type"], ["id_or_name", "access_token", "type"], ["id_or_name", "bindings", "browser_id", "input", "page_url", "tool_ref", "type"], @@ -1059,6 +1093,8 @@ def perform_operation( | Literal["1pw_recover"] | Literal["1pw_update_access_token"] | Literal["webmcp_invoke"], + browser_id: str | Omit = omit, + page_url: str | Omit = omit, amount: int | Omit = omit, currency: str | Omit = omit, occurred_at: Union[str, datetime] | Omit = omit, @@ -1068,9 +1104,7 @@ def perform_operation( ] | Omit = omit, checkout: VaultCheckoutContextParam | Omit = omit, - browser_id: str | Omit = omit, fields: Iterable[VaultFillFieldParam] | Omit = omit, - page_url: str | Omit = omit, timeout_ms: int | Omit = omit, goal: str | Omit = omit, keywords: SequenceNotStr[str] | Omit = omit, @@ -1101,15 +1135,15 @@ def perform_operation( body=maybe_transform( { "type": type, + "browser_id": browser_id, + "page_url": page_url, "amount": amount, "currency": currency, "occurred_at": occurred_at, "status": status, "transaction_type": transaction_type, "checkout": checkout, - "browser_id": browser_id, "fields": fields, - "page_url": page_url, "timeout_ms": timeout_ms, "goal": goal, "keywords": keywords, @@ -1205,7 +1239,12 @@ def upsert( checkout instead. Args: - spec: Live payment card. Test-mode card creation is not supported. + spec: Live Link card request. Test-mode card creation is not supported. The spec can + be changed with PATCH until the card is authorized at a checkout. Authorize it + with the browser at final checkout: Kernel inspects the checkout through WebMCP + and internally chooses a merchant-bound Link Pay Token when supported or a + virtual card otherwise. Callers never receive or choose how the credential is + delivered. extra_headers: Send extra headers @@ -1452,10 +1491,17 @@ async def update( remain unchanged and explicit empty lists clear them. Wallet/provider binding and unsupported fields cannot change after authorization starts. An uncertain update enters recovery_required and must not be retried. Checkout cards may be - edited between authorizations. + edited between authorizations. A Link card authorized with browser_id and + page_url cannot be changed; delete it and create a new card with the updated + details. Args: - spec: Live payment card. Test-mode card creation is not supported. + spec: Live Link card request. Test-mode card creation is not supported. The spec can + be changed with PATCH until the card is authorized at a checkout. Authorize it + with the browser at final checkout: Kernel inspects the checkout through WebMCP + and internally chooses a merchant-bound Link Pay Token when supported or a + virtual card otherwise. Callers never receive or choose how the credential is + delivered. extra_headers: Send extra headers @@ -1496,7 +1542,9 @@ async def update( remain unchanged and explicit empty lists clear them. Wallet/provider binding and unsupported fields cannot change after authorization starts. An uncertain update enters recovery_required and must not be retried. Checkout cards may be - edited between authorizations. + edited between authorizations. A Link card authorized with browser_id and + page_url cannot be changed; delete it and create a new card with the updated + details. Args: version: Expected current item version from the latest read. @@ -1697,6 +1745,8 @@ async def perform_operation( *, id_or_name: str, type: Literal["authorize"], + browser_id: str | Omit = omit, + page_url: str | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -1709,10 +1759,11 @@ async def perform_operation( `available_operations`, following its natural-language description. Availability is rechecked at execution time; unavailable operations return 409. Authorization and preparation may call an external provider and return updated state. Link - cards advertise authorize without checkout context. Eligible unused AgentCard - cards advertise prepare_checkout, which requires checkout context and obtains - device approval before native Square Pay. Keep the returned approval page open, - poll until ready_to_submit, then submit before preparation.expires_at. Unused + cards advertise authorize; pass browser_id and page_url from the final checkout + page so Kernel can inspect the checkout. Eligible unused AgentCard cards + advertise prepare_checkout, which requires checkout context and obtains device + approval before native Square Pay. Keep the returned approval page open, poll + until ready_to_submit, then submit before preparation.expires_at. Unused preparations expire automatically and cannot be reused. If spend-request creation is rejected with a non-retryable provider error, the card item is deleted and the provider's error code and message are returned. Rate limits @@ -1727,6 +1778,11 @@ async def perform_operation( a failure, an `unknown` outcome, or a transport error. Args: + browser_id: Browser session ID, not a reusable browser name. The browser must have this + vault attached. + + page_url: Exact current top-level URL of the final checkout page open in browser_id. + extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -1756,10 +1812,11 @@ async def perform_operation( `available_operations`, following its natural-language description. Availability is rechecked at execution time; unavailable operations return 409. Authorization and preparation may call an external provider and return updated state. Link - cards advertise authorize without checkout context. Eligible unused AgentCard - cards advertise prepare_checkout, which requires checkout context and obtains - device approval before native Square Pay. Keep the returned approval page open, - poll until ready_to_submit, then submit before preparation.expires_at. Unused + cards advertise authorize; pass browser_id and page_url from the final checkout + page so Kernel can inspect the checkout. Eligible unused AgentCard cards + advertise prepare_checkout, which requires checkout context and obtains device + approval before native Square Pay. Keep the returned approval page open, poll + until ready_to_submit, then submit before preparation.expires_at. Unused preparations expire automatically and cannot be reused. If spend-request creation is rejected with a non-retryable provider error, the card item is deleted and the provider's error code and message are returned. Rate limits @@ -1810,10 +1867,11 @@ async def perform_operation( `available_operations`, following its natural-language description. Availability is rechecked at execution time; unavailable operations return 409. Authorization and preparation may call an external provider and return updated state. Link - cards advertise authorize without checkout context. Eligible unused AgentCard - cards advertise prepare_checkout, which requires checkout context and obtains - device approval before native Square Pay. Keep the returned approval page open, - poll until ready_to_submit, then submit before preparation.expires_at. Unused + cards advertise authorize; pass browser_id and page_url from the final checkout + page so Kernel can inspect the checkout. Eligible unused AgentCard cards + advertise prepare_checkout, which requires checkout context and obtains device + approval before native Square Pay. Keep the returned approval page open, poll + until ready_to_submit, then submit before preparation.expires_at. Unused preparations expire automatically and cannot be reused. If spend-request creation is rejected with a non-retryable provider error, the card item is deleted and the provider's error code and message are returned. Rate limits @@ -1863,10 +1921,11 @@ async def perform_operation( `available_operations`, following its natural-language description. Availability is rechecked at execution time; unavailable operations return 409. Authorization and preparation may call an external provider and return updated state. Link - cards advertise authorize without checkout context. Eligible unused AgentCard - cards advertise prepare_checkout, which requires checkout context and obtains - device approval before native Square Pay. Keep the returned approval page open, - poll until ready_to_submit, then submit before preparation.expires_at. Unused + cards advertise authorize; pass browser_id and page_url from the final checkout + page so Kernel can inspect the checkout. Eligible unused AgentCard cards + advertise prepare_checkout, which requires checkout context and obtains device + approval before native Square Pay. Keep the returned approval page open, poll + until ready_to_submit, then submit before preparation.expires_at. Unused preparations expire automatically and cannot be reused. If spend-request creation is rejected with a non-retryable provider error, the card item is deleted and the provider's error code and message are returned. Rate limits @@ -1911,10 +1970,11 @@ async def perform_operation( `available_operations`, following its natural-language description. Availability is rechecked at execution time; unavailable operations return 409. Authorization and preparation may call an external provider and return updated state. Link - cards advertise authorize without checkout context. Eligible unused AgentCard - cards advertise prepare_checkout, which requires checkout context and obtains - device approval before native Square Pay. Keep the returned approval page open, - poll until ready_to_submit, then submit before preparation.expires_at. Unused + cards advertise authorize; pass browser_id and page_url from the final checkout + page so Kernel can inspect the checkout. Eligible unused AgentCard cards + advertise prepare_checkout, which requires checkout context and obtains device + approval before native Square Pay. Keep the returned approval page open, poll + until ready_to_submit, then submit before preparation.expires_at. Unused preparations expire automatically and cannot be reused. If spend-request creation is rejected with a non-retryable provider error, the card item is deleted and the provider's error code and message are returned. Rate limits @@ -1952,8 +2012,8 @@ async def perform_operation( *, id_or_name: str, browser_id: str, - fields: Iterable[VaultFillFieldParam], type: Literal["fill"], + fields: Iterable[VaultFillFieldParam] | Omit = omit, page_url: str | Omit = omit, timeout_ms: int | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. @@ -1968,10 +2028,11 @@ async def perform_operation( `available_operations`, following its natural-language description. Availability is rechecked at execution time; unavailable operations return 409. Authorization and preparation may call an external provider and return updated state. Link - cards advertise authorize without checkout context. Eligible unused AgentCard - cards advertise prepare_checkout, which requires checkout context and obtains - device approval before native Square Pay. Keep the returned approval page open, - poll until ready_to_submit, then submit before preparation.expires_at. Unused + cards advertise authorize; pass browser_id and page_url from the final checkout + page so Kernel can inspect the checkout. Eligible unused AgentCard cards + advertise prepare_checkout, which requires checkout context and obtains device + approval before native Square Pay. Keep the returned approval page open, poll + until ready_to_submit, then submit before preparation.expires_at. Unused preparations expire automatically and cannot be reused. If spend-request creation is rejected with a non-retryable provider error, the card item is deleted and the provider's error code and message are returned. Rate limits @@ -1988,13 +2049,19 @@ async def perform_operation( Args: browser_id: Browser session ID, not a reusable browser name. - fields: Field bindings for this step. No two bindings may resolve to the same element. + fields: Field bindings, when the item's advertised fill operation requires them. Each + selector is searched in the main frame and all descendant frames and must + resolve to exactly one editable input or select, matched directly or through a + containing element; zero or multiple candidates fail, and no two bindings may + resolve to the same element. Select elements match an option by value, not + label. All bindings are validated before any write, then filled in request + order, stopping at the first failure. If the page navigates or a target + disappears, fill stops rather than choosing another page or element. page_url: Exact current top-level page URL, including path, query, and fragment. Must match exactly one open page in the browser; zero or multiple matches fail. No - prefix or glob matching. Required for cards, which must use HTTPS without - embedded credentials. Optional for credentials, where omission requires exactly - one open page. + prefix or glob matching. When an item allows omitting it, the browser must have + exactly one open page. timeout_ms: Total operation deadline in milliseconds, not a per-field timeout. @@ -2030,10 +2097,11 @@ async def perform_operation( `available_operations`, following its natural-language description. Availability is rechecked at execution time; unavailable operations return 409. Authorization and preparation may call an external provider and return updated state. Link - cards advertise authorize without checkout context. Eligible unused AgentCard - cards advertise prepare_checkout, which requires checkout context and obtains - device approval before native Square Pay. Keep the returned approval page open, - poll until ready_to_submit, then submit before preparation.expires_at. Unused + cards advertise authorize; pass browser_id and page_url from the final checkout + page so Kernel can inspect the checkout. Eligible unused AgentCard cards + advertise prepare_checkout, which requires checkout context and obtains device + approval before native Square Pay. Keep the returned approval page open, poll + until ready_to_submit, then submit before preparation.expires_at. Unused preparations expire automatically and cannot be reused. If spend-request creation is rejected with a non-retryable provider error, the card item is deleted and the provider's error code and message are returned. Rate limits @@ -2078,10 +2146,11 @@ async def perform_operation( `available_operations`, following its natural-language description. Availability is rechecked at execution time; unavailable operations return 409. Authorization and preparation may call an external provider and return updated state. Link - cards advertise authorize without checkout context. Eligible unused AgentCard - cards advertise prepare_checkout, which requires checkout context and obtains - device approval before native Square Pay. Keep the returned approval page open, - poll until ready_to_submit, then submit before preparation.expires_at. Unused + cards advertise authorize; pass browser_id and page_url from the final checkout + page so Kernel can inspect the checkout. Eligible unused AgentCard cards + advertise prepare_checkout, which requires checkout context and obtains device + approval before native Square Pay. Keep the returned approval page open, poll + until ready_to_submit, then submit before preparation.expires_at. Unused preparations expire automatically and cannot be reused. If spend-request creation is rejected with a non-retryable provider error, the card item is deleted and the provider's error code and message are returned. Rate limits @@ -2129,10 +2198,11 @@ async def perform_operation( `available_operations`, following its natural-language description. Availability is rechecked at execution time; unavailable operations return 409. Authorization and preparation may call an external provider and return updated state. Link - cards advertise authorize without checkout context. Eligible unused AgentCard - cards advertise prepare_checkout, which requires checkout context and obtains - device approval before native Square Pay. Keep the returned approval page open, - poll until ready_to_submit, then submit before preparation.expires_at. Unused + cards advertise authorize; pass browser_id and page_url from the final checkout + page so Kernel can inspect the checkout. Eligible unused AgentCard cards + advertise prepare_checkout, which requires checkout context and obtains device + approval before native Square Pay. Keep the returned approval page open, poll + until ready_to_submit, then submit before preparation.expires_at. Unused preparations expire automatically and cannot be reused. If spend-request creation is rejected with a non-retryable provider error, the card item is deleted and the provider's error code and message are returned. Rate limits @@ -2184,10 +2254,11 @@ async def perform_operation( `available_operations`, following its natural-language description. Availability is rechecked at execution time; unavailable operations return 409. Authorization and preparation may call an external provider and return updated state. Link - cards advertise authorize without checkout context. Eligible unused AgentCard - cards advertise prepare_checkout, which requires checkout context and obtains - device approval before native Square Pay. Keep the returned approval page open, - poll until ready_to_submit, then submit before preparation.expires_at. Unused + cards advertise authorize; pass browser_id and page_url from the final checkout + page so Kernel can inspect the checkout. Eligible unused AgentCard cards + advertise prepare_checkout, which requires checkout context and obtains device + approval before native Square Pay. Keep the returned approval page open, poll + until ready_to_submit, then submit before preparation.expires_at. Unused preparations expire automatically and cannot be reused. If spend-request creation is rejected with a non-retryable provider error, the card item is deleted and the provider's error code and message are returned. Rate limits @@ -2233,10 +2304,11 @@ async def perform_operation( `available_operations`, following its natural-language description. Availability is rechecked at execution time; unavailable operations return 409. Authorization and preparation may call an external provider and return updated state. Link - cards advertise authorize without checkout context. Eligible unused AgentCard - cards advertise prepare_checkout, which requires checkout context and obtains - device approval before native Square Pay. Keep the returned approval page open, - poll until ready_to_submit, then submit before preparation.expires_at. Unused + cards advertise authorize; pass browser_id and page_url from the final checkout + page so Kernel can inspect the checkout. Eligible unused AgentCard cards + advertise prepare_checkout, which requires checkout context and obtains device + approval before native Square Pay. Keep the returned approval page open, poll + until ready_to_submit, then submit before preparation.expires_at. Unused preparations expire automatically and cannot be reused. If spend-request creation is rejected with a non-retryable provider error, the card item is deleted and the provider's error code and message are returned. Rate limits @@ -2288,10 +2360,11 @@ async def perform_operation( `available_operations`, following its natural-language description. Availability is rechecked at execution time; unavailable operations return 409. Authorization and preparation may call an external provider and return updated state. Link - cards advertise authorize without checkout context. Eligible unused AgentCard - cards advertise prepare_checkout, which requires checkout context and obtains - device approval before native Square Pay. Keep the returned approval page open, - poll until ready_to_submit, then submit before preparation.expires_at. Unused + cards advertise authorize; pass browser_id and page_url from the final checkout + page so Kernel can inspect the checkout. Eligible unused AgentCard cards + advertise prepare_checkout, which requires checkout context and obtains device + approval before native Square Pay. Keep the returned approval page open, poll + until ready_to_submit, then submit before preparation.expires_at. Unused preparations expire automatically and cannot be reused. If spend-request creation is rejected with a non-retryable provider error, the card item is deleted and the provider's error code and message are returned. Rate limits @@ -2334,7 +2407,7 @@ async def perform_operation( ["id_or_name", "type"], ["id_or_name", "amount", "currency", "occurred_at", "status", "transaction_type", "type"], ["id_or_name", "checkout", "type"], - ["id_or_name", "browser_id", "fields", "type"], + ["id_or_name", "browser_id", "type"], ["id_or_name", "browser_id", "page_url", "type"], ["id_or_name", "access_token", "type"], ["id_or_name", "bindings", "browser_id", "input", "page_url", "tool_ref", "type"], @@ -2356,6 +2429,8 @@ async def perform_operation( | Literal["1pw_recover"] | Literal["1pw_update_access_token"] | Literal["webmcp_invoke"], + browser_id: str | Omit = omit, + page_url: str | Omit = omit, amount: int | Omit = omit, currency: str | Omit = omit, occurred_at: Union[str, datetime] | Omit = omit, @@ -2365,9 +2440,7 @@ async def perform_operation( ] | Omit = omit, checkout: VaultCheckoutContextParam | Omit = omit, - browser_id: str | Omit = omit, fields: Iterable[VaultFillFieldParam] | Omit = omit, - page_url: str | Omit = omit, timeout_ms: int | Omit = omit, goal: str | Omit = omit, keywords: SequenceNotStr[str] | Omit = omit, @@ -2398,15 +2471,15 @@ async def perform_operation( body=await async_maybe_transform( { "type": type, + "browser_id": browser_id, + "page_url": page_url, "amount": amount, "currency": currency, "occurred_at": occurred_at, "status": status, "transaction_type": transaction_type, "checkout": checkout, - "browser_id": browser_id, "fields": fields, - "page_url": page_url, "timeout_ms": timeout_ms, "goal": goal, "keywords": keywords, @@ -2502,7 +2575,12 @@ async def upsert( checkout instead. Args: - spec: Live payment card. Test-mode card creation is not supported. + spec: Live Link card request. Test-mode card creation is not supported. The spec can + be changed with PATCH until the card is authorized at a checkout. Authorize it + with the browser at final checkout: Kernel inspects the checkout through WebMCP + and internally chooses a merchant-bound Link Pay Token when supported or a + virtual card otherwise. Callers never receive or choose how the credential is + delivered. extra_headers: Send extra headers diff --git a/src/kernel/types/vaults/authorize_vault_item_operation_request_param.py b/src/kernel/types/vaults/authorize_vault_item_operation_request_param.py index d267b310..b2f9bee5 100644 --- a/src/kernel/types/vaults/authorize_vault_item_operation_request_param.py +++ b/src/kernel/types/vaults/authorize_vault_item_operation_request_param.py @@ -10,7 +10,16 @@ class AuthorizeVaultItemOperationRequestParam(TypedDict, total=False): """Authorize a Link or Kernel card using its existing purchase specification. - Use only after explicit user approval and when the item advertises authorize. Do not automatically retry provider failures or indeterminate outcomes. Checkout context is not accepted. + Use only after explicit user approval and when the item advertises authorize; follow the advertised operation's description. For a Link card, pass browser_id and page_url together while the browser is on the final checkout page: Kernel inspects that checkout, chooses how the credential is delivered, and limits fill to that checkout's origin in any browser with this vault attached. Omitting both issues a virtual card that fills any page on the merchant origin. Once approval has been requested, browser_id and page_url are ignored and authorize only re-checks the request. Browser and checkout inspection errors occur before any provider request and can be retried once the browser is on the checkout page. Kernel cards do not accept browser_id or page_url. """ type: Required[Literal["authorize"]] + + browser_id: str + """Browser session ID, not a reusable browser name. + + The browser must have this vault attached. + """ + + page_url: str + """Exact current top-level URL of the final checkout page open in browser_id.""" diff --git a/src/kernel/types/vaults/card_vault_item_spec.py b/src/kernel/types/vaults/card_vault_item_spec.py index 61f8fff4..9224fe34 100644 --- a/src/kernel/types/vaults/card_vault_item_spec.py +++ b/src/kernel/types/vaults/card_vault_item_spec.py @@ -57,12 +57,17 @@ class LinkCardVaultItemSpecTotal(BaseModel): class LinkCardVaultItemSpec(BaseModel): - """Live payment card. Test-mode card creation is not supported.""" + """Live Link card request. + + Test-mode card creation is not supported. The spec can be changed with PATCH until the card is authorized at a checkout. Authorize it with the browser at final checkout: Kernel inspects the checkout through WebMCP and internally chooses a merchant-bound Link Pay Token when supported or a virtual card otherwise. Callers never receive or choose how the credential is delivered. + """ amount: int """Integer amount in minor currency units. - Link permits at most 50000 per spend request. + Link Pay Token execution permits at most 500000; virtual-card execution permits + at most 50000. Authorization rejects a larger amount when the checkout requires + a virtual card. """ context: str @@ -83,7 +88,7 @@ class LinkCardVaultItemSpec(BaseModel): provider: Literal["link"] wallet: str - """Wallet item key used to mint this card.""" + """Connected Link wallet item key.""" expires_at: Optional[int] = None diff --git a/src/kernel/types/vaults/card_vault_item_spec_param.py b/src/kernel/types/vaults/card_vault_item_spec_param.py index 635bcdc1..08cd8545 100644 --- a/src/kernel/types/vaults/card_vault_item_spec_param.py +++ b/src/kernel/types/vaults/card_vault_item_spec_param.py @@ -57,12 +57,17 @@ class LinkCardVaultItemSpecTotal(TypedDict, total=False): class LinkCardVaultItemSpec(TypedDict, total=False): - """Live payment card. Test-mode card creation is not supported.""" + """Live Link card request. + + Test-mode card creation is not supported. The spec can be changed with PATCH until the card is authorized at a checkout. Authorize it with the browser at final checkout: Kernel inspects the checkout through WebMCP and internally chooses a merchant-bound Link Pay Token when supported or a virtual card otherwise. Callers never receive or choose how the credential is delivered. + """ amount: Required[int] """Integer amount in minor currency units. - Link permits at most 50000 per spend request. + Link Pay Token execution permits at most 500000; virtual-card execution permits + at most 50000. Authorization rejects a larger amount when the checkout requires + a virtual card. """ context: Required[str] @@ -83,7 +88,7 @@ class LinkCardVaultItemSpec(TypedDict, total=False): provider: Required[Literal["link"]] wallet: Required[str] - """Wallet item key used to mint this card.""" + """Connected Link wallet item key.""" expires_at: int diff --git a/src/kernel/types/vaults/fill_vault_item_operation_request_param.py b/src/kernel/types/vaults/fill_vault_item_operation_request_param.py index f00f5369..a86966d1 100644 --- a/src/kernel/types/vaults/fill_vault_item_operation_request_param.py +++ b/src/kernel/types/vaults/fill_vault_item_operation_request_param.py @@ -12,33 +12,18 @@ class FillVaultItemOperationRequestParam(TypedDict, total=False): """ - Fill selected fields from one ready credential or ready, unexpired Link or - Kernel card into a browser linked to its vault. - Only invoke when the item advertises `fill`. Browser and vault must belong - to the same project. Kernel checks access and allowed destinations before - filling; providing a page URL does not authorize a destination. - - Find exactly one open page matching `page_url`. Credential items may omit - `page_url` to require exactly one open page; cards require an HTTPS page URL. - Credentials have no destination allowlist. TOTP fields generate a current - code immediately before writing; their seeds never enter the browser. For each selector, search - the main frame and all descendant frames for editable inputs or selects - matched directly or contained within matching elements. Each selector must - resolve to one unique editable element across all frames; zero or multiple - candidates fail. Count each element once, even if multiple matching - containers contain it. Validate all bindings before filling. - Select elements match an option by its value, not its label. - If the page navigates or a target disappears during filling, stop rather - than selecting a different page or element. - - Fill in request order and stop on the first failure. This operation is - not atomic: previously filled fields are not rolled back. Never submit - the form or click buttons, though input/change events may trigger site - behavior. Link and Kernel cards use fill for browser checkout and do not expose - aliases or support egress substitution. Fill does not consume the item, so - a failed or indeterminate fill is safe to retry; a retry rewrites the same - fields. A retry right after an indeterminate fill may wait up to 15 seconds - for the earlier attempt's browser lock to expire. + Use a vault item in a browser session, for example to fill a login or + payment form. Only invoke when the item advertises `fill`; the advertised + operation describes the inputs that item needs. Requires `browser_id` and + usually `page_url`; some items also require `fields`. Browser and vault must + belong to the same project. Kernel checks access and allowed destinations + before filling; providing a page URL does not authorize a destination. + + Fill never submits forms or clicks buttons, though input and change events + may trigger site behavior. It is not atomic: completed steps are not rolled + back. Fill does not consume the item, so a failed or indeterminate fill is + safe to retry. A retry right after an indeterminate fill may wait up to 15 + seconds for the earlier attempt's browser lock to expire. Secret values are never returned or included in operation logs, traces, audit events, or error details. This does not prevent an agent with @@ -49,18 +34,26 @@ class FillVaultItemOperationRequestParam(TypedDict, total=False): browser_id: Required[str] """Browser session ID, not a reusable browser name.""" - fields: Required[Iterable[VaultFillFieldParam]] - """Field bindings for this step. No two bindings may resolve to the same element.""" - type: Required[Literal["fill"]] + fields: Iterable[VaultFillFieldParam] + """ + Field bindings, when the item's advertised fill operation requires them. Each + selector is searched in the main frame and all descendant frames and must + resolve to exactly one editable input or select, matched directly or through a + containing element; zero or multiple candidates fail, and no two bindings may + resolve to the same element. Select elements match an option by value, not + label. All bindings are validated before any write, then filled in request + order, stopping at the first failure. If the page navigates or a target + disappears, fill stops rather than choosing another page or element. + """ + page_url: str """Exact current top-level page URL, including path, query, and fragment. Must match exactly one open page in the browser; zero or multiple matches fail. - No prefix or glob matching. Required for cards, which must use HTTPS without - embedded credentials. Optional for credentials, where omission requires exactly - one open page. + No prefix or glob matching. When an item allows omitting it, the browser must + have exactly one open page. """ timeout_ms: int diff --git a/src/kernel/types/vaults/fill_vault_item_operation_result.py b/src/kernel/types/vaults/fill_vault_item_operation_result.py index 0f3f1855..8f63d2d7 100644 --- a/src/kernel/types/vaults/fill_vault_item_operation_result.py +++ b/src/kernel/types/vaults/fill_vault_item_operation_result.py @@ -11,17 +11,18 @@ class FillVaultItemOperationResult(BaseModel): fields: List[VaultFillFieldResult] - """Exactly one result per request binding, in request order. - - After the first failed or unknown field, all remaining fields are not_attempted. + """ + One result per request binding, in request order; empty when the fill used no + bindings. After the first failed or unknown field, all remaining fields are + not_attempted. """ status: Literal["completed", "failed", "unknown"] - """Completed only when all fields were filled. + """Completed when the fill finished. - Failed when execution stopped with known outcomes. Unknown when any field's - outcome cannot be determined. None of these statuses confirms payment or - merchant acceptance. + Failed when execution stopped with known outcomes. Unknown when an outcome + cannot be determined. Completed means values were supplied to the page, not that + the site accepted or submitted them. """ type: Literal["fill"] diff --git a/src/kernel/types/vaults/item_perform_operation_params.py b/src/kernel/types/vaults/item_perform_operation_params.py index 3db75e75..9c3cdbf1 100644 --- a/src/kernel/types/vaults/item_perform_operation_params.py +++ b/src/kernel/types/vaults/item_perform_operation_params.py @@ -34,6 +34,15 @@ class AuthorizeVaultItemOperationRequest(TypedDict, total=False): type: Required[Literal["authorize"]] + browser_id: str + """Browser session ID, not a reusable browser name. + + The browser must have this vault attached. + """ + + page_url: str + """Exact current top-level URL of the final checkout page open in browser_id.""" + class RestartVerificationVaultItemOperationRequest(TypedDict, total=False): id_or_name: Required[str] @@ -89,18 +98,26 @@ class FillVaultItemOperationRequest(TypedDict, total=False): browser_id: Required[str] """Browser session ID, not a reusable browser name.""" - fields: Required[Iterable[VaultFillFieldParam]] - """Field bindings for this step. No two bindings may resolve to the same element.""" - type: Required[Literal["fill"]] + fields: Iterable[VaultFillFieldParam] + """ + Field bindings, when the item's advertised fill operation requires them. Each + selector is searched in the main frame and all descendant frames and must + resolve to exactly one editable input or select, matched directly or through a + containing element; zero or multiple candidates fail, and no two bindings may + resolve to the same element. Select elements match an option by value, not + label. All bindings are validated before any write, then filled in request + order, stopping at the first failure. If the page navigates or a target + disappears, fill stops rather than choosing another page or element. + """ + page_url: str """Exact current top-level page URL, including path, query, and fragment. Must match exactly one open page in the browser; zero or multiple matches fail. - No prefix or glob matching. Required for cards, which must use HTTPS without - embedded credentials. Optional for credentials, where omission requires exactly - one open page. + No prefix or glob matching. When an item allows omitting it, the browser must + have exactly one open page. """ timeout_ms: int diff --git a/src/kernel/types/vaults/item_update_params.py b/src/kernel/types/vaults/item_update_params.py index 136a04d0..33e3ad08 100644 --- a/src/kernel/types/vaults/item_update_params.py +++ b/src/kernel/types/vaults/item_update_params.py @@ -15,7 +15,14 @@ class CardVaultItemUpdateRequest(TypedDict, total=False): id_or_name: Required[str] spec: Required[CardVaultItemSpecParam] - """Live payment card. Test-mode card creation is not supported.""" + """Live Link card request. + + Test-mode card creation is not supported. The spec can be changed with PATCH + until the card is authorized at a checkout. Authorize it with the browser at + final checkout: Kernel inspects the checkout through WebMCP and internally + chooses a merchant-bound Link Pay Token when supported or a virtual card + otherwise. Callers never receive or choose how the credential is delivered. + """ type: Literal["card"] diff --git a/src/kernel/types/vaults/item_upsert_params.py b/src/kernel/types/vaults/item_upsert_params.py index e77fbabf..3fa6c509 100644 --- a/src/kernel/types/vaults/item_upsert_params.py +++ b/src/kernel/types/vaults/item_upsert_params.py @@ -187,7 +187,14 @@ class CardVaultItemRequest(TypedDict, total=False): id_or_name: Required[str] spec: Required[CardVaultItemSpecParam] - """Live payment card. Test-mode card creation is not supported.""" + """Live Link card request. + + Test-mode card creation is not supported. The spec can be changed with PATCH + until the card is authorized at a checkout. Authorize it with the browser at + final checkout: Kernel inspects the checkout through WebMCP and internally + chooses a merchant-bound Link Pay Token when supported or a virtual card + otherwise. Callers never receive or choose how the credential is delivered. + """ type: Required[Literal["card"]] diff --git a/src/kernel/types/vaults/vault_item.py b/src/kernel/types/vaults/vault_item.py index 697f56d9..1b72d59c 100644 --- a/src/kernel/types/vaults/vault_item.py +++ b/src/kernel/types/vaults/vault_item.py @@ -98,6 +98,9 @@ class WalletVaultItem(BaseModel): action: Optional[VaultItemAction] = None + description: Optional[str] = None + """Server-generated provider and lifecycle guidance for agents.""" + expanded: Optional[WalletVaultItemExpanded] = None """Live, non-persisted data requested through the item GET expand parameter.""" @@ -151,7 +154,14 @@ class CardVaultItem(BaseModel): """Immutable item key assigned when the item is created.""" spec: CardVaultItemSpec - """Live payment card. Test-mode card creation is not supported.""" + """Live Link card request. + + Test-mode card creation is not supported. The spec can be changed with PATCH + until the card is authorized at a checkout. Authorize it with the browser at + final checkout: Kernel inspects the checkout through WebMCP and internally + chooses a merchant-bound Link Pay Token when supported or a virtual card + otherwise. Callers never receive or choose how the credential is delivered. + """ state: CardVaultItemState """Issued Link cards retain encrypted card material for the fill operation. diff --git a/src/kernel/types/vaults/vault_item_operation_response.py b/src/kernel/types/vaults/vault_item_operation_response.py index 0968dab7..4faf7487 100644 --- a/src/kernel/types/vaults/vault_item_operation_response.py +++ b/src/kernel/types/vaults/vault_item_operation_response.py @@ -100,6 +100,9 @@ class WalletVaultItem(BaseModel): action: Optional[VaultItemAction] = None + description: Optional[str] = None + """Server-generated provider and lifecycle guidance for agents.""" + expanded: Optional[WalletVaultItemExpanded] = None """Live, non-persisted data requested through the item GET expand parameter.""" @@ -153,7 +156,14 @@ class CardVaultItem(BaseModel): """Immutable item key assigned when the item is created.""" spec: CardVaultItemSpec - """Live payment card. Test-mode card creation is not supported.""" + """Live Link card request. + + Test-mode card creation is not supported. The spec can be changed with PATCH + until the card is authorized at a checkout. Authorize it with the browser at + final checkout: Kernel inspects the checkout through WebMCP and internally + chooses a merchant-bound Link Pay Token when supported or a virtual card + otherwise. Callers never receive or choose how the credential is delivered. + """ state: CardVaultItemState """Issued Link cards retain encrypted card material for the fill operation. diff --git a/tests/api_resources/vaults/test_items.py b/tests/api_resources/vaults/test_items.py index f69942ef..8e565e2e 100644 --- a/tests/api_resources/vaults/test_items.py +++ b/tests/api_resources/vaults/test_items.py @@ -491,6 +491,18 @@ def test_method_perform_operation_overload_1(self, client: Kernel) -> None: ) assert_matches_type(VaultItemOperationResponse, item, path=["response"]) + @pytest.mark.skip(reason="Mock server tests are disabled") + @parametrize + def test_method_perform_operation_with_all_params_overload_1(self, client: Kernel) -> None: + item = client.vaults.items.perform_operation( + key="key", + id_or_name="id_or_name", + type="authorize", + browser_id="x", + page_url="https://example.com", + ) + assert_matches_type(VaultItemOperationResponse, item, path=["response"]) + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_raw_response_perform_operation_overload_1(self, client: Kernel) -> None: @@ -839,24 +851,6 @@ def test_method_perform_operation_overload_6(self, client: Kernel) -> None: key="key", id_or_name="id_or_name", browser_id="browser-session-id", - fields=[ - { - "field": "number", - "selector": "#card-number", - }, - { - "field": "exp_month", - "selector": "#expiry-month", - }, - { - "field": "exp_year", - "selector": "#expiry-year", - }, - { - "field": "cvc", - "selector": "#security-code", - }, - ], type="fill", ) assert_matches_type(VaultItemOperationResponse, item, path=["response"]) @@ -868,6 +862,7 @@ def test_method_perform_operation_with_all_params_overload_6(self, client: Kerne key="key", id_or_name="id_or_name", browser_id="browser-session-id", + type="fill", fields=[ { "field": "number", @@ -890,7 +885,6 @@ def test_method_perform_operation_with_all_params_overload_6(self, client: Kerne "format": "MM/YY", }, ], - type="fill", page_url="https://shop.example/checkout", timeout_ms=1, ) @@ -903,24 +897,6 @@ def test_raw_response_perform_operation_overload_6(self, client: Kernel) -> None key="key", id_or_name="id_or_name", browser_id="browser-session-id", - fields=[ - { - "field": "number", - "selector": "#card-number", - }, - { - "field": "exp_month", - "selector": "#expiry-month", - }, - { - "field": "exp_year", - "selector": "#expiry-year", - }, - { - "field": "cvc", - "selector": "#security-code", - }, - ], type="fill", ) @@ -936,24 +912,6 @@ def test_streaming_response_perform_operation_overload_6(self, client: Kernel) - key="key", id_or_name="id_or_name", browser_id="browser-session-id", - fields=[ - { - "field": "number", - "selector": "#card-number", - }, - { - "field": "exp_month", - "selector": "#expiry-month", - }, - { - "field": "exp_year", - "selector": "#expiry-year", - }, - { - "field": "cvc", - "selector": "#security-code", - }, - ], type="fill", ) as response: assert not response.is_closed @@ -972,24 +930,6 @@ def test_path_params_perform_operation_overload_6(self, client: Kernel) -> None: key="key", id_or_name="", browser_id="browser-session-id", - fields=[ - { - "field": "number", - "selector": "#card-number", - }, - { - "field": "exp_month", - "selector": "#expiry-month", - }, - { - "field": "exp_year", - "selector": "#expiry-year", - }, - { - "field": "cvc", - "selector": "#security-code", - }, - ], type="fill", ) @@ -998,24 +938,6 @@ def test_path_params_perform_operation_overload_6(self, client: Kernel) -> None: key="", id_or_name="id_or_name", browser_id="browser-session-id", - fields=[ - { - "field": "number", - "selector": "#card-number", - }, - { - "field": "exp_month", - "selector": "#expiry-month", - }, - { - "field": "exp_year", - "selector": "#expiry-year", - }, - { - "field": "cvc", - "selector": "#security-code", - }, - ], type="fill", ) @@ -2498,6 +2420,18 @@ async def test_method_perform_operation_overload_1(self, async_client: AsyncKern ) assert_matches_type(VaultItemOperationResponse, item, path=["response"]) + @pytest.mark.skip(reason="Mock server tests are disabled") + @parametrize + async def test_method_perform_operation_with_all_params_overload_1(self, async_client: AsyncKernel) -> None: + item = await async_client.vaults.items.perform_operation( + key="key", + id_or_name="id_or_name", + type="authorize", + browser_id="x", + page_url="https://example.com", + ) + assert_matches_type(VaultItemOperationResponse, item, path=["response"]) + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_raw_response_perform_operation_overload_1(self, async_client: AsyncKernel) -> None: @@ -2846,24 +2780,6 @@ async def test_method_perform_operation_overload_6(self, async_client: AsyncKern key="key", id_or_name="id_or_name", browser_id="browser-session-id", - fields=[ - { - "field": "number", - "selector": "#card-number", - }, - { - "field": "exp_month", - "selector": "#expiry-month", - }, - { - "field": "exp_year", - "selector": "#expiry-year", - }, - { - "field": "cvc", - "selector": "#security-code", - }, - ], type="fill", ) assert_matches_type(VaultItemOperationResponse, item, path=["response"]) @@ -2875,6 +2791,7 @@ async def test_method_perform_operation_with_all_params_overload_6(self, async_c key="key", id_or_name="id_or_name", browser_id="browser-session-id", + type="fill", fields=[ { "field": "number", @@ -2897,7 +2814,6 @@ async def test_method_perform_operation_with_all_params_overload_6(self, async_c "format": "MM/YY", }, ], - type="fill", page_url="https://shop.example/checkout", timeout_ms=1, ) @@ -2910,24 +2826,6 @@ async def test_raw_response_perform_operation_overload_6(self, async_client: Asy key="key", id_or_name="id_or_name", browser_id="browser-session-id", - fields=[ - { - "field": "number", - "selector": "#card-number", - }, - { - "field": "exp_month", - "selector": "#expiry-month", - }, - { - "field": "exp_year", - "selector": "#expiry-year", - }, - { - "field": "cvc", - "selector": "#security-code", - }, - ], type="fill", ) @@ -2943,24 +2841,6 @@ async def test_streaming_response_perform_operation_overload_6(self, async_clien key="key", id_or_name="id_or_name", browser_id="browser-session-id", - fields=[ - { - "field": "number", - "selector": "#card-number", - }, - { - "field": "exp_month", - "selector": "#expiry-month", - }, - { - "field": "exp_year", - "selector": "#expiry-year", - }, - { - "field": "cvc", - "selector": "#security-code", - }, - ], type="fill", ) as response: assert not response.is_closed @@ -2979,24 +2859,6 @@ async def test_path_params_perform_operation_overload_6(self, async_client: Asyn key="key", id_or_name="", browser_id="browser-session-id", - fields=[ - { - "field": "number", - "selector": "#card-number", - }, - { - "field": "exp_month", - "selector": "#expiry-month", - }, - { - "field": "exp_year", - "selector": "#expiry-year", - }, - { - "field": "cvc", - "selector": "#security-code", - }, - ], type="fill", ) @@ -3005,24 +2867,6 @@ async def test_path_params_perform_operation_overload_6(self, async_client: Asyn key="", id_or_name="id_or_name", browser_id="browser-session-id", - fields=[ - { - "field": "number", - "selector": "#card-number", - }, - { - "field": "exp_month", - "selector": "#expiry-month", - }, - { - "field": "exp_year", - "selector": "#expiry-year", - }, - { - "field": "cvc", - "selector": "#security-code", - }, - ], type="fill", )