diff --git a/src/runloop_api_client/sdk/_types.py b/src/runloop_api_client/sdk/_types.py index 4d2accc46..92070988e 100644 --- a/src/runloop_api_client/sdk/_types.py +++ b/src/runloop_api_client/sdk/_types.py @@ -19,6 +19,7 @@ McpConfigListParams, ObjectDownloadParams, ScenarioUpdateParams, + AgentListPublicParams, BenchmarkCreateParams, BenchmarkUpdateParams, BlueprintCreateParams, @@ -191,6 +192,10 @@ class SDKAgentListParams(AgentListParams, BaseRequestOptions): pass +class SDKAgentListPublicParams(AgentListPublicParams, BaseRequestOptions): + pass + + class SDKAxonListParams(AxonListParams, BaseRequestOptions): pass diff --git a/src/runloop_api_client/sdk/agent.py b/src/runloop_api_client/sdk/agent.py index f5ee69a58..c938358aa 100644 --- a/src/runloop_api_client/sdk/agent.py +++ b/src/runloop_api_client/sdk/agent.py @@ -7,6 +7,7 @@ from ._types import ( BaseRequestOptions, + LongRequestOptions, ) from .._client import Runloop from ..types.agent_view import AgentView @@ -68,3 +69,18 @@ def get_info( self._id, **options, ) + + def delete( + self, + **options: Unpack[LongRequestOptions], + ) -> object: + """Delete this agent. This action is irreversible. + + :param options: Optional request configuration + :return: API response acknowledging deletion + :rtype: object + """ + return self._client.agents.delete( + self._id, + **options, + ) diff --git a/src/runloop_api_client/sdk/async_.py b/src/runloop_api_client/sdk/async_.py index d02a6a9f1..6319e02bd 100644 --- a/src/runloop_api_client/sdk/async_.py +++ b/src/runloop_api_client/sdk/async_.py @@ -3,7 +3,7 @@ from __future__ import annotations import asyncio -from typing import Dict, Mapping, Optional +from typing import Dict, List, Mapping, Optional from pathlib import Path from datetime import timedelta from typing_extensions import Unpack @@ -27,6 +27,7 @@ SDKBenchmarkListParams, SDKBlueprintListParams, SDKMcpConfigListParams, + SDKAgentListPublicParams, SDKBenchmarkCreateParams, SDKBlueprintCreateParams, SDKMcpConfigCreateParams, @@ -57,6 +58,7 @@ from .async_storage_object import AsyncStorageObject from .async_scenario_builder import AsyncScenarioBuilder from ..types.object_create_params import ContentType +from ..types.agent_devbox_counts_view import AgentDevboxCountsView from ..types.shared_params.agent_source import Git, Npm, Pip, Object @@ -805,6 +807,35 @@ async def list( ) return [AsyncAgent(self._client, item.id, item) for item in page.agents] + async def list_public( + self, + **params: Unpack[SDKAgentListPublicParams], + ) -> List[AsyncAgent]: + """List public agents. + + :param params: See :typeddict:`~runloop_api_client.sdk._types.SDKAgentListPublicParams` for available parameters + :return: Collection of public agent wrappers + :rtype: list[AsyncAgent] + """ + page = await self._client.agents.list_public( + **params, + ) + return [AsyncAgent(self._client, item.id, item) for item in page.agents] + + async def devbox_counts( + self, + **options: Unpack[BaseRequestOptions], + ) -> AgentDevboxCountsView: + """Get devbox counts grouped by agent name. + + :param options: Optional request configuration + :return: Devbox counts per agent name and total + :rtype: AgentDevboxCountsView + """ + return await self._client.agents.devbox_counts( + **options, + ) + class AsyncScenarioOps: """Manage scenarios (async). Access via ``runloop.scenario``. diff --git a/src/runloop_api_client/sdk/async_agent.py b/src/runloop_api_client/sdk/async_agent.py index 8c9eca8ef..907bcf588 100644 --- a/src/runloop_api_client/sdk/async_agent.py +++ b/src/runloop_api_client/sdk/async_agent.py @@ -7,6 +7,7 @@ from ._types import ( BaseRequestOptions, + LongRequestOptions, ) from .._client import AsyncRunloop from ..types.agent_view import AgentView @@ -68,3 +69,18 @@ async def get_info( self._id, **options, ) + + async def delete( + self, + **options: Unpack[LongRequestOptions], + ) -> object: + """Delete this agent. This action is irreversible. + + :param options: Optional request configuration + :return: API response acknowledging deletion + :rtype: object + """ + return await self._client.agents.delete( + self._id, + **options, + ) diff --git a/src/runloop_api_client/sdk/sync.py b/src/runloop_api_client/sdk/sync.py index e6b672159..7d3afcb24 100644 --- a/src/runloop_api_client/sdk/sync.py +++ b/src/runloop_api_client/sdk/sync.py @@ -2,7 +2,7 @@ from __future__ import annotations -from typing import Dict, Mapping, Optional +from typing import Dict, List, Mapping, Optional from pathlib import Path from datetime import timedelta from typing_extensions import Unpack @@ -28,6 +28,7 @@ SDKBenchmarkListParams, SDKBlueprintListParams, SDKMcpConfigListParams, + SDKAgentListPublicParams, SDKBenchmarkCreateParams, SDKBlueprintCreateParams, SDKMcpConfigCreateParams, @@ -56,6 +57,7 @@ from ..types.secret_view import SecretView from ..lib.context_loader import TarFilter, build_directory_tar from ..types.object_create_params import ContentType +from ..types.agent_devbox_counts_view import AgentDevboxCountsView from ..types.shared_params.agent_source import Git, Npm, Pip, Object @@ -830,6 +832,35 @@ def list( ) return [Agent(self._client, item.id, item) for item in page.agents] + def list_public( + self, + **params: Unpack[SDKAgentListPublicParams], + ) -> List[Agent]: + """List public agents. + + :param params: See :typeddict:`~runloop_api_client.sdk._types.SDKAgentListPublicParams` for available parameters + :return: Collection of public agent wrappers + :rtype: list[Agent] + """ + page = self._client.agents.list_public( + **params, + ) + return [Agent(self._client, item.id, item) for item in page.agents] + + def devbox_counts( + self, + **options: Unpack[BaseRequestOptions], + ) -> AgentDevboxCountsView: + """Get devbox counts grouped by agent name. + + :param options: Optional request configuration + :return: Devbox counts per agent name and total + :rtype: AgentDevboxCountsView + """ + return self._client.agents.devbox_counts( + **options, + ) + class ScenarioOps: """Manage scenarios. Access via ``runloop.scenario``. diff --git a/uv.lock b/uv.lock index 7f63794ea..b35c4f478 100644 --- a/uv.lock +++ b/uv.lock @@ -2386,7 +2386,7 @@ wheels = [ [[package]] name = "runloop-api-client" -version = "1.18.1" +version = "1.19.0" source = { editable = "." } dependencies = [ { name = "anyio" },