|
7 | 7 | from ..scope import Scope |
8 | 8 | from ..._models import BaseModel |
9 | 9 | from .run_state import RunState |
10 | | -from ..error_code import ErrorCode |
| 10 | +from .agent_skill import AgentSkill |
11 | 11 | from ..user_profile import UserProfile |
12 | 12 | from .artifact_item import ArtifactItem |
| 13 | +from .request_usage import RequestUsage |
| 14 | +from .schedule_info import ScheduleInfo |
13 | 15 | from .run_source_type import RunSourceType |
| 16 | +from .run_status_message import RunStatusMessage |
14 | 17 | from ..ambient_agent_config import AmbientAgentConfig |
15 | 18 |
|
16 | | -__all__ = ["RunItem", "AgentSkill", "RequestUsage", "Schedule", "StatusMessage"] |
17 | | - |
18 | | - |
19 | | -class AgentSkill(BaseModel): |
20 | | - """ |
21 | | - Information about the agent skill used for the run. |
22 | | - Either full_path or bundled_skill_id will be set, but not both. |
23 | | - """ |
24 | | - |
25 | | - bundled_skill_id: Optional[str] = None |
26 | | - """Unique identifier for bundled skills""" |
27 | | - |
28 | | - description: Optional[str] = None |
29 | | - """Description of the skill""" |
30 | | - |
31 | | - full_path: Optional[str] = None |
32 | | - """Path to the SKILL.md file (for file-based skills)""" |
33 | | - |
34 | | - name: Optional[str] = None |
35 | | - """Human-readable name of the skill""" |
36 | | - |
37 | | - |
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 | | - """ |
| 19 | +__all__ = ["RunItem"] |
109 | 20 |
|
110 | 21 |
|
111 | 22 | class RunItem(BaseModel): |
@@ -174,7 +85,7 @@ class RunItem(BaseModel): |
174 | 85 | request_usage: Optional[RequestUsage] = None |
175 | 86 | """Resource usage information for the run""" |
176 | 87 |
|
177 | | - schedule: Optional[Schedule] = None |
| 88 | + schedule: Optional[ScheduleInfo] = None |
178 | 89 | """ |
179 | 90 | Information about the schedule that triggered this run (only present for |
180 | 91 | scheduled runs) |
@@ -206,7 +117,7 @@ class RunItem(BaseModel): |
206 | 117 | started_at: Optional[datetime] = None |
207 | 118 | """Timestamp when the agent started working on the run (RFC3339)""" |
208 | 119 |
|
209 | | - status_message: Optional[StatusMessage] = None |
| 120 | + status_message: Optional[RunStatusMessage] = None |
210 | 121 | """Status message for a run. |
211 | 122 |
|
212 | 123 | For terminal error states, includes structured error code and retryability info |
|
0 commit comments