Skip to content

Commit 5e2d3ee

Browse files
feat(api): api update
1 parent ed9f4cf commit 5e2d3ee

File tree

12 files changed

+101
-148
lines changed

12 files changed

+101
-148
lines changed

.stats.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
configured_endpoints: 14
22
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/warp-bnavetta%2Fwarp-api-e281c64ee44d0db13ba9ce62d3a61e8b17fcd1fad9bffb5c3b0e3dfb2b5e66e1.yml
33
openapi_spec_hash: 6bd667f546147c5fac3bffe34522ba2f
4-
config_hash: 56e5336dfbbacf3f4ec7f63b41309773
4+
config_hash: 1888db8b2f33dc16874aea51a90e78f7

api.md

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@ from oz_agent_sdk.types import (
1111
Error,
1212
ErrorCode,
1313
GcpProviderConfig,
14-
Harness,
1514
McpServerConfig,
1615
Scope,
1716
UserProfile,
@@ -34,12 +33,9 @@ Types:
3433
```python
3534
from oz_agent_sdk.types.agent import (
3635
ArtifactItem,
37-
RequestUsage,
3836
RunItem,
3937
RunSourceType,
4038
RunState,
41-
RunStatusMessage,
42-
ScheduleInfo,
4339
RunCancelResponse,
4440
)
4541
```

src/oz_agent_sdk/types/__init__.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,9 @@
33
from __future__ import annotations
44

55
from .scope import Scope as Scope
6-
from .harness import Harness as Harness
76
from .error_code import ErrorCode as ErrorCode
87
from .agent_skill import AgentSkill as AgentSkill
98
from .user_profile import UserProfile as UserProfile
10-
from .harness_param import HarnessParam as HarnessParam
119
from .agent_run_params import AgentRunParams as AgentRunParams
1210
from .agent_list_params import AgentListParams as AgentListParams
1311
from .mcp_server_config import McpServerConfig as McpServerConfig

src/oz_agent_sdk/types/agent/__init__.py

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,8 @@
55
from .run_item import RunItem as RunItem
66
from .run_state import RunState as RunState
77
from .artifact_item import ArtifactItem as ArtifactItem
8-
from .request_usage import RequestUsage as RequestUsage
9-
from .schedule_info import ScheduleInfo as ScheduleInfo
108
from .run_list_params import RunListParams as RunListParams
119
from .run_source_type import RunSourceType as RunSourceType
12-
from .run_status_message import RunStatusMessage as RunStatusMessage
1310
from .run_cancel_response import RunCancelResponse as RunCancelResponse
1411
from .scheduled_agent_item import ScheduledAgentItem as ScheduledAgentItem
1512
from .schedule_create_params import ScheduleCreateParams as ScheduleCreateParams

src/oz_agent_sdk/types/agent/request_usage.py

Lines changed: 0 additions & 17 deletions
This file was deleted.

src/oz_agent_sdk/types/agent/run_item.py

Lines changed: 77 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -7,15 +7,13 @@
77
from ..scope import Scope
88
from ..._models import BaseModel
99
from .run_state import RunState
10+
from ..error_code import ErrorCode
1011
from ..user_profile import UserProfile
1112
from .artifact_item import ArtifactItem
12-
from .request_usage import RequestUsage
13-
from .schedule_info import ScheduleInfo
1413
from .run_source_type import RunSourceType
15-
from .run_status_message import RunStatusMessage
1614
from ..ambient_agent_config import AmbientAgentConfig
1715

18-
__all__ = ["RunItem", "AgentSkill"]
16+
__all__ = ["RunItem", "AgentSkill", "RequestUsage", "Schedule", "StatusMessage"]
1917

2018

2119
class AgentSkill(BaseModel):
@@ -37,6 +35,79 @@ class AgentSkill(BaseModel):
3735
"""Human-readable name of the skill"""
3836

3937

38+
class RequestUsage(BaseModel):
39+
"""Resource usage information for the run"""
40+
41+
compute_cost: Optional[float] = None
42+
"""Cost of compute resources for the run"""
43+
44+
inference_cost: Optional[float] = None
45+
"""Cost of LLM inference for the run"""
46+
47+
48+
class Schedule(BaseModel):
49+
"""
50+
Information about the schedule that triggered this run (only present for scheduled runs)
51+
"""
52+
53+
cron_schedule: str
54+
"""Cron expression at the time the run was created"""
55+
56+
schedule_id: str
57+
"""Unique identifier for the schedule"""
58+
59+
schedule_name: str
60+
"""Name of the schedule at the time the run was created"""
61+
62+
63+
class StatusMessage(BaseModel):
64+
"""Status message for a run.
65+
66+
For terminal error states, includes structured
67+
error code and retryability info from the platform error catalog.
68+
"""
69+
70+
message: str
71+
"""Human-readable status message"""
72+
73+
error_code: Optional[ErrorCode] = None
74+
"""
75+
Machine-readable error code identifying the problem type. Used in the `type` URI
76+
of Error responses and in the `error_code` field of RunStatusMessage.
77+
78+
User errors (run transitions to FAILED):
79+
80+
- `insufficient_credits` — Team has no remaining add-on credits
81+
- `feature_not_available` — Required feature not enabled for user's plan
82+
- `external_authentication_required` — User hasn't authorized a required
83+
external service
84+
- `not_authorized` — Principal lacks permission for the requested operation
85+
- `invalid_request` — Request is malformed or contains invalid parameters
86+
- `resource_not_found` — Referenced resource does not exist
87+
- `budget_exceeded` — Spending budget limit has been reached
88+
- `integration_disabled` — Integration is disabled and must be enabled
89+
- `integration_not_configured` — Integration setup is incomplete
90+
- `operation_not_supported` — Requested operation not supported for this
91+
resource/state
92+
- `environment_setup_failed` — Client-side environment setup failed
93+
- `content_policy_violation` — Prompt or setup commands violated content policy
94+
- `conflict` — Request conflicts with the current state of the resource
95+
96+
Warp errors (run transitions to ERROR):
97+
98+
- `authentication_required` — Request lacks valid authentication credentials
99+
- `resource_unavailable` — Transient infrastructure issue (retryable)
100+
- `internal_error` — Unexpected server-side error (retryable)
101+
"""
102+
103+
retryable: Optional[bool] = None
104+
"""Whether the error is transient and the client may retry by submitting a new run.
105+
106+
Only present on terminal error states. When false, retrying without addressing
107+
the underlying cause will not succeed.
108+
"""
109+
110+
40111
class RunItem(BaseModel):
41112
created_at: datetime
42113
"""Timestamp when the run was created (RFC3339)"""
@@ -103,7 +174,7 @@ class RunItem(BaseModel):
103174
request_usage: Optional[RequestUsage] = None
104175
"""Resource usage information for the run"""
105176

106-
schedule: Optional[ScheduleInfo] = None
177+
schedule: Optional[Schedule] = None
107178
"""
108179
Information about the schedule that triggered this run (only present for
109180
scheduled runs)
@@ -135,7 +206,7 @@ class RunItem(BaseModel):
135206
started_at: Optional[datetime] = None
136207
"""Timestamp when the agent started working on the run (RFC3339)"""
137208

138-
status_message: Optional[RunStatusMessage] = None
209+
status_message: Optional[StatusMessage] = None
139210
"""Status message for a run.
140211
141212
For terminal error states, includes structured error code and retryability info

src/oz_agent_sdk/types/agent/run_status_message.py

Lines changed: 0 additions & 56 deletions
This file was deleted.

src/oz_agent_sdk/types/agent/schedule_info.py

Lines changed: 0 additions & 20 deletions
This file was deleted.

src/oz_agent_sdk/types/ambient_agent_config.py

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,20 @@
44

55
from pydantic import Field as FieldInfo
66

7-
from .harness import Harness
87
from .._models import BaseModel
98
from .mcp_server_config import McpServerConfig
109

11-
__all__ = ["AmbientAgentConfig"]
10+
__all__ = ["AmbientAgentConfig", "Harness"]
11+
12+
13+
class Harness(BaseModel):
14+
"""
15+
Specifies which execution harness to use for the agent run.
16+
Default (nil/empty) uses Warp's built-in Oz harness.
17+
"""
18+
19+
type: Optional[str] = None
20+
"""The harness type identifier (e.g. "claude")."""
1221

1322

1423
class AmbientAgentConfig(BaseModel):

src/oz_agent_sdk/types/ambient_agent_config_param.py

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,19 @@
55
from typing import Dict
66
from typing_extensions import TypedDict
77

8-
from .harness_param import HarnessParam
98
from .mcp_server_config_param import McpServerConfigParam
109

11-
__all__ = ["AmbientAgentConfigParam"]
10+
__all__ = ["AmbientAgentConfigParam", "Harness"]
11+
12+
13+
class Harness(TypedDict, total=False):
14+
"""
15+
Specifies which execution harness to use for the agent run.
16+
Default (nil/empty) uses Warp's built-in Oz harness.
17+
"""
18+
19+
type: str
20+
"""The harness type identifier (e.g. "claude")."""
1221

1322

1423
class AmbientAgentConfigParam(TypedDict, total=False):
@@ -26,7 +35,7 @@ class AmbientAgentConfigParam(TypedDict, total=False):
2635
environment_id: str
2736
"""UID of the environment to run the agent in"""
2837

29-
harness: HarnessParam
38+
harness: Harness
3039
"""
3140
Specifies which execution harness to use for the agent run. Default (nil/empty)
3241
uses Warp's built-in Oz harness.

0 commit comments

Comments
 (0)