diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 71a918c..ef66079 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -55,14 +55,18 @@ jobs: run: uv build - name: Get GitHub OIDC Token - if: github.repository == 'stainless-sdks/warp-api-python' + if: |- + github.repository == 'stainless-sdks/warp-api-python' && + !startsWith(github.ref, 'refs/heads/stl/') id: github-oidc uses: actions/github-script@v8 with: script: core.setOutput('github_token', await core.getIDToken()); - name: Upload tarball - if: github.repository == 'stainless-sdks/warp-api-python' + if: |- + github.repository == 'stainless-sdks/warp-api-python' && + !startsWith(github.ref, 'refs/heads/stl/') env: URL: https://pkg.stainless.com/s AUTH: ${{ steps.github-oidc.outputs.github_token }} diff --git a/.release-please-manifest.json b/.release-please-manifest.json index 6d78745..091cfb1 100644 --- a/.release-please-manifest.json +++ b/.release-please-manifest.json @@ -1,3 +1,3 @@ { - ".": "0.9.0" + ".": "0.10.0" } \ No newline at end of file diff --git a/.stats.yml b/.stats.yml index 26fe290..7dd01bc 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 14 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/warp-bnavetta%2Fwarp-api-39e18bbb8b0af73eca7a880f56afbdecd69e3e5bab82a04c4d6429c32d7e6727.yml -openapi_spec_hash: 7a0de988bb37416d6e80f4a4bbe9d0d0 -config_hash: 0884847870200ee9d34bb00ce94aaa8e +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/warp-bnavetta%2Fwarp-api-6c175d34cab49d79dbb24289ae516867404c42f3097264bbae171aced72ecc49.yml +openapi_spec_hash: 5abb55a1fc2836207bc88d4815f47f24 +config_hash: a4b1ffc5b2e162efb3d557c7461153c1 diff --git a/CHANGELOG.md b/CHANGELOG.md index bd2fe52..92f2b8a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,21 @@ # Changelog +## 0.10.0 (2026-03-07) + +Full Changelog: [v0.9.0...v0.10.0](https://github.com/warpdotdev/oz-sdk-python/compare/v0.9.0...v0.10.0) + +### Features + +* **api:** error and error_code as types ([9766f85](https://github.com/warpdotdev/oz-sdk-python/commit/9766f85585ff3553f1f366476a3a6806f2534b22)) +* **api:** fix ScheduledAgentHistoryItem name ([ac75431](https://github.com/warpdotdev/oz-sdk-python/commit/ac754319e41b73d323cf9a36cbcf1c4dce2902bb)) +* **api:** fix schema version issues ([9c2f6a3](https://github.com/warpdotdev/oz-sdk-python/commit/9c2f6a32fa06812860efa1d76893dd8d2b60d176)) +* **api:** sorting ([0cc041e](https://github.com/warpdotdev/oz-sdk-python/commit/0cc041edf53d26c4f38c64faa7fd065d7a6760ab)) + + +### Chores + +* **ci:** skip uploading artifacts on stainless-internal branches ([1ef523c](https://github.com/warpdotdev/oz-sdk-python/commit/1ef523caca4d137def551560de8c8a75c761d0f9)) + ## 0.9.0 (2026-03-03) Full Changelog: [v0.8.0...v0.9.0](https://github.com/warpdotdev/oz-sdk-python/compare/v0.8.0...v0.9.0) diff --git a/api.md b/api.md index a28b73a..19e78a3 100644 --- a/api.md +++ b/api.md @@ -7,6 +7,8 @@ from oz_agent_sdk.types import ( AgentSkill, AmbientAgentConfig, CloudEnvironmentConfig, + Error, + ErrorCode, McpServerConfig, Scope, UserProfile, diff --git a/pyproject.toml b/pyproject.toml index add485e..8385c48 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [project] name = "oz-agent-sdk" -version = "0.9.0" +version = "0.10.0" description = "The official Python library for the oz-api API" dynamic = ["readme"] license = "Apache-2.0" diff --git a/src/oz_agent_sdk/_version.py b/src/oz_agent_sdk/_version.py index 39f67b8..fdf4152 100644 --- a/src/oz_agent_sdk/_version.py +++ b/src/oz_agent_sdk/_version.py @@ -1,4 +1,4 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. __title__ = "oz_agent_sdk" -__version__ = "0.9.0" # x-release-please-version +__version__ = "0.10.0" # x-release-please-version diff --git a/src/oz_agent_sdk/resources/agent/runs.py b/src/oz_agent_sdk/resources/agent/runs.py index 3b4d1d2..7e09eee 100644 --- a/src/oz_agent_sdk/resources/agent/runs.py +++ b/src/oz_agent_sdk/resources/agent/runs.py @@ -100,6 +100,8 @@ def list( schedule_id: str | Omit = omit, skill: str | Omit = omit, skill_spec: str | Omit = omit, + sort_by: Literal["updated_at", "created_at", "title", "agent"] | Omit = omit, + sort_order: Literal["asc", "desc"] | Omit = omit, source: RunSourceType | Omit = omit, state: List[RunState] | Omit = omit, updated_after: Union[str, datetime] | Omit = omit, @@ -112,8 +114,8 @@ def list( ) -> RunListResponse: """Retrieve a paginated list of agent runs with optional filtering. - Results are - ordered by creation time (newest first). + Results default + to `sort_by=updated_at` and `sort_order=desc`. Args: artifact_type: Filter runs by artifact type (PLAN or PULL_REQUEST) @@ -143,6 +145,15 @@ def list( skill_spec: Filter runs by skill spec (e.g., "owner/repo:path/to/SKILL.md") + sort_by: Sort field for results. + + - `updated_at`: Sort by last update timestamp (default) + - `created_at`: Sort by creation timestamp + - `title`: Sort alphabetically by run title + - `agent`: Sort alphabetically by skill. Runs without a skill are grouped last. + + sort_order: Sort direction + source: Filter by run source type state: Filter by run state. Can be specified multiple times to match any of the given @@ -180,6 +191,8 @@ def list( "schedule_id": schedule_id, "skill": skill, "skill_spec": skill_spec, + "sort_by": sort_by, + "sort_order": sort_order, "source": source, "state": state, "updated_after": updated_after, @@ -302,6 +315,8 @@ async def list( schedule_id: str | Omit = omit, skill: str | Omit = omit, skill_spec: str | Omit = omit, + sort_by: Literal["updated_at", "created_at", "title", "agent"] | Omit = omit, + sort_order: Literal["asc", "desc"] | Omit = omit, source: RunSourceType | Omit = omit, state: List[RunState] | Omit = omit, updated_after: Union[str, datetime] | Omit = omit, @@ -314,8 +329,8 @@ async def list( ) -> RunListResponse: """Retrieve a paginated list of agent runs with optional filtering. - Results are - ordered by creation time (newest first). + Results default + to `sort_by=updated_at` and `sort_order=desc`. Args: artifact_type: Filter runs by artifact type (PLAN or PULL_REQUEST) @@ -345,6 +360,15 @@ async def list( skill_spec: Filter runs by skill spec (e.g., "owner/repo:path/to/SKILL.md") + sort_by: Sort field for results. + + - `updated_at`: Sort by last update timestamp (default) + - `created_at`: Sort by creation timestamp + - `title`: Sort alphabetically by run title + - `agent`: Sort alphabetically by skill. Runs without a skill are grouped last. + + sort_order: Sort direction + source: Filter by run source type state: Filter by run state. Can be specified multiple times to match any of the given @@ -382,6 +406,8 @@ async def list( "schedule_id": schedule_id, "skill": skill, "skill_spec": skill_spec, + "sort_by": sort_by, + "sort_order": sort_order, "source": source, "state": state, "updated_after": updated_after, diff --git a/src/oz_agent_sdk/types/__init__.py b/src/oz_agent_sdk/types/__init__.py index 5398f2d..f4d2daa 100644 --- a/src/oz_agent_sdk/types/__init__.py +++ b/src/oz_agent_sdk/types/__init__.py @@ -3,6 +3,7 @@ from __future__ import annotations from .scope import Scope as Scope +from .error_code import ErrorCode as ErrorCode from .agent_skill import AgentSkill as AgentSkill from .user_profile import UserProfile as UserProfile from .agent_run_params import AgentRunParams as AgentRunParams diff --git a/src/oz_agent_sdk/types/agent/run_item.py b/src/oz_agent_sdk/types/agent/run_item.py index b486acf..014ab6b 100644 --- a/src/oz_agent_sdk/types/agent/run_item.py +++ b/src/oz_agent_sdk/types/agent/run_item.py @@ -2,11 +2,11 @@ from typing import List, Optional from datetime import datetime -from typing_extensions import Literal from ..scope import Scope from ..._models import BaseModel from .run_state import RunState +from ..error_code import ErrorCode from ..user_profile import UserProfile from .artifact_item import ArtifactItem from .run_source_type import RunSourceType @@ -69,26 +69,7 @@ class StatusMessage(BaseModel): message: str """Human-readable status message""" - error_code: Optional[ - Literal[ - "insufficient_credits", - "feature_not_available", - "external_authentication_required", - "not_authorized", - "invalid_request", - "resource_not_found", - "budget_exceeded", - "integration_disabled", - "integration_not_configured", - "operation_not_supported", - "environment_setup_failed", - "content_policy_violation", - "conflict", - "authentication_required", - "resource_unavailable", - "internal_error", - ] - ] = None + error_code: Optional[ErrorCode] = None """ Machine-readable error code identifying the problem type. Used in the `type` URI of Error responses and in the `error_code` field of RunStatusMessage. diff --git a/src/oz_agent_sdk/types/agent/run_list_params.py b/src/oz_agent_sdk/types/agent/run_list_params.py index d0c89d9..cb662bc 100644 --- a/src/oz_agent_sdk/types/agent/run_list_params.py +++ b/src/oz_agent_sdk/types/agent/run_list_params.py @@ -56,6 +56,18 @@ class RunListParams(TypedDict, total=False): skill_spec: str """Filter runs by skill spec (e.g., "owner/repo:path/to/SKILL.md")""" + sort_by: Literal["updated_at", "created_at", "title", "agent"] + """Sort field for results. + + - `updated_at`: Sort by last update timestamp (default) + - `created_at`: Sort by creation timestamp + - `title`: Sort alphabetically by run title + - `agent`: Sort alphabetically by skill. Runs without a skill are grouped last. + """ + + sort_order: Literal["asc", "desc"] + """Sort direction""" + source: RunSourceType """Filter by run source type""" diff --git a/src/oz_agent_sdk/types/error_code.py b/src/oz_agent_sdk/types/error_code.py new file mode 100644 index 0000000..5732142 --- /dev/null +++ b/src/oz_agent_sdk/types/error_code.py @@ -0,0 +1,24 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import Literal, TypeAlias + +__all__ = ["ErrorCode"] + +ErrorCode: TypeAlias = Literal[ + "insufficient_credits", + "feature_not_available", + "external_authentication_required", + "not_authorized", + "invalid_request", + "resource_not_found", + "budget_exceeded", + "integration_disabled", + "integration_not_configured", + "operation_not_supported", + "environment_setup_failed", + "content_policy_violation", + "conflict", + "authentication_required", + "resource_unavailable", + "internal_error", +] diff --git a/tests/api_resources/agent/test_runs.py b/tests/api_resources/agent/test_runs.py index 04ec55d..480564c 100644 --- a/tests/api_resources/agent/test_runs.py +++ b/tests/api_resources/agent/test_runs.py @@ -83,6 +83,8 @@ def test_method_list_with_all_params(self, client: OzAPI) -> None: schedule_id="schedule_id", skill="skill", skill_spec="skill_spec", + sort_by="updated_at", + sort_order="asc", source="LINEAR", state=["QUEUED"], updated_after=parse_datetime("2019-12-27T18:11:19.117Z"), @@ -224,6 +226,8 @@ async def test_method_list_with_all_params(self, async_client: AsyncOzAPI) -> No schedule_id="schedule_id", skill="skill", skill_spec="skill_spec", + sort_by="updated_at", + sort_order="asc", source="LINEAR", state=["QUEUED"], updated_after=parse_datetime("2019-12-27T18:11:19.117Z"),