Skip to content

Commit 39ffff8

Browse files
feat: Accept a workload intent and use it to widen vendor coverage
Stainless-Generated-From: 3973041af0408ac2efd51b5cfe1c472ab6708c7b
1 parent c439359 commit 39ffff8

4 files changed

Lines changed: 43 additions & 0 deletions

File tree

src/kernel/resources/config_registry/config_registry.py

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -165,6 +165,7 @@ def resolve(
165165
*,
166166
url: str,
167167
allowed_proxy_countries: SequenceNotStr[str] | Omit = omit,
168+
intent: str | Omit = omit,
168169
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
169170
# The extra values given here take precedence over values defined on the client or passed to this method.
170171
extra_headers: Headers | None = None,
@@ -184,6 +185,14 @@ def resolve(
184185
configuration. Kernel may test a subset of allowed countries. When omitted,
185186
Kernel uses its default country selection.
186187
188+
intent: Plain-language description of the workload you intend to run against this
189+
target, in a sentence or two. Requires an https target, because the pass treats
190+
any non-HTTPS destination as off-site and will not drive an http one. Kernel
191+
uses it to drive the browser further into the site, where it can observe
192+
protections that only appear once a session interacts. When this target already
193+
has a verified configuration, the run confirms that one instead of re-deriving
194+
the whole matrix, so supplying an intent narrows what can be recommended.
195+
187196
extra_headers: Send extra headers
188197
189198
extra_query: Add additional query parameters to the request
@@ -198,6 +207,7 @@ def resolve(
198207
{
199208
"url": url,
200209
"allowed_proxy_countries": allowed_proxy_countries,
210+
"intent": intent,
201211
},
202212
config_registry_resolve_params.ConfigRegistryResolveParams,
203213
),
@@ -339,6 +349,7 @@ async def resolve(
339349
*,
340350
url: str,
341351
allowed_proxy_countries: SequenceNotStr[str] | Omit = omit,
352+
intent: str | Omit = omit,
342353
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
343354
# The extra values given here take precedence over values defined on the client or passed to this method.
344355
extra_headers: Headers | None = None,
@@ -358,6 +369,14 @@ async def resolve(
358369
configuration. Kernel may test a subset of allowed countries. When omitted,
359370
Kernel uses its default country selection.
360371
372+
intent: Plain-language description of the workload you intend to run against this
373+
target, in a sentence or two. Requires an https target, because the pass treats
374+
any non-HTTPS destination as off-site and will not drive an http one. Kernel
375+
uses it to drive the browser further into the site, where it can observe
376+
protections that only appear once a session interacts. When this target already
377+
has a verified configuration, the run confirms that one instead of re-deriving
378+
the whole matrix, so supplying an intent narrows what can be recommended.
379+
361380
extra_headers: Send extra headers
362381
363382
extra_query: Add additional query parameters to the request
@@ -372,6 +391,7 @@ async def resolve(
372391
{
373392
"url": url,
374393
"allowed_proxy_countries": allowed_proxy_countries,
394+
"intent": intent,
375395
},
376396
config_registry_resolve_params.ConfigRegistryResolveParams,
377397
),

src/kernel/types/config_registry_resolve_params.py

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,3 +19,14 @@ class ConfigRegistryResolveParams(TypedDict, total=False):
1919
configuration. Kernel may test a subset of allowed countries. When omitted,
2020
Kernel uses its default country selection.
2121
"""
22+
23+
intent: str
24+
"""
25+
Plain-language description of the workload you intend to run against this
26+
target, in a sentence or two. Requires an https target, because the pass treats
27+
any non-HTTPS destination as off-site and will not drive an http one. Kernel
28+
uses it to drive the browser further into the site, where it can observe
29+
protections that only appear once a session interacts. When this target already
30+
has a verified configuration, the run confirms that one instead of re-deriving
31+
the whole matrix, so supplying an intent narrows what can be recommended.
32+
"""

src/kernel/types/config_registry_response.py

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
22

33
from typing import Optional
4+
from typing_extensions import Literal
45

56
from .target import Target
67
from .._models import BaseModel
@@ -29,3 +30,12 @@ class ConfigRegistryResponse(BaseModel):
2930
prevented success is useful without a configuration. Not verified against this
3031
target. Null when nothing applicable was observed or no notes exist.
3132
"""
33+
34+
workload_outcome: Optional[
35+
Literal["completed", "turn_limit", "auth_required", "payment_required", "blocked", "error"]
36+
] = None
37+
"""How far the workload pass got, when an intent was supplied and a pass ran.
38+
39+
A run outcome rather than advice, so it is reported whether or not any guidance
40+
could be assembled. Null when no intent was supplied or no pass ran.
41+
"""

tests/api_resources/test_config_registry.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -119,6 +119,7 @@ def test_method_resolve_with_all_params(self, client: Kernel) -> None:
119119
config_registry = client.config_registry.resolve(
120120
url="https://example.com",
121121
allowed_proxy_countries=["US"],
122+
intent="search for a black hoodie and add it to the cart",
122123
)
123124
assert_matches_type(ConfigRegistryResponse, config_registry, path=["response"])
124125

@@ -251,6 +252,7 @@ async def test_method_resolve_with_all_params(self, async_client: AsyncKernel) -
251252
config_registry = await async_client.config_registry.resolve(
252253
url="https://example.com",
253254
allowed_proxy_countries=["US"],
255+
intent="search for a black hoodie and add it to the cart",
254256
)
255257
assert_matches_type(ConfigRegistryResponse, config_registry, path=["response"])
256258

0 commit comments

Comments
 (0)