Skip to content

Commit 4aa1225

Browse files
feat(api): add artifacts, worker_host, and new source types
1 parent 713ae7d commit 4aa1225

File tree

12 files changed

+100
-6
lines changed

12 files changed

+100
-6
lines changed

.stats.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
configured_endpoints: 3
2-
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/warp-bnavetta%2Fwarp-api-24029c9a3bb61d8ed8807686035c52060f97505d57ad827ae4debdec426ea0a0.yml
3-
openapi_spec_hash: ffe58e3dd2d1c5c1552af6c0330e6fb1
4-
config_hash: 386210f0e52fc8dd00b78e25011b9980
2+
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/warp-bnavetta%2Fwarp-api-48ffcddda2e2febbe761bbb643e04c4d260c5b6ba6378297f1e7af9793dedaa5.yml
3+
openapi_spec_hash: 1058ed679fc1f8a91d4f4c3136445dbc
4+
config_hash: efa7e85b4732b72432e1b5828d2b6b9c

api.md

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,13 @@ Methods:
1515
Types:
1616

1717
```python
18-
from warp_agent_sdk.types.agent import RunItem, RunSourceType, RunState, RunListResponse
18+
from warp_agent_sdk.types.agent import (
19+
ArtifactItem,
20+
RunItem,
21+
RunSourceType,
22+
RunState,
23+
RunListResponse,
24+
)
1925
```
2026

2127
Methods:

src/warp_agent_sdk/resources/agent/runs.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -89,6 +89,7 @@ def list(
8989
created_before: Union[str, datetime] | Omit = omit,
9090
creator: str | Omit = omit,
9191
cursor: str | Omit = omit,
92+
environment_id: str | Omit = omit,
9293
limit: int | Omit = omit,
9394
model_id: str | Omit = omit,
9495
source: RunSourceType | Omit = omit,
@@ -116,6 +117,8 @@ def list(
116117
117118
cursor: Pagination cursor from previous response
118119
120+
environment_id: Filter runs by environment ID
121+
119122
limit: Maximum number of runs to return
120123
121124
model_id: Filter by model ID
@@ -147,6 +150,7 @@ def list(
147150
"created_before": created_before,
148151
"creator": creator,
149152
"cursor": cursor,
153+
"environment_id": environment_id,
150154
"limit": limit,
151155
"model_id": model_id,
152156
"source": source,
@@ -221,6 +225,7 @@ async def list(
221225
created_before: Union[str, datetime] | Omit = omit,
222226
creator: str | Omit = omit,
223227
cursor: str | Omit = omit,
228+
environment_id: str | Omit = omit,
224229
limit: int | Omit = omit,
225230
model_id: str | Omit = omit,
226231
source: RunSourceType | Omit = omit,
@@ -248,6 +253,8 @@ async def list(
248253
249254
cursor: Pagination cursor from previous response
250255
256+
environment_id: Filter runs by environment ID
257+
251258
limit: Maximum number of runs to return
252259
253260
model_id: Filter by model ID
@@ -279,6 +286,7 @@ async def list(
279286
"created_before": created_before,
280287
"creator": creator,
281288
"cursor": cursor,
289+
"environment_id": environment_id,
282290
"limit": limit,
283291
"model_id": model_id,
284292
"source": source,

src/warp_agent_sdk/types/agent/__init__.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44

55
from .run_item import RunItem as RunItem
66
from .run_state import RunState as RunState
7+
from .artifact_item import ArtifactItem as ArtifactItem
78
from .run_list_params import RunListParams as RunListParams
89
from .run_source_type import RunSourceType as RunSourceType
910
from .run_list_response import RunListResponse as RunListResponse
Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2+
3+
from typing import Union, Optional
4+
from datetime import datetime
5+
from typing_extensions import Literal, Annotated, TypeAlias
6+
7+
from ..._utils import PropertyInfo
8+
from ..._models import BaseModel
9+
10+
__all__ = ["ArtifactItem", "PlanArtifact", "PlanArtifactPlan", "PullRequestArtifact", "PullRequestArtifactPullRequest"]
11+
12+
13+
class PlanArtifactPlan(BaseModel):
14+
document_uid: str
15+
"""Unique identifier for the plan document"""
16+
17+
notebook_uid: Optional[str] = None
18+
"""Unique identifier for the associated notebook"""
19+
20+
title: Optional[str] = None
21+
"""Title of the plan"""
22+
23+
24+
class PlanArtifact(BaseModel):
25+
artifact_type: Literal["plan"]
26+
"""Type of the artifact"""
27+
28+
created_at: datetime
29+
"""Timestamp when the artifact was created (RFC3339)"""
30+
31+
plan: PlanArtifactPlan
32+
33+
34+
class PullRequestArtifactPullRequest(BaseModel):
35+
branch: str
36+
"""Branch name for the pull request"""
37+
38+
url: str
39+
"""URL of the pull request"""
40+
41+
42+
class PullRequestArtifact(BaseModel):
43+
artifact_type: Literal["pull_request"]
44+
"""Type of the artifact"""
45+
46+
created_at: datetime
47+
"""Timestamp when the artifact was created (RFC3339)"""
48+
49+
pull_request: PullRequestArtifactPullRequest
50+
51+
52+
ArtifactItem: TypeAlias = Annotated[
53+
Union[PlanArtifact, PullRequestArtifact], PropertyInfo(discriminator="artifact_type")
54+
]

src/warp_agent_sdk/types/agent/run_item.py

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

3-
from typing import Optional
3+
from typing import List, Optional
44
from datetime import datetime
55
from typing_extensions import Literal
66

77
from ..._models import BaseModel
88
from .run_state import RunState
9+
from .artifact_item import ArtifactItem
910
from .run_source_type import RunSourceType
1011
from ..ambient_agent_config import AmbientAgentConfig
1112

@@ -77,6 +78,9 @@ class RunItem(BaseModel):
7778
agent_config: Optional[AmbientAgentConfig] = None
7879
"""Configuration for an ambient agent run"""
7980

81+
artifacts: Optional[List[ArtifactItem]] = None
82+
"""Artifacts created during the run (plans, pull requests, etc.)"""
83+
8084
conversation_id: Optional[str] = None
8185
"""UUID of the conversation associated with the run"""
8286

@@ -102,6 +106,8 @@ class RunItem(BaseModel):
102106
- SLACK: Created from Slack integration
103107
- LOCAL: Created from local CLI/app
104108
- SCHEDULED_AGENT: Created by a scheduled agent
109+
- WEB_APP: Created from the Warp web app
110+
- GITHUB_ACTION: Created from a GitHub action
105111
"""
106112

107113
started_at: Optional[datetime] = None

src/warp_agent_sdk/types/agent/run_list_params.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,9 @@ class RunListParams(TypedDict, total=False):
2929
cursor: str
3030
"""Pagination cursor from previous response"""
3131

32+
environment_id: Annotated[str, PropertyInfo(alias="environmentId")]
33+
"""Filter runs by environment ID"""
34+
3235
limit: int
3336
"""Maximum number of runs to return"""
3437

src/warp_agent_sdk/types/agent/run_source_type.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,4 +4,4 @@
44

55
__all__ = ["RunSourceType"]
66

7-
RunSourceType: TypeAlias = Literal["LINEAR", "API", "SLACK", "LOCAL", "SCHEDULED_AGENT"]
7+
RunSourceType: TypeAlias = Literal["LINEAR", "API", "SLACK", "LOCAL", "SCHEDULED_AGENT", "WEB_APP", "GITHUB_ACTION"]

src/warp_agent_sdk/types/ambient_agent_config.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,3 +51,9 @@ class AmbientAgentConfig(BaseModel):
5151

5252
name: Optional[str] = None
5353
"""Config name for searchability and traceability"""
54+
55+
worker_host: Optional[str] = None
56+
"""
57+
Self-hosted worker ID that should execute this task. If not specified or set to
58+
"warp", the task runs on Warp-hosted workers.
59+
"""

src/warp_agent_sdk/types/ambient_agent_config_param.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,3 +52,9 @@ class AmbientAgentConfigParam(TypedDict, total=False):
5252

5353
name: str
5454
"""Config name for searchability and traceability"""
55+
56+
worker_host: str
57+
"""
58+
Self-hosted worker ID that should execute this task. If not specified or set to
59+
"warp", the task runs on Warp-hosted workers.
60+
"""

0 commit comments

Comments
 (0)