Skip to main content

muse_code_sdk/msp/view/
item_status.rs

1// @generated from the MSP stable schema and protocol sources; do not edit by hand.
2
3use serde::Deserialize;
4use serde::Serialize;
5
6mod catch_all;
7
8/// `toolCall.statusProgress`: the latest `TaskProgressDetail`, field-for-field.
9#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)]
10#[serde(rename_all = "camelCase")]
11#[non_exhaustive]
12pub struct StatusProgress {
13    /// Completed units.
14    pub current: u64,
15    /// Total units, when known.
16    #[serde(skip_serializing_if = "Option::is_none")]
17    pub total: Option<u64>,
18    /// Unit label, when recorded.
19    #[serde(skip_serializing_if = "Option::is_none")]
20    pub unit: Option<String>,
21}
22
23/// `toolCall.statusStep`: the latest `TaskActiveStepDetail`, field-for-field.
24#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)]
25#[serde(rename_all = "camelCase")]
26#[non_exhaustive]
27pub struct StatusStep {
28    /// The active step's label.
29    pub label: String,
30    /// The step index, when known.
31    #[serde(skip_serializing_if = "Option::is_none")]
32    pub index: Option<u64>,
33    /// The step count, when known.
34    #[serde(skip_serializing_if = "Option::is_none")]
35    pub total: Option<u64>,
36}
37
38/// `toolCall.statusAttempt`: the latest `TaskExternalAttemptDetail`,
39/// field-for-field — countdown inputs the client renders the tick from, so no
40/// event spam.
41#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)]
42#[serde(rename_all = "camelCase")]
43#[non_exhaustive]
44pub struct StatusAttempt {
45    /// The external system (durable vocabulary, verbatim).
46    pub system: String,
47    /// The operation (durable vocabulary, verbatim).
48    pub operation: String,
49    /// The attempt number.
50    pub attempt: u32,
51    /// The scheduled next attempt, when known.
52    #[serde(skip_serializing_if = "Option::is_none")]
53    pub next_attempt: Option<u32>,
54    /// The maximum attempts, when known.
55    #[serde(skip_serializing_if = "Option::is_none")]
56    pub max_attempts: Option<u32>,
57    /// The retry delay in ms, when known.
58    #[serde(skip_serializing_if = "Option::is_none")]
59    pub retry_delay_ms: Option<u64>,
60    /// The error kind (durable vocabulary, verbatim), when recorded.
61    #[serde(skip_serializing_if = "Option::is_none")]
62    pub error_kind: Option<String>,
63    /// The HTTP status, when recorded.
64    #[serde(skip_serializing_if = "Option::is_none")]
65    pub http_status: Option<u16>,
66}
67
68/// `toolCall.statusHealth`: the latest `TaskHealthDetail`, field-for-field.
69#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)]
70#[serde(rename_all = "camelCase")]
71#[non_exhaustive]
72pub struct StatusHealth {
73    /// The health level (the durable `TaskHealthLevel` vocabulary verbatim).
74    pub level: StatusHealthLevel,
75    /// The reason, when recorded.
76    #[serde(skip_serializing_if = "Option::is_none")]
77    pub reason: Option<String>,
78}
79
80/// `toolCall.statusHealth.level`: the durable `TaskHealthLevel` vocabulary
81/// verbatim. Open — runtime vocabulary may grow additively, and clients MUST
82/// render unknown levels generically.
83#[derive(Debug, Clone, PartialEq, Eq)]
84#[non_exhaustive]
85pub enum StatusHealthLevel {
86    /// Healthy.
87    Ok,
88    /// Waiting.
89    Waiting,
90    /// Degraded.
91    Degraded,
92    /// Retrying.
93    Retrying,
94    /// Blocked.
95    Blocked,
96    /// Failed.
97    Failed,
98    /// A value from a newer host, kept verbatim so an older client decodes the
99    /// rest of the message. Never construct it with a known word.
100    Unknown(String),
101}
102
103/// `toolCall.statusChildren`: the latest `TaskChildSummaryDetail`,
104/// field-for-field.
105#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)]
106#[serde(rename_all = "camelCase")]
107#[non_exhaustive]
108pub struct StatusChildren {
109    /// Active children.
110    pub active: u64,
111    /// Completed children.
112    pub completed: u64,
113    /// Failed children.
114    pub failed: u64,
115    /// Cancelled children.
116    pub cancelled: u64,
117    /// Total children, when known.
118    #[serde(skip_serializing_if = "Option::is_none")]
119    pub total: Option<u64>,
120}