Skip to content

Commit 1927318

Browse files
feat(api): add schedules, agent list, skill-spec
1 parent 68f4b61 commit 1927318

26 files changed

+2285
-80
lines changed

.stats.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
configured_endpoints: 3
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
1+
configured_endpoints: 12
2+
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/warp-bnavetta%2Fwarp-api-3ee19d97da1711b8dfcba85f38c3c345fa96aaf78ea7f025e1ae490d17e97517.yml
3+
openapi_spec_hash: 2d03e7a248b1be5bd5600b62912cdab8
4+
config_hash: 9db55bfa03e8dd5e251342bd7491408c

api.md

Lines changed: 33 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,19 @@
33
Types:
44

55
```python
6-
from warp_agent_sdk.types import AmbientAgentConfig, AgentRunResponse
6+
from warp_agent_sdk.types import (
7+
AmbientAgentConfig,
8+
CloudEnvironmentConfig,
9+
McpServerConfig,
10+
RunCreatorInfo,
11+
AgentListResponse,
12+
AgentRunResponse,
13+
)
714
```
815

916
Methods:
1017

18+
- <code title="get /agent">client.agent.<a href="./src/warp_agent_sdk/resources/agent/agent.py">list</a>(\*\*<a href="src/warp_agent_sdk/types/agent_list_params.py">params</a>) -> <a href="./src/warp_agent_sdk/types/agent_list_response.py">AgentListResponse</a></code>
1119
- <code title="post /agent/run">client.agent.<a href="./src/warp_agent_sdk/resources/agent/agent.py">run</a>(\*\*<a href="src/warp_agent_sdk/types/agent_run_params.py">params</a>) -> <a href="./src/warp_agent_sdk/types/agent_run_response.py">AgentRunResponse</a></code>
1220

1321
## Runs
@@ -21,10 +29,34 @@ from warp_agent_sdk.types.agent import (
2129
RunSourceType,
2230
RunState,
2331
RunListResponse,
32+
RunCancelResponse,
2433
)
2534
```
2635

2736
Methods:
2837

2938
- <code title="get /agent/runs/{runId}">client.agent.runs.<a href="./src/warp_agent_sdk/resources/agent/runs.py">retrieve</a>(run_id) -> <a href="./src/warp_agent_sdk/types/agent/run_item.py">RunItem</a></code>
3039
- <code title="get /agent/runs">client.agent.runs.<a href="./src/warp_agent_sdk/resources/agent/runs.py">list</a>(\*\*<a href="src/warp_agent_sdk/types/agent/run_list_params.py">params</a>) -> <a href="./src/warp_agent_sdk/types/agent/run_list_response.py">RunListResponse</a></code>
40+
- <code title="post /agent/runs/{runId}/cancel">client.agent.runs.<a href="./src/warp_agent_sdk/resources/agent/runs.py">cancel</a>(run_id) -> str</code>
41+
42+
## Schedules
43+
44+
Types:
45+
46+
```python
47+
from warp_agent_sdk.types.agent import (
48+
ScheduledAgentItem,
49+
ScheduleListResponse,
50+
ScheduleDeleteResponse,
51+
)
52+
```
53+
54+
Methods:
55+
56+
- <code title="post /agent/schedules">client.agent.schedules.<a href="./src/warp_agent_sdk/resources/agent/schedules.py">create</a>(\*\*<a href="src/warp_agent_sdk/types/agent/schedule_create_params.py">params</a>) -> <a href="./src/warp_agent_sdk/types/agent/scheduled_agent_item.py">ScheduledAgentItem</a></code>
57+
- <code title="get /agent/schedules/{scheduleId}">client.agent.schedules.<a href="./src/warp_agent_sdk/resources/agent/schedules.py">retrieve</a>(schedule_id) -> <a href="./src/warp_agent_sdk/types/agent/scheduled_agent_item.py">ScheduledAgentItem</a></code>
58+
- <code title="put /agent/schedules/{scheduleId}">client.agent.schedules.<a href="./src/warp_agent_sdk/resources/agent/schedules.py">update</a>(schedule_id, \*\*<a href="src/warp_agent_sdk/types/agent/schedule_update_params.py">params</a>) -> <a href="./src/warp_agent_sdk/types/agent/scheduled_agent_item.py">ScheduledAgentItem</a></code>
59+
- <code title="get /agent/schedules">client.agent.schedules.<a href="./src/warp_agent_sdk/resources/agent/schedules.py">list</a>() -> <a href="./src/warp_agent_sdk/types/agent/schedule_list_response.py">ScheduleListResponse</a></code>
60+
- <code title="delete /agent/schedules/{scheduleId}">client.agent.schedules.<a href="./src/warp_agent_sdk/resources/agent/schedules.py">delete</a>(schedule_id) -> <a href="./src/warp_agent_sdk/types/agent/schedule_delete_response.py">ScheduleDeleteResponse</a></code>
61+
- <code title="post /agent/schedules/{scheduleId}/pause">client.agent.schedules.<a href="./src/warp_agent_sdk/resources/agent/schedules.py">pause</a>(schedule_id) -> <a href="./src/warp_agent_sdk/types/agent/scheduled_agent_item.py">ScheduledAgentItem</a></code>
62+
- <code title="post /agent/schedules/{scheduleId}/resume">client.agent.schedules.<a href="./src/warp_agent_sdk/resources/agent/schedules.py">resume</a>(schedule_id) -> <a href="./src/warp_agent_sdk/types/agent/scheduled_agent_item.py">ScheduledAgentItem</a></code>

src/warp_agent_sdk/resources/agent/__init__.py

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,14 @@
1616
AgentResourceWithStreamingResponse,
1717
AsyncAgentResourceWithStreamingResponse,
1818
)
19+
from .schedules import (
20+
SchedulesResource,
21+
AsyncSchedulesResource,
22+
SchedulesResourceWithRawResponse,
23+
AsyncSchedulesResourceWithRawResponse,
24+
SchedulesResourceWithStreamingResponse,
25+
AsyncSchedulesResourceWithStreamingResponse,
26+
)
1927

2028
__all__ = [
2129
"RunsResource",
@@ -24,6 +32,12 @@
2432
"AsyncRunsResourceWithRawResponse",
2533
"RunsResourceWithStreamingResponse",
2634
"AsyncRunsResourceWithStreamingResponse",
35+
"SchedulesResource",
36+
"AsyncSchedulesResource",
37+
"SchedulesResourceWithRawResponse",
38+
"AsyncSchedulesResourceWithRawResponse",
39+
"SchedulesResourceWithStreamingResponse",
40+
"AsyncSchedulesResourceWithStreamingResponse",
2741
"AgentResource",
2842
"AsyncAgentResource",
2943
"AgentResourceWithRawResponse",

src/warp_agent_sdk/resources/agent/agent.py

Lines changed: 124 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,10 +12,18 @@
1212
RunsResourceWithStreamingResponse,
1313
AsyncRunsResourceWithStreamingResponse,
1414
)
15-
from ...types import agent_run_params
15+
from ...types import agent_run_params, agent_list_params
1616
from ..._types import Body, Omit, Query, Headers, NotGiven, omit, not_given
1717
from ..._utils import maybe_transform, async_maybe_transform
1818
from ..._compat import cached_property
19+
from .schedules import (
20+
SchedulesResource,
21+
AsyncSchedulesResource,
22+
SchedulesResourceWithRawResponse,
23+
AsyncSchedulesResourceWithRawResponse,
24+
SchedulesResourceWithStreamingResponse,
25+
AsyncSchedulesResourceWithStreamingResponse,
26+
)
1927
from ..._resource import SyncAPIResource, AsyncAPIResource
2028
from ..._response import (
2129
to_raw_response_wrapper,
@@ -25,6 +33,7 @@
2533
)
2634
from ..._base_client import make_request_options
2735
from ...types.agent_run_response import AgentRunResponse
36+
from ...types.agent_list_response import AgentListResponse
2837
from ...types.ambient_agent_config_param import AmbientAgentConfigParam
2938

3039
__all__ = ["AgentResource", "AsyncAgentResource"]
@@ -35,6 +44,10 @@ class AgentResource(SyncAPIResource):
3544
def runs(self) -> RunsResource:
3645
return RunsResource(self._client)
3746

47+
@cached_property
48+
def schedules(self) -> SchedulesResource:
49+
return SchedulesResource(self._client)
50+
3851
@cached_property
3952
def with_raw_response(self) -> AgentResourceWithRawResponse:
4053
"""
@@ -54,6 +67,45 @@ def with_streaming_response(self) -> AgentResourceWithStreamingResponse:
5467
"""
5568
return AgentResourceWithStreamingResponse(self)
5669

70+
def list(
71+
self,
72+
*,
73+
repo: str | Omit = omit,
74+
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
75+
# The extra values given here take precedence over values defined on the client or passed to this method.
76+
extra_headers: Headers | None = None,
77+
extra_query: Query | None = None,
78+
extra_body: Body | None = None,
79+
timeout: float | httpx.Timeout | None | NotGiven = not_given,
80+
) -> AgentListResponse:
81+
"""
82+
Retrieve a list of available agents (skills) that can be used to run tasks.
83+
Agents are discovered from environments or a specific repository.
84+
85+
Args:
86+
repo: Optional repository specification to list agents from (format: "owner/repo"). If
87+
not provided, lists agents from all accessible environments.
88+
89+
extra_headers: Send extra headers
90+
91+
extra_query: Add additional query parameters to the request
92+
93+
extra_body: Add additional JSON properties to the request
94+
95+
timeout: Override the client-level default timeout for this request, in seconds
96+
"""
97+
return self._get(
98+
"/agent",
99+
options=make_request_options(
100+
extra_headers=extra_headers,
101+
extra_query=extra_query,
102+
extra_body=extra_body,
103+
timeout=timeout,
104+
query=maybe_transform({"repo": repo}, agent_list_params.AgentListParams),
105+
),
106+
cast_to=AgentListResponse,
107+
)
108+
57109
def run(
58110
self,
59111
*,
@@ -113,6 +165,10 @@ class AsyncAgentResource(AsyncAPIResource):
113165
def runs(self) -> AsyncRunsResource:
114166
return AsyncRunsResource(self._client)
115167

168+
@cached_property
169+
def schedules(self) -> AsyncSchedulesResource:
170+
return AsyncSchedulesResource(self._client)
171+
116172
@cached_property
117173
def with_raw_response(self) -> AsyncAgentResourceWithRawResponse:
118174
"""
@@ -132,6 +188,45 @@ def with_streaming_response(self) -> AsyncAgentResourceWithStreamingResponse:
132188
"""
133189
return AsyncAgentResourceWithStreamingResponse(self)
134190

191+
async def list(
192+
self,
193+
*,
194+
repo: str | Omit = omit,
195+
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
196+
# The extra values given here take precedence over values defined on the client or passed to this method.
197+
extra_headers: Headers | None = None,
198+
extra_query: Query | None = None,
199+
extra_body: Body | None = None,
200+
timeout: float | httpx.Timeout | None | NotGiven = not_given,
201+
) -> AgentListResponse:
202+
"""
203+
Retrieve a list of available agents (skills) that can be used to run tasks.
204+
Agents are discovered from environments or a specific repository.
205+
206+
Args:
207+
repo: Optional repository specification to list agents from (format: "owner/repo"). If
208+
not provided, lists agents from all accessible environments.
209+
210+
extra_headers: Send extra headers
211+
212+
extra_query: Add additional query parameters to the request
213+
214+
extra_body: Add additional JSON properties to the request
215+
216+
timeout: Override the client-level default timeout for this request, in seconds
217+
"""
218+
return await self._get(
219+
"/agent",
220+
options=make_request_options(
221+
extra_headers=extra_headers,
222+
extra_query=extra_query,
223+
extra_body=extra_body,
224+
timeout=timeout,
225+
query=await async_maybe_transform({"repo": repo}, agent_list_params.AgentListParams),
226+
),
227+
cast_to=AgentListResponse,
228+
)
229+
135230
async def run(
136231
self,
137232
*,
@@ -190,6 +285,9 @@ class AgentResourceWithRawResponse:
190285
def __init__(self, agent: AgentResource) -> None:
191286
self._agent = agent
192287

288+
self.list = to_raw_response_wrapper(
289+
agent.list,
290+
)
193291
self.run = to_raw_response_wrapper(
194292
agent.run,
195293
)
@@ -198,11 +296,18 @@ def __init__(self, agent: AgentResource) -> None:
198296
def runs(self) -> RunsResourceWithRawResponse:
199297
return RunsResourceWithRawResponse(self._agent.runs)
200298

299+
@cached_property
300+
def schedules(self) -> SchedulesResourceWithRawResponse:
301+
return SchedulesResourceWithRawResponse(self._agent.schedules)
302+
201303

202304
class AsyncAgentResourceWithRawResponse:
203305
def __init__(self, agent: AsyncAgentResource) -> None:
204306
self._agent = agent
205307

308+
self.list = async_to_raw_response_wrapper(
309+
agent.list,
310+
)
206311
self.run = async_to_raw_response_wrapper(
207312
agent.run,
208313
)
@@ -211,11 +316,18 @@ def __init__(self, agent: AsyncAgentResource) -> None:
211316
def runs(self) -> AsyncRunsResourceWithRawResponse:
212317
return AsyncRunsResourceWithRawResponse(self._agent.runs)
213318

319+
@cached_property
320+
def schedules(self) -> AsyncSchedulesResourceWithRawResponse:
321+
return AsyncSchedulesResourceWithRawResponse(self._agent.schedules)
322+
214323

215324
class AgentResourceWithStreamingResponse:
216325
def __init__(self, agent: AgentResource) -> None:
217326
self._agent = agent
218327

328+
self.list = to_streamed_response_wrapper(
329+
agent.list,
330+
)
219331
self.run = to_streamed_response_wrapper(
220332
agent.run,
221333
)
@@ -224,15 +336,26 @@ def __init__(self, agent: AgentResource) -> None:
224336
def runs(self) -> RunsResourceWithStreamingResponse:
225337
return RunsResourceWithStreamingResponse(self._agent.runs)
226338

339+
@cached_property
340+
def schedules(self) -> SchedulesResourceWithStreamingResponse:
341+
return SchedulesResourceWithStreamingResponse(self._agent.schedules)
342+
227343

228344
class AsyncAgentResourceWithStreamingResponse:
229345
def __init__(self, agent: AsyncAgentResource) -> None:
230346
self._agent = agent
231347

348+
self.list = async_to_streamed_response_wrapper(
349+
agent.list,
350+
)
232351
self.run = async_to_streamed_response_wrapper(
233352
agent.run,
234353
)
235354

236355
@cached_property
237356
def runs(self) -> AsyncRunsResourceWithStreamingResponse:
238357
return AsyncRunsResourceWithStreamingResponse(self._agent.runs)
358+
359+
@cached_property
360+
def schedules(self) -> AsyncSchedulesResourceWithStreamingResponse:
361+
return AsyncSchedulesResourceWithStreamingResponse(self._agent.schedules)

0 commit comments

Comments
 (0)