Skip to main content

talos_sync_types/generated/
business.rs

1// Generated from canonical-v1.json by scripts/schema-gen. Do not edit.
2pub mod error {
3    pub struct ConversionError(::std::borrow::Cow<'static, str>);
4    impl ::std::error::Error for ConversionError {}
5    impl ::std::fmt::Display for ConversionError {
6        fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> Result<(), ::std::fmt::Error> {
7            ::std::fmt::Display::fmt(&self.0, f)
8        }
9    }
10    impl ::std::fmt::Debug for ConversionError {
11        fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> Result<(), ::std::fmt::Error> {
12            ::std::fmt::Debug::fmt(&self.0, f)
13        }
14    }
15    impl From<&'static str> for ConversionError {
16        fn from(value: &'static str) -> Self {
17            Self(value.into())
18        }
19    }
20    impl From<String> for ConversionError {
21        fn from(value: String) -> Self {
22            Self(value.into())
23        }
24    }
25}
26#[derive(
27    ::serde::Deserialize,
28    ::serde::Serialize,
29    Clone,
30    Copy,
31    Debug,
32    Eq,
33    Hash,
34    Ord,
35    PartialEq,
36    PartialOrd,
37)]
38pub enum ActiveTurnState {
39    #[serde(rename = "running")]
40    Running,
41    #[serde(rename = "waitingForInput")]
42    WaitingForInput,
43    #[serde(rename = "cancelling")]
44    Cancelling,
45}
46impl ::std::fmt::Display for ActiveTurnState {
47    fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
48        match *self {
49            Self::Running => f.write_str("running"),
50            Self::WaitingForInput => f.write_str("waitingForInput"),
51            Self::Cancelling => f.write_str("cancelling"),
52        }
53    }
54}
55impl ::std::str::FromStr for ActiveTurnState {
56    type Err = self::error::ConversionError;
57    fn from_str(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
58        match value {
59            "running" => Ok(Self::Running),
60            "waitingForInput" => Ok(Self::WaitingForInput),
61            "cancelling" => Ok(Self::Cancelling),
62            _ => Err("invalid value".into()),
63        }
64    }
65}
66impl ::std::convert::TryFrom<&str> for ActiveTurnState {
67    type Error = self::error::ConversionError;
68    fn try_from(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
69        value.parse()
70    }
71}
72impl ::std::convert::TryFrom<&::std::string::String> for ActiveTurnState {
73    type Error = self::error::ConversionError;
74    fn try_from(
75        value: &::std::string::String,
76    ) -> ::std::result::Result<Self, self::error::ConversionError> {
77        value.parse()
78    }
79}
80impl ::std::convert::TryFrom<::std::string::String> for ActiveTurnState {
81    type Error = self::error::ConversionError;
82    fn try_from(
83        value: ::std::string::String,
84    ) -> ::std::result::Result<Self, self::error::ConversionError> {
85        value.parse()
86    }
87}
88#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug, PartialEq)]
89#[serde(deny_unknown_fields)]
90pub struct AgentAssistantText {
91    pub phase: AgentAssistantTextPhase,
92    pub text: ::std::string::String,
93}
94#[derive(
95    ::serde::Deserialize,
96    ::serde::Serialize,
97    Clone,
98    Copy,
99    Debug,
100    Eq,
101    Hash,
102    Ord,
103    PartialEq,
104    PartialOrd,
105)]
106pub enum AgentAssistantTextPhase {
107    #[serde(rename = "pending")]
108    Pending,
109    #[serde(rename = "commentary")]
110    Commentary,
111    #[serde(rename = "finalAnswer")]
112    FinalAnswer,
113}
114impl ::std::fmt::Display for AgentAssistantTextPhase {
115    fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
116        match *self {
117            Self::Pending => f.write_str("pending"),
118            Self::Commentary => f.write_str("commentary"),
119            Self::FinalAnswer => f.write_str("finalAnswer"),
120        }
121    }
122}
123impl ::std::str::FromStr for AgentAssistantTextPhase {
124    type Err = self::error::ConversionError;
125    fn from_str(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
126        match value {
127            "pending" => Ok(Self::Pending),
128            "commentary" => Ok(Self::Commentary),
129            "finalAnswer" => Ok(Self::FinalAnswer),
130            _ => Err("invalid value".into()),
131        }
132    }
133}
134impl ::std::convert::TryFrom<&str> for AgentAssistantTextPhase {
135    type Error = self::error::ConversionError;
136    fn try_from(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
137        value.parse()
138    }
139}
140impl ::std::convert::TryFrom<&::std::string::String> for AgentAssistantTextPhase {
141    type Error = self::error::ConversionError;
142    fn try_from(
143        value: &::std::string::String,
144    ) -> ::std::result::Result<Self, self::error::ConversionError> {
145        value.parse()
146    }
147}
148impl ::std::convert::TryFrom<::std::string::String> for AgentAssistantTextPhase {
149    type Error = self::error::ConversionError;
150    fn try_from(
151        value: ::std::string::String,
152    ) -> ::std::result::Result<Self, self::error::ConversionError> {
153        value.parse()
154    }
155}
156#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug, PartialEq)]
157#[serde(deny_unknown_fields)]
158pub struct AgentContextCompaction {
159    #[serde(default)]
160    pub message: ::std::option::Option<::std::string::String>,
161    #[serde(default)]
162    pub metrics: ::std::option::Option<ContextCompactionMetrics>,
163    #[serde(default)]
164    pub outcome: ::std::option::Option<ContextCompactionOutcome>,
165    pub stage: ContextCompactionStage,
166    pub trigger: ContextCompactionTrigger,
167}
168#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug, PartialEq)]
169#[serde(deny_unknown_fields)]
170#[derive(Default)]
171pub struct AgentContextCompactionDelta {
172    #[serde(default)]
173    pub message: ::std::option::Option<::std::string::String>,
174    #[serde(default)]
175    pub metrics: ::std::option::Option<ContextCompactionMetrics>,
176    #[serde(default)]
177    pub outcome: ::std::option::Option<ContextCompactionOutcome>,
178    #[serde(default)]
179    pub stage: ::std::option::Option<ContextCompactionStage>,
180}
181#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug, PartialEq)]
182#[serde(deny_unknown_fields)]
183pub struct AgentEvent {
184    pub identity: AgentTurnRef,
185    #[serde(rename = "occurredAt")]
186    pub occurred_at: i64,
187    pub payload: AgentEventPayload,
188    pub sequence: u64,
189}
190#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug, PartialEq)]
191#[serde(tag = "type", content = "data")]
192pub enum AgentEventPayload {
193    #[serde(rename = "turnStarted")]
194    TurnStarted(AgentTurnStarted),
195    #[serde(rename = "messageStarted")]
196    MessageStarted(AgentMessageStarted),
197    #[serde(rename = "messageBlockStarted")]
198    MessageBlockStarted(AgentMessageBlockStarted),
199    #[serde(rename = "messageBlockDelta")]
200    MessageBlockDelta(AgentMessageBlockDelta),
201    #[serde(rename = "messageBlockCompleted")]
202    MessageBlockCompleted(AgentMessageBlockCompleted),
203    #[serde(rename = "messageCompleted")]
204    MessageCompleted(AgentMessage),
205    #[serde(rename = "waitingForInput")]
206    WaitingForInput(AgentPendingInput),
207    #[serde(rename = "metricsUpdated")]
208    MetricsUpdated(AgentRunMetrics),
209    #[serde(rename = "turnCompleted")]
210    TurnCompleted(AgentTurnCompleted),
211    #[serde(rename = "turnFailed")]
212    TurnFailed(AgentTurnFailed),
213}
214impl ::std::convert::From<AgentTurnStarted> for AgentEventPayload {
215    fn from(value: AgentTurnStarted) -> Self {
216        Self::TurnStarted(value)
217    }
218}
219impl ::std::convert::From<AgentMessageStarted> for AgentEventPayload {
220    fn from(value: AgentMessageStarted) -> Self {
221        Self::MessageStarted(value)
222    }
223}
224impl ::std::convert::From<AgentMessageBlockStarted> for AgentEventPayload {
225    fn from(value: AgentMessageBlockStarted) -> Self {
226        Self::MessageBlockStarted(value)
227    }
228}
229impl ::std::convert::From<AgentMessageBlockDelta> for AgentEventPayload {
230    fn from(value: AgentMessageBlockDelta) -> Self {
231        Self::MessageBlockDelta(value)
232    }
233}
234impl ::std::convert::From<AgentMessageBlockCompleted> for AgentEventPayload {
235    fn from(value: AgentMessageBlockCompleted) -> Self {
236        Self::MessageBlockCompleted(value)
237    }
238}
239impl ::std::convert::From<AgentMessage> for AgentEventPayload {
240    fn from(value: AgentMessage) -> Self {
241        Self::MessageCompleted(value)
242    }
243}
244impl ::std::convert::From<AgentPendingInput> for AgentEventPayload {
245    fn from(value: AgentPendingInput) -> Self {
246        Self::WaitingForInput(value)
247    }
248}
249impl ::std::convert::From<AgentRunMetrics> for AgentEventPayload {
250    fn from(value: AgentRunMetrics) -> Self {
251        Self::MetricsUpdated(value)
252    }
253}
254impl ::std::convert::From<AgentTurnCompleted> for AgentEventPayload {
255    fn from(value: AgentTurnCompleted) -> Self {
256        Self::TurnCompleted(value)
257    }
258}
259impl ::std::convert::From<AgentTurnFailed> for AgentEventPayload {
260    fn from(value: AgentTurnFailed) -> Self {
261        Self::TurnFailed(value)
262    }
263}
264#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug, PartialEq)]
265#[serde(deny_unknown_fields)]
266pub struct AgentExecutionSummary {
267    pub text: ::std::string::String,
268}
269#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug, PartialEq)]
270#[serde(tag = "type", deny_unknown_fields)]
271pub enum AgentMediaSource {
272    #[serde(rename = "url")]
273    Url { url: ::std::string::String },
274    #[serde(rename = "inlineBase64")]
275    InlineBase64 { data: ::std::string::String },
276}
277#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug, PartialEq)]
278#[serde(deny_unknown_fields)]
279pub struct AgentMessage {
280    pub blocks: ::std::vec::Vec<AgentMessageBlock>,
281    #[serde(rename = "completedAt", default)]
282    pub completed_at: ::std::option::Option<i64>,
283    #[serde(rename = "createdAt")]
284    pub created_at: i64,
285    #[serde(rename = "messageId")]
286    pub message_id: ::std::string::String,
287    pub role: AgentMessageRole,
288    pub status: AgentMessageStatus,
289    #[serde(rename = "turnId")]
290    pub turn_id: ::std::string::String,
291}
292#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug, PartialEq)]
293#[serde(deny_unknown_fields)]
294pub struct AgentMessageBlock {
295    #[serde(rename = "blockId")]
296    pub block_id: ::std::string::String,
297    #[serde(rename = "completedAt", default)]
298    pub completed_at: ::std::option::Option<i64>,
299    pub content: AgentMessageBlockContent,
300    #[serde(rename = "startedAt")]
301    pub started_at: i64,
302    pub status: AgentMessageBlockStatus,
303}
304#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug, PartialEq)]
305#[serde(deny_unknown_fields)]
306pub struct AgentMessageBlockCompleted {
307    pub block: AgentMessageBlock,
308    #[serde(rename = "messageId")]
309    pub message_id: ::std::string::String,
310}
311#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug, PartialEq)]
312#[serde(tag = "type", content = "data")]
313pub enum AgentMessageBlockContent {
314    #[serde(rename = "userContent")]
315    UserContent(AgentUserContent),
316    #[serde(rename = "reasoning")]
317    Reasoning(AgentReasoning),
318    #[serde(rename = "assistantText")]
319    AssistantText(AgentAssistantText),
320    #[serde(rename = "toolCall")]
321    ToolCall(AgentToolCall),
322    #[serde(rename = "toolResult")]
323    ToolResult(AgentToolResult),
324    #[serde(rename = "executionSummary")]
325    ExecutionSummary(AgentExecutionSummary),
326    #[serde(rename = "contextCompaction")]
327    ContextCompaction(AgentContextCompaction),
328    #[serde(rename = "systemNotice")]
329    SystemNotice(AgentSystemNotice),
330}
331impl ::std::convert::From<AgentUserContent> for AgentMessageBlockContent {
332    fn from(value: AgentUserContent) -> Self {
333        Self::UserContent(value)
334    }
335}
336impl ::std::convert::From<AgentReasoning> for AgentMessageBlockContent {
337    fn from(value: AgentReasoning) -> Self {
338        Self::Reasoning(value)
339    }
340}
341impl ::std::convert::From<AgentAssistantText> for AgentMessageBlockContent {
342    fn from(value: AgentAssistantText) -> Self {
343        Self::AssistantText(value)
344    }
345}
346impl ::std::convert::From<AgentToolCall> for AgentMessageBlockContent {
347    fn from(value: AgentToolCall) -> Self {
348        Self::ToolCall(value)
349    }
350}
351impl ::std::convert::From<AgentToolResult> for AgentMessageBlockContent {
352    fn from(value: AgentToolResult) -> Self {
353        Self::ToolResult(value)
354    }
355}
356impl ::std::convert::From<AgentExecutionSummary> for AgentMessageBlockContent {
357    fn from(value: AgentExecutionSummary) -> Self {
358        Self::ExecutionSummary(value)
359    }
360}
361impl ::std::convert::From<AgentContextCompaction> for AgentMessageBlockContent {
362    fn from(value: AgentContextCompaction) -> Self {
363        Self::ContextCompaction(value)
364    }
365}
366impl ::std::convert::From<AgentSystemNotice> for AgentMessageBlockContent {
367    fn from(value: AgentSystemNotice) -> Self {
368        Self::SystemNotice(value)
369    }
370}
371#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug, PartialEq)]
372#[serde(deny_unknown_fields)]
373pub struct AgentMessageBlockDelta {
374    #[serde(rename = "blockId")]
375    pub block_id: ::std::string::String,
376    pub delta: AgentMessageBlockDeltaContent,
377    #[serde(rename = "messageId")]
378    pub message_id: ::std::string::String,
379}
380#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug, PartialEq)]
381#[serde(tag = "type", content = "data")]
382pub enum AgentMessageBlockDeltaContent {
383    #[serde(rename = "text")]
384    Text(::std::string::String),
385    #[serde(rename = "assistantTextPhase")]
386    AssistantTextPhase(AgentAssistantTextPhase),
387    #[serde(rename = "toolCallArguments")]
388    ToolCallArguments(AgentToolCallArgumentsDelta),
389    #[serde(rename = "toolProgress")]
390    ToolProgress(AgentToolProgress),
391    #[serde(rename = "contextCompaction")]
392    ContextCompaction(AgentContextCompactionDelta),
393}
394impl ::std::convert::From<AgentAssistantTextPhase> for AgentMessageBlockDeltaContent {
395    fn from(value: AgentAssistantTextPhase) -> Self {
396        Self::AssistantTextPhase(value)
397    }
398}
399impl ::std::convert::From<AgentToolCallArgumentsDelta> for AgentMessageBlockDeltaContent {
400    fn from(value: AgentToolCallArgumentsDelta) -> Self {
401        Self::ToolCallArguments(value)
402    }
403}
404impl ::std::convert::From<AgentToolProgress> for AgentMessageBlockDeltaContent {
405    fn from(value: AgentToolProgress) -> Self {
406        Self::ToolProgress(value)
407    }
408}
409impl ::std::convert::From<AgentContextCompactionDelta> for AgentMessageBlockDeltaContent {
410    fn from(value: AgentContextCompactionDelta) -> Self {
411        Self::ContextCompaction(value)
412    }
413}
414#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug, PartialEq)]
415#[serde(deny_unknown_fields)]
416pub struct AgentMessageBlockStarted {
417    pub block: AgentMessageBlock,
418    #[serde(rename = "messageId")]
419    pub message_id: ::std::string::String,
420}
421#[derive(
422    ::serde::Deserialize,
423    ::serde::Serialize,
424    Clone,
425    Copy,
426    Debug,
427    Eq,
428    Hash,
429    Ord,
430    PartialEq,
431    PartialOrd,
432)]
433pub enum AgentMessageBlockStatus {
434    #[serde(rename = "queued")]
435    Queued,
436    #[serde(rename = "running")]
437    Running,
438    #[serde(rename = "waitingForInput")]
439    WaitingForInput,
440    #[serde(rename = "completed")]
441    Completed,
442    #[serde(rename = "failed")]
443    Failed,
444    #[serde(rename = "cancelled")]
445    Cancelled,
446}
447impl ::std::fmt::Display for AgentMessageBlockStatus {
448    fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
449        match *self {
450            Self::Queued => f.write_str("queued"),
451            Self::Running => f.write_str("running"),
452            Self::WaitingForInput => f.write_str("waitingForInput"),
453            Self::Completed => f.write_str("completed"),
454            Self::Failed => f.write_str("failed"),
455            Self::Cancelled => f.write_str("cancelled"),
456        }
457    }
458}
459impl ::std::str::FromStr for AgentMessageBlockStatus {
460    type Err = self::error::ConversionError;
461    fn from_str(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
462        match value {
463            "queued" => Ok(Self::Queued),
464            "running" => Ok(Self::Running),
465            "waitingForInput" => Ok(Self::WaitingForInput),
466            "completed" => Ok(Self::Completed),
467            "failed" => Ok(Self::Failed),
468            "cancelled" => Ok(Self::Cancelled),
469            _ => Err("invalid value".into()),
470        }
471    }
472}
473impl ::std::convert::TryFrom<&str> for AgentMessageBlockStatus {
474    type Error = self::error::ConversionError;
475    fn try_from(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
476        value.parse()
477    }
478}
479impl ::std::convert::TryFrom<&::std::string::String> for AgentMessageBlockStatus {
480    type Error = self::error::ConversionError;
481    fn try_from(
482        value: &::std::string::String,
483    ) -> ::std::result::Result<Self, self::error::ConversionError> {
484        value.parse()
485    }
486}
487impl ::std::convert::TryFrom<::std::string::String> for AgentMessageBlockStatus {
488    type Error = self::error::ConversionError;
489    fn try_from(
490        value: ::std::string::String,
491    ) -> ::std::result::Result<Self, self::error::ConversionError> {
492        value.parse()
493    }
494}
495#[derive(
496    ::serde::Deserialize,
497    ::serde::Serialize,
498    Clone,
499    Copy,
500    Debug,
501    Eq,
502    Hash,
503    Ord,
504    PartialEq,
505    PartialOrd,
506)]
507pub enum AgentMessageRole {
508    #[serde(rename = "user")]
509    User,
510    #[serde(rename = "agent")]
511    Agent,
512    #[serde(rename = "tool")]
513    Tool,
514    #[serde(rename = "system")]
515    System,
516}
517impl ::std::fmt::Display for AgentMessageRole {
518    fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
519        match *self {
520            Self::User => f.write_str("user"),
521            Self::Agent => f.write_str("agent"),
522            Self::Tool => f.write_str("tool"),
523            Self::System => f.write_str("system"),
524        }
525    }
526}
527impl ::std::str::FromStr for AgentMessageRole {
528    type Err = self::error::ConversionError;
529    fn from_str(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
530        match value {
531            "user" => Ok(Self::User),
532            "agent" => Ok(Self::Agent),
533            "tool" => Ok(Self::Tool),
534            "system" => Ok(Self::System),
535            _ => Err("invalid value".into()),
536        }
537    }
538}
539impl ::std::convert::TryFrom<&str> for AgentMessageRole {
540    type Error = self::error::ConversionError;
541    fn try_from(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
542        value.parse()
543    }
544}
545impl ::std::convert::TryFrom<&::std::string::String> for AgentMessageRole {
546    type Error = self::error::ConversionError;
547    fn try_from(
548        value: &::std::string::String,
549    ) -> ::std::result::Result<Self, self::error::ConversionError> {
550        value.parse()
551    }
552}
553impl ::std::convert::TryFrom<::std::string::String> for AgentMessageRole {
554    type Error = self::error::ConversionError;
555    fn try_from(
556        value: ::std::string::String,
557    ) -> ::std::result::Result<Self, self::error::ConversionError> {
558        value.parse()
559    }
560}
561#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug, PartialEq)]
562#[serde(deny_unknown_fields)]
563pub struct AgentMessageStarted {
564    pub message: AgentMessage,
565}
566#[derive(
567    ::serde::Deserialize,
568    ::serde::Serialize,
569    Clone,
570    Copy,
571    Debug,
572    Eq,
573    Hash,
574    Ord,
575    PartialEq,
576    PartialOrd,
577)]
578pub enum AgentMessageStatus {
579    #[serde(rename = "inProgress")]
580    InProgress,
581    #[serde(rename = "completed")]
582    Completed,
583    #[serde(rename = "failed")]
584    Failed,
585    #[serde(rename = "cancelled")]
586    Cancelled,
587}
588impl ::std::fmt::Display for AgentMessageStatus {
589    fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
590        match *self {
591            Self::InProgress => f.write_str("inProgress"),
592            Self::Completed => f.write_str("completed"),
593            Self::Failed => f.write_str("failed"),
594            Self::Cancelled => f.write_str("cancelled"),
595        }
596    }
597}
598impl ::std::str::FromStr for AgentMessageStatus {
599    type Err = self::error::ConversionError;
600    fn from_str(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
601        match value {
602            "inProgress" => Ok(Self::InProgress),
603            "completed" => Ok(Self::Completed),
604            "failed" => Ok(Self::Failed),
605            "cancelled" => Ok(Self::Cancelled),
606            _ => Err("invalid value".into()),
607        }
608    }
609}
610impl ::std::convert::TryFrom<&str> for AgentMessageStatus {
611    type Error = self::error::ConversionError;
612    fn try_from(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
613        value.parse()
614    }
615}
616impl ::std::convert::TryFrom<&::std::string::String> for AgentMessageStatus {
617    type Error = self::error::ConversionError;
618    fn try_from(
619        value: &::std::string::String,
620    ) -> ::std::result::Result<Self, self::error::ConversionError> {
621        value.parse()
622    }
623}
624impl ::std::convert::TryFrom<::std::string::String> for AgentMessageStatus {
625    type Error = self::error::ConversionError;
626    fn try_from(
627        value: ::std::string::String,
628    ) -> ::std::result::Result<Self, self::error::ConversionError> {
629        value.parse()
630    }
631}
632#[derive(
633    ::serde::Deserialize, ::serde::Serialize, Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd,
634)]
635#[serde(transparent)]
636pub struct AgentPath(pub ::std::string::String);
637impl ::std::ops::Deref for AgentPath {
638    type Target = ::std::string::String;
639    fn deref(&self) -> &::std::string::String {
640        &self.0
641    }
642}
643impl ::std::convert::From<AgentPath> for ::std::string::String {
644    fn from(value: AgentPath) -> Self {
645        value.0
646    }
647}
648impl ::std::convert::From<::std::string::String> for AgentPath {
649    fn from(value: ::std::string::String) -> Self {
650        Self(value)
651    }
652}
653impl ::std::str::FromStr for AgentPath {
654    type Err = ::std::convert::Infallible;
655    fn from_str(value: &str) -> ::std::result::Result<Self, Self::Err> {
656        Ok(Self(value.to_string()))
657    }
658}
659impl ::std::fmt::Display for AgentPath {
660    fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
661        self.0.fmt(f)
662    }
663}
664#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug, PartialEq)]
665#[serde(tag = "type", deny_unknown_fields)]
666pub enum AgentPendingInput {
667    #[serde(rename = "message")]
668    Message {
669        #[serde(rename = "actionId")]
670        action_id: ::std::string::String,
671        prompt: ::std::string::String,
672    },
673    #[serde(rename = "userAction")]
674    UserAction { action: PendingUserAction },
675}
676#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug, PartialEq)]
677#[serde(deny_unknown_fields)]
678pub struct AgentReasoning {
679    pub text: ::std::string::String,
680}
681#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug, PartialEq)]
682#[serde(deny_unknown_fields)]
683pub struct AgentRunMetrics {
684    #[serde(default)]
685    pub context: ::std::option::Option<ContextUsage>,
686    #[serde(rename = "durationMs", default)]
687    pub duration_ms: ::std::option::Option<u64>,
688    #[serde(rename = "modelRounds")]
689    pub model_rounds: u32,
690    #[serde(rename = "toolCalls")]
691    pub tool_calls: u32,
692    #[serde(rename = "toolErrors")]
693    pub tool_errors: u32,
694    #[serde(rename = "toolSuccesses")]
695    pub tool_successes: u32,
696    pub usage: TokenUsage,
697}
698#[derive(
699    ::serde::Deserialize,
700    ::serde::Serialize,
701    Clone,
702    Copy,
703    Debug,
704    Eq,
705    Hash,
706    Ord,
707    PartialEq,
708    PartialOrd,
709)]
710pub enum AgentStopReason {
711    #[serde(rename = "endTurn")]
712    EndTurn,
713    #[serde(rename = "outputLimit")]
714    OutputLimit,
715    #[serde(rename = "transferUnresolved")]
716    TransferUnresolved,
717}
718impl ::std::fmt::Display for AgentStopReason {
719    fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
720        match *self {
721            Self::EndTurn => f.write_str("endTurn"),
722            Self::OutputLimit => f.write_str("outputLimit"),
723            Self::TransferUnresolved => f.write_str("transferUnresolved"),
724        }
725    }
726}
727impl ::std::str::FromStr for AgentStopReason {
728    type Err = self::error::ConversionError;
729    fn from_str(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
730        match value {
731            "endTurn" => Ok(Self::EndTurn),
732            "outputLimit" => Ok(Self::OutputLimit),
733            "transferUnresolved" => Ok(Self::TransferUnresolved),
734            _ => Err("invalid value".into()),
735        }
736    }
737}
738impl ::std::convert::TryFrom<&str> for AgentStopReason {
739    type Error = self::error::ConversionError;
740    fn try_from(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
741        value.parse()
742    }
743}
744impl ::std::convert::TryFrom<&::std::string::String> for AgentStopReason {
745    type Error = self::error::ConversionError;
746    fn try_from(
747        value: &::std::string::String,
748    ) -> ::std::result::Result<Self, self::error::ConversionError> {
749        value.parse()
750    }
751}
752impl ::std::convert::TryFrom<::std::string::String> for AgentStopReason {
753    type Error = self::error::ConversionError;
754    fn try_from(
755        value: ::std::string::String,
756    ) -> ::std::result::Result<Self, self::error::ConversionError> {
757        value.parse()
758    }
759}
760#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug, PartialEq)]
761#[serde(deny_unknown_fields)]
762pub struct AgentSystemNotice {
763    pub content: SystemNoticeContent,
764    pub level: TalosTimelineNoticeLevel,
765}
766#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug, PartialEq)]
767#[serde(deny_unknown_fields)]
768pub struct AgentToolCall {
769    pub arguments: AgentToolCallArguments,
770    #[serde(rename = "callId")]
771    pub call_id: ::std::string::String,
772    pub name: ::std::string::String,
773    pub progress: ::std::vec::Vec<AgentToolProgress>,
774}
775#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug, PartialEq)]
776#[serde(tag = "state", deny_unknown_fields)]
777pub enum AgentToolCallArguments {
778    #[serde(rename = "streaming")]
779    Streaming {
780        #[serde(rename = "jsonFragment")]
781        json_fragment: ::std::string::String,
782    },
783    #[serde(rename = "complete")]
784    Complete { value: ToolArguments },
785}
786#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug, PartialEq)]
787#[serde(deny_unknown_fields)]
788pub struct AgentToolCallArgumentsDelta {
789    #[serde(rename = "jsonFragment")]
790    pub json_fragment: ::std::string::String,
791}
792#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug, PartialEq)]
793#[serde(deny_unknown_fields)]
794pub struct AgentToolProgress {
795    pub kind: TalosToolProgressKind,
796    #[serde(rename = "occurredAt")]
797    pub occurred_at: i64,
798    pub text: ::std::string::String,
799}
800#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug, PartialEq)]
801#[serde(deny_unknown_fields)]
802pub struct AgentToolResult {
803    #[serde(rename = "callId")]
804    pub call_id: ::std::string::String,
805    pub content: ::std::vec::Vec<TalosContentItem>,
806    #[serde(rename = "isError")]
807    pub is_error: bool,
808    #[serde(default)]
809    pub metrics: ::std::option::Option<ToolExecutionMetrics>,
810    #[serde(rename = "toolName")]
811    pub tool_name: ::std::string::String,
812}
813#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug, PartialEq)]
814#[serde(deny_unknown_fields)]
815pub struct AgentTreeNode {
816    pub children: ::std::vec::Vec<AgentTreeNode>,
817    pub snapshot: SubagentSnapshot,
818}
819#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug, PartialEq)]
820#[serde(deny_unknown_fields)]
821pub struct AgentTreeSnapshot {
822    pub children: ::std::vec::Vec<AgentTreeNode>,
823}
824#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug, PartialEq)]
825#[serde(deny_unknown_fields)]
826pub struct AgentTurnCompleted {
827    #[serde(rename = "stopReason")]
828    pub stop_reason: AgentStopReason,
829}
830#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug, PartialEq)]
831#[serde(deny_unknown_fields)]
832pub struct AgentTurnFailed {
833    pub error: ApiError,
834    pub retryable: bool,
835}
836#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug, PartialEq)]
837#[serde(deny_unknown_fields)]
838pub struct AgentTurnRef {
839    #[serde(rename = "sessionId")]
840    pub session_id: ::std::string::String,
841    #[serde(rename = "turnId")]
842    pub turn_id: ::std::string::String,
843}
844#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug, PartialEq)]
845#[serde(deny_unknown_fields)]
846#[derive(Default)]
847pub struct AgentTurnStarted {}
848#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug, PartialEq)]
849#[serde(tag = "type", deny_unknown_fields)]
850pub enum AgentUserContent {
851    #[serde(rename = "text")]
852    Text { text: ::std::string::String },
853    #[serde(rename = "skillSelection")]
854    SkillSelection {
855        name: ::std::string::String,
856        path: ::std::string::String,
857    },
858    #[serde(rename = "file")]
859    File {
860        #[serde(rename = "fileId")]
861        file_id: ::std::string::String,
862    },
863    #[serde(rename = "audio")]
864    Audio {
865        #[serde(rename = "mimeType", default)]
866        mime_type: ::std::option::Option<::std::string::String>,
867        source: AgentMediaSource,
868    },
869    #[serde(rename = "video")]
870    Video {
871        #[serde(rename = "mimeType", default)]
872        mime_type: ::std::option::Option<::std::string::String>,
873        source: AgentMediaSource,
874    },
875    #[serde(rename = "userActionResponse")]
876    UserActionResponse {
877        #[serde(rename = "actionId")]
878        action_id: ::std::string::String,
879        response: UserActionResponse,
880    },
881}
882#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug, PartialEq)]
883#[serde(deny_unknown_fields)]
884pub struct ApiError {
885    pub code: ErrorCode,
886    pub localization: ::std::option::Option<ErrorLocalization>,
887    pub message: ::std::string::String,
888}
889#[derive(
890    ::serde::Deserialize,
891    ::serde::Serialize,
892    Clone,
893    Copy,
894    Debug,
895    Eq,
896    Hash,
897    Ord,
898    PartialEq,
899    PartialOrd,
900)]
901pub enum BashOutputCaptureStatus {
902    #[serde(rename = "capturing")]
903    Capturing,
904    #[serde(rename = "complete")]
905    Complete,
906    #[serde(rename = "quotaLimited")]
907    QuotaLimited,
908    #[serde(rename = "interrupted")]
909    Interrupted,
910    #[serde(rename = "writeFailed")]
911    WriteFailed,
912}
913impl ::std::fmt::Display for BashOutputCaptureStatus {
914    fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
915        match *self {
916            Self::Capturing => f.write_str("capturing"),
917            Self::Complete => f.write_str("complete"),
918            Self::QuotaLimited => f.write_str("quotaLimited"),
919            Self::Interrupted => f.write_str("interrupted"),
920            Self::WriteFailed => f.write_str("writeFailed"),
921        }
922    }
923}
924impl ::std::str::FromStr for BashOutputCaptureStatus {
925    type Err = self::error::ConversionError;
926    fn from_str(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
927        match value {
928            "capturing" => Ok(Self::Capturing),
929            "complete" => Ok(Self::Complete),
930            "quotaLimited" => Ok(Self::QuotaLimited),
931            "interrupted" => Ok(Self::Interrupted),
932            "writeFailed" => Ok(Self::WriteFailed),
933            _ => Err("invalid value".into()),
934        }
935    }
936}
937impl ::std::convert::TryFrom<&str> for BashOutputCaptureStatus {
938    type Error = self::error::ConversionError;
939    fn try_from(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
940        value.parse()
941    }
942}
943impl ::std::convert::TryFrom<&::std::string::String> for BashOutputCaptureStatus {
944    type Error = self::error::ConversionError;
945    fn try_from(
946        value: &::std::string::String,
947    ) -> ::std::result::Result<Self, self::error::ConversionError> {
948        value.parse()
949    }
950}
951impl ::std::convert::TryFrom<::std::string::String> for BashOutputCaptureStatus {
952    type Error = self::error::ConversionError;
953    fn try_from(
954        value: ::std::string::String,
955    ) -> ::std::result::Result<Self, self::error::ConversionError> {
956        value.parse()
957    }
958}
959#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug, PartialEq)]
960#[serde(deny_unknown_fields)]
961pub struct BashOutputLog {
962    #[serde(rename = "captureStatus")]
963    pub capture_status: BashOutputCaptureStatus,
964    #[serde(rename = "expiresAt")]
965    pub expires_at: i64,
966    pub path: ::std::string::String,
967    #[serde(rename = "relativePath")]
968    pub relative_path: ::std::string::String,
969    #[serde(rename = "storedBytes")]
970    pub stored_bytes: u64,
971    #[serde(rename = "totalBytes")]
972    pub total_bytes: u64,
973    #[serde(rename = "totalLines")]
974    pub total_lines: u64,
975}
976#[derive(
977    ::serde::Deserialize,
978    ::serde::Serialize,
979    Clone,
980    Copy,
981    Debug,
982    Eq,
983    Hash,
984    Ord,
985    PartialEq,
986    PartialOrd,
987)]
988pub enum BrowserCapabilityOperation {
989    #[serde(rename = "remoteDesktop")]
990    RemoteDesktop,
991    #[serde(rename = "takeControl")]
992    TakeControl,
993    #[serde(rename = "releaseControl")]
994    ReleaseControl,
995    #[serde(rename = "openLocal")]
996    OpenLocal,
997}
998impl ::std::fmt::Display for BrowserCapabilityOperation {
999    fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
1000        match *self {
1001            Self::RemoteDesktop => f.write_str("remoteDesktop"),
1002            Self::TakeControl => f.write_str("takeControl"),
1003            Self::ReleaseControl => f.write_str("releaseControl"),
1004            Self::OpenLocal => f.write_str("openLocal"),
1005        }
1006    }
1007}
1008impl ::std::str::FromStr for BrowserCapabilityOperation {
1009    type Err = self::error::ConversionError;
1010    fn from_str(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
1011        match value {
1012            "remoteDesktop" => Ok(Self::RemoteDesktop),
1013            "takeControl" => Ok(Self::TakeControl),
1014            "releaseControl" => Ok(Self::ReleaseControl),
1015            "openLocal" => Ok(Self::OpenLocal),
1016            _ => Err("invalid value".into()),
1017        }
1018    }
1019}
1020impl ::std::convert::TryFrom<&str> for BrowserCapabilityOperation {
1021    type Error = self::error::ConversionError;
1022    fn try_from(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
1023        value.parse()
1024    }
1025}
1026impl ::std::convert::TryFrom<&::std::string::String> for BrowserCapabilityOperation {
1027    type Error = self::error::ConversionError;
1028    fn try_from(
1029        value: &::std::string::String,
1030    ) -> ::std::result::Result<Self, self::error::ConversionError> {
1031        value.parse()
1032    }
1033}
1034impl ::std::convert::TryFrom<::std::string::String> for BrowserCapabilityOperation {
1035    type Error = self::error::ConversionError;
1036    fn try_from(
1037        value: ::std::string::String,
1038    ) -> ::std::result::Result<Self, self::error::ConversionError> {
1039        value.parse()
1040    }
1041}
1042#[derive(
1043    ::serde::Deserialize,
1044    ::serde::Serialize,
1045    Clone,
1046    Copy,
1047    Debug,
1048    Eq,
1049    Hash,
1050    Ord,
1051    PartialEq,
1052    PartialOrd,
1053)]
1054pub enum BrowserCapabilityReason {
1055    #[serde(rename = "nativeHost")]
1056    NativeHost,
1057    #[serde(rename = "notBundled")]
1058    NotBundled,
1059    #[serde(rename = "hostPolicy")]
1060    HostPolicy,
1061    #[serde(rename = "unsupportedVersion")]
1062    UnsupportedVersion,
1063    #[serde(rename = "clientMismatch")]
1064    ClientMismatch,
1065}
1066impl ::std::fmt::Display for BrowserCapabilityReason {
1067    fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
1068        match *self {
1069            Self::NativeHost => f.write_str("nativeHost"),
1070            Self::NotBundled => f.write_str("notBundled"),
1071            Self::HostPolicy => f.write_str("hostPolicy"),
1072            Self::UnsupportedVersion => f.write_str("unsupportedVersion"),
1073            Self::ClientMismatch => f.write_str("clientMismatch"),
1074        }
1075    }
1076}
1077impl ::std::str::FromStr for BrowserCapabilityReason {
1078    type Err = self::error::ConversionError;
1079    fn from_str(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
1080        match value {
1081            "nativeHost" => Ok(Self::NativeHost),
1082            "notBundled" => Ok(Self::NotBundled),
1083            "hostPolicy" => Ok(Self::HostPolicy),
1084            "unsupportedVersion" => Ok(Self::UnsupportedVersion),
1085            "clientMismatch" => Ok(Self::ClientMismatch),
1086            _ => Err("invalid value".into()),
1087        }
1088    }
1089}
1090impl ::std::convert::TryFrom<&str> for BrowserCapabilityReason {
1091    type Error = self::error::ConversionError;
1092    fn try_from(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
1093        value.parse()
1094    }
1095}
1096impl ::std::convert::TryFrom<&::std::string::String> for BrowserCapabilityReason {
1097    type Error = self::error::ConversionError;
1098    fn try_from(
1099        value: &::std::string::String,
1100    ) -> ::std::result::Result<Self, self::error::ConversionError> {
1101        value.parse()
1102    }
1103}
1104impl ::std::convert::TryFrom<::std::string::String> for BrowserCapabilityReason {
1105    type Error = self::error::ConversionError;
1106    fn try_from(
1107        value: ::std::string::String,
1108    ) -> ::std::result::Result<Self, self::error::ConversionError> {
1109        value.parse()
1110    }
1111}
1112#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug, PartialEq)]
1113#[serde(tag = "operation", content = "result")]
1114pub enum CollaborationToolResult {
1115    #[serde(rename = "spawnAgent")]
1116    SpawnAgent(SubagentSpawnResult),
1117    #[serde(rename = "sendMessage")]
1118    SendMessage(SendMessageResult),
1119    #[serde(rename = "waitAgent")]
1120    WaitAgent(SubagentSnapshot),
1121    #[serde(rename = "interruptAgent")]
1122    InterruptAgent(SubagentSnapshot),
1123    #[serde(rename = "followupTask")]
1124    FollowupTask(SubagentSnapshot),
1125    #[serde(rename = "listAgents")]
1126    ListAgents(AgentTreeSnapshot),
1127}
1128impl ::std::convert::From<SubagentSpawnResult> for CollaborationToolResult {
1129    fn from(value: SubagentSpawnResult) -> Self {
1130        Self::SpawnAgent(value)
1131    }
1132}
1133impl ::std::convert::From<SendMessageResult> for CollaborationToolResult {
1134    fn from(value: SendMessageResult) -> Self {
1135        Self::SendMessage(value)
1136    }
1137}
1138impl ::std::convert::From<AgentTreeSnapshot> for CollaborationToolResult {
1139    fn from(value: AgentTreeSnapshot) -> Self {
1140        Self::ListAgents(value)
1141    }
1142}
1143#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug, PartialEq)]
1144#[serde(deny_unknown_fields)]
1145pub struct ContextCompactionMetrics {
1146    pub compaction_input_tokens: u32,
1147    pub compaction_output_tokens: u32,
1148    #[serde(default)]
1149    pub covers_from_seq: ::std::option::Option<u64>,
1150    #[serde(default)]
1151    pub covers_until_seq: ::std::option::Option<u64>,
1152    pub post_compaction_total_tokens: u32,
1153    pub pre_compaction_total_tokens: u32,
1154    #[serde(default)]
1155    pub raw_tail_backfilled_count: ::std::option::Option<u32>,
1156    #[serde(default)]
1157    pub raw_tail_preferred_count: ::std::option::Option<u32>,
1158    pub trimmed_context_unit_count: u32,
1159    #[serde(default)]
1160    pub working_context_compacted_messages: ::std::option::Option<u32>,
1161    #[serde(default)]
1162    pub working_context_input_messages: ::std::option::Option<u32>,
1163    #[serde(default)]
1164    pub working_context_preserved_recent_exchanges: ::std::option::Option<u32>,
1165}
1166#[derive(
1167    ::serde::Deserialize,
1168    ::serde::Serialize,
1169    Clone,
1170    Copy,
1171    Debug,
1172    Eq,
1173    Hash,
1174    Ord,
1175    PartialEq,
1176    PartialOrd,
1177)]
1178pub enum ContextCompactionOutcome {
1179    #[serde(rename = "applied")]
1180    Applied,
1181    #[serde(rename = "no_changes")]
1182    NoChanges,
1183    #[serde(rename = "rejected_missing_summary")]
1184    RejectedMissingSummary,
1185    #[serde(rename = "trimmed_fallback_applied")]
1186    TrimmedFallbackApplied,
1187    #[serde(rename = "failed_context_still_too_large")]
1188    FailedContextStillTooLarge,
1189    #[serde(rename = "failed_provider_error")]
1190    FailedProviderError,
1191    #[serde(rename = "failed_internal_error")]
1192    FailedInternalError,
1193}
1194impl ::std::fmt::Display for ContextCompactionOutcome {
1195    fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
1196        match *self {
1197            Self::Applied => f.write_str("applied"),
1198            Self::NoChanges => f.write_str("no_changes"),
1199            Self::RejectedMissingSummary => f.write_str("rejected_missing_summary"),
1200            Self::TrimmedFallbackApplied => f.write_str("trimmed_fallback_applied"),
1201            Self::FailedContextStillTooLarge => f.write_str("failed_context_still_too_large"),
1202            Self::FailedProviderError => f.write_str("failed_provider_error"),
1203            Self::FailedInternalError => f.write_str("failed_internal_error"),
1204        }
1205    }
1206}
1207impl ::std::str::FromStr for ContextCompactionOutcome {
1208    type Err = self::error::ConversionError;
1209    fn from_str(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
1210        match value {
1211            "applied" => Ok(Self::Applied),
1212            "no_changes" => Ok(Self::NoChanges),
1213            "rejected_missing_summary" => Ok(Self::RejectedMissingSummary),
1214            "trimmed_fallback_applied" => Ok(Self::TrimmedFallbackApplied),
1215            "failed_context_still_too_large" => Ok(Self::FailedContextStillTooLarge),
1216            "failed_provider_error" => Ok(Self::FailedProviderError),
1217            "failed_internal_error" => Ok(Self::FailedInternalError),
1218            _ => Err("invalid value".into()),
1219        }
1220    }
1221}
1222impl ::std::convert::TryFrom<&str> for ContextCompactionOutcome {
1223    type Error = self::error::ConversionError;
1224    fn try_from(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
1225        value.parse()
1226    }
1227}
1228impl ::std::convert::TryFrom<&::std::string::String> for ContextCompactionOutcome {
1229    type Error = self::error::ConversionError;
1230    fn try_from(
1231        value: &::std::string::String,
1232    ) -> ::std::result::Result<Self, self::error::ConversionError> {
1233        value.parse()
1234    }
1235}
1236impl ::std::convert::TryFrom<::std::string::String> for ContextCompactionOutcome {
1237    type Error = self::error::ConversionError;
1238    fn try_from(
1239        value: ::std::string::String,
1240    ) -> ::std::result::Result<Self, self::error::ConversionError> {
1241        value.parse()
1242    }
1243}
1244#[derive(
1245    ::serde::Deserialize,
1246    ::serde::Serialize,
1247    Clone,
1248    Copy,
1249    Debug,
1250    Eq,
1251    Hash,
1252    Ord,
1253    PartialEq,
1254    PartialOrd,
1255)]
1256pub enum ContextCompactionStage {
1257    #[serde(rename = "preparing")]
1258    Preparing,
1259    #[serde(rename = "summarizing")]
1260    Summarizing,
1261    #[serde(rename = "rebuilding_prompt")]
1262    RebuildingPrompt,
1263    #[serde(rename = "trimming")]
1264    Trimming,
1265    #[serde(rename = "completed")]
1266    Completed,
1267    #[serde(rename = "failed")]
1268    Failed,
1269}
1270impl ::std::fmt::Display for ContextCompactionStage {
1271    fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
1272        match *self {
1273            Self::Preparing => f.write_str("preparing"),
1274            Self::Summarizing => f.write_str("summarizing"),
1275            Self::RebuildingPrompt => f.write_str("rebuilding_prompt"),
1276            Self::Trimming => f.write_str("trimming"),
1277            Self::Completed => f.write_str("completed"),
1278            Self::Failed => f.write_str("failed"),
1279        }
1280    }
1281}
1282impl ::std::str::FromStr for ContextCompactionStage {
1283    type Err = self::error::ConversionError;
1284    fn from_str(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
1285        match value {
1286            "preparing" => Ok(Self::Preparing),
1287            "summarizing" => Ok(Self::Summarizing),
1288            "rebuilding_prompt" => Ok(Self::RebuildingPrompt),
1289            "trimming" => Ok(Self::Trimming),
1290            "completed" => Ok(Self::Completed),
1291            "failed" => Ok(Self::Failed),
1292            _ => Err("invalid value".into()),
1293        }
1294    }
1295}
1296impl ::std::convert::TryFrom<&str> for ContextCompactionStage {
1297    type Error = self::error::ConversionError;
1298    fn try_from(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
1299        value.parse()
1300    }
1301}
1302impl ::std::convert::TryFrom<&::std::string::String> for ContextCompactionStage {
1303    type Error = self::error::ConversionError;
1304    fn try_from(
1305        value: &::std::string::String,
1306    ) -> ::std::result::Result<Self, self::error::ConversionError> {
1307        value.parse()
1308    }
1309}
1310impl ::std::convert::TryFrom<::std::string::String> for ContextCompactionStage {
1311    type Error = self::error::ConversionError;
1312    fn try_from(
1313        value: ::std::string::String,
1314    ) -> ::std::result::Result<Self, self::error::ConversionError> {
1315        value.parse()
1316    }
1317}
1318#[derive(
1319    ::serde::Deserialize,
1320    ::serde::Serialize,
1321    Clone,
1322    Copy,
1323    Debug,
1324    Eq,
1325    Hash,
1326    Ord,
1327    PartialEq,
1328    PartialOrd,
1329)]
1330pub enum ContextCompactionTrigger {
1331    #[serde(rename = "user_requested")]
1332    UserRequested,
1333    #[serde(rename = "threshold_exceeded")]
1334    ThresholdExceeded,
1335    #[serde(rename = "hard_threshold_exceeded")]
1336    HardThresholdExceeded,
1337    #[serde(rename = "budget_exceeded")]
1338    BudgetExceeded,
1339    #[serde(rename = "history_sections_dropped")]
1340    HistorySectionsDropped,
1341    #[serde(rename = "working_context_exceeded")]
1342    WorkingContextExceeded,
1343}
1344impl ::std::fmt::Display for ContextCompactionTrigger {
1345    fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
1346        match *self {
1347            Self::UserRequested => f.write_str("user_requested"),
1348            Self::ThresholdExceeded => f.write_str("threshold_exceeded"),
1349            Self::HardThresholdExceeded => f.write_str("hard_threshold_exceeded"),
1350            Self::BudgetExceeded => f.write_str("budget_exceeded"),
1351            Self::HistorySectionsDropped => f.write_str("history_sections_dropped"),
1352            Self::WorkingContextExceeded => f.write_str("working_context_exceeded"),
1353        }
1354    }
1355}
1356impl ::std::str::FromStr for ContextCompactionTrigger {
1357    type Err = self::error::ConversionError;
1358    fn from_str(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
1359        match value {
1360            "user_requested" => Ok(Self::UserRequested),
1361            "threshold_exceeded" => Ok(Self::ThresholdExceeded),
1362            "hard_threshold_exceeded" => Ok(Self::HardThresholdExceeded),
1363            "budget_exceeded" => Ok(Self::BudgetExceeded),
1364            "history_sections_dropped" => Ok(Self::HistorySectionsDropped),
1365            "working_context_exceeded" => Ok(Self::WorkingContextExceeded),
1366            _ => Err("invalid value".into()),
1367        }
1368    }
1369}
1370impl ::std::convert::TryFrom<&str> for ContextCompactionTrigger {
1371    type Error = self::error::ConversionError;
1372    fn try_from(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
1373        value.parse()
1374    }
1375}
1376impl ::std::convert::TryFrom<&::std::string::String> for ContextCompactionTrigger {
1377    type Error = self::error::ConversionError;
1378    fn try_from(
1379        value: &::std::string::String,
1380    ) -> ::std::result::Result<Self, self::error::ConversionError> {
1381        value.parse()
1382    }
1383}
1384impl ::std::convert::TryFrom<::std::string::String> for ContextCompactionTrigger {
1385    type Error = self::error::ConversionError;
1386    fn try_from(
1387        value: ::std::string::String,
1388    ) -> ::std::result::Result<Self, self::error::ConversionError> {
1389        value.parse()
1390    }
1391}
1392#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug, PartialEq)]
1393#[serde(deny_unknown_fields)]
1394pub struct ContextUsage {
1395    #[serde(rename = "contextWindowTokens")]
1396    pub context_window_tokens: u32,
1397    #[serde(rename = "effectivePromptBudgetTokens")]
1398    pub effective_prompt_budget_tokens: u32,
1399    #[serde(rename = "measuredAt")]
1400    pub measured_at: i64,
1401    #[serde(rename = "usedTokens")]
1402    pub used_tokens: u32,
1403}
1404#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug, PartialEq)]
1405#[serde(deny_unknown_fields)]
1406pub struct DynamicToolResult {
1407    pub output: ::std::string::String,
1408    pub success: bool,
1409}
1410#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug, PartialEq)]
1411#[serde(deny_unknown_fields)]
1412pub struct DynamicToolResultParams {
1413    #[serde(rename = "toolName")]
1414    pub tool_name: ::std::string::String,
1415}
1416#[derive(
1417    ::serde::Deserialize,
1418    ::serde::Serialize,
1419    Clone,
1420    Copy,
1421    Debug,
1422    Eq,
1423    Hash,
1424    Ord,
1425    PartialEq,
1426    PartialOrd,
1427)]
1428pub enum ErrorCode {
1429    #[serde(rename = "invalidRequest")]
1430    InvalidRequest,
1431    #[serde(rename = "invalidRetryRequest")]
1432    InvalidRetryRequest,
1433    #[serde(rename = "unauthenticated")]
1434    Unauthenticated,
1435    #[serde(rename = "permissionDenied")]
1436    PermissionDenied,
1437    #[serde(rename = "resourceNotFound")]
1438    ResourceNotFound,
1439    #[serde(rename = "sessionNotFound")]
1440    SessionNotFound,
1441    #[serde(rename = "resourceExpired")]
1442    ResourceExpired,
1443    #[serde(rename = "conflict")]
1444    Conflict,
1445    #[serde(rename = "activeTurnRunning")]
1446    ActiveTurnRunning,
1447    #[serde(rename = "messageQueueFull")]
1448    MessageQueueFull,
1449    #[serde(rename = "messageQueueBusy")]
1450    MessageQueueBusy,
1451    #[serde(rename = "retrySourceCompleted")]
1452    RetrySourceCompleted,
1453    #[serde(rename = "retrySourceMismatch")]
1454    RetrySourceMismatch,
1455    #[serde(rename = "idempotencyConflict")]
1456    IdempotencyConflict,
1457    #[serde(rename = "invalidCursor")]
1458    InvalidCursor,
1459    #[serde(rename = "eventCursorExpired")]
1460    EventCursorExpired,
1461    #[serde(rename = "fsDisabled")]
1462    FsDisabled,
1463    #[serde(rename = "invalidPath")]
1464    InvalidPath,
1465    #[serde(rename = "pathOutsideRoot")]
1466    PathOutsideRoot,
1467    #[serde(rename = "symlinkNotSupported")]
1468    SymlinkNotSupported,
1469    #[serde(rename = "pathNotFound")]
1470    PathNotFound,
1471    #[serde(rename = "notDirectory")]
1472    NotDirectory,
1473    #[serde(rename = "invalidName")]
1474    InvalidName,
1475    #[serde(rename = "alreadyExists")]
1476    AlreadyExists,
1477    #[serde(rename = "uploadTooLarge")]
1478    UploadTooLarge,
1479    #[serde(rename = "unsupportedMediaType")]
1480    UnsupportedMediaType,
1481    #[serde(rename = "attachmentLimitExceeded")]
1482    AttachmentLimitExceeded,
1483    #[serde(rename = "unsupportedAttachment")]
1484    UnsupportedAttachment,
1485    #[serde(rename = "fileInputRejected")]
1486    FileInputRejected,
1487    #[serde(rename = "contextWindowExceeded")]
1488    ContextWindowExceeded,
1489    #[serde(rename = "sessionBudgetExceeded")]
1490    SessionBudgetExceeded,
1491    #[serde(rename = "usageLimitExceeded")]
1492    UsageLimitExceeded,
1493    #[serde(rename = "contextCompactionFailed")]
1494    ContextCompactionFailed,
1495    #[serde(rename = "providerUnavailable")]
1496    ProviderUnavailable,
1497    #[serde(rename = "toolExecutionFailed")]
1498    ToolExecutionFailed,
1499    #[serde(rename = "timeout")]
1500    Timeout,
1501    #[serde(rename = "cancelled")]
1502    Cancelled,
1503    #[serde(rename = "serviceUnavailable")]
1504    ServiceUnavailable,
1505    #[serde(rename = "runForcedAbort")]
1506    RunForcedAbort,
1507    #[serde(rename = "runCleanupUnconfirmed")]
1508    RunCleanupUnconfirmed,
1509    #[serde(rename = "internalError")]
1510    InternalError,
1511}
1512impl ::std::fmt::Display for ErrorCode {
1513    fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
1514        match *self {
1515            Self::InvalidRequest => f.write_str("invalidRequest"),
1516            Self::InvalidRetryRequest => f.write_str("invalidRetryRequest"),
1517            Self::Unauthenticated => f.write_str("unauthenticated"),
1518            Self::PermissionDenied => f.write_str("permissionDenied"),
1519            Self::ResourceNotFound => f.write_str("resourceNotFound"),
1520            Self::SessionNotFound => f.write_str("sessionNotFound"),
1521            Self::ResourceExpired => f.write_str("resourceExpired"),
1522            Self::Conflict => f.write_str("conflict"),
1523            Self::ActiveTurnRunning => f.write_str("activeTurnRunning"),
1524            Self::MessageQueueFull => f.write_str("messageQueueFull"),
1525            Self::MessageQueueBusy => f.write_str("messageQueueBusy"),
1526            Self::RetrySourceCompleted => f.write_str("retrySourceCompleted"),
1527            Self::RetrySourceMismatch => f.write_str("retrySourceMismatch"),
1528            Self::IdempotencyConflict => f.write_str("idempotencyConflict"),
1529            Self::InvalidCursor => f.write_str("invalidCursor"),
1530            Self::EventCursorExpired => f.write_str("eventCursorExpired"),
1531            Self::FsDisabled => f.write_str("fsDisabled"),
1532            Self::InvalidPath => f.write_str("invalidPath"),
1533            Self::PathOutsideRoot => f.write_str("pathOutsideRoot"),
1534            Self::SymlinkNotSupported => f.write_str("symlinkNotSupported"),
1535            Self::PathNotFound => f.write_str("pathNotFound"),
1536            Self::NotDirectory => f.write_str("notDirectory"),
1537            Self::InvalidName => f.write_str("invalidName"),
1538            Self::AlreadyExists => f.write_str("alreadyExists"),
1539            Self::UploadTooLarge => f.write_str("uploadTooLarge"),
1540            Self::UnsupportedMediaType => f.write_str("unsupportedMediaType"),
1541            Self::AttachmentLimitExceeded => f.write_str("attachmentLimitExceeded"),
1542            Self::UnsupportedAttachment => f.write_str("unsupportedAttachment"),
1543            Self::FileInputRejected => f.write_str("fileInputRejected"),
1544            Self::ContextWindowExceeded => f.write_str("contextWindowExceeded"),
1545            Self::SessionBudgetExceeded => f.write_str("sessionBudgetExceeded"),
1546            Self::UsageLimitExceeded => f.write_str("usageLimitExceeded"),
1547            Self::ContextCompactionFailed => f.write_str("contextCompactionFailed"),
1548            Self::ProviderUnavailable => f.write_str("providerUnavailable"),
1549            Self::ToolExecutionFailed => f.write_str("toolExecutionFailed"),
1550            Self::Timeout => f.write_str("timeout"),
1551            Self::Cancelled => f.write_str("cancelled"),
1552            Self::ServiceUnavailable => f.write_str("serviceUnavailable"),
1553            Self::RunForcedAbort => f.write_str("runForcedAbort"),
1554            Self::RunCleanupUnconfirmed => f.write_str("runCleanupUnconfirmed"),
1555            Self::InternalError => f.write_str("internalError"),
1556        }
1557    }
1558}
1559impl ::std::str::FromStr for ErrorCode {
1560    type Err = self::error::ConversionError;
1561    fn from_str(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
1562        match value {
1563            "invalidRequest" => Ok(Self::InvalidRequest),
1564            "invalidRetryRequest" => Ok(Self::InvalidRetryRequest),
1565            "unauthenticated" => Ok(Self::Unauthenticated),
1566            "permissionDenied" => Ok(Self::PermissionDenied),
1567            "resourceNotFound" => Ok(Self::ResourceNotFound),
1568            "sessionNotFound" => Ok(Self::SessionNotFound),
1569            "resourceExpired" => Ok(Self::ResourceExpired),
1570            "conflict" => Ok(Self::Conflict),
1571            "activeTurnRunning" => Ok(Self::ActiveTurnRunning),
1572            "messageQueueFull" => Ok(Self::MessageQueueFull),
1573            "messageQueueBusy" => Ok(Self::MessageQueueBusy),
1574            "retrySourceCompleted" => Ok(Self::RetrySourceCompleted),
1575            "retrySourceMismatch" => Ok(Self::RetrySourceMismatch),
1576            "idempotencyConflict" => Ok(Self::IdempotencyConflict),
1577            "invalidCursor" => Ok(Self::InvalidCursor),
1578            "eventCursorExpired" => Ok(Self::EventCursorExpired),
1579            "fsDisabled" => Ok(Self::FsDisabled),
1580            "invalidPath" => Ok(Self::InvalidPath),
1581            "pathOutsideRoot" => Ok(Self::PathOutsideRoot),
1582            "symlinkNotSupported" => Ok(Self::SymlinkNotSupported),
1583            "pathNotFound" => Ok(Self::PathNotFound),
1584            "notDirectory" => Ok(Self::NotDirectory),
1585            "invalidName" => Ok(Self::InvalidName),
1586            "alreadyExists" => Ok(Self::AlreadyExists),
1587            "uploadTooLarge" => Ok(Self::UploadTooLarge),
1588            "unsupportedMediaType" => Ok(Self::UnsupportedMediaType),
1589            "attachmentLimitExceeded" => Ok(Self::AttachmentLimitExceeded),
1590            "unsupportedAttachment" => Ok(Self::UnsupportedAttachment),
1591            "fileInputRejected" => Ok(Self::FileInputRejected),
1592            "contextWindowExceeded" => Ok(Self::ContextWindowExceeded),
1593            "sessionBudgetExceeded" => Ok(Self::SessionBudgetExceeded),
1594            "usageLimitExceeded" => Ok(Self::UsageLimitExceeded),
1595            "contextCompactionFailed" => Ok(Self::ContextCompactionFailed),
1596            "providerUnavailable" => Ok(Self::ProviderUnavailable),
1597            "toolExecutionFailed" => Ok(Self::ToolExecutionFailed),
1598            "timeout" => Ok(Self::Timeout),
1599            "cancelled" => Ok(Self::Cancelled),
1600            "serviceUnavailable" => Ok(Self::ServiceUnavailable),
1601            "runForcedAbort" => Ok(Self::RunForcedAbort),
1602            "runCleanupUnconfirmed" => Ok(Self::RunCleanupUnconfirmed),
1603            "internalError" => Ok(Self::InternalError),
1604            _ => Err("invalid value".into()),
1605        }
1606    }
1607}
1608impl ::std::convert::TryFrom<&str> for ErrorCode {
1609    type Error = self::error::ConversionError;
1610    fn try_from(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
1611        value.parse()
1612    }
1613}
1614impl ::std::convert::TryFrom<&::std::string::String> for ErrorCode {
1615    type Error = self::error::ConversionError;
1616    fn try_from(
1617        value: &::std::string::String,
1618    ) -> ::std::result::Result<Self, self::error::ConversionError> {
1619        value.parse()
1620    }
1621}
1622impl ::std::convert::TryFrom<::std::string::String> for ErrorCode {
1623    type Error = self::error::ConversionError;
1624    fn try_from(
1625        value: ::std::string::String,
1626    ) -> ::std::result::Result<Self, self::error::ConversionError> {
1627        value.parse()
1628    }
1629}
1630#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug, PartialEq)]
1631#[serde(tag = "type", deny_unknown_fields)]
1632pub enum ErrorLocalization {
1633    #[serde(rename = "browserCapabilityUnavailable")]
1634    BrowserCapabilityUnavailable {
1635        operation: BrowserCapabilityOperation,
1636        reason: BrowserCapabilityReason,
1637    },
1638    #[serde(rename = "computerDeletionActive")]
1639    ComputerDeletionActive,
1640    #[serde(rename = "computerRegistrationRemoved")]
1641    ComputerRegistrationRemoved,
1642    #[serde(rename = "computerDeletionUnverified")]
1643    ComputerDeletionUnverified,
1644    #[serde(rename = "modelNotConfigured")]
1645    ModelNotConfigured {
1646        model: ::std::string::String,
1647        provider: ::std::string::String,
1648    },
1649    #[serde(rename = "attachmentCountExceeded")]
1650    AttachmentCountExceeded { actual: u64, limit: u64 },
1651}
1652#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug, PartialEq)]
1653#[serde(deny_unknown_fields)]
1654pub struct FileInfo {
1655    #[serde(rename = "createdAt")]
1656    pub created_at: i64,
1657    #[serde(rename = "fileId")]
1658    pub file_id: ::std::string::String,
1659    pub metadata: ::std::collections::HashMap<::std::string::String, ::std::string::String>,
1660    #[serde(rename = "mimeType")]
1661    pub mime_type: ::std::string::String,
1662    #[serde(rename = "originalFilename")]
1663    pub original_filename: ::std::string::String,
1664    pub scope: FileScope,
1665    #[serde(rename = "sizeBytes")]
1666    pub size_bytes: u64,
1667    pub tags: ::std::vec::Vec<::std::string::String>,
1668    #[serde(rename = "updatedAt")]
1669    pub updated_at: i64,
1670}
1671#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug, PartialEq)]
1672#[serde(tag = "type", content = "projectId")]
1673pub enum FileScope {
1674    #[serde(rename = "personal")]
1675    Personal,
1676    #[serde(rename = "project")]
1677    Project(::std::string::String),
1678}
1679#[derive(
1680    ::serde::Deserialize,
1681    ::serde::Serialize,
1682    Clone,
1683    Copy,
1684    Debug,
1685    Eq,
1686    Hash,
1687    Ord,
1688    PartialEq,
1689    PartialOrd,
1690)]
1691pub enum IdempotentCommand {
1692    #[serde(rename = "turn_submission")]
1693    TurnSubmission,
1694    #[serde(rename = "turn_input")]
1695    TurnInput,
1696}
1697impl ::std::fmt::Display for IdempotentCommand {
1698    fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
1699        match *self {
1700            Self::TurnSubmission => f.write_str("turn_submission"),
1701            Self::TurnInput => f.write_str("turn_input"),
1702        }
1703    }
1704}
1705impl ::std::str::FromStr for IdempotentCommand {
1706    type Err = self::error::ConversionError;
1707    fn from_str(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
1708        match value {
1709            "turn_submission" => Ok(Self::TurnSubmission),
1710            "turn_input" => Ok(Self::TurnInput),
1711            _ => Err("invalid value".into()),
1712        }
1713    }
1714}
1715impl ::std::convert::TryFrom<&str> for IdempotentCommand {
1716    type Error = self::error::ConversionError;
1717    fn try_from(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
1718        value.parse()
1719    }
1720}
1721impl ::std::convert::TryFrom<&::std::string::String> for IdempotentCommand {
1722    type Error = self::error::ConversionError;
1723    fn try_from(
1724        value: &::std::string::String,
1725    ) -> ::std::result::Result<Self, self::error::ConversionError> {
1726        value.parse()
1727    }
1728}
1729impl ::std::convert::TryFrom<::std::string::String> for IdempotentCommand {
1730    type Error = self::error::ConversionError;
1731    fn try_from(
1732        value: ::std::string::String,
1733    ) -> ::std::result::Result<Self, self::error::ConversionError> {
1734        value.parse()
1735    }
1736}
1737#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug, PartialEq)]
1738#[serde(transparent)]
1739pub struct JsonContentValue(pub ::serde_json::Value);
1740impl ::std::ops::Deref for JsonContentValue {
1741    type Target = ::serde_json::Value;
1742    fn deref(&self) -> &::serde_json::Value {
1743        &self.0
1744    }
1745}
1746impl ::std::convert::From<JsonContentValue> for ::serde_json::Value {
1747    fn from(value: JsonContentValue) -> Self {
1748        value.0
1749    }
1750}
1751impl ::std::convert::From<::serde_json::Value> for JsonContentValue {
1752    fn from(value: ::serde_json::Value) -> Self {
1753        Self(value)
1754    }
1755}
1756#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug, PartialEq)]
1757#[serde(deny_unknown_fields)]
1758pub struct ModelRef {
1759    pub id: ::std::string::String,
1760    pub provider: ::std::string::String,
1761}
1762#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug, PartialEq)]
1763#[serde(deny_unknown_fields)]
1764pub struct ModelSelection {
1765    #[serde(rename = "modelRef")]
1766    pub model_ref: ModelRef,
1767    #[serde(rename = "reasoningEffort", default)]
1768    pub reasoning_effort: ::std::option::Option<ReasoningEffort>,
1769}
1770#[derive(
1771    ::serde::Deserialize,
1772    ::serde::Serialize,
1773    Clone,
1774    Copy,
1775    Debug,
1776    Eq,
1777    Hash,
1778    Ord,
1779    PartialEq,
1780    PartialOrd,
1781)]
1782pub enum NodeHealth {
1783    #[serde(rename = "unknown")]
1784    Unknown,
1785    #[serde(rename = "healthy")]
1786    Healthy,
1787    #[serde(rename = "degraded")]
1788    Degraded,
1789}
1790impl ::std::fmt::Display for NodeHealth {
1791    fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
1792        match *self {
1793            Self::Unknown => f.write_str("unknown"),
1794            Self::Healthy => f.write_str("healthy"),
1795            Self::Degraded => f.write_str("degraded"),
1796        }
1797    }
1798}
1799impl ::std::str::FromStr for NodeHealth {
1800    type Err = self::error::ConversionError;
1801    fn from_str(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
1802        match value {
1803            "unknown" => Ok(Self::Unknown),
1804            "healthy" => Ok(Self::Healthy),
1805            "degraded" => Ok(Self::Degraded),
1806            _ => Err("invalid value".into()),
1807        }
1808    }
1809}
1810impl ::std::convert::TryFrom<&str> for NodeHealth {
1811    type Error = self::error::ConversionError;
1812    fn try_from(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
1813        value.parse()
1814    }
1815}
1816impl ::std::convert::TryFrom<&::std::string::String> for NodeHealth {
1817    type Error = self::error::ConversionError;
1818    fn try_from(
1819        value: &::std::string::String,
1820    ) -> ::std::result::Result<Self, self::error::ConversionError> {
1821        value.parse()
1822    }
1823}
1824impl ::std::convert::TryFrom<::std::string::String> for NodeHealth {
1825    type Error = self::error::ConversionError;
1826    fn try_from(
1827        value: ::std::string::String,
1828    ) -> ::std::result::Result<Self, self::error::ConversionError> {
1829        value.parse()
1830    }
1831}
1832#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug, PartialEq)]
1833#[serde(deny_unknown_fields)]
1834pub struct NodeInfo {
1835    #[serde(rename = "createdAt")]
1836    pub created_at: i64,
1837    #[serde(rename = "displayName")]
1838    pub display_name: ::std::string::String,
1839    #[serde(default)]
1840    pub endpoint: ::std::option::Option<::std::string::String>,
1841    pub mode: NodeMode,
1842    #[serde(rename = "nodeId")]
1843    pub node_id: ::std::string::String,
1844    #[serde(rename = "ownerUserId", default)]
1845    pub owner_user_id: ::std::option::Option<::std::string::String>,
1846    pub status: NodeStatus,
1847    #[serde(rename = "systemInfo", default)]
1848    pub system_info: ::std::option::Option<NodeSystemInfo>,
1849    #[serde(rename = "updatedAt")]
1850    pub updated_at: i64,
1851}
1852#[derive(
1853    ::serde::Deserialize,
1854    ::serde::Serialize,
1855    Clone,
1856    Copy,
1857    Debug,
1858    Eq,
1859    Hash,
1860    Ord,
1861    PartialEq,
1862    PartialOrd,
1863)]
1864pub enum NodeMode {
1865    #[serde(rename = "embedded")]
1866    Embedded,
1867    #[serde(rename = "remote")]
1868    Remote,
1869}
1870impl ::std::fmt::Display for NodeMode {
1871    fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
1872        match *self {
1873            Self::Embedded => f.write_str("embedded"),
1874            Self::Remote => f.write_str("remote"),
1875        }
1876    }
1877}
1878impl ::std::str::FromStr for NodeMode {
1879    type Err = self::error::ConversionError;
1880    fn from_str(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
1881        match value {
1882            "embedded" => Ok(Self::Embedded),
1883            "remote" => Ok(Self::Remote),
1884            _ => Err("invalid value".into()),
1885        }
1886    }
1887}
1888impl ::std::convert::TryFrom<&str> for NodeMode {
1889    type Error = self::error::ConversionError;
1890    fn try_from(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
1891        value.parse()
1892    }
1893}
1894impl ::std::convert::TryFrom<&::std::string::String> for NodeMode {
1895    type Error = self::error::ConversionError;
1896    fn try_from(
1897        value: &::std::string::String,
1898    ) -> ::std::result::Result<Self, self::error::ConversionError> {
1899        value.parse()
1900    }
1901}
1902impl ::std::convert::TryFrom<::std::string::String> for NodeMode {
1903    type Error = self::error::ConversionError;
1904    fn try_from(
1905        value: ::std::string::String,
1906    ) -> ::std::result::Result<Self, self::error::ConversionError> {
1907        value.parse()
1908    }
1909}
1910#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug, PartialEq)]
1911#[serde(deny_unknown_fields)]
1912pub struct NodeNetworkInterface {
1913    #[serde(rename = "macAddress")]
1914    pub mac_address: ::std::string::String,
1915    pub name: ::std::string::String,
1916}
1917#[derive(
1918    ::serde::Deserialize,
1919    ::serde::Serialize,
1920    Clone,
1921    Copy,
1922    Debug,
1923    Eq,
1924    Hash,
1925    Ord,
1926    PartialEq,
1927    PartialOrd,
1928)]
1929pub enum NodeOperatingSystem {
1930    #[serde(rename = "linux")]
1931    Linux,
1932    #[serde(rename = "macOs")]
1933    MacOs,
1934}
1935impl ::std::fmt::Display for NodeOperatingSystem {
1936    fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
1937        match *self {
1938            Self::Linux => f.write_str("linux"),
1939            Self::MacOs => f.write_str("macOs"),
1940        }
1941    }
1942}
1943impl ::std::str::FromStr for NodeOperatingSystem {
1944    type Err = self::error::ConversionError;
1945    fn from_str(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
1946        match value {
1947            "linux" => Ok(Self::Linux),
1948            "macOs" => Ok(Self::MacOs),
1949            _ => Err("invalid value".into()),
1950        }
1951    }
1952}
1953impl ::std::convert::TryFrom<&str> for NodeOperatingSystem {
1954    type Error = self::error::ConversionError;
1955    fn try_from(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
1956        value.parse()
1957    }
1958}
1959impl ::std::convert::TryFrom<&::std::string::String> for NodeOperatingSystem {
1960    type Error = self::error::ConversionError;
1961    fn try_from(
1962        value: &::std::string::String,
1963    ) -> ::std::result::Result<Self, self::error::ConversionError> {
1964        value.parse()
1965    }
1966}
1967impl ::std::convert::TryFrom<::std::string::String> for NodeOperatingSystem {
1968    type Error = self::error::ConversionError;
1969    fn try_from(
1970        value: ::std::string::String,
1971    ) -> ::std::result::Result<Self, self::error::ConversionError> {
1972        value.parse()
1973    }
1974}
1975#[derive(
1976    ::serde::Deserialize,
1977    ::serde::Serialize,
1978    Clone,
1979    Copy,
1980    Debug,
1981    Eq,
1982    Hash,
1983    Ord,
1984    PartialEq,
1985    PartialOrd,
1986)]
1987pub enum NodeStatus {
1988    #[serde(rename = "enabled")]
1989    Enabled,
1990    #[serde(rename = "disabled")]
1991    Disabled,
1992}
1993impl ::std::fmt::Display for NodeStatus {
1994    fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
1995        match *self {
1996            Self::Enabled => f.write_str("enabled"),
1997            Self::Disabled => f.write_str("disabled"),
1998        }
1999    }
2000}
2001impl ::std::str::FromStr for NodeStatus {
2002    type Err = self::error::ConversionError;
2003    fn from_str(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
2004        match value {
2005            "enabled" => Ok(Self::Enabled),
2006            "disabled" => Ok(Self::Disabled),
2007            _ => Err("invalid value".into()),
2008        }
2009    }
2010}
2011impl ::std::convert::TryFrom<&str> for NodeStatus {
2012    type Error = self::error::ConversionError;
2013    fn try_from(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
2014        value.parse()
2015    }
2016}
2017impl ::std::convert::TryFrom<&::std::string::String> for NodeStatus {
2018    type Error = self::error::ConversionError;
2019    fn try_from(
2020        value: &::std::string::String,
2021    ) -> ::std::result::Result<Self, self::error::ConversionError> {
2022        value.parse()
2023    }
2024}
2025impl ::std::convert::TryFrom<::std::string::String> for NodeStatus {
2026    type Error = self::error::ConversionError;
2027    fn try_from(
2028        value: ::std::string::String,
2029    ) -> ::std::result::Result<Self, self::error::ConversionError> {
2030        value.parse()
2031    }
2032}
2033#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug, PartialEq)]
2034#[serde(deny_unknown_fields)]
2035pub struct NodeSystemInfo {
2036    pub architecture: ::std::string::String,
2037    #[serde(rename = "boardModel", default)]
2038    pub board_model: ::std::option::Option<::std::string::String>,
2039    #[serde(rename = "cpuModel", default)]
2040    pub cpu_model: ::std::option::Option<::std::string::String>,
2041    pub graphics: ::std::vec::Vec<::std::string::String>,
2042    #[serde(default)]
2043    pub hostname: ::std::option::Option<::std::string::String>,
2044    #[serde(rename = "logicalCpuCount")]
2045    pub logical_cpu_count: u32,
2046    #[serde(rename = "memoryBytes")]
2047    pub memory_bytes: u64,
2048    #[serde(rename = "networkInterfaces")]
2049    pub network_interfaces: ::std::vec::Vec<NodeNetworkInterface>,
2050    pub os: NodeOperatingSystem,
2051    #[serde(rename = "osVersion", default)]
2052    pub os_version: ::std::option::Option<::std::string::String>,
2053    #[serde(rename = "workerVersion")]
2054    pub worker_version: ::std::string::String,
2055}
2056#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug, PartialEq)]
2057#[serde(deny_unknown_fields)]
2058pub struct PendingUserAction {
2059    #[serde(rename = "actionId")]
2060    pub action_id: ::std::string::String,
2061    #[serde(rename = "callId")]
2062    pub call_id: ::std::string::String,
2063    #[serde(rename = "itemId", default)]
2064    pub item_id: ::std::option::Option<::std::string::String>,
2065    pub params: UserActionParams,
2066    pub state: UserActionState,
2067}
2068#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug, PartialEq)]
2069#[serde(deny_unknown_fields)]
2070pub struct ProjectInfo {
2071    pub created_at: i64,
2072    pub directory: ::std::string::String,
2073    pub name: ::std::string::String,
2074    #[serde(rename = "nodeId")]
2075    pub node_id: ::std::string::String,
2076    pub project_id: ::std::string::String,
2077    pub session_count: i64,
2078    #[serde(default = "defaults::project_info_status")]
2079    pub status: ProjectStatus,
2080    pub updated_at: i64,
2081}
2082#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug, PartialEq)]
2083#[serde(deny_unknown_fields)]
2084pub struct ProjectStatus {
2085    #[serde(default)]
2086    pub reason: ::std::option::Option<ProjectUnavailableReason>,
2087    pub state: ProjectStatusState,
2088}
2089#[derive(
2090    ::serde::Deserialize,
2091    ::serde::Serialize,
2092    Clone,
2093    Copy,
2094    Debug,
2095    Eq,
2096    Hash,
2097    Ord,
2098    PartialEq,
2099    PartialOrd,
2100)]
2101pub enum ProjectStatusState {
2102    #[serde(rename = "available")]
2103    Available,
2104    #[serde(rename = "missing")]
2105    Missing,
2106    #[serde(rename = "not_directory")]
2107    NotDirectory,
2108    #[serde(rename = "permission_denied")]
2109    PermissionDenied,
2110    #[serde(rename = "nodeUnavailable")]
2111    NodeUnavailable,
2112}
2113impl ::std::fmt::Display for ProjectStatusState {
2114    fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
2115        match *self {
2116            Self::Available => f.write_str("available"),
2117            Self::Missing => f.write_str("missing"),
2118            Self::NotDirectory => f.write_str("not_directory"),
2119            Self::PermissionDenied => f.write_str("permission_denied"),
2120            Self::NodeUnavailable => f.write_str("nodeUnavailable"),
2121        }
2122    }
2123}
2124impl ::std::str::FromStr for ProjectStatusState {
2125    type Err = self::error::ConversionError;
2126    fn from_str(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
2127        match value {
2128            "available" => Ok(Self::Available),
2129            "missing" => Ok(Self::Missing),
2130            "not_directory" => Ok(Self::NotDirectory),
2131            "permission_denied" => Ok(Self::PermissionDenied),
2132            "nodeUnavailable" => Ok(Self::NodeUnavailable),
2133            _ => Err("invalid value".into()),
2134        }
2135    }
2136}
2137impl ::std::convert::TryFrom<&str> for ProjectStatusState {
2138    type Error = self::error::ConversionError;
2139    fn try_from(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
2140        value.parse()
2141    }
2142}
2143impl ::std::convert::TryFrom<&::std::string::String> for ProjectStatusState {
2144    type Error = self::error::ConversionError;
2145    fn try_from(
2146        value: &::std::string::String,
2147    ) -> ::std::result::Result<Self, self::error::ConversionError> {
2148        value.parse()
2149    }
2150}
2151impl ::std::convert::TryFrom<::std::string::String> for ProjectStatusState {
2152    type Error = self::error::ConversionError;
2153    fn try_from(
2154        value: ::std::string::String,
2155    ) -> ::std::result::Result<Self, self::error::ConversionError> {
2156        value.parse()
2157    }
2158}
2159#[derive(
2160    ::serde::Deserialize,
2161    ::serde::Serialize,
2162    Clone,
2163    Copy,
2164    Debug,
2165    Eq,
2166    Hash,
2167    Ord,
2168    PartialEq,
2169    PartialOrd,
2170)]
2171pub enum ProjectUnavailableReason {
2172    #[serde(rename = "path_not_found")]
2173    PathNotFound,
2174    #[serde(rename = "not_directory")]
2175    NotDirectory,
2176    #[serde(rename = "permission_denied")]
2177    PermissionDenied,
2178    #[serde(rename = "nodeUnavailable")]
2179    NodeUnavailable,
2180}
2181impl ::std::fmt::Display for ProjectUnavailableReason {
2182    fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
2183        match *self {
2184            Self::PathNotFound => f.write_str("path_not_found"),
2185            Self::NotDirectory => f.write_str("not_directory"),
2186            Self::PermissionDenied => f.write_str("permission_denied"),
2187            Self::NodeUnavailable => f.write_str("nodeUnavailable"),
2188        }
2189    }
2190}
2191impl ::std::str::FromStr for ProjectUnavailableReason {
2192    type Err = self::error::ConversionError;
2193    fn from_str(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
2194        match value {
2195            "path_not_found" => Ok(Self::PathNotFound),
2196            "not_directory" => Ok(Self::NotDirectory),
2197            "permission_denied" => Ok(Self::PermissionDenied),
2198            "nodeUnavailable" => Ok(Self::NodeUnavailable),
2199            _ => Err("invalid value".into()),
2200        }
2201    }
2202}
2203impl ::std::convert::TryFrom<&str> for ProjectUnavailableReason {
2204    type Error = self::error::ConversionError;
2205    fn try_from(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
2206        value.parse()
2207    }
2208}
2209impl ::std::convert::TryFrom<&::std::string::String> for ProjectUnavailableReason {
2210    type Error = self::error::ConversionError;
2211    fn try_from(
2212        value: &::std::string::String,
2213    ) -> ::std::result::Result<Self, self::error::ConversionError> {
2214        value.parse()
2215    }
2216}
2217impl ::std::convert::TryFrom<::std::string::String> for ProjectUnavailableReason {
2218    type Error = self::error::ConversionError;
2219    fn try_from(
2220        value: ::std::string::String,
2221    ) -> ::std::result::Result<Self, self::error::ConversionError> {
2222        value.parse()
2223    }
2224}
2225#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug, PartialEq)]
2226#[serde(tag = "type", deny_unknown_fields)]
2227pub enum PromptWarning {
2228    #[serde(rename = "bootstrapFileMissing")]
2229    BootstrapFileMissing { file: PromptWarningFile },
2230    #[serde(rename = "bootstrapFileTruncated")]
2231    BootstrapFileTruncated {
2232        file: PromptWarningFile,
2233        #[serde(rename = "injectedChars")]
2234        injected_chars: u32,
2235        #[serde(rename = "rawChars")]
2236        raw_chars: u32,
2237    },
2238    #[serde(rename = "bootstrapFileDropped")]
2239    BootstrapFileDropped { file: PromptWarningFile },
2240    #[serde(rename = "dynamicSectionsDropped")]
2241    DynamicSectionsDropped { count: u32 },
2242}
2243#[derive(
2244    ::serde::Deserialize,
2245    ::serde::Serialize,
2246    Clone,
2247    Copy,
2248    Debug,
2249    Eq,
2250    Hash,
2251    Ord,
2252    PartialEq,
2253    PartialOrd,
2254)]
2255pub enum PromptWarningFile {
2256    #[serde(rename = "agents")]
2257    Agents,
2258    #[serde(rename = "soul")]
2259    Soul,
2260    #[serde(rename = "identity")]
2261    Identity,
2262    #[serde(rename = "user")]
2263    User,
2264    #[serde(rename = "heartbeat")]
2265    Heartbeat,
2266}
2267impl ::std::fmt::Display for PromptWarningFile {
2268    fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
2269        match *self {
2270            Self::Agents => f.write_str("agents"),
2271            Self::Soul => f.write_str("soul"),
2272            Self::Identity => f.write_str("identity"),
2273            Self::User => f.write_str("user"),
2274            Self::Heartbeat => f.write_str("heartbeat"),
2275        }
2276    }
2277}
2278impl ::std::str::FromStr for PromptWarningFile {
2279    type Err = self::error::ConversionError;
2280    fn from_str(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
2281        match value {
2282            "agents" => Ok(Self::Agents),
2283            "soul" => Ok(Self::Soul),
2284            "identity" => Ok(Self::Identity),
2285            "user" => Ok(Self::User),
2286            "heartbeat" => Ok(Self::Heartbeat),
2287            _ => Err("invalid value".into()),
2288        }
2289    }
2290}
2291impl ::std::convert::TryFrom<&str> for PromptWarningFile {
2292    type Error = self::error::ConversionError;
2293    fn try_from(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
2294        value.parse()
2295    }
2296}
2297impl ::std::convert::TryFrom<&::std::string::String> for PromptWarningFile {
2298    type Error = self::error::ConversionError;
2299    fn try_from(
2300        value: &::std::string::String,
2301    ) -> ::std::result::Result<Self, self::error::ConversionError> {
2302        value.parse()
2303    }
2304}
2305impl ::std::convert::TryFrom<::std::string::String> for PromptWarningFile {
2306    type Error = self::error::ConversionError;
2307    fn try_from(
2308        value: ::std::string::String,
2309    ) -> ::std::result::Result<Self, self::error::ConversionError> {
2310        value.parse()
2311    }
2312}
2313#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug, PartialEq)]
2314#[serde(deny_unknown_fields)]
2315pub struct PromptWarningNotice {
2316    pub message: ::std::string::String,
2317    pub warning: PromptWarning,
2318}
2319#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug, PartialEq)]
2320#[serde(tag = "type", deny_unknown_fields)]
2321pub enum QuestionAnswer {
2322    #[serde(rename = "selectedOption")]
2323    SelectedOption {
2324        #[serde(rename = "optionId")]
2325        option_id: ::std::string::String,
2326    },
2327    #[serde(rename = "freeForm")]
2328    FreeForm { text: ::std::string::String },
2329}
2330#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug, PartialEq)]
2331#[serde(deny_unknown_fields)]
2332pub struct QuestionOption {
2333    pub description: ::std::string::String,
2334    pub id: ::std::string::String,
2335    pub label: ::std::string::String,
2336}
2337#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug, PartialEq)]
2338#[serde(deny_unknown_fields)]
2339pub struct QuestionParams {
2340    pub header: ::std::string::String,
2341    pub options: ::std::vec::Vec<QuestionOption>,
2342    pub question: ::std::string::String,
2343}
2344#[derive(
2345    ::serde::Deserialize,
2346    ::serde::Serialize,
2347    Clone,
2348    Copy,
2349    Debug,
2350    Eq,
2351    Hash,
2352    Ord,
2353    PartialEq,
2354    PartialOrd,
2355)]
2356pub enum ReasoningEffort {
2357    #[serde(rename = "light")]
2358    Light,
2359    #[serde(rename = "medium")]
2360    Medium,
2361    #[serde(rename = "high")]
2362    High,
2363    #[serde(rename = "xhigh")]
2364    Xhigh,
2365}
2366impl ::std::fmt::Display for ReasoningEffort {
2367    fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
2368        match *self {
2369            Self::Light => f.write_str("light"),
2370            Self::Medium => f.write_str("medium"),
2371            Self::High => f.write_str("high"),
2372            Self::Xhigh => f.write_str("xhigh"),
2373        }
2374    }
2375}
2376impl ::std::str::FromStr for ReasoningEffort {
2377    type Err = self::error::ConversionError;
2378    fn from_str(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
2379        match value {
2380            "light" => Ok(Self::Light),
2381            "medium" => Ok(Self::Medium),
2382            "high" => Ok(Self::High),
2383            "xhigh" => Ok(Self::Xhigh),
2384            _ => Err("invalid value".into()),
2385        }
2386    }
2387}
2388impl ::std::convert::TryFrom<&str> for ReasoningEffort {
2389    type Error = self::error::ConversionError;
2390    fn try_from(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
2391        value.parse()
2392    }
2393}
2394impl ::std::convert::TryFrom<&::std::string::String> for ReasoningEffort {
2395    type Error = self::error::ConversionError;
2396    fn try_from(
2397        value: &::std::string::String,
2398    ) -> ::std::result::Result<Self, self::error::ConversionError> {
2399        value.parse()
2400    }
2401}
2402impl ::std::convert::TryFrom<::std::string::String> for ReasoningEffort {
2403    type Error = self::error::ConversionError;
2404    fn try_from(
2405        value: ::std::string::String,
2406    ) -> ::std::result::Result<Self, self::error::ConversionError> {
2407        value.parse()
2408    }
2409}
2410#[derive(
2411    ::serde::Deserialize,
2412    ::serde::Serialize,
2413    Clone,
2414    Copy,
2415    Debug,
2416    Eq,
2417    Hash,
2418    Ord,
2419    PartialEq,
2420    PartialOrd,
2421)]
2422pub enum SandboxApprovalDecision {
2423    #[serde(rename = "allowOnce")]
2424    AllowOnce,
2425    #[serde(rename = "deny")]
2426    Deny,
2427    #[serde(rename = "cancel")]
2428    Cancel,
2429}
2430impl ::std::fmt::Display for SandboxApprovalDecision {
2431    fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
2432        match *self {
2433            Self::AllowOnce => f.write_str("allowOnce"),
2434            Self::Deny => f.write_str("deny"),
2435            Self::Cancel => f.write_str("cancel"),
2436        }
2437    }
2438}
2439impl ::std::str::FromStr for SandboxApprovalDecision {
2440    type Err = self::error::ConversionError;
2441    fn from_str(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
2442        match value {
2443            "allowOnce" => Ok(Self::AllowOnce),
2444            "deny" => Ok(Self::Deny),
2445            "cancel" => Ok(Self::Cancel),
2446            _ => Err("invalid value".into()),
2447        }
2448    }
2449}
2450impl ::std::convert::TryFrom<&str> for SandboxApprovalDecision {
2451    type Error = self::error::ConversionError;
2452    fn try_from(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
2453        value.parse()
2454    }
2455}
2456impl ::std::convert::TryFrom<&::std::string::String> for SandboxApprovalDecision {
2457    type Error = self::error::ConversionError;
2458    fn try_from(
2459        value: &::std::string::String,
2460    ) -> ::std::result::Result<Self, self::error::ConversionError> {
2461        value.parse()
2462    }
2463}
2464impl ::std::convert::TryFrom<::std::string::String> for SandboxApprovalDecision {
2465    type Error = self::error::ConversionError;
2466    fn try_from(
2467        value: ::std::string::String,
2468    ) -> ::std::result::Result<Self, self::error::ConversionError> {
2469        value.parse()
2470    }
2471}
2472#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug, PartialEq)]
2473#[serde(deny_unknown_fields)]
2474pub struct SandboxApprovalParams {
2475    #[serde(rename = "availableDecisions")]
2476    pub available_decisions: ::std::vec::Vec<SandboxApprovalDecision>,
2477    pub presentation: SandboxApprovalPresentation,
2478    pub reason: SandboxApprovalReason,
2479    #[serde(rename = "toolName")]
2480    pub tool_name: ::std::string::String,
2481}
2482#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug, PartialEq)]
2483#[serde(tag = "type", deny_unknown_fields)]
2484pub enum SandboxApprovalPresentation {
2485    #[serde(rename = "command")]
2486    Command {
2487        command: ::std::string::String,
2488        cwd: ::std::string::String,
2489        #[serde(rename = "riskSummary", default)]
2490        risk_summary: ::std::option::Option<::std::string::String>,
2491    },
2492    #[serde(rename = "fileSystem")]
2493    FileSystem {
2494        operation: SandboxFileOperation,
2495        paths: ::std::vec::Vec<::std::string::String>,
2496    },
2497    #[serde(rename = "network")]
2498    Network { scope: ::std::string::String },
2499}
2500#[derive(
2501    ::serde::Deserialize,
2502    ::serde::Serialize,
2503    Clone,
2504    Copy,
2505    Debug,
2506    Eq,
2507    Hash,
2508    Ord,
2509    PartialEq,
2510    PartialOrd,
2511)]
2512pub enum SandboxApprovalReason {
2513    #[serde(rename = "networkAccess")]
2514    NetworkAccess,
2515    #[serde(rename = "fileSystemAccessOutsideWorkspace")]
2516    FileSystemAccessOutsideWorkspace,
2517    #[serde(rename = "sandboxBypass")]
2518    SandboxBypass,
2519    #[serde(rename = "riskyCommand")]
2520    RiskyCommand,
2521}
2522impl ::std::fmt::Display for SandboxApprovalReason {
2523    fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
2524        match *self {
2525            Self::NetworkAccess => f.write_str("networkAccess"),
2526            Self::FileSystemAccessOutsideWorkspace => {
2527                f.write_str("fileSystemAccessOutsideWorkspace")
2528            }
2529            Self::SandboxBypass => f.write_str("sandboxBypass"),
2530            Self::RiskyCommand => f.write_str("riskyCommand"),
2531        }
2532    }
2533}
2534impl ::std::str::FromStr for SandboxApprovalReason {
2535    type Err = self::error::ConversionError;
2536    fn from_str(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
2537        match value {
2538            "networkAccess" => Ok(Self::NetworkAccess),
2539            "fileSystemAccessOutsideWorkspace" => Ok(Self::FileSystemAccessOutsideWorkspace),
2540            "sandboxBypass" => Ok(Self::SandboxBypass),
2541            "riskyCommand" => Ok(Self::RiskyCommand),
2542            _ => Err("invalid value".into()),
2543        }
2544    }
2545}
2546impl ::std::convert::TryFrom<&str> for SandboxApprovalReason {
2547    type Error = self::error::ConversionError;
2548    fn try_from(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
2549        value.parse()
2550    }
2551}
2552impl ::std::convert::TryFrom<&::std::string::String> for SandboxApprovalReason {
2553    type Error = self::error::ConversionError;
2554    fn try_from(
2555        value: &::std::string::String,
2556    ) -> ::std::result::Result<Self, self::error::ConversionError> {
2557        value.parse()
2558    }
2559}
2560impl ::std::convert::TryFrom<::std::string::String> for SandboxApprovalReason {
2561    type Error = self::error::ConversionError;
2562    fn try_from(
2563        value: ::std::string::String,
2564    ) -> ::std::result::Result<Self, self::error::ConversionError> {
2565        value.parse()
2566    }
2567}
2568#[derive(
2569    ::serde::Deserialize,
2570    ::serde::Serialize,
2571    Clone,
2572    Copy,
2573    Debug,
2574    Eq,
2575    Hash,
2576    Ord,
2577    PartialEq,
2578    PartialOrd,
2579)]
2580pub enum SandboxFileOperation {
2581    #[serde(rename = "read")]
2582    Read,
2583    #[serde(rename = "write")]
2584    Write,
2585}
2586impl ::std::fmt::Display for SandboxFileOperation {
2587    fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
2588        match *self {
2589            Self::Read => f.write_str("read"),
2590            Self::Write => f.write_str("write"),
2591        }
2592    }
2593}
2594impl ::std::str::FromStr for SandboxFileOperation {
2595    type Err = self::error::ConversionError;
2596    fn from_str(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
2597        match value {
2598            "read" => Ok(Self::Read),
2599            "write" => Ok(Self::Write),
2600            _ => Err("invalid value".into()),
2601        }
2602    }
2603}
2604impl ::std::convert::TryFrom<&str> for SandboxFileOperation {
2605    type Error = self::error::ConversionError;
2606    fn try_from(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
2607        value.parse()
2608    }
2609}
2610impl ::std::convert::TryFrom<&::std::string::String> for SandboxFileOperation {
2611    type Error = self::error::ConversionError;
2612    fn try_from(
2613        value: &::std::string::String,
2614    ) -> ::std::result::Result<Self, self::error::ConversionError> {
2615        value.parse()
2616    }
2617}
2618impl ::std::convert::TryFrom<::std::string::String> for SandboxFileOperation {
2619    type Error = self::error::ConversionError;
2620    fn try_from(
2621        value: ::std::string::String,
2622    ) -> ::std::result::Result<Self, self::error::ConversionError> {
2623        value.parse()
2624    }
2625}
2626#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug, PartialEq)]
2627#[serde(deny_unknown_fields)]
2628pub struct SendMessageResult {
2629    pub accepted: bool,
2630    #[serde(rename = "agentId")]
2631    pub agent_id: ::std::string::String,
2632    pub subagent: SubagentRef,
2633    pub turn: AgentTurnRef,
2634}
2635#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug, PartialEq)]
2636#[serde(deny_unknown_fields)]
2637#[derive(Default)]
2638pub struct SessionConf {
2639    #[serde(rename = "modelSelection", default)]
2640    pub model_selection: ::std::option::Option<ModelSelection>,
2641    #[serde(rename = "userPermissionMode", default)]
2642    pub user_permission_mode: ::std::option::Option<UserPermissionMode>,
2643}
2644#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug, PartialEq)]
2645#[serde(deny_unknown_fields)]
2646pub struct SessionInfo {
2647    #[serde(rename = "configuredDefaultMode")]
2648    pub configured_default_mode: UserPermissionMode,
2649    #[serde(rename = "createdAt")]
2650    pub created_at: u64,
2651    #[serde(rename = "currentDirectory", default)]
2652    pub current_directory: ::std::option::Option<::std::string::String>,
2653    #[serde(rename = "effectiveMode")]
2654    pub effective_mode: UserPermissionMode,
2655    pub id: ::std::string::String,
2656    #[serde(rename = "lastActivity")]
2657    pub last_activity: u64,
2658    #[serde(rename = "messageCount")]
2659    pub message_count: u64,
2660    #[serde(rename = "modelSelection")]
2661    pub model_selection: ModelSelection,
2662    #[serde(rename = "nodeId")]
2663    pub node_id: ::std::string::String,
2664    #[serde(rename = "projectId", default)]
2665    pub project_id: ::std::option::Option<::std::string::String>,
2666    #[serde(rename = "sourceProvider")]
2667    pub source_provider: SessionSourceProvider,
2668    #[serde(rename = "sourceType")]
2669    pub source_type: SessionSourceType,
2670    pub title: ::std::string::String,
2671    #[serde(default = "defaults::session_info_usage")]
2672    pub usage: SessionUsage,
2673    #[serde(rename = "userId")]
2674    pub user_id: ::std::string::String,
2675}
2676#[derive(
2677    ::serde::Deserialize,
2678    ::serde::Serialize,
2679    Clone,
2680    Copy,
2681    Debug,
2682    Eq,
2683    Hash,
2684    Ord,
2685    PartialEq,
2686    PartialOrd,
2687)]
2688pub enum SessionSourceProvider {
2689    #[serde(rename = "http")]
2690    Http,
2691    #[serde(rename = "sdk")]
2692    Sdk,
2693    #[serde(rename = "cli")]
2694    Cli,
2695    #[serde(rename = "telegram")]
2696    Telegram,
2697    #[serde(rename = "web_socket")]
2698    WebSocket,
2699    #[serde(rename = "system")]
2700    System,
2701}
2702impl ::std::fmt::Display for SessionSourceProvider {
2703    fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
2704        match *self {
2705            Self::Http => f.write_str("http"),
2706            Self::Sdk => f.write_str("sdk"),
2707            Self::Cli => f.write_str("cli"),
2708            Self::Telegram => f.write_str("telegram"),
2709            Self::WebSocket => f.write_str("web_socket"),
2710            Self::System => f.write_str("system"),
2711        }
2712    }
2713}
2714impl ::std::str::FromStr for SessionSourceProvider {
2715    type Err = self::error::ConversionError;
2716    fn from_str(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
2717        match value {
2718            "http" => Ok(Self::Http),
2719            "sdk" => Ok(Self::Sdk),
2720            "cli" => Ok(Self::Cli),
2721            "telegram" => Ok(Self::Telegram),
2722            "web_socket" => Ok(Self::WebSocket),
2723            "system" => Ok(Self::System),
2724            _ => Err("invalid value".into()),
2725        }
2726    }
2727}
2728impl ::std::convert::TryFrom<&str> for SessionSourceProvider {
2729    type Error = self::error::ConversionError;
2730    fn try_from(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
2731        value.parse()
2732    }
2733}
2734impl ::std::convert::TryFrom<&::std::string::String> for SessionSourceProvider {
2735    type Error = self::error::ConversionError;
2736    fn try_from(
2737        value: &::std::string::String,
2738    ) -> ::std::result::Result<Self, self::error::ConversionError> {
2739        value.parse()
2740    }
2741}
2742impl ::std::convert::TryFrom<::std::string::String> for SessionSourceProvider {
2743    type Error = self::error::ConversionError;
2744    fn try_from(
2745        value: ::std::string::String,
2746    ) -> ::std::result::Result<Self, self::error::ConversionError> {
2747        value.parse()
2748    }
2749}
2750#[derive(
2751    ::serde::Deserialize,
2752    ::serde::Serialize,
2753    Clone,
2754    Copy,
2755    Debug,
2756    Eq,
2757    Hash,
2758    Ord,
2759    PartialEq,
2760    PartialOrd,
2761)]
2762pub enum SessionSourceType {
2763    #[serde(rename = "http")]
2764    Http,
2765    #[serde(rename = "desktop")]
2766    Desktop,
2767    #[serde(rename = "im")]
2768    Im,
2769    #[serde(rename = "cli")]
2770    Cli,
2771    #[serde(rename = "ws")]
2772    Ws,
2773    #[serde(rename = "system")]
2774    System,
2775}
2776impl ::std::fmt::Display for SessionSourceType {
2777    fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
2778        match *self {
2779            Self::Http => f.write_str("http"),
2780            Self::Desktop => f.write_str("desktop"),
2781            Self::Im => f.write_str("im"),
2782            Self::Cli => f.write_str("cli"),
2783            Self::Ws => f.write_str("ws"),
2784            Self::System => f.write_str("system"),
2785        }
2786    }
2787}
2788impl ::std::str::FromStr for SessionSourceType {
2789    type Err = self::error::ConversionError;
2790    fn from_str(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
2791        match value {
2792            "http" => Ok(Self::Http),
2793            "desktop" => Ok(Self::Desktop),
2794            "im" => Ok(Self::Im),
2795            "cli" => Ok(Self::Cli),
2796            "ws" => Ok(Self::Ws),
2797            "system" => Ok(Self::System),
2798            _ => Err("invalid value".into()),
2799        }
2800    }
2801}
2802impl ::std::convert::TryFrom<&str> for SessionSourceType {
2803    type Error = self::error::ConversionError;
2804    fn try_from(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
2805        value.parse()
2806    }
2807}
2808impl ::std::convert::TryFrom<&::std::string::String> for SessionSourceType {
2809    type Error = self::error::ConversionError;
2810    fn try_from(
2811        value: &::std::string::String,
2812    ) -> ::std::result::Result<Self, self::error::ConversionError> {
2813        value.parse()
2814    }
2815}
2816impl ::std::convert::TryFrom<::std::string::String> for SessionSourceType {
2817    type Error = self::error::ConversionError;
2818    fn try_from(
2819        value: ::std::string::String,
2820    ) -> ::std::result::Result<Self, self::error::ConversionError> {
2821        value.parse()
2822    }
2823}
2824#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug, PartialEq)]
2825#[serde(tag = "type", deny_unknown_fields)]
2826pub enum SessionTreeIdentity {
2827    #[serde(rename = "primary")]
2828    Primary,
2829    #[serde(rename = "subagent")]
2830    Subagent {
2831        parent: AgentTurnRef,
2832        path: AgentPath,
2833        tree_root_session_id: ::std::string::String,
2834    },
2835}
2836#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug, PartialEq)]
2837#[serde(deny_unknown_fields)]
2838pub struct SessionUsage {
2839    #[serde(default)]
2840    pub context: ::std::option::Option<ContextUsage>,
2841    pub tokens: TokenUsage,
2842}
2843#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug, PartialEq)]
2844#[serde(tag = "status", deny_unknown_fields)]
2845pub enum SubagentOutcome {
2846    #[serde(rename = "running")]
2847    Running {
2848        #[serde(rename = "turnId")]
2849        turn_id: ::std::string::String,
2850    },
2851    #[serde(rename = "waitingUserAction")]
2852    WaitingUserAction {
2853        #[serde(rename = "turnId")]
2854        turn_id: ::std::string::String,
2855    },
2856    #[serde(rename = "cancelling")]
2857    Cancelling {
2858        #[serde(rename = "turnId")]
2859        turn_id: ::std::string::String,
2860    },
2861    #[serde(rename = "completed")]
2862    Completed {
2863        output: ::std::string::String,
2864        truncated: bool,
2865        #[serde(rename = "turnId")]
2866        turn_id: ::std::string::String,
2867    },
2868    #[serde(rename = "failed")]
2869    Failed {
2870        error: ::std::string::String,
2871        truncated: bool,
2872        #[serde(rename = "turnId")]
2873        turn_id: ::std::string::String,
2874    },
2875    #[serde(rename = "interrupted")]
2876    Interrupted {
2877        #[serde(rename = "turnId")]
2878        turn_id: ::std::string::String,
2879    },
2880}
2881#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug, PartialEq)]
2882#[serde(deny_unknown_fields)]
2883pub struct SubagentRef {
2884    pub parent: AgentTurnRef,
2885    pub path: AgentPath,
2886    #[serde(rename = "sessionId")]
2887    pub session_id: ::std::string::String,
2888}
2889#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug, PartialEq)]
2890#[serde(deny_unknown_fields)]
2891pub struct SubagentSnapshot {
2892    #[serde(rename = "agentId")]
2893    pub agent_id: ::std::string::String,
2894    #[serde(rename = "latestUpdate", default)]
2895    pub latest_update: ::std::option::Option<SubagentUpdate>,
2896    pub outcome: SubagentOutcome,
2897    pub subagent: SubagentRef,
2898}
2899#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug, PartialEq)]
2900#[serde(deny_unknown_fields)]
2901pub struct SubagentSpawnResult {
2902    #[serde(rename = "agentId")]
2903    pub agent_id: ::std::string::String,
2904    pub subagent: SubagentRef,
2905    pub turn: AgentTurnRef,
2906}
2907#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug, PartialEq)]
2908#[serde(deny_unknown_fields)]
2909pub struct SubagentUpdate {
2910    pub kind: SubagentUpdateKind,
2911    pub text: ::std::string::String,
2912    pub truncated: bool,
2913}
2914#[derive(
2915    ::serde::Deserialize,
2916    ::serde::Serialize,
2917    Clone,
2918    Copy,
2919    Debug,
2920    Eq,
2921    Hash,
2922    Ord,
2923    PartialEq,
2924    PartialOrd,
2925)]
2926pub enum SubagentUpdateKind {
2927    #[serde(rename = "commentary")]
2928    Commentary,
2929    #[serde(rename = "finalAnswer")]
2930    FinalAnswer,
2931}
2932impl ::std::fmt::Display for SubagentUpdateKind {
2933    fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
2934        match *self {
2935            Self::Commentary => f.write_str("commentary"),
2936            Self::FinalAnswer => f.write_str("finalAnswer"),
2937        }
2938    }
2939}
2940impl ::std::str::FromStr for SubagentUpdateKind {
2941    type Err = self::error::ConversionError;
2942    fn from_str(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
2943        match value {
2944            "commentary" => Ok(Self::Commentary),
2945            "finalAnswer" => Ok(Self::FinalAnswer),
2946            _ => Err("invalid value".into()),
2947        }
2948    }
2949}
2950impl ::std::convert::TryFrom<&str> for SubagentUpdateKind {
2951    type Error = self::error::ConversionError;
2952    fn try_from(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
2953        value.parse()
2954    }
2955}
2956impl ::std::convert::TryFrom<&::std::string::String> for SubagentUpdateKind {
2957    type Error = self::error::ConversionError;
2958    fn try_from(
2959        value: &::std::string::String,
2960    ) -> ::std::result::Result<Self, self::error::ConversionError> {
2961        value.parse()
2962    }
2963}
2964impl ::std::convert::TryFrom<::std::string::String> for SubagentUpdateKind {
2965    type Error = self::error::ConversionError;
2966    fn try_from(
2967        value: ::std::string::String,
2968    ) -> ::std::result::Result<Self, self::error::ConversionError> {
2969        value.parse()
2970    }
2971}
2972#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug, PartialEq)]
2973#[serde(tag = "type", content = "data")]
2974pub enum SystemNoticeContent {
2975    #[serde(rename = "text")]
2976    Text(::std::string::String),
2977    #[serde(rename = "error")]
2978    Error(ApiError),
2979    #[serde(rename = "promptWarning")]
2980    PromptWarning(PromptWarningNotice),
2981}
2982impl ::std::convert::From<ApiError> for SystemNoticeContent {
2983    fn from(value: ApiError) -> Self {
2984        Self::Error(value)
2985    }
2986}
2987impl ::std::convert::From<PromptWarningNotice> for SystemNoticeContent {
2988    fn from(value: PromptWarningNotice) -> Self {
2989        Self::PromptWarning(value)
2990    }
2991}
2992#[derive(
2993    ::serde::Deserialize,
2994    ::serde::Serialize,
2995    Clone,
2996    Copy,
2997    Debug,
2998    Eq,
2999    Hash,
3000    Ord,
3001    PartialEq,
3002    PartialOrd,
3003)]
3004pub enum TalosConnectionMode {
3005    #[serde(rename = "embedded")]
3006    Embedded,
3007    #[serde(rename = "remote")]
3008    Remote,
3009}
3010impl ::std::fmt::Display for TalosConnectionMode {
3011    fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
3012        match *self {
3013            Self::Embedded => f.write_str("embedded"),
3014            Self::Remote => f.write_str("remote"),
3015        }
3016    }
3017}
3018impl ::std::str::FromStr for TalosConnectionMode {
3019    type Err = self::error::ConversionError;
3020    fn from_str(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
3021        match value {
3022            "embedded" => Ok(Self::Embedded),
3023            "remote" => Ok(Self::Remote),
3024            _ => Err("invalid value".into()),
3025        }
3026    }
3027}
3028impl ::std::convert::TryFrom<&str> for TalosConnectionMode {
3029    type Error = self::error::ConversionError;
3030    fn try_from(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
3031        value.parse()
3032    }
3033}
3034impl ::std::convert::TryFrom<&::std::string::String> for TalosConnectionMode {
3035    type Error = self::error::ConversionError;
3036    fn try_from(
3037        value: &::std::string::String,
3038    ) -> ::std::result::Result<Self, self::error::ConversionError> {
3039        value.parse()
3040    }
3041}
3042impl ::std::convert::TryFrom<::std::string::String> for TalosConnectionMode {
3043    type Error = self::error::ConversionError;
3044    fn try_from(
3045        value: ::std::string::String,
3046    ) -> ::std::result::Result<Self, self::error::ConversionError> {
3047        value.parse()
3048    }
3049}
3050#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug, PartialEq)]
3051#[serde(tag = "type", deny_unknown_fields)]
3052pub enum TalosContentItem {
3053    #[serde(rename = "text")]
3054    Text { text: ::std::string::String },
3055    #[serde(rename = "json")]
3056    Json { value: JsonContentValue },
3057    #[serde(rename = "subagent_result")]
3058    SubagentResult { result: CollaborationToolResult },
3059    #[serde(rename = "file_read")]
3060    FileRead {
3061        content: ::std::string::String,
3062        limit: u32,
3063        #[serde(rename = "nextByteOffset", default)]
3064        next_byte_offset: ::std::option::Option<u64>,
3065        offset: u32,
3066        path: ::std::string::String,
3067        #[serde(default)]
3068        total_lines: ::std::option::Option<u32>,
3069        truncated: bool,
3070    },
3071    #[serde(rename = "diff")]
3072    Diff {
3073        files: ::std::vec::Vec<TalosToolFileDiff>,
3074    },
3075    #[serde(rename = "search_results")]
3076    SearchResults {
3077        limit: u32,
3078        matches: ::std::vec::Vec<TalosToolSearchMatch>,
3079        more_available: bool,
3080        offset: u32,
3081        partial: bool,
3082        #[serde(default)]
3083        query: ::std::option::Option<::std::string::String>,
3084        #[serde(default)]
3085        total_matches: ::std::option::Option<u32>,
3086    },
3087    #[serde(rename = "bash_output")]
3088    BashOutput {
3089        #[serde(default)]
3090        elapsed_ms: ::std::option::Option<u64>,
3091        #[serde(default)]
3092        exit_code: ::std::option::Option<i32>,
3093        #[serde(rename = "outputLog", default)]
3094        output_log: ::std::option::Option<BashOutputLog>,
3095        #[serde(default)]
3096        session_id: ::std::option::Option<i64>,
3097        status: TalosToolTaskStatus,
3098        stderr: ::std::string::String,
3099        stdout: ::std::string::String,
3100        truncated: bool,
3101    },
3102    #[serde(rename = "web_reference")]
3103    WebReference {
3104        #[serde(default)]
3105        citation_id: ::std::option::Option<::std::string::String>,
3106        #[serde(default)]
3107        provider_rank: ::std::option::Option<u32>,
3108        #[serde(default)]
3109        published_at: ::std::option::Option<::std::string::String>,
3110        #[serde(default)]
3111        snippet: ::std::option::Option<::std::string::String>,
3112        #[serde(default)]
3113        source_domain: ::std::option::Option<::std::string::String>,
3114        #[serde(default)]
3115        title: ::std::option::Option<::std::string::String>,
3116        url: ::std::string::String,
3117    },
3118    #[serde(rename = "image")]
3119    Image {
3120        #[serde(rename = "fileId")]
3121        file_id: ::std::string::String,
3122        label: ::std::string::String,
3123        #[serde(rename = "mimeType")]
3124        mime_type: ::std::string::String,
3125    },
3126    #[serde(rename = "artifact_ref")]
3127    ArtifactRef {
3128        artifact_id: ::std::string::String,
3129        #[serde(default)]
3130        label: ::std::option::Option<::std::string::String>,
3131        #[serde(default)]
3132        mime_type: ::std::option::Option<::std::string::String>,
3133    },
3134    #[serde(rename = "mcp_resource_ref")]
3135    McpResourceRef {
3136        #[serde(default)]
3137        mime_type: ::std::option::Option<::std::string::String>,
3138        server: ::std::string::String,
3139        uri: ::std::string::String,
3140    },
3141    #[serde(rename = "progress")]
3142    Progress {
3143        #[serde(default)]
3144        elapsed_ms: ::std::option::Option<u64>,
3145        message: ::std::string::String,
3146    },
3147}
3148#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug, PartialEq)]
3149#[serde(deny_unknown_fields)]
3150pub struct TalosSessionEnvironment {
3151    #[serde(default = "defaults::talos_session_environment_connection_mode")]
3152    pub connection_mode: TalosConnectionMode,
3153    pub directory: ::std::string::String,
3154}
3155#[derive(
3156    ::serde::Deserialize,
3157    ::serde::Serialize,
3158    Clone,
3159    Copy,
3160    Debug,
3161    Eq,
3162    Hash,
3163    Ord,
3164    PartialEq,
3165    PartialOrd,
3166)]
3167pub enum TalosTimelineNoticeLevel {
3168    #[serde(rename = "info")]
3169    Info,
3170    #[serde(rename = "warning")]
3171    Warning,
3172    #[serde(rename = "error")]
3173    Error,
3174}
3175impl ::std::fmt::Display for TalosTimelineNoticeLevel {
3176    fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
3177        match *self {
3178            Self::Info => f.write_str("info"),
3179            Self::Warning => f.write_str("warning"),
3180            Self::Error => f.write_str("error"),
3181        }
3182    }
3183}
3184impl ::std::str::FromStr for TalosTimelineNoticeLevel {
3185    type Err = self::error::ConversionError;
3186    fn from_str(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
3187        match value {
3188            "info" => Ok(Self::Info),
3189            "warning" => Ok(Self::Warning),
3190            "error" => Ok(Self::Error),
3191            _ => Err("invalid value".into()),
3192        }
3193    }
3194}
3195impl ::std::convert::TryFrom<&str> for TalosTimelineNoticeLevel {
3196    type Error = self::error::ConversionError;
3197    fn try_from(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
3198        value.parse()
3199    }
3200}
3201impl ::std::convert::TryFrom<&::std::string::String> for TalosTimelineNoticeLevel {
3202    type Error = self::error::ConversionError;
3203    fn try_from(
3204        value: &::std::string::String,
3205    ) -> ::std::result::Result<Self, self::error::ConversionError> {
3206        value.parse()
3207    }
3208}
3209impl ::std::convert::TryFrom<::std::string::String> for TalosTimelineNoticeLevel {
3210    type Error = self::error::ConversionError;
3211    fn try_from(
3212        value: ::std::string::String,
3213    ) -> ::std::result::Result<Self, self::error::ConversionError> {
3214        value.parse()
3215    }
3216}
3217#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug, PartialEq)]
3218#[serde(deny_unknown_fields)]
3219pub struct TalosToolDiffHunk {
3220    pub lines: ::std::vec::Vec<TalosToolDiffLine>,
3221    #[serde(default)]
3222    pub new_lines: ::std::option::Option<u32>,
3223    #[serde(default)]
3224    pub new_start: ::std::option::Option<u32>,
3225    #[serde(default)]
3226    pub old_lines: ::std::option::Option<u32>,
3227    #[serde(default)]
3228    pub old_start: ::std::option::Option<u32>,
3229}
3230#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug, PartialEq)]
3231#[serde(tag = "kind", content = "text")]
3232pub enum TalosToolDiffLine {
3233    #[serde(rename = "context")]
3234    Context(::std::string::String),
3235    #[serde(rename = "added")]
3236    Added(::std::string::String),
3237    #[serde(rename = "removed")]
3238    Removed(::std::string::String),
3239}
3240#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug, PartialEq)]
3241#[serde(deny_unknown_fields)]
3242pub struct TalosToolFileDiff {
3243    pub hunks: ::std::vec::Vec<TalosToolDiffHunk>,
3244    #[serde(default)]
3245    pub old_path: ::std::option::Option<::std::string::String>,
3246    pub path: ::std::string::String,
3247    pub truncated: bool,
3248}
3249#[derive(
3250    ::serde::Deserialize,
3251    ::serde::Serialize,
3252    Clone,
3253    Copy,
3254    Debug,
3255    Eq,
3256    Hash,
3257    Ord,
3258    PartialEq,
3259    PartialOrd,
3260)]
3261pub enum TalosToolProgressKind {
3262    #[serde(rename = "status")]
3263    Status,
3264    #[serde(rename = "stdout")]
3265    Stdout,
3266    #[serde(rename = "stderr")]
3267    Stderr,
3268}
3269impl ::std::fmt::Display for TalosToolProgressKind {
3270    fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
3271        match *self {
3272            Self::Status => f.write_str("status"),
3273            Self::Stdout => f.write_str("stdout"),
3274            Self::Stderr => f.write_str("stderr"),
3275        }
3276    }
3277}
3278impl ::std::str::FromStr for TalosToolProgressKind {
3279    type Err = self::error::ConversionError;
3280    fn from_str(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
3281        match value {
3282            "status" => Ok(Self::Status),
3283            "stdout" => Ok(Self::Stdout),
3284            "stderr" => Ok(Self::Stderr),
3285            _ => Err("invalid value".into()),
3286        }
3287    }
3288}
3289impl ::std::convert::TryFrom<&str> for TalosToolProgressKind {
3290    type Error = self::error::ConversionError;
3291    fn try_from(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
3292        value.parse()
3293    }
3294}
3295impl ::std::convert::TryFrom<&::std::string::String> for TalosToolProgressKind {
3296    type Error = self::error::ConversionError;
3297    fn try_from(
3298        value: &::std::string::String,
3299    ) -> ::std::result::Result<Self, self::error::ConversionError> {
3300        value.parse()
3301    }
3302}
3303impl ::std::convert::TryFrom<::std::string::String> for TalosToolProgressKind {
3304    type Error = self::error::ConversionError;
3305    fn try_from(
3306        value: ::std::string::String,
3307    ) -> ::std::result::Result<Self, self::error::ConversionError> {
3308        value.parse()
3309    }
3310}
3311#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug, PartialEq)]
3312#[serde(deny_unknown_fields)]
3313pub struct TalosToolSearchMatch {
3314    #[serde(default)]
3315    pub after: ::std::vec::Vec<::std::string::String>,
3316    #[serde(default)]
3317    pub before: ::std::vec::Vec<::std::string::String>,
3318    #[serde(default)]
3319    pub column: ::std::option::Option<u32>,
3320    pub line: u32,
3321    pub path: ::std::string::String,
3322    pub text: ::std::string::String,
3323}
3324#[derive(
3325    ::serde::Deserialize,
3326    ::serde::Serialize,
3327    Clone,
3328    Copy,
3329    Debug,
3330    Eq,
3331    Hash,
3332    Ord,
3333    PartialEq,
3334    PartialOrd,
3335)]
3336pub enum TalosToolTaskStatus {
3337    #[serde(rename = "queued")]
3338    Queued,
3339    #[serde(rename = "running")]
3340    Running,
3341    #[serde(rename = "completed")]
3342    Completed,
3343    #[serde(rename = "failed")]
3344    Failed,
3345    #[serde(rename = "timed_out")]
3346    TimedOut,
3347    #[serde(rename = "cancelled")]
3348    Cancelled,
3349}
3350impl ::std::fmt::Display for TalosToolTaskStatus {
3351    fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
3352        match *self {
3353            Self::Queued => f.write_str("queued"),
3354            Self::Running => f.write_str("running"),
3355            Self::Completed => f.write_str("completed"),
3356            Self::Failed => f.write_str("failed"),
3357            Self::TimedOut => f.write_str("timed_out"),
3358            Self::Cancelled => f.write_str("cancelled"),
3359        }
3360    }
3361}
3362impl ::std::str::FromStr for TalosToolTaskStatus {
3363    type Err = self::error::ConversionError;
3364    fn from_str(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
3365        match value {
3366            "queued" => Ok(Self::Queued),
3367            "running" => Ok(Self::Running),
3368            "completed" => Ok(Self::Completed),
3369            "failed" => Ok(Self::Failed),
3370            "timed_out" => Ok(Self::TimedOut),
3371            "cancelled" => Ok(Self::Cancelled),
3372            _ => Err("invalid value".into()),
3373        }
3374    }
3375}
3376impl ::std::convert::TryFrom<&str> for TalosToolTaskStatus {
3377    type Error = self::error::ConversionError;
3378    fn try_from(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
3379        value.parse()
3380    }
3381}
3382impl ::std::convert::TryFrom<&::std::string::String> for TalosToolTaskStatus {
3383    type Error = self::error::ConversionError;
3384    fn try_from(
3385        value: &::std::string::String,
3386    ) -> ::std::result::Result<Self, self::error::ConversionError> {
3387        value.parse()
3388    }
3389}
3390impl ::std::convert::TryFrom<::std::string::String> for TalosToolTaskStatus {
3391    type Error = self::error::ConversionError;
3392    fn try_from(
3393        value: ::std::string::String,
3394    ) -> ::std::result::Result<Self, self::error::ConversionError> {
3395        value.parse()
3396    }
3397}
3398#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug, PartialEq)]
3399#[serde(tag = "type", content = "data")]
3400pub enum TimelineEventPayload {
3401    #[serde(rename = "agent")]
3402    Agent(AgentEvent),
3403    #[serde(rename = "systemNotice")]
3404    SystemNotice(TimelineSystemNotice),
3405}
3406impl ::std::convert::From<AgentEvent> for TimelineEventPayload {
3407    fn from(value: AgentEvent) -> Self {
3408        Self::Agent(value)
3409    }
3410}
3411impl ::std::convert::From<TimelineSystemNotice> for TimelineEventPayload {
3412    fn from(value: TimelineSystemNotice) -> Self {
3413        Self::SystemNotice(value)
3414    }
3415}
3416#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug, PartialEq)]
3417#[serde(deny_unknown_fields)]
3418pub struct TimelineSystemNotice {
3419    pub identity: AgentTurnRef,
3420    pub notice: AgentSystemNotice,
3421    #[serde(rename = "occurredAt")]
3422    pub occurred_at: i64,
3423}
3424#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug, PartialEq)]
3425#[serde(deny_unknown_fields)]
3426pub struct TokenUsage {
3427    #[serde(default)]
3428    pub cache_creation_input_tokens: ::std::option::Option<u32>,
3429    #[serde(default)]
3430    pub cache_read_input_tokens: ::std::option::Option<u32>,
3431    pub input_tokens: u32,
3432    pub output_tokens: u32,
3433    pub total_tokens: u32,
3434}
3435#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug, PartialEq)]
3436#[serde(transparent)]
3437pub struct ToolArguments(pub ::serde_json::Value);
3438impl ::std::ops::Deref for ToolArguments {
3439    type Target = ::serde_json::Value;
3440    fn deref(&self) -> &::serde_json::Value {
3441        &self.0
3442    }
3443}
3444impl ::std::convert::From<ToolArguments> for ::serde_json::Value {
3445    fn from(value: ToolArguments) -> Self {
3446        value.0
3447    }
3448}
3449impl ::std::convert::From<::serde_json::Value> for ToolArguments {
3450    fn from(value: ::serde_json::Value) -> Self {
3451        Self(value)
3452    }
3453}
3454#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug, PartialEq)]
3455#[serde(deny_unknown_fields)]
3456#[derive(Default)]
3457pub struct ToolExecutionMetrics {
3458    #[serde(rename = "executionDurationMs", default)]
3459    pub execution_duration_ms: ::std::option::Option<f64>,
3460    #[serde(rename = "finishedAtMs", default)]
3461    pub finished_at_ms: ::std::option::Option<i64>,
3462    #[serde(rename = "queueDurationMs", default)]
3463    pub queue_duration_ms: ::std::option::Option<f64>,
3464    #[serde(rename = "queuedAtMs", default)]
3465    pub queued_at_ms: ::std::option::Option<i64>,
3466    #[serde(rename = "startedAtMs", default)]
3467    pub started_at_ms: ::std::option::Option<i64>,
3468}
3469#[derive(
3470    ::serde::Deserialize,
3471    ::serde::Serialize,
3472    Clone,
3473    Copy,
3474    Debug,
3475    Eq,
3476    Hash,
3477    Ord,
3478    PartialEq,
3479    PartialOrd,
3480)]
3481pub enum TurnCommandStatus {
3482    #[serde(rename = "pending")]
3483    Pending,
3484    #[serde(rename = "accepted")]
3485    Accepted,
3486    #[serde(rename = "failed")]
3487    Failed,
3488    #[serde(rename = "failedNoFirstEvent")]
3489    FailedNoFirstEvent,
3490}
3491impl ::std::fmt::Display for TurnCommandStatus {
3492    fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
3493        match *self {
3494            Self::Pending => f.write_str("pending"),
3495            Self::Accepted => f.write_str("accepted"),
3496            Self::Failed => f.write_str("failed"),
3497            Self::FailedNoFirstEvent => f.write_str("failedNoFirstEvent"),
3498        }
3499    }
3500}
3501impl ::std::str::FromStr for TurnCommandStatus {
3502    type Err = self::error::ConversionError;
3503    fn from_str(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
3504        match value {
3505            "pending" => Ok(Self::Pending),
3506            "accepted" => Ok(Self::Accepted),
3507            "failed" => Ok(Self::Failed),
3508            "failedNoFirstEvent" => Ok(Self::FailedNoFirstEvent),
3509            _ => Err("invalid value".into()),
3510        }
3511    }
3512}
3513impl ::std::convert::TryFrom<&str> for TurnCommandStatus {
3514    type Error = self::error::ConversionError;
3515    fn try_from(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
3516        value.parse()
3517    }
3518}
3519impl ::std::convert::TryFrom<&::std::string::String> for TurnCommandStatus {
3520    type Error = self::error::ConversionError;
3521    fn try_from(
3522        value: &::std::string::String,
3523    ) -> ::std::result::Result<Self, self::error::ConversionError> {
3524        value.parse()
3525    }
3526}
3527impl ::std::convert::TryFrom<::std::string::String> for TurnCommandStatus {
3528    type Error = self::error::ConversionError;
3529    fn try_from(
3530        value: ::std::string::String,
3531    ) -> ::std::result::Result<Self, self::error::ConversionError> {
3532        value.parse()
3533    }
3534}
3535#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug, PartialEq)]
3536#[serde(tag = "type", content = "params")]
3537pub enum UserActionParams {
3538    #[serde(rename = "dynamicToolResult")]
3539    DynamicToolResult(DynamicToolResultParams),
3540    #[serde(rename = "question")]
3541    Question(QuestionParams),
3542    #[serde(rename = "sandboxApproval")]
3543    SandboxApproval(SandboxApprovalParams),
3544}
3545impl ::std::convert::From<DynamicToolResultParams> for UserActionParams {
3546    fn from(value: DynamicToolResultParams) -> Self {
3547        Self::DynamicToolResult(value)
3548    }
3549}
3550impl ::std::convert::From<QuestionParams> for UserActionParams {
3551    fn from(value: QuestionParams) -> Self {
3552        Self::Question(value)
3553    }
3554}
3555impl ::std::convert::From<SandboxApprovalParams> for UserActionParams {
3556    fn from(value: SandboxApprovalParams) -> Self {
3557        Self::SandboxApproval(value)
3558    }
3559}
3560#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug, PartialEq)]
3561#[serde(tag = "type", content = "response")]
3562pub enum UserActionResponse {
3563    #[serde(rename = "dynamicToolResult")]
3564    DynamicToolResult(DynamicToolResult),
3565    #[serde(rename = "question")]
3566    Question(QuestionAnswer),
3567    #[serde(rename = "sandboxApproval")]
3568    SandboxApproval(SandboxApprovalDecision),
3569}
3570impl ::std::convert::From<DynamicToolResult> for UserActionResponse {
3571    fn from(value: DynamicToolResult) -> Self {
3572        Self::DynamicToolResult(value)
3573    }
3574}
3575impl ::std::convert::From<QuestionAnswer> for UserActionResponse {
3576    fn from(value: QuestionAnswer) -> Self {
3577        Self::Question(value)
3578    }
3579}
3580impl ::std::convert::From<SandboxApprovalDecision> for UserActionResponse {
3581    fn from(value: SandboxApprovalDecision) -> Self {
3582        Self::SandboxApproval(value)
3583    }
3584}
3585#[derive(
3586    ::serde::Deserialize,
3587    ::serde::Serialize,
3588    Clone,
3589    Copy,
3590    Debug,
3591    Eq,
3592    Hash,
3593    Ord,
3594    PartialEq,
3595    PartialOrd,
3596)]
3597pub enum UserActionState {
3598    #[serde(rename = "pending")]
3599    Pending,
3600    #[serde(rename = "responseAccepted")]
3601    ResponseAccepted,
3602    #[serde(rename = "resuming")]
3603    Resuming,
3604    #[serde(rename = "resumeFailed")]
3605    ResumeFailed,
3606    #[serde(rename = "executionUnknown")]
3607    ExecutionUnknown,
3608    #[serde(rename = "resolved")]
3609    Resolved,
3610    #[serde(rename = "cancelled")]
3611    Cancelled,
3612}
3613impl ::std::fmt::Display for UserActionState {
3614    fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
3615        match *self {
3616            Self::Pending => f.write_str("pending"),
3617            Self::ResponseAccepted => f.write_str("responseAccepted"),
3618            Self::Resuming => f.write_str("resuming"),
3619            Self::ResumeFailed => f.write_str("resumeFailed"),
3620            Self::ExecutionUnknown => f.write_str("executionUnknown"),
3621            Self::Resolved => f.write_str("resolved"),
3622            Self::Cancelled => f.write_str("cancelled"),
3623        }
3624    }
3625}
3626impl ::std::str::FromStr for UserActionState {
3627    type Err = self::error::ConversionError;
3628    fn from_str(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
3629        match value {
3630            "pending" => Ok(Self::Pending),
3631            "responseAccepted" => Ok(Self::ResponseAccepted),
3632            "resuming" => Ok(Self::Resuming),
3633            "resumeFailed" => Ok(Self::ResumeFailed),
3634            "executionUnknown" => Ok(Self::ExecutionUnknown),
3635            "resolved" => Ok(Self::Resolved),
3636            "cancelled" => Ok(Self::Cancelled),
3637            _ => Err("invalid value".into()),
3638        }
3639    }
3640}
3641impl ::std::convert::TryFrom<&str> for UserActionState {
3642    type Error = self::error::ConversionError;
3643    fn try_from(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
3644        value.parse()
3645    }
3646}
3647impl ::std::convert::TryFrom<&::std::string::String> for UserActionState {
3648    type Error = self::error::ConversionError;
3649    fn try_from(
3650        value: &::std::string::String,
3651    ) -> ::std::result::Result<Self, self::error::ConversionError> {
3652        value.parse()
3653    }
3654}
3655impl ::std::convert::TryFrom<::std::string::String> for UserActionState {
3656    type Error = self::error::ConversionError;
3657    fn try_from(
3658        value: ::std::string::String,
3659    ) -> ::std::result::Result<Self, self::error::ConversionError> {
3660        value.parse()
3661    }
3662}
3663#[derive(
3664    ::serde::Deserialize,
3665    ::serde::Serialize,
3666    Clone,
3667    Copy,
3668    Debug,
3669    Eq,
3670    Hash,
3671    Ord,
3672    PartialEq,
3673    PartialOrd,
3674)]
3675pub enum UserPermissionMode {
3676    #[serde(rename = "askForApproval")]
3677    AskForApproval,
3678    #[serde(rename = "approveForMe")]
3679    ApproveForMe,
3680    #[serde(rename = "fullAccess")]
3681    FullAccess,
3682}
3683impl ::std::fmt::Display for UserPermissionMode {
3684    fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
3685        match *self {
3686            Self::AskForApproval => f.write_str("askForApproval"),
3687            Self::ApproveForMe => f.write_str("approveForMe"),
3688            Self::FullAccess => f.write_str("fullAccess"),
3689        }
3690    }
3691}
3692impl ::std::str::FromStr for UserPermissionMode {
3693    type Err = self::error::ConversionError;
3694    fn from_str(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
3695        match value {
3696            "askForApproval" => Ok(Self::AskForApproval),
3697            "approveForMe" => Ok(Self::ApproveForMe),
3698            "fullAccess" => Ok(Self::FullAccess),
3699            _ => Err("invalid value".into()),
3700        }
3701    }
3702}
3703impl ::std::convert::TryFrom<&str> for UserPermissionMode {
3704    type Error = self::error::ConversionError;
3705    fn try_from(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
3706        value.parse()
3707    }
3708}
3709impl ::std::convert::TryFrom<&::std::string::String> for UserPermissionMode {
3710    type Error = self::error::ConversionError;
3711    fn try_from(
3712        value: &::std::string::String,
3713    ) -> ::std::result::Result<Self, self::error::ConversionError> {
3714        value.parse()
3715    }
3716}
3717impl ::std::convert::TryFrom<::std::string::String> for UserPermissionMode {
3718    type Error = self::error::ConversionError;
3719    fn try_from(
3720        value: ::std::string::String,
3721    ) -> ::std::result::Result<Self, self::error::ConversionError> {
3722        value.parse()
3723    }
3724}
3725pub mod defaults {
3726    pub(super) fn project_info_status() -> super::ProjectStatus {
3727        super::ProjectStatus {
3728            reason: ::std::option::Option::None,
3729            state: super::ProjectStatusState::Available,
3730        }
3731    }
3732    pub(super) fn session_info_usage() -> super::SessionUsage {
3733        super::SessionUsage {
3734            context: ::std::option::Option::None,
3735            tokens: super::TokenUsage {
3736                cache_creation_input_tokens: ::std::option::Option::None,
3737                cache_read_input_tokens: ::std::option::Option::None,
3738                input_tokens: 0_u32,
3739                output_tokens: 0_u32,
3740                total_tokens: 0_u32,
3741            },
3742        }
3743    }
3744    pub(super) fn talos_session_environment_connection_mode() -> super::TalosConnectionMode {
3745        super::TalosConnectionMode::Remote
3746    }
3747}