diff --git a/.release-please-manifest.json b/.release-please-manifest.json index 4c56f2a48..57726a4f1 100644 --- a/.release-please-manifest.json +++ b/.release-please-manifest.json @@ -1,3 +1,3 @@ { - ".": "0.64.0" + ".": "0.65.0" } \ No newline at end of file diff --git a/.stats.yml b/.stats.yml index 3999b4279..3729fb940 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 94 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-d1cc15eb5ef9125c6eef2855fc9ccc1129f68116e20ac0a72a9c77a445909033.yml -openapi_spec_hash: 925f218d18ed7f1faff9389b318a674f -config_hash: 82af97d4d6dde958eed9f5e4ae55f75a +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-039b6fefb20a791ff9739695a732c6d70ac20788675486b6ef04c7a3911b938d.yml +openapi_spec_hash: 2a41f3c2f6c48a1787d06094240302a5 +config_hash: 95facb8cef59b5a1b05763b871bf6a4b diff --git a/CHANGELOG.md b/CHANGELOG.md index 9e01527ba..c86d1c0bb 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,18 @@ # Changelog +## 0.65.0 (2025-10-15) + +Full Changelog: [v0.64.0...v0.65.0](https://github.com/runloopai/api-client-python/compare/v0.64.0...v0.65.0) + +### Features + +* **api:** api update ([e6de5c0](https://github.com/runloopai/api-client-python/commit/e6de5c068a75512dd89a9240c281f46c69f14f07)) + + +### Chores + +* **internal:** detect missing future annotations with ruff ([e8914e3](https://github.com/runloopai/api-client-python/commit/e8914e3d40f6bbed2175d39f25e3b1da1c350225)) + ## 0.64.0 (2025-10-06) Full Changelog: [v0.63.0...v0.64.0](https://github.com/runloopai/api-client-python/compare/v0.63.0...v0.64.0) diff --git a/api.md b/api.md index 245907bbc..deb30848b 100644 --- a/api.md +++ b/api.md @@ -86,6 +86,8 @@ from runloop_api_client.types import ( DevboxExecutionDetailView, DevboxKillExecutionRequest, DevboxListView, + DevboxSendStdInRequest, + DevboxSendStdInResult, DevboxSnapshotListView, DevboxSnapshotView, DevboxTunnelView, @@ -198,7 +200,7 @@ Methods: - client.devboxes.executions.execute_async(id, \*\*params) -> DevboxAsyncExecutionDetailView - client.devboxes.executions.execute_sync(id, \*\*params) -> DevboxExecutionDetailView - client.devboxes.executions.kill(execution_id, \*, devbox_id, \*\*params) -> DevboxAsyncExecutionDetailView -- client.devboxes.executions.send_std_in(execution_id, \*, devbox_id, \*\*params) -> DevboxAsyncExecutionDetailView +- client.devboxes.executions.send_std_in(execution_id, \*, devbox_id, \*\*params) -> DevboxSendStdInResult - client.devboxes.executions.stream_stderr_updates(execution_id, \*, devbox_id, \*\*params) -> ExecutionUpdateChunk - client.devboxes.executions.stream_stdout_updates(execution_id, \*, devbox_id, \*\*params) -> ExecutionUpdateChunk diff --git a/pyproject.toml b/pyproject.toml index d43a7d9e1..e31882e20 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [project] name = "runloop_api_client" -version = "0.64.0" +version = "0.65.0" description = "The official Python library for the runloop API" dynamic = ["readme"] license = "MIT" @@ -234,6 +234,8 @@ select = [ "B", # remove unused imports "F401", + # check for missing future annotations + "FA102", # bare except statements "E722", # unused arguments @@ -256,6 +258,8 @@ unfixable = [ "T203", ] +extend-safe-fixes = ["FA102"] + [tool.ruff.lint.flake8-tidy-imports.banned-api] "functools.lru_cache".msg = "This function does not retain type information for the wrapped function's arguments; The `lru_cache` function from `_utils` should be used instead" diff --git a/src/runloop_api_client/_version.py b/src/runloop_api_client/_version.py index 86a8c7253..4608f59f0 100644 --- a/src/runloop_api_client/_version.py +++ b/src/runloop_api_client/_version.py @@ -1,4 +1,4 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. __title__ = "runloop_api_client" -__version__ = "0.64.0" # x-release-please-version +__version__ = "0.65.0" # x-release-please-version diff --git a/src/runloop_api_client/resources/devboxes/devboxes.py b/src/runloop_api_client/resources/devboxes/devboxes.py index 407d0e22b..00de4ba45 100644 --- a/src/runloop_api_client/resources/devboxes/devboxes.py +++ b/src/runloop_api_client/resources/devboxes/devboxes.py @@ -724,6 +724,7 @@ def execute( *, command: str, command_id: str = str(uuid7()), + last_n: str | Omit = omit, optimistic_timeout: Optional[int] | Omit = omit, shell_name: Optional[str] | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. @@ -738,6 +739,8 @@ def execute( Execute a command with a known command ID on a devbox, optimistically waiting for it to complete within the specified timeout. If it completes in time, return the result. If not, return a status indicating the command is still running. + Note: attach_stdin parameter is not supported; use execute_async for stdin + support. Args: command: The command to execute via the Devbox shell. By default, commands are run from @@ -747,6 +750,8 @@ def execute( command_id: The command ID in UUIDv7 string format for idempotency and tracking + last_n: Last n lines of standard error / standard out to return (default: 100) + optimistic_timeout: Timeout in seconds to wait for command completion. Operation is not killed. Max is 600 seconds. @@ -785,6 +790,7 @@ def execute( extra_body=extra_body, timeout=timeout, idempotency_key=idempotency_key, + query=maybe_transform({"last_n": last_n}, devbox_execute_params.DevboxExecuteParams), ), cast_to=DevboxAsyncExecutionDetailView, ) @@ -847,6 +853,7 @@ def execute_async( id: str, *, command: str, + attach_stdin: Optional[bool] | Omit = omit, shell_name: Optional[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. @@ -866,6 +873,9 @@ def execute_async( specified the command is run from the directory based on the recent state of the persistent shell. + attach_stdin: Whether to attach stdin streaming for async commands. Not valid for execute_sync + endpoint. Defaults to false if not specified. + shell_name: The name of the persistent shell to create or use if already created. When using a persistent shell, the command will run from the directory at the end of the previous command and environment variables will be preserved. @@ -887,6 +897,7 @@ def execute_async( body=maybe_transform( { "command": command, + "attach_stdin": attach_stdin, "shell_name": shell_name, }, devbox_execute_async_params.DevboxExecuteAsyncParams, @@ -908,6 +919,7 @@ def execute_sync( id: str, *, command: str, + attach_stdin: Optional[bool] | Omit = omit, shell_name: Optional[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. @@ -919,7 +931,8 @@ def execute_sync( ) -> DevboxExecutionDetailView: """ Execute a bash command in the Devbox shell, await the command completion and - return the output. + return the output. Note: attach_stdin parameter is not supported for synchronous + execution. .. deprecated:: Use execute, executeAsync, or executeAndAwaitCompletion instead. @@ -930,6 +943,9 @@ def execute_sync( specified the command is run from the directory based on the recent state of the persistent shell. + attach_stdin: Whether to attach stdin streaming for async commands. Not valid for execute_sync + endpoint. Defaults to false if not specified. + shell_name: The name of the persistent shell to create or use if already created. When using a persistent shell, the command will run from the directory at the end of the previous command and environment variables will be preserved. @@ -953,6 +969,7 @@ def execute_sync( body=maybe_transform( { "command": command, + "attach_stdin": attach_stdin, "shell_name": shell_name, }, devbox_execute_sync_params.DevboxExecuteSyncParams, @@ -1256,6 +1273,7 @@ def snapshot_disk( self, id: str, *, + commit_message: Optional[str] | Omit = omit, metadata: Optional[Dict[str, str]] | Omit = omit, name: Optional[str] | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. @@ -1271,6 +1289,8 @@ def snapshot_disk( enable launching future Devboxes with the same disk state. Args: + commit_message: (Optional) Commit message associated with the snapshot (max 1000 characters) + metadata: (Optional) Metadata used to describe the snapshot name: (Optional) A user specified name to give the snapshot @@ -1293,6 +1313,7 @@ def snapshot_disk( f"/v1/devboxes/{id}/snapshot_disk", body=maybe_transform( { + "commit_message": commit_message, "metadata": metadata, "name": name, }, @@ -1312,6 +1333,7 @@ def snapshot_disk_async( self, id: str, *, + commit_message: Optional[str] | Omit = omit, metadata: Optional[Dict[str, str]] | Omit = omit, name: Optional[str] | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. @@ -1328,6 +1350,8 @@ def snapshot_disk_async( monitored using the query endpoint. Args: + commit_message: (Optional) Commit message associated with the snapshot (max 1000 characters) + metadata: (Optional) Metadata used to describe the snapshot name: (Optional) A user specified name to give the snapshot @@ -1348,6 +1372,7 @@ def snapshot_disk_async( f"/v1/devboxes/{id}/snapshot_disk_async", body=maybe_transform( { + "commit_message": commit_message, "metadata": metadata, "name": name, }, @@ -1474,6 +1499,7 @@ def wait_for_command( *, devbox_id: str, statuses: List[Literal["queued", "running", "completed"]], + last_n: str | Omit = omit, timeout_seconds: Optional[int] | 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. @@ -1492,6 +1518,8 @@ def wait_for_command( provided. The command will be returned as soon as it reaches any of the provided statuses. + last_n: Last n lines of standard error / standard out to return (default: 100) + timeout_seconds: (Optional) Timeout in seconds to wait for the status, up to 60 seconds. Defaults to 60 seconds. @@ -1524,6 +1552,7 @@ def wait_for_command( extra_body=extra_body, timeout=timeout, idempotency_key=idempotency_key, + query=maybe_transform({"last_n": last_n}, devbox_wait_for_command_params.DevboxWaitForCommandParams), ), cast_to=DevboxAsyncExecutionDetailView, ) @@ -2175,6 +2204,7 @@ async def execute( *, command: str, command_id: str = str(uuid7()), + last_n: str | Omit = omit, optimistic_timeout: Optional[int] | Omit = omit, shell_name: Optional[str] | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. @@ -2189,6 +2219,8 @@ async def execute( Execute a command with a known command ID on a devbox, optimistically waiting for it to complete within the specified timeout. If it completes in time, return the result. If not, return a status indicating the command is still running. + Note: attach_stdin parameter is not supported; use execute_async for stdin + support. Args: command: The command to execute via the Devbox shell. By default, commands are run from @@ -2198,6 +2230,8 @@ async def execute( command_id: The command ID in UUIDv7 string format for idempotency and tracking + last_n: Last n lines of standard error / standard out to return (default: 100) + optimistic_timeout: Timeout in seconds to wait for command completion. Operation is not killed. Max is 600 seconds. @@ -2236,6 +2270,7 @@ async def execute( extra_body=extra_body, timeout=timeout, idempotency_key=idempotency_key, + query=await async_maybe_transform({"last_n": last_n}, devbox_execute_params.DevboxExecuteParams), ), cast_to=DevboxAsyncExecutionDetailView, ) @@ -2299,6 +2334,7 @@ async def execute_async( id: str, *, command: str, + attach_stdin: Optional[bool] | Omit = omit, shell_name: Optional[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. @@ -2318,6 +2354,9 @@ async def execute_async( specified the command is run from the directory based on the recent state of the persistent shell. + attach_stdin: Whether to attach stdin streaming for async commands. Not valid for execute_sync + endpoint. Defaults to false if not specified. + shell_name: The name of the persistent shell to create or use if already created. When using a persistent shell, the command will run from the directory at the end of the previous command and environment variables will be preserved. @@ -2339,6 +2378,7 @@ async def execute_async( body=await async_maybe_transform( { "command": command, + "attach_stdin": attach_stdin, "shell_name": shell_name, }, devbox_execute_async_params.DevboxExecuteAsyncParams, @@ -2360,6 +2400,7 @@ async def execute_sync( id: str, *, command: str, + attach_stdin: Optional[bool] | Omit = omit, shell_name: Optional[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. @@ -2371,7 +2412,8 @@ async def execute_sync( ) -> DevboxExecutionDetailView: """ Execute a bash command in the Devbox shell, await the command completion and - return the output. + return the output. Note: attach_stdin parameter is not supported for synchronous + execution. .. deprecated:: Use execute, executeAsync, or executeAndAwaitCompletion instead. @@ -2382,6 +2424,9 @@ async def execute_sync( specified the command is run from the directory based on the recent state of the persistent shell. + attach_stdin: Whether to attach stdin streaming for async commands. Not valid for execute_sync + endpoint. Defaults to false if not specified. + shell_name: The name of the persistent shell to create or use if already created. When using a persistent shell, the command will run from the directory at the end of the previous command and environment variables will be preserved. @@ -2405,6 +2450,7 @@ async def execute_sync( body=await async_maybe_transform( { "command": command, + "attach_stdin": attach_stdin, "shell_name": shell_name, }, devbox_execute_sync_params.DevboxExecuteSyncParams, @@ -2708,6 +2754,7 @@ async def snapshot_disk( self, id: str, *, + commit_message: Optional[str] | Omit = omit, metadata: Optional[Dict[str, str]] | Omit = omit, name: Optional[str] | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. @@ -2723,6 +2770,8 @@ async def snapshot_disk( enable launching future Devboxes with the same disk state. Args: + commit_message: (Optional) Commit message associated with the snapshot (max 1000 characters) + metadata: (Optional) Metadata used to describe the snapshot name: (Optional) A user specified name to give the snapshot @@ -2745,6 +2794,7 @@ async def snapshot_disk( f"/v1/devboxes/{id}/snapshot_disk", body=await async_maybe_transform( { + "commit_message": commit_message, "metadata": metadata, "name": name, }, @@ -2764,6 +2814,7 @@ async def snapshot_disk_async( self, id: str, *, + commit_message: Optional[str] | Omit = omit, metadata: Optional[Dict[str, str]] | Omit = omit, name: Optional[str] | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. @@ -2780,6 +2831,8 @@ async def snapshot_disk_async( monitored using the query endpoint. Args: + commit_message: (Optional) Commit message associated with the snapshot (max 1000 characters) + metadata: (Optional) Metadata used to describe the snapshot name: (Optional) A user specified name to give the snapshot @@ -2800,6 +2853,7 @@ async def snapshot_disk_async( f"/v1/devboxes/{id}/snapshot_disk_async", body=await async_maybe_transform( { + "commit_message": commit_message, "metadata": metadata, "name": name, }, @@ -2926,6 +2980,7 @@ async def wait_for_command( *, devbox_id: str, statuses: List[Literal["queued", "running", "completed"]], + last_n: str | Omit = omit, timeout_seconds: Optional[int] | 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. @@ -2944,6 +2999,8 @@ async def wait_for_command( provided. The command will be returned as soon as it reaches any of the provided statuses. + last_n: Last n lines of standard error / standard out to return (default: 100) + timeout_seconds: (Optional) Timeout in seconds to wait for the status, up to 60 seconds. Defaults to 60 seconds. @@ -2976,6 +3033,9 @@ async def wait_for_command( extra_body=extra_body, timeout=timeout, idempotency_key=idempotency_key, + query=await async_maybe_transform( + {"last_n": last_n}, devbox_wait_for_command_params.DevboxWaitForCommandParams + ), ), cast_to=DevboxAsyncExecutionDetailView, ) diff --git a/src/runloop_api_client/resources/devboxes/disk_snapshots.py b/src/runloop_api_client/resources/devboxes/disk_snapshots.py index 38a91fd8d..3575b41f0 100644 --- a/src/runloop_api_client/resources/devboxes/disk_snapshots.py +++ b/src/runloop_api_client/resources/devboxes/disk_snapshots.py @@ -49,6 +49,7 @@ def update( self, id: str, *, + commit_message: Optional[str] | Omit = omit, metadata: Optional[Dict[str, str]] | Omit = omit, name: Optional[str] | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. @@ -65,6 +66,8 @@ def update( replaced. Args: + commit_message: (Optional) Commit message associated with the snapshot (max 1000 characters) + metadata: (Optional) Metadata used to describe the snapshot name: (Optional) A user specified name to give the snapshot @@ -85,6 +88,7 @@ def update( f"/v1/devboxes/disk_snapshots/{id}", body=maybe_transform( { + "commit_message": commit_message, "metadata": metadata, "name": name, }, @@ -260,6 +264,7 @@ async def update( self, id: str, *, + commit_message: Optional[str] | Omit = omit, metadata: Optional[Dict[str, str]] | Omit = omit, name: Optional[str] | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. @@ -276,6 +281,8 @@ async def update( replaced. Args: + commit_message: (Optional) Commit message associated with the snapshot (max 1000 characters) + metadata: (Optional) Metadata used to describe the snapshot name: (Optional) A user specified name to give the snapshot @@ -296,6 +303,7 @@ async def update( f"/v1/devboxes/disk_snapshots/{id}", body=await async_maybe_transform( { + "commit_message": commit_message, "metadata": metadata, "name": name, }, diff --git a/src/runloop_api_client/resources/devboxes/executions.py b/src/runloop_api_client/resources/devboxes/executions.py index 6f4189c96..233ae6e50 100755 --- a/src/runloop_api_client/resources/devboxes/executions.py +++ b/src/runloop_api_client/resources/devboxes/executions.py @@ -33,6 +33,7 @@ execution_stream_stdout_updates_params, ) from ...lib.polling_async import async_poll_until +from ...types.devbox_send_std_in_result import DevboxSendStdInResult from ...types.devbox_execution_detail_view import DevboxExecutionDetailView from ...types.devboxes.execution_update_chunk import ExecutionUpdateChunk from ...types.devbox_async_execution_detail_view import DevboxAsyncExecutionDetailView @@ -88,7 +89,7 @@ def retrieve( stdout/error and the exit code if complete. Args: - last_n: Last n lines of standard error / standard out to return + last_n: Last n lines of standard error / standard out to return (default: 100) extra_headers: Send extra headers @@ -169,6 +170,7 @@ def execute_async( id: str, *, command: str, + attach_stdin: Optional[bool] | Omit = omit, shell_name: Optional[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. @@ -188,6 +190,9 @@ def execute_async( specified the command is run from the directory based on the recent state of the persistent shell. + attach_stdin: Whether to attach stdin streaming for async commands. Not valid for execute_sync + endpoint. Defaults to false if not specified. + shell_name: The name of the persistent shell to create or use if already created. When using a persistent shell, the command will run from the directory at the end of the previous command and environment variables will be preserved. @@ -209,6 +214,7 @@ def execute_async( body=maybe_transform( { "command": command, + "attach_stdin": attach_stdin, "shell_name": shell_name, }, execution_execute_async_params.ExecutionExecuteAsyncParams, @@ -229,6 +235,7 @@ def execute_sync( id: str, *, command: str, + attach_stdin: Optional[bool] | Omit = omit, shell_name: Optional[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. @@ -240,7 +247,8 @@ def execute_sync( ) -> DevboxExecutionDetailView: """ Execute a bash command in the Devbox shell, await the command completion and - return the output. + return the output. Note: attach_stdin parameter is not supported for synchronous + execution. Args: command: The command to execute via the Devbox shell. By default, commands are run from @@ -248,6 +256,9 @@ def execute_sync( specified the command is run from the directory based on the recent state of the persistent shell. + attach_stdin: Whether to attach stdin streaming for async commands. Not valid for execute_sync + endpoint. Defaults to false if not specified. + shell_name: The name of the persistent shell to create or use if already created. When using a persistent shell, the command will run from the directory at the end of the previous command and environment variables will be preserved. @@ -271,6 +282,7 @@ def execute_sync( body=maybe_transform( { "command": command, + "attach_stdin": attach_stdin, "shell_name": shell_name, }, execution_execute_sync_params.ExecutionExecuteSyncParams, @@ -348,7 +360,7 @@ def send_std_in( extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = not_given, idempotency_key: str | None = None, - ) -> DevboxAsyncExecutionDetailView: + ) -> DevboxSendStdInResult: """ Send content to the Std In of a running execution. @@ -387,7 +399,7 @@ def send_std_in( timeout=timeout, idempotency_key=idempotency_key, ), - cast_to=DevboxAsyncExecutionDetailView, + cast_to=DevboxSendStdInResult, ) def stream_stderr_updates( @@ -597,7 +609,7 @@ async def retrieve( stdout/error and the exit code if complete. Args: - last_n: Last n lines of standard error / standard out to return + last_n: Last n lines of standard error / standard out to return (default: 100) extra_headers: Send extra headers @@ -676,6 +688,7 @@ async def execute_async( id: str, *, command: str, + attach_stdin: Optional[bool] | Omit = omit, shell_name: Optional[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. @@ -695,6 +708,9 @@ async def execute_async( specified the command is run from the directory based on the recent state of the persistent shell. + attach_stdin: Whether to attach stdin streaming for async commands. Not valid for execute_sync + endpoint. Defaults to false if not specified. + shell_name: The name of the persistent shell to create or use if already created. When using a persistent shell, the command will run from the directory at the end of the previous command and environment variables will be preserved. @@ -716,6 +732,7 @@ async def execute_async( body=await async_maybe_transform( { "command": command, + "attach_stdin": attach_stdin, "shell_name": shell_name, }, execution_execute_async_params.ExecutionExecuteAsyncParams, @@ -736,6 +753,7 @@ async def execute_sync( id: str, *, command: str, + attach_stdin: Optional[bool] | Omit = omit, shell_name: Optional[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. @@ -747,7 +765,8 @@ async def execute_sync( ) -> DevboxExecutionDetailView: """ Execute a bash command in the Devbox shell, await the command completion and - return the output. + return the output. Note: attach_stdin parameter is not supported for synchronous + execution. Args: command: The command to execute via the Devbox shell. By default, commands are run from @@ -755,6 +774,9 @@ async def execute_sync( specified the command is run from the directory based on the recent state of the persistent shell. + attach_stdin: Whether to attach stdin streaming for async commands. Not valid for execute_sync + endpoint. Defaults to false if not specified. + shell_name: The name of the persistent shell to create or use if already created. When using a persistent shell, the command will run from the directory at the end of the previous command and environment variables will be preserved. @@ -778,6 +800,7 @@ async def execute_sync( body=await async_maybe_transform( { "command": command, + "attach_stdin": attach_stdin, "shell_name": shell_name, }, execution_execute_sync_params.ExecutionExecuteSyncParams, @@ -857,7 +880,7 @@ async def send_std_in( extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = not_given, idempotency_key: str | None = None, - ) -> DevboxAsyncExecutionDetailView: + ) -> DevboxSendStdInResult: """ Send content to the Std In of a running execution. @@ -896,7 +919,7 @@ async def send_std_in( timeout=timeout, idempotency_key=idempotency_key, ), - cast_to=DevboxAsyncExecutionDetailView, + cast_to=DevboxSendStdInResult, ) async def stream_stderr_updates( diff --git a/src/runloop_api_client/types/__init__.py b/src/runloop_api_client/types/__init__.py index 0fbcf8275..2330d5227 100644 --- a/src/runloop_api_client/types/__init__.py +++ b/src/runloop_api_client/types/__init__.py @@ -60,6 +60,7 @@ from .object_download_url_view import ObjectDownloadURLView as ObjectDownloadURLView from .repository_create_params import RepositoryCreateParams as RepositoryCreateParams from .repository_manifest_view import RepositoryManifestView as RepositoryManifestView +from .devbox_send_std_in_result import DevboxSendStdInResult as DevboxSendStdInResult from .devbox_snapshot_list_view import DevboxSnapshotListView as DevboxSnapshotListView from .devbox_upload_file_params import DevboxUploadFileParams as DevboxUploadFileParams from .object_list_public_params import ObjectListPublicParams as ObjectListPublicParams diff --git a/src/runloop_api_client/types/devbox_execute_async_params.py b/src/runloop_api_client/types/devbox_execute_async_params.py index f4d0280b8..9de00ccf0 100644 --- a/src/runloop_api_client/types/devbox_execute_async_params.py +++ b/src/runloop_api_client/types/devbox_execute_async_params.py @@ -17,6 +17,12 @@ class DevboxExecuteAsyncParams(TypedDict, total=False): based on the recent state of the persistent shell. """ + attach_stdin: Optional[bool] + """Whether to attach stdin streaming for async commands. + + Not valid for execute_sync endpoint. Defaults to false if not specified. + """ + shell_name: Optional[str] """The name of the persistent shell to create or use if already created. diff --git a/src/runloop_api_client/types/devbox_execute_params.py b/src/runloop_api_client/types/devbox_execute_params.py index 30defa616..24ca9e7fe 100644 --- a/src/runloop_api_client/types/devbox_execute_params.py +++ b/src/runloop_api_client/types/devbox_execute_params.py @@ -20,6 +20,9 @@ class DevboxExecuteParams(TypedDict, total=False): command_id: Required[str] """The command ID in UUIDv7 string format for idempotency and tracking""" + last_n: str + """Last n lines of standard error / standard out to return (default: 100)""" + optimistic_timeout: Optional[int] """Timeout in seconds to wait for command completion. diff --git a/src/runloop_api_client/types/devbox_execute_sync_params.py b/src/runloop_api_client/types/devbox_execute_sync_params.py index 1a873032c..c911a151c 100644 --- a/src/runloop_api_client/types/devbox_execute_sync_params.py +++ b/src/runloop_api_client/types/devbox_execute_sync_params.py @@ -17,6 +17,12 @@ class DevboxExecuteSyncParams(TypedDict, total=False): based on the recent state of the persistent shell. """ + attach_stdin: Optional[bool] + """Whether to attach stdin streaming for async commands. + + Not valid for execute_sync endpoint. Defaults to false if not specified. + """ + shell_name: Optional[str] """The name of the persistent shell to create or use if already created. diff --git a/src/runloop_api_client/types/devbox_send_std_in_result.py b/src/runloop_api_client/types/devbox_send_std_in_result.py new file mode 100644 index 000000000..2b675f9e9 --- /dev/null +++ b/src/runloop_api_client/types/devbox_send_std_in_result.py @@ -0,0 +1,16 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from .._models import BaseModel + +__all__ = ["DevboxSendStdInResult"] + + +class DevboxSendStdInResult(BaseModel): + devbox_id: str + """Devbox id where command is executing.""" + + execution_id: str + """Execution id that received the stdin.""" + + success: bool + """Whether the stdin was successfully sent.""" diff --git a/src/runloop_api_client/types/devbox_snapshot_disk_async_params.py b/src/runloop_api_client/types/devbox_snapshot_disk_async_params.py index eda38c53b..7ad87ffb9 100644 --- a/src/runloop_api_client/types/devbox_snapshot_disk_async_params.py +++ b/src/runloop_api_client/types/devbox_snapshot_disk_async_params.py @@ -9,6 +9,9 @@ class DevboxSnapshotDiskAsyncParams(TypedDict, total=False): + commit_message: Optional[str] + """(Optional) Commit message associated with the snapshot (max 1000 characters)""" + metadata: Optional[Dict[str, str]] """(Optional) Metadata used to describe the snapshot""" diff --git a/src/runloop_api_client/types/devbox_snapshot_disk_params.py b/src/runloop_api_client/types/devbox_snapshot_disk_params.py index 67bf5ec9d..6ce8804b4 100644 --- a/src/runloop_api_client/types/devbox_snapshot_disk_params.py +++ b/src/runloop_api_client/types/devbox_snapshot_disk_params.py @@ -9,6 +9,9 @@ class DevboxSnapshotDiskParams(TypedDict, total=False): + commit_message: Optional[str] + """(Optional) Commit message associated with the snapshot (max 1000 characters)""" + metadata: Optional[Dict[str, str]] """(Optional) Metadata used to describe the snapshot""" diff --git a/src/runloop_api_client/types/devbox_snapshot_view.py b/src/runloop_api_client/types/devbox_snapshot_view.py index 115fe72e9..82ae90907 100644 --- a/src/runloop_api_client/types/devbox_snapshot_view.py +++ b/src/runloop_api_client/types/devbox_snapshot_view.py @@ -20,5 +20,8 @@ class DevboxSnapshotView(BaseModel): source_devbox_id: str """The source Devbox ID this snapshot was created from.""" + commit_message: Optional[str] = None + """(Optional) The commit message of the snapshot (max 1000 characters).""" + name: Optional[str] = None """(Optional) The custom name of the snapshot.""" diff --git a/src/runloop_api_client/types/devbox_wait_for_command_params.py b/src/runloop_api_client/types/devbox_wait_for_command_params.py index 93cf7e1e5..367d6ed2f 100644 --- a/src/runloop_api_client/types/devbox_wait_for_command_params.py +++ b/src/runloop_api_client/types/devbox_wait_for_command_params.py @@ -18,6 +18,9 @@ class DevboxWaitForCommandParams(TypedDict, total=False): reaches any of the provided statuses. """ + last_n: str + """Last n lines of standard error / standard out to return (default: 100)""" + timeout_seconds: Optional[int] """(Optional) Timeout in seconds to wait for the status, up to 60 seconds. diff --git a/src/runloop_api_client/types/devboxes/disk_snapshot_update_params.py b/src/runloop_api_client/types/devboxes/disk_snapshot_update_params.py index 6b4d276c5..548b6c08d 100644 --- a/src/runloop_api_client/types/devboxes/disk_snapshot_update_params.py +++ b/src/runloop_api_client/types/devboxes/disk_snapshot_update_params.py @@ -9,6 +9,9 @@ class DiskSnapshotUpdateParams(TypedDict, total=False): + commit_message: Optional[str] + """(Optional) Commit message associated with the snapshot (max 1000 characters)""" + metadata: Optional[Dict[str, str]] """(Optional) Metadata used to describe the snapshot""" diff --git a/src/runloop_api_client/types/devboxes/execution_execute_async_params.py b/src/runloop_api_client/types/devboxes/execution_execute_async_params.py index 22a5292c9..e0ae30e53 100644 --- a/src/runloop_api_client/types/devboxes/execution_execute_async_params.py +++ b/src/runloop_api_client/types/devboxes/execution_execute_async_params.py @@ -17,6 +17,12 @@ class ExecutionExecuteAsyncParams(TypedDict, total=False): based on the recent state of the persistent shell. """ + attach_stdin: Optional[bool] + """Whether to attach stdin streaming for async commands. + + Not valid for execute_sync endpoint. Defaults to false if not specified. + """ + shell_name: Optional[str] """The name of the persistent shell to create or use if already created. diff --git a/src/runloop_api_client/types/devboxes/execution_execute_sync_params.py b/src/runloop_api_client/types/devboxes/execution_execute_sync_params.py index a900f3e4b..e0875a1c1 100755 --- a/src/runloop_api_client/types/devboxes/execution_execute_sync_params.py +++ b/src/runloop_api_client/types/devboxes/execution_execute_sync_params.py @@ -17,6 +17,12 @@ class ExecutionExecuteSyncParams(TypedDict, total=False): based on the recent state of the persistent shell. """ + attach_stdin: Optional[bool] + """Whether to attach stdin streaming for async commands. + + Not valid for execute_sync endpoint. Defaults to false if not specified. + """ + shell_name: Optional[str] """The name of the persistent shell to create or use if already created. diff --git a/src/runloop_api_client/types/devboxes/execution_retrieve_params.py b/src/runloop_api_client/types/devboxes/execution_retrieve_params.py index 96e8bc24b..145d1a679 100644 --- a/src/runloop_api_client/types/devboxes/execution_retrieve_params.py +++ b/src/runloop_api_client/types/devboxes/execution_retrieve_params.py @@ -11,4 +11,4 @@ class ExecutionRetrieveParams(TypedDict, total=False): devbox_id: Required[str] last_n: str - """Last n lines of standard error / standard out to return""" + """Last n lines of standard error / standard out to return (default: 100)""" diff --git a/src/runloop_api_client/types/object_view.py b/src/runloop_api_client/types/object_view.py index 18c7c1d3c..b8a2e0f4c 100644 --- a/src/runloop_api_client/types/object_view.py +++ b/src/runloop_api_client/types/object_view.py @@ -15,6 +15,9 @@ class ObjectView(BaseModel): content_type: Literal["unspecified", "text", "binary", "gzip", "tar", "tgz"] """The content type of the Object.""" + create_time_ms: int + """The creation time of the Object in milliseconds since epoch.""" + name: str """The name of the Object.""" diff --git a/tests/api_resources/devboxes/test_disk_snapshots.py b/tests/api_resources/devboxes/test_disk_snapshots.py index 3ef9f7b94..c04e4e971 100644 --- a/tests/api_resources/devboxes/test_disk_snapshots.py +++ b/tests/api_resources/devboxes/test_disk_snapshots.py @@ -32,6 +32,7 @@ def test_method_update(self, client: Runloop) -> None: def test_method_update_with_all_params(self, client: Runloop) -> None: disk_snapshot = client.devboxes.disk_snapshots.update( id="id", + commit_message="commit_message", metadata={"foo": "string"}, name="name", ) @@ -197,6 +198,7 @@ async def test_method_update(self, async_client: AsyncRunloop) -> None: async def test_method_update_with_all_params(self, async_client: AsyncRunloop) -> None: disk_snapshot = await async_client.devboxes.disk_snapshots.update( id="id", + commit_message="commit_message", metadata={"foo": "string"}, name="name", ) diff --git a/tests/api_resources/devboxes/test_executions.py b/tests/api_resources/devboxes/test_executions.py index a3bcaaa1e..ae69a42e4 100755 --- a/tests/api_resources/devboxes/test_executions.py +++ b/tests/api_resources/devboxes/test_executions.py @@ -12,7 +12,7 @@ from tests.utils import assert_matches_type from runloop_api_client import Runloop, AsyncRunloop -from runloop_api_client.types import DevboxExecutionDetailView, DevboxAsyncExecutionDetailView +from runloop_api_client.types import DevboxSendStdInResult, DevboxExecutionDetailView, DevboxAsyncExecutionDetailView from runloop_api_client._exceptions import APIStatusError, APITimeoutError from runloop_api_client.lib.polling import PollingConfig, PollingTimeout @@ -94,6 +94,7 @@ def test_method_execute_async_with_all_params(self, client: Runloop) -> None: execution = client.devboxes.executions.execute_async( id="id", command="command", + attach_stdin=True, shell_name="shell_name", ) assert_matches_type(DevboxAsyncExecutionDetailView, execution, path=["response"]) @@ -148,6 +149,7 @@ def test_method_execute_sync_with_all_params(self, client: Runloop) -> None: execution = client.devboxes.executions.execute_sync( id="id", command="command", + attach_stdin=True, shell_name="shell_name", ) @@ -253,7 +255,7 @@ def test_method_send_std_in(self, client: Runloop) -> None: execution_id="execution_id", devbox_id="devbox_id", ) - assert_matches_type(DevboxAsyncExecutionDetailView, execution, path=["response"]) + assert_matches_type(DevboxSendStdInResult, execution, path=["response"]) @parametrize def test_method_send_std_in_with_all_params(self, client: Runloop) -> None: @@ -263,7 +265,7 @@ def test_method_send_std_in_with_all_params(self, client: Runloop) -> None: signal="EOF", text="text", ) - assert_matches_type(DevboxAsyncExecutionDetailView, execution, path=["response"]) + assert_matches_type(DevboxSendStdInResult, execution, path=["response"]) @parametrize def test_raw_response_send_std_in(self, client: Runloop) -> None: @@ -275,7 +277,7 @@ def test_raw_response_send_std_in(self, client: Runloop) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" execution = response.parse() - assert_matches_type(DevboxAsyncExecutionDetailView, execution, path=["response"]) + assert_matches_type(DevboxSendStdInResult, execution, path=["response"]) @parametrize def test_streaming_response_send_std_in(self, client: Runloop) -> None: @@ -287,7 +289,7 @@ def test_streaming_response_send_std_in(self, client: Runloop) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" execution = response.parse() - assert_matches_type(DevboxAsyncExecutionDetailView, execution, path=["response"]) + assert_matches_type(DevboxSendStdInResult, execution, path=["response"]) assert cast(Any, response.is_closed) is True @@ -675,6 +677,7 @@ async def test_method_execute_async_with_all_params(self, async_client: AsyncRun execution = await async_client.devboxes.executions.execute_async( id="id", command="command", + attach_stdin=True, shell_name="shell_name", ) assert_matches_type(DevboxAsyncExecutionDetailView, execution, path=["response"]) @@ -729,6 +732,7 @@ async def test_method_execute_sync_with_all_params(self, async_client: AsyncRunl execution = await async_client.devboxes.executions.execute_sync( id="id", command="command", + attach_stdin=True, shell_name="shell_name", ) @@ -834,7 +838,7 @@ async def test_method_send_std_in(self, async_client: AsyncRunloop) -> None: execution_id="execution_id", devbox_id="devbox_id", ) - assert_matches_type(DevboxAsyncExecutionDetailView, execution, path=["response"]) + assert_matches_type(DevboxSendStdInResult, execution, path=["response"]) @parametrize async def test_method_send_std_in_with_all_params(self, async_client: AsyncRunloop) -> None: @@ -844,7 +848,7 @@ async def test_method_send_std_in_with_all_params(self, async_client: AsyncRunlo signal="EOF", text="text", ) - assert_matches_type(DevboxAsyncExecutionDetailView, execution, path=["response"]) + assert_matches_type(DevboxSendStdInResult, execution, path=["response"]) @parametrize async def test_raw_response_send_std_in(self, async_client: AsyncRunloop) -> None: @@ -856,7 +860,7 @@ async def test_raw_response_send_std_in(self, async_client: AsyncRunloop) -> Non assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" execution = await response.parse() - assert_matches_type(DevboxAsyncExecutionDetailView, execution, path=["response"]) + assert_matches_type(DevboxSendStdInResult, execution, path=["response"]) @parametrize async def test_streaming_response_send_std_in(self, async_client: AsyncRunloop) -> None: @@ -868,7 +872,7 @@ async def test_streaming_response_send_std_in(self, async_client: AsyncRunloop) assert response.http_request.headers.get("X-Stainless-Lang") == "python" execution = await response.parse() - assert_matches_type(DevboxAsyncExecutionDetailView, execution, path=["response"]) + assert_matches_type(DevboxSendStdInResult, execution, path=["response"]) assert cast(Any, response.is_closed) is True diff --git a/tests/api_resources/test_devboxes.py b/tests/api_resources/test_devboxes.py index 22643a1ee..5ffa79548 100644 --- a/tests/api_resources/test_devboxes.py +++ b/tests/api_resources/test_devboxes.py @@ -429,6 +429,7 @@ def test_method_execute_with_all_params(self, client: Runloop) -> None: id="id", command="command", command_id="command_id", + last_n="last_n", optimistic_timeout=0, shell_name="shell_name", ) @@ -484,6 +485,7 @@ def test_method_execute_async_with_all_params(self, client: Runloop) -> None: devbox = client.devboxes.execute_async( id="id", command="command", + attach_stdin=True, shell_name="shell_name", ) assert_matches_type(DevboxAsyncExecutionDetailView, devbox, path=["response"]) @@ -538,6 +540,7 @@ def test_method_execute_sync_with_all_params(self, client: Runloop) -> None: devbox = client.devboxes.execute_sync( id="id", command="command", + attach_stdin=True, shell_name="shell_name", ) @@ -825,6 +828,7 @@ def test_method_snapshot_disk(self, client: Runloop) -> None: def test_method_snapshot_disk_with_all_params(self, client: Runloop) -> None: devbox = client.devboxes.snapshot_disk( id="id", + commit_message="commit_message", metadata={"foo": "string"}, name="name", ) @@ -872,6 +876,7 @@ def test_method_snapshot_disk_async(self, client: Runloop) -> None: def test_method_snapshot_disk_async_with_all_params(self, client: Runloop) -> None: devbox = client.devboxes.snapshot_disk_async( id="id", + commit_message="commit_message", metadata={"foo": "string"}, name="name", ) @@ -1012,6 +1017,7 @@ def test_method_wait_for_command_with_all_params(self, client: Runloop) -> None: execution_id="execution_id", devbox_id="devbox_id", statuses=["queued"], + last_n="last_n", timeout_seconds=0, ) assert_matches_type(DevboxAsyncExecutionDetailView, devbox, path=["response"]) @@ -1783,6 +1789,7 @@ async def test_method_execute_with_all_params(self, async_client: AsyncRunloop) id="id", command="command", command_id="command_id", + last_n="last_n", optimistic_timeout=0, shell_name="shell_name", ) @@ -1838,6 +1845,7 @@ async def test_method_execute_async_with_all_params(self, async_client: AsyncRun devbox = await async_client.devboxes.execute_async( id="id", command="command", + attach_stdin=True, shell_name="shell_name", ) assert_matches_type(DevboxAsyncExecutionDetailView, devbox, path=["response"]) @@ -1892,6 +1900,7 @@ async def test_method_execute_sync_with_all_params(self, async_client: AsyncRunl devbox = await async_client.devboxes.execute_sync( id="id", command="command", + attach_stdin=True, shell_name="shell_name", ) @@ -2179,6 +2188,7 @@ async def test_method_snapshot_disk(self, async_client: AsyncRunloop) -> None: async def test_method_snapshot_disk_with_all_params(self, async_client: AsyncRunloop) -> None: devbox = await async_client.devboxes.snapshot_disk( id="id", + commit_message="commit_message", metadata={"foo": "string"}, name="name", ) @@ -2226,6 +2236,7 @@ async def test_method_snapshot_disk_async(self, async_client: AsyncRunloop) -> N async def test_method_snapshot_disk_async_with_all_params(self, async_client: AsyncRunloop) -> None: devbox = await async_client.devboxes.snapshot_disk_async( id="id", + commit_message="commit_message", metadata={"foo": "string"}, name="name", ) @@ -2366,6 +2377,7 @@ async def test_method_wait_for_command_with_all_params(self, async_client: Async execution_id="execution_id", devbox_id="devbox_id", statuses=["queued"], + last_n="last_n", timeout_seconds=0, ) assert_matches_type(DevboxAsyncExecutionDetailView, devbox, path=["response"])