pub mod error {
pub struct ConversionError(::std::borrow::Cow<'static, str>);
impl ::std::error::Error for ConversionError {}
impl ::std::fmt::Display for ConversionError {
fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> Result<(), ::std::fmt::Error> {
::std::fmt::Display::fmt(&self.0, f)
}
}
impl ::std::fmt::Debug for ConversionError {
fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> Result<(), ::std::fmt::Error> {
::std::fmt::Debug::fmt(&self.0, f)
}
}
impl From<&'static str> for ConversionError {
fn from(value: &'static str) -> Self {
Self(value.into())
}
}
impl From<String> for ConversionError {
fn from(value: String) -> Self {
Self(value.into())
}
}
}
#[derive(
::serde::Deserialize,
::serde::Serialize,
Clone,
Copy,
Debug,
Eq,
Hash,
Ord,
PartialEq,
PartialOrd,
)]
pub enum ActiveTurnState {
#[serde(rename = "running")]
Running,
#[serde(rename = "waitingForInput")]
WaitingForInput,
#[serde(rename = "cancelling")]
Cancelling,
}
impl ::std::fmt::Display for ActiveTurnState {
fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
match *self {
Self::Running => f.write_str("running"),
Self::WaitingForInput => f.write_str("waitingForInput"),
Self::Cancelling => f.write_str("cancelling"),
}
}
}
impl ::std::str::FromStr for ActiveTurnState {
type Err = self::error::ConversionError;
fn from_str(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
match value {
"running" => Ok(Self::Running),
"waitingForInput" => Ok(Self::WaitingForInput),
"cancelling" => Ok(Self::Cancelling),
_ => Err("invalid value".into()),
}
}
}
impl ::std::convert::TryFrom<&str> for ActiveTurnState {
type Error = self::error::ConversionError;
fn try_from(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
value.parse()
}
}
impl ::std::convert::TryFrom<&::std::string::String> for ActiveTurnState {
type Error = self::error::ConversionError;
fn try_from(
value: &::std::string::String,
) -> ::std::result::Result<Self, self::error::ConversionError> {
value.parse()
}
}
impl ::std::convert::TryFrom<::std::string::String> for ActiveTurnState {
type Error = self::error::ConversionError;
fn try_from(
value: ::std::string::String,
) -> ::std::result::Result<Self, self::error::ConversionError> {
value.parse()
}
}
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug, PartialEq)]
#[serde(deny_unknown_fields)]
pub struct AgentAssistantText {
pub phase: AgentAssistantTextPhase,
pub text: ::std::string::String,
}
#[derive(
::serde::Deserialize,
::serde::Serialize,
Clone,
Copy,
Debug,
Eq,
Hash,
Ord,
PartialEq,
PartialOrd,
)]
pub enum AgentAssistantTextPhase {
#[serde(rename = "pending")]
Pending,
#[serde(rename = "commentary")]
Commentary,
#[serde(rename = "finalAnswer")]
FinalAnswer,
}
impl ::std::fmt::Display for AgentAssistantTextPhase {
fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
match *self {
Self::Pending => f.write_str("pending"),
Self::Commentary => f.write_str("commentary"),
Self::FinalAnswer => f.write_str("finalAnswer"),
}
}
}
impl ::std::str::FromStr for AgentAssistantTextPhase {
type Err = self::error::ConversionError;
fn from_str(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
match value {
"pending" => Ok(Self::Pending),
"commentary" => Ok(Self::Commentary),
"finalAnswer" => Ok(Self::FinalAnswer),
_ => Err("invalid value".into()),
}
}
}
impl ::std::convert::TryFrom<&str> for AgentAssistantTextPhase {
type Error = self::error::ConversionError;
fn try_from(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
value.parse()
}
}
impl ::std::convert::TryFrom<&::std::string::String> for AgentAssistantTextPhase {
type Error = self::error::ConversionError;
fn try_from(
value: &::std::string::String,
) -> ::std::result::Result<Self, self::error::ConversionError> {
value.parse()
}
}
impl ::std::convert::TryFrom<::std::string::String> for AgentAssistantTextPhase {
type Error = self::error::ConversionError;
fn try_from(
value: ::std::string::String,
) -> ::std::result::Result<Self, self::error::ConversionError> {
value.parse()
}
}
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug, PartialEq)]
#[serde(deny_unknown_fields)]
pub struct AgentContextCompaction {
#[serde(default)]
pub message: ::std::option::Option<::std::string::String>,
#[serde(default)]
pub metrics: ::std::option::Option<ContextCompactionMetrics>,
#[serde(default)]
pub outcome: ::std::option::Option<ContextCompactionOutcome>,
pub stage: ContextCompactionStage,
pub trigger: ContextCompactionTrigger,
}
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug, PartialEq)]
#[serde(deny_unknown_fields)]
#[derive(Default)]
pub struct AgentContextCompactionDelta {
#[serde(default)]
pub message: ::std::option::Option<::std::string::String>,
#[serde(default)]
pub metrics: ::std::option::Option<ContextCompactionMetrics>,
#[serde(default)]
pub outcome: ::std::option::Option<ContextCompactionOutcome>,
#[serde(default)]
pub stage: ::std::option::Option<ContextCompactionStage>,
}
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug, PartialEq)]
#[serde(deny_unknown_fields)]
pub struct AgentEvent {
pub identity: AgentTurnRef,
#[serde(rename = "occurredAt")]
pub occurred_at: i64,
pub payload: AgentEventPayload,
pub sequence: u64,
}
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug, PartialEq)]
#[serde(tag = "type", content = "data")]
pub enum AgentEventPayload {
#[serde(rename = "turnStarted")]
TurnStarted(AgentTurnStarted),
#[serde(rename = "messageStarted")]
MessageStarted(AgentMessageStarted),
#[serde(rename = "messageBlockStarted")]
MessageBlockStarted(AgentMessageBlockStarted),
#[serde(rename = "messageBlockDelta")]
MessageBlockDelta(AgentMessageBlockDelta),
#[serde(rename = "messageBlockCompleted")]
MessageBlockCompleted(AgentMessageBlockCompleted),
#[serde(rename = "messageCompleted")]
MessageCompleted(AgentMessage),
#[serde(rename = "waitingForInput")]
WaitingForInput(AgentPendingInput),
#[serde(rename = "metricsUpdated")]
MetricsUpdated(AgentRunMetrics),
#[serde(rename = "turnCompleted")]
TurnCompleted(AgentTurnCompleted),
#[serde(rename = "turnFailed")]
TurnFailed(AgentTurnFailed),
}
impl ::std::convert::From<AgentTurnStarted> for AgentEventPayload {
fn from(value: AgentTurnStarted) -> Self {
Self::TurnStarted(value)
}
}
impl ::std::convert::From<AgentMessageStarted> for AgentEventPayload {
fn from(value: AgentMessageStarted) -> Self {
Self::MessageStarted(value)
}
}
impl ::std::convert::From<AgentMessageBlockStarted> for AgentEventPayload {
fn from(value: AgentMessageBlockStarted) -> Self {
Self::MessageBlockStarted(value)
}
}
impl ::std::convert::From<AgentMessageBlockDelta> for AgentEventPayload {
fn from(value: AgentMessageBlockDelta) -> Self {
Self::MessageBlockDelta(value)
}
}
impl ::std::convert::From<AgentMessageBlockCompleted> for AgentEventPayload {
fn from(value: AgentMessageBlockCompleted) -> Self {
Self::MessageBlockCompleted(value)
}
}
impl ::std::convert::From<AgentMessage> for AgentEventPayload {
fn from(value: AgentMessage) -> Self {
Self::MessageCompleted(value)
}
}
impl ::std::convert::From<AgentPendingInput> for AgentEventPayload {
fn from(value: AgentPendingInput) -> Self {
Self::WaitingForInput(value)
}
}
impl ::std::convert::From<AgentRunMetrics> for AgentEventPayload {
fn from(value: AgentRunMetrics) -> Self {
Self::MetricsUpdated(value)
}
}
impl ::std::convert::From<AgentTurnCompleted> for AgentEventPayload {
fn from(value: AgentTurnCompleted) -> Self {
Self::TurnCompleted(value)
}
}
impl ::std::convert::From<AgentTurnFailed> for AgentEventPayload {
fn from(value: AgentTurnFailed) -> Self {
Self::TurnFailed(value)
}
}
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug, PartialEq)]
#[serde(deny_unknown_fields)]
pub struct AgentExecutionSummary {
pub text: ::std::string::String,
}
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug, PartialEq)]
#[serde(tag = "type", deny_unknown_fields)]
pub enum AgentMediaSource {
#[serde(rename = "url")]
Url { url: ::std::string::String },
#[serde(rename = "inlineBase64")]
InlineBase64 { data: ::std::string::String },
}
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug, PartialEq)]
#[serde(deny_unknown_fields)]
pub struct AgentMessage {
pub blocks: ::std::vec::Vec<AgentMessageBlock>,
#[serde(rename = "completedAt", default)]
pub completed_at: ::std::option::Option<i64>,
#[serde(rename = "createdAt")]
pub created_at: i64,
#[serde(rename = "messageId")]
pub message_id: ::std::string::String,
pub role: AgentMessageRole,
pub status: AgentMessageStatus,
#[serde(rename = "turnId")]
pub turn_id: ::std::string::String,
}
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug, PartialEq)]
#[serde(deny_unknown_fields)]
pub struct AgentMessageBlock {
#[serde(rename = "blockId")]
pub block_id: ::std::string::String,
#[serde(rename = "completedAt", default)]
pub completed_at: ::std::option::Option<i64>,
pub content: AgentMessageBlockContent,
#[serde(rename = "startedAt")]
pub started_at: i64,
pub status: AgentMessageBlockStatus,
}
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug, PartialEq)]
#[serde(deny_unknown_fields)]
pub struct AgentMessageBlockCompleted {
pub block: AgentMessageBlock,
#[serde(rename = "messageId")]
pub message_id: ::std::string::String,
}
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug, PartialEq)]
#[serde(tag = "type", content = "data")]
pub enum AgentMessageBlockContent {
#[serde(rename = "userContent")]
UserContent(AgentUserContent),
#[serde(rename = "reasoning")]
Reasoning(AgentReasoning),
#[serde(rename = "assistantText")]
AssistantText(AgentAssistantText),
#[serde(rename = "toolCall")]
ToolCall(AgentToolCall),
#[serde(rename = "toolResult")]
ToolResult(AgentToolResult),
#[serde(rename = "executionSummary")]
ExecutionSummary(AgentExecutionSummary),
#[serde(rename = "contextCompaction")]
ContextCompaction(AgentContextCompaction),
#[serde(rename = "systemNotice")]
SystemNotice(AgentSystemNotice),
}
impl ::std::convert::From<AgentUserContent> for AgentMessageBlockContent {
fn from(value: AgentUserContent) -> Self {
Self::UserContent(value)
}
}
impl ::std::convert::From<AgentReasoning> for AgentMessageBlockContent {
fn from(value: AgentReasoning) -> Self {
Self::Reasoning(value)
}
}
impl ::std::convert::From<AgentAssistantText> for AgentMessageBlockContent {
fn from(value: AgentAssistantText) -> Self {
Self::AssistantText(value)
}
}
impl ::std::convert::From<AgentToolCall> for AgentMessageBlockContent {
fn from(value: AgentToolCall) -> Self {
Self::ToolCall(value)
}
}
impl ::std::convert::From<AgentToolResult> for AgentMessageBlockContent {
fn from(value: AgentToolResult) -> Self {
Self::ToolResult(value)
}
}
impl ::std::convert::From<AgentExecutionSummary> for AgentMessageBlockContent {
fn from(value: AgentExecutionSummary) -> Self {
Self::ExecutionSummary(value)
}
}
impl ::std::convert::From<AgentContextCompaction> for AgentMessageBlockContent {
fn from(value: AgentContextCompaction) -> Self {
Self::ContextCompaction(value)
}
}
impl ::std::convert::From<AgentSystemNotice> for AgentMessageBlockContent {
fn from(value: AgentSystemNotice) -> Self {
Self::SystemNotice(value)
}
}
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug, PartialEq)]
#[serde(deny_unknown_fields)]
pub struct AgentMessageBlockDelta {
#[serde(rename = "blockId")]
pub block_id: ::std::string::String,
pub delta: AgentMessageBlockDeltaContent,
#[serde(rename = "messageId")]
pub message_id: ::std::string::String,
}
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug, PartialEq)]
#[serde(tag = "type", content = "data")]
pub enum AgentMessageBlockDeltaContent {
#[serde(rename = "text")]
Text(::std::string::String),
#[serde(rename = "assistantTextPhase")]
AssistantTextPhase(AgentAssistantTextPhase),
#[serde(rename = "toolCallArguments")]
ToolCallArguments(AgentToolCallArgumentsDelta),
#[serde(rename = "toolProgress")]
ToolProgress(AgentToolProgress),
#[serde(rename = "contextCompaction")]
ContextCompaction(AgentContextCompactionDelta),
}
impl ::std::convert::From<AgentAssistantTextPhase> for AgentMessageBlockDeltaContent {
fn from(value: AgentAssistantTextPhase) -> Self {
Self::AssistantTextPhase(value)
}
}
impl ::std::convert::From<AgentToolCallArgumentsDelta> for AgentMessageBlockDeltaContent {
fn from(value: AgentToolCallArgumentsDelta) -> Self {
Self::ToolCallArguments(value)
}
}
impl ::std::convert::From<AgentToolProgress> for AgentMessageBlockDeltaContent {
fn from(value: AgentToolProgress) -> Self {
Self::ToolProgress(value)
}
}
impl ::std::convert::From<AgentContextCompactionDelta> for AgentMessageBlockDeltaContent {
fn from(value: AgentContextCompactionDelta) -> Self {
Self::ContextCompaction(value)
}
}
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug, PartialEq)]
#[serde(deny_unknown_fields)]
pub struct AgentMessageBlockStarted {
pub block: AgentMessageBlock,
#[serde(rename = "messageId")]
pub message_id: ::std::string::String,
}
#[derive(
::serde::Deserialize,
::serde::Serialize,
Clone,
Copy,
Debug,
Eq,
Hash,
Ord,
PartialEq,
PartialOrd,
)]
pub enum AgentMessageBlockStatus {
#[serde(rename = "queued")]
Queued,
#[serde(rename = "running")]
Running,
#[serde(rename = "waitingForInput")]
WaitingForInput,
#[serde(rename = "completed")]
Completed,
#[serde(rename = "failed")]
Failed,
#[serde(rename = "cancelled")]
Cancelled,
}
impl ::std::fmt::Display for AgentMessageBlockStatus {
fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
match *self {
Self::Queued => f.write_str("queued"),
Self::Running => f.write_str("running"),
Self::WaitingForInput => f.write_str("waitingForInput"),
Self::Completed => f.write_str("completed"),
Self::Failed => f.write_str("failed"),
Self::Cancelled => f.write_str("cancelled"),
}
}
}
impl ::std::str::FromStr for AgentMessageBlockStatus {
type Err = self::error::ConversionError;
fn from_str(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
match value {
"queued" => Ok(Self::Queued),
"running" => Ok(Self::Running),
"waitingForInput" => Ok(Self::WaitingForInput),
"completed" => Ok(Self::Completed),
"failed" => Ok(Self::Failed),
"cancelled" => Ok(Self::Cancelled),
_ => Err("invalid value".into()),
}
}
}
impl ::std::convert::TryFrom<&str> for AgentMessageBlockStatus {
type Error = self::error::ConversionError;
fn try_from(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
value.parse()
}
}
impl ::std::convert::TryFrom<&::std::string::String> for AgentMessageBlockStatus {
type Error = self::error::ConversionError;
fn try_from(
value: &::std::string::String,
) -> ::std::result::Result<Self, self::error::ConversionError> {
value.parse()
}
}
impl ::std::convert::TryFrom<::std::string::String> for AgentMessageBlockStatus {
type Error = self::error::ConversionError;
fn try_from(
value: ::std::string::String,
) -> ::std::result::Result<Self, self::error::ConversionError> {
value.parse()
}
}
#[derive(
::serde::Deserialize,
::serde::Serialize,
Clone,
Copy,
Debug,
Eq,
Hash,
Ord,
PartialEq,
PartialOrd,
)]
pub enum AgentMessageRole {
#[serde(rename = "user")]
User,
#[serde(rename = "agent")]
Agent,
#[serde(rename = "tool")]
Tool,
#[serde(rename = "system")]
System,
}
impl ::std::fmt::Display for AgentMessageRole {
fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
match *self {
Self::User => f.write_str("user"),
Self::Agent => f.write_str("agent"),
Self::Tool => f.write_str("tool"),
Self::System => f.write_str("system"),
}
}
}
impl ::std::str::FromStr for AgentMessageRole {
type Err = self::error::ConversionError;
fn from_str(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
match value {
"user" => Ok(Self::User),
"agent" => Ok(Self::Agent),
"tool" => Ok(Self::Tool),
"system" => Ok(Self::System),
_ => Err("invalid value".into()),
}
}
}
impl ::std::convert::TryFrom<&str> for AgentMessageRole {
type Error = self::error::ConversionError;
fn try_from(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
value.parse()
}
}
impl ::std::convert::TryFrom<&::std::string::String> for AgentMessageRole {
type Error = self::error::ConversionError;
fn try_from(
value: &::std::string::String,
) -> ::std::result::Result<Self, self::error::ConversionError> {
value.parse()
}
}
impl ::std::convert::TryFrom<::std::string::String> for AgentMessageRole {
type Error = self::error::ConversionError;
fn try_from(
value: ::std::string::String,
) -> ::std::result::Result<Self, self::error::ConversionError> {
value.parse()
}
}
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug, PartialEq)]
#[serde(deny_unknown_fields)]
pub struct AgentMessageStarted {
pub message: AgentMessage,
}
#[derive(
::serde::Deserialize,
::serde::Serialize,
Clone,
Copy,
Debug,
Eq,
Hash,
Ord,
PartialEq,
PartialOrd,
)]
pub enum AgentMessageStatus {
#[serde(rename = "inProgress")]
InProgress,
#[serde(rename = "completed")]
Completed,
#[serde(rename = "failed")]
Failed,
#[serde(rename = "cancelled")]
Cancelled,
}
impl ::std::fmt::Display for AgentMessageStatus {
fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
match *self {
Self::InProgress => f.write_str("inProgress"),
Self::Completed => f.write_str("completed"),
Self::Failed => f.write_str("failed"),
Self::Cancelled => f.write_str("cancelled"),
}
}
}
impl ::std::str::FromStr for AgentMessageStatus {
type Err = self::error::ConversionError;
fn from_str(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
match value {
"inProgress" => Ok(Self::InProgress),
"completed" => Ok(Self::Completed),
"failed" => Ok(Self::Failed),
"cancelled" => Ok(Self::Cancelled),
_ => Err("invalid value".into()),
}
}
}
impl ::std::convert::TryFrom<&str> for AgentMessageStatus {
type Error = self::error::ConversionError;
fn try_from(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
value.parse()
}
}
impl ::std::convert::TryFrom<&::std::string::String> for AgentMessageStatus {
type Error = self::error::ConversionError;
fn try_from(
value: &::std::string::String,
) -> ::std::result::Result<Self, self::error::ConversionError> {
value.parse()
}
}
impl ::std::convert::TryFrom<::std::string::String> for AgentMessageStatus {
type Error = self::error::ConversionError;
fn try_from(
value: ::std::string::String,
) -> ::std::result::Result<Self, self::error::ConversionError> {
value.parse()
}
}
#[derive(
::serde::Deserialize, ::serde::Serialize, Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd,
)]
#[serde(transparent)]
pub struct AgentPath(pub ::std::string::String);
impl ::std::ops::Deref for AgentPath {
type Target = ::std::string::String;
fn deref(&self) -> &::std::string::String {
&self.0
}
}
impl ::std::convert::From<AgentPath> for ::std::string::String {
fn from(value: AgentPath) -> Self {
value.0
}
}
impl ::std::convert::From<::std::string::String> for AgentPath {
fn from(value: ::std::string::String) -> Self {
Self(value)
}
}
impl ::std::str::FromStr for AgentPath {
type Err = ::std::convert::Infallible;
fn from_str(value: &str) -> ::std::result::Result<Self, Self::Err> {
Ok(Self(value.to_string()))
}
}
impl ::std::fmt::Display for AgentPath {
fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
self.0.fmt(f)
}
}
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug, PartialEq)]
#[serde(tag = "type", deny_unknown_fields)]
pub enum AgentPendingInput {
#[serde(rename = "message")]
Message {
#[serde(rename = "actionId")]
action_id: ::std::string::String,
prompt: ::std::string::String,
},
#[serde(rename = "userAction")]
UserAction { action: PendingUserAction },
}
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug, PartialEq)]
#[serde(deny_unknown_fields)]
pub struct AgentReasoning {
pub text: ::std::string::String,
}
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug, PartialEq)]
#[serde(deny_unknown_fields)]
pub struct AgentRunMetrics {
#[serde(default)]
pub context: ::std::option::Option<ContextUsage>,
#[serde(rename = "durationMs", default)]
pub duration_ms: ::std::option::Option<u64>,
#[serde(rename = "modelRounds")]
pub model_rounds: u32,
#[serde(rename = "toolCalls")]
pub tool_calls: u32,
#[serde(rename = "toolErrors")]
pub tool_errors: u32,
#[serde(rename = "toolSuccesses")]
pub tool_successes: u32,
pub usage: TokenUsage,
}
#[derive(
::serde::Deserialize,
::serde::Serialize,
Clone,
Copy,
Debug,
Eq,
Hash,
Ord,
PartialEq,
PartialOrd,
)]
pub enum AgentStopReason {
#[serde(rename = "endTurn")]
EndTurn,
#[serde(rename = "outputLimit")]
OutputLimit,
#[serde(rename = "transferUnresolved")]
TransferUnresolved,
}
impl ::std::fmt::Display for AgentStopReason {
fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
match *self {
Self::EndTurn => f.write_str("endTurn"),
Self::OutputLimit => f.write_str("outputLimit"),
Self::TransferUnresolved => f.write_str("transferUnresolved"),
}
}
}
impl ::std::str::FromStr for AgentStopReason {
type Err = self::error::ConversionError;
fn from_str(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
match value {
"endTurn" => Ok(Self::EndTurn),
"outputLimit" => Ok(Self::OutputLimit),
"transferUnresolved" => Ok(Self::TransferUnresolved),
_ => Err("invalid value".into()),
}
}
}
impl ::std::convert::TryFrom<&str> for AgentStopReason {
type Error = self::error::ConversionError;
fn try_from(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
value.parse()
}
}
impl ::std::convert::TryFrom<&::std::string::String> for AgentStopReason {
type Error = self::error::ConversionError;
fn try_from(
value: &::std::string::String,
) -> ::std::result::Result<Self, self::error::ConversionError> {
value.parse()
}
}
impl ::std::convert::TryFrom<::std::string::String> for AgentStopReason {
type Error = self::error::ConversionError;
fn try_from(
value: ::std::string::String,
) -> ::std::result::Result<Self, self::error::ConversionError> {
value.parse()
}
}
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug, PartialEq)]
#[serde(deny_unknown_fields)]
pub struct AgentSystemNotice {
pub content: SystemNoticeContent,
pub level: TalosTimelineNoticeLevel,
}
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug, PartialEq)]
#[serde(deny_unknown_fields)]
pub struct AgentToolCall {
pub arguments: AgentToolCallArguments,
#[serde(rename = "callId")]
pub call_id: ::std::string::String,
pub name: ::std::string::String,
pub progress: ::std::vec::Vec<AgentToolProgress>,
}
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug, PartialEq)]
#[serde(tag = "state", deny_unknown_fields)]
pub enum AgentToolCallArguments {
#[serde(rename = "streaming")]
Streaming {
#[serde(rename = "jsonFragment")]
json_fragment: ::std::string::String,
},
#[serde(rename = "complete")]
Complete { value: ToolArguments },
}
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug, PartialEq)]
#[serde(deny_unknown_fields)]
pub struct AgentToolCallArgumentsDelta {
#[serde(rename = "jsonFragment")]
pub json_fragment: ::std::string::String,
}
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug, PartialEq)]
#[serde(deny_unknown_fields)]
pub struct AgentToolProgress {
pub kind: TalosToolProgressKind,
#[serde(rename = "occurredAt")]
pub occurred_at: i64,
pub text: ::std::string::String,
}
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug, PartialEq)]
#[serde(deny_unknown_fields)]
pub struct AgentToolResult {
#[serde(rename = "callId")]
pub call_id: ::std::string::String,
pub content: ::std::vec::Vec<TalosContentItem>,
#[serde(rename = "isError")]
pub is_error: bool,
#[serde(default)]
pub metrics: ::std::option::Option<ToolExecutionMetrics>,
#[serde(rename = "toolName")]
pub tool_name: ::std::string::String,
}
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug, PartialEq)]
#[serde(deny_unknown_fields)]
pub struct AgentTreeNode {
pub children: ::std::vec::Vec<AgentTreeNode>,
pub snapshot: SubagentSnapshot,
}
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug, PartialEq)]
#[serde(deny_unknown_fields)]
pub struct AgentTreeSnapshot {
pub children: ::std::vec::Vec<AgentTreeNode>,
}
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug, PartialEq)]
#[serde(deny_unknown_fields)]
pub struct AgentTurnCompleted {
#[serde(rename = "stopReason")]
pub stop_reason: AgentStopReason,
}
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug, PartialEq)]
#[serde(deny_unknown_fields)]
pub struct AgentTurnFailed {
pub error: ApiError,
pub retryable: bool,
}
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug, PartialEq)]
#[serde(deny_unknown_fields)]
pub struct AgentTurnRef {
#[serde(rename = "sessionId")]
pub session_id: ::std::string::String,
#[serde(rename = "turnId")]
pub turn_id: ::std::string::String,
}
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug, PartialEq)]
#[serde(deny_unknown_fields)]
#[derive(Default)]
pub struct AgentTurnStarted {}
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug, PartialEq)]
#[serde(tag = "type", deny_unknown_fields)]
pub enum AgentUserContent {
#[serde(rename = "text")]
Text { text: ::std::string::String },
#[serde(rename = "skillSelection")]
SkillSelection {
name: ::std::string::String,
path: ::std::string::String,
},
#[serde(rename = "file")]
File {
#[serde(rename = "fileId")]
file_id: ::std::string::String,
},
#[serde(rename = "audio")]
Audio {
#[serde(rename = "mimeType", default)]
mime_type: ::std::option::Option<::std::string::String>,
source: AgentMediaSource,
},
#[serde(rename = "video")]
Video {
#[serde(rename = "mimeType", default)]
mime_type: ::std::option::Option<::std::string::String>,
source: AgentMediaSource,
},
#[serde(rename = "userActionResponse")]
UserActionResponse {
#[serde(rename = "actionId")]
action_id: ::std::string::String,
response: UserActionResponse,
},
}
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug, PartialEq)]
#[serde(deny_unknown_fields)]
pub struct ApiError {
pub code: ErrorCode,
pub localization: ::std::option::Option<ErrorLocalization>,
pub message: ::std::string::String,
}
#[derive(
::serde::Deserialize,
::serde::Serialize,
Clone,
Copy,
Debug,
Eq,
Hash,
Ord,
PartialEq,
PartialOrd,
)]
pub enum BashOutputCaptureStatus {
#[serde(rename = "capturing")]
Capturing,
#[serde(rename = "complete")]
Complete,
#[serde(rename = "quotaLimited")]
QuotaLimited,
#[serde(rename = "interrupted")]
Interrupted,
#[serde(rename = "writeFailed")]
WriteFailed,
}
impl ::std::fmt::Display for BashOutputCaptureStatus {
fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
match *self {
Self::Capturing => f.write_str("capturing"),
Self::Complete => f.write_str("complete"),
Self::QuotaLimited => f.write_str("quotaLimited"),
Self::Interrupted => f.write_str("interrupted"),
Self::WriteFailed => f.write_str("writeFailed"),
}
}
}
impl ::std::str::FromStr for BashOutputCaptureStatus {
type Err = self::error::ConversionError;
fn from_str(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
match value {
"capturing" => Ok(Self::Capturing),
"complete" => Ok(Self::Complete),
"quotaLimited" => Ok(Self::QuotaLimited),
"interrupted" => Ok(Self::Interrupted),
"writeFailed" => Ok(Self::WriteFailed),
_ => Err("invalid value".into()),
}
}
}
impl ::std::convert::TryFrom<&str> for BashOutputCaptureStatus {
type Error = self::error::ConversionError;
fn try_from(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
value.parse()
}
}
impl ::std::convert::TryFrom<&::std::string::String> for BashOutputCaptureStatus {
type Error = self::error::ConversionError;
fn try_from(
value: &::std::string::String,
) -> ::std::result::Result<Self, self::error::ConversionError> {
value.parse()
}
}
impl ::std::convert::TryFrom<::std::string::String> for BashOutputCaptureStatus {
type Error = self::error::ConversionError;
fn try_from(
value: ::std::string::String,
) -> ::std::result::Result<Self, self::error::ConversionError> {
value.parse()
}
}
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug, PartialEq)]
#[serde(deny_unknown_fields)]
pub struct BashOutputLog {
#[serde(rename = "captureStatus")]
pub capture_status: BashOutputCaptureStatus,
#[serde(rename = "expiresAt")]
pub expires_at: i64,
pub path: ::std::string::String,
#[serde(rename = "relativePath")]
pub relative_path: ::std::string::String,
#[serde(rename = "storedBytes")]
pub stored_bytes: u64,
#[serde(rename = "totalBytes")]
pub total_bytes: u64,
#[serde(rename = "totalLines")]
pub total_lines: u64,
}
#[derive(
::serde::Deserialize,
::serde::Serialize,
Clone,
Copy,
Debug,
Eq,
Hash,
Ord,
PartialEq,
PartialOrd,
)]
pub enum BrowserCapabilityOperation {
#[serde(rename = "remoteDesktop")]
RemoteDesktop,
#[serde(rename = "takeControl")]
TakeControl,
#[serde(rename = "releaseControl")]
ReleaseControl,
#[serde(rename = "openLocal")]
OpenLocal,
}
impl ::std::fmt::Display for BrowserCapabilityOperation {
fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
match *self {
Self::RemoteDesktop => f.write_str("remoteDesktop"),
Self::TakeControl => f.write_str("takeControl"),
Self::ReleaseControl => f.write_str("releaseControl"),
Self::OpenLocal => f.write_str("openLocal"),
}
}
}
impl ::std::str::FromStr for BrowserCapabilityOperation {
type Err = self::error::ConversionError;
fn from_str(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
match value {
"remoteDesktop" => Ok(Self::RemoteDesktop),
"takeControl" => Ok(Self::TakeControl),
"releaseControl" => Ok(Self::ReleaseControl),
"openLocal" => Ok(Self::OpenLocal),
_ => Err("invalid value".into()),
}
}
}
impl ::std::convert::TryFrom<&str> for BrowserCapabilityOperation {
type Error = self::error::ConversionError;
fn try_from(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
value.parse()
}
}
impl ::std::convert::TryFrom<&::std::string::String> for BrowserCapabilityOperation {
type Error = self::error::ConversionError;
fn try_from(
value: &::std::string::String,
) -> ::std::result::Result<Self, self::error::ConversionError> {
value.parse()
}
}
impl ::std::convert::TryFrom<::std::string::String> for BrowserCapabilityOperation {
type Error = self::error::ConversionError;
fn try_from(
value: ::std::string::String,
) -> ::std::result::Result<Self, self::error::ConversionError> {
value.parse()
}
}
#[derive(
::serde::Deserialize,
::serde::Serialize,
Clone,
Copy,
Debug,
Eq,
Hash,
Ord,
PartialEq,
PartialOrd,
)]
pub enum BrowserCapabilityReason {
#[serde(rename = "nativeHost")]
NativeHost,
#[serde(rename = "notBundled")]
NotBundled,
#[serde(rename = "hostPolicy")]
HostPolicy,
#[serde(rename = "unsupportedVersion")]
UnsupportedVersion,
#[serde(rename = "clientMismatch")]
ClientMismatch,
}
impl ::std::fmt::Display for BrowserCapabilityReason {
fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
match *self {
Self::NativeHost => f.write_str("nativeHost"),
Self::NotBundled => f.write_str("notBundled"),
Self::HostPolicy => f.write_str("hostPolicy"),
Self::UnsupportedVersion => f.write_str("unsupportedVersion"),
Self::ClientMismatch => f.write_str("clientMismatch"),
}
}
}
impl ::std::str::FromStr for BrowserCapabilityReason {
type Err = self::error::ConversionError;
fn from_str(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
match value {
"nativeHost" => Ok(Self::NativeHost),
"notBundled" => Ok(Self::NotBundled),
"hostPolicy" => Ok(Self::HostPolicy),
"unsupportedVersion" => Ok(Self::UnsupportedVersion),
"clientMismatch" => Ok(Self::ClientMismatch),
_ => Err("invalid value".into()),
}
}
}
impl ::std::convert::TryFrom<&str> for BrowserCapabilityReason {
type Error = self::error::ConversionError;
fn try_from(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
value.parse()
}
}
impl ::std::convert::TryFrom<&::std::string::String> for BrowserCapabilityReason {
type Error = self::error::ConversionError;
fn try_from(
value: &::std::string::String,
) -> ::std::result::Result<Self, self::error::ConversionError> {
value.parse()
}
}
impl ::std::convert::TryFrom<::std::string::String> for BrowserCapabilityReason {
type Error = self::error::ConversionError;
fn try_from(
value: ::std::string::String,
) -> ::std::result::Result<Self, self::error::ConversionError> {
value.parse()
}
}
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug, PartialEq)]
#[serde(tag = "operation", content = "result")]
pub enum CollaborationToolResult {
#[serde(rename = "spawnAgent")]
SpawnAgent(SubagentSpawnResult),
#[serde(rename = "sendMessage")]
SendMessage(SendMessageResult),
#[serde(rename = "waitAgent")]
WaitAgent(SubagentSnapshot),
#[serde(rename = "interruptAgent")]
InterruptAgent(SubagentSnapshot),
#[serde(rename = "followupTask")]
FollowupTask(SubagentSnapshot),
#[serde(rename = "listAgents")]
ListAgents(AgentTreeSnapshot),
}
impl ::std::convert::From<SubagentSpawnResult> for CollaborationToolResult {
fn from(value: SubagentSpawnResult) -> Self {
Self::SpawnAgent(value)
}
}
impl ::std::convert::From<SendMessageResult> for CollaborationToolResult {
fn from(value: SendMessageResult) -> Self {
Self::SendMessage(value)
}
}
impl ::std::convert::From<AgentTreeSnapshot> for CollaborationToolResult {
fn from(value: AgentTreeSnapshot) -> Self {
Self::ListAgents(value)
}
}
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug, PartialEq)]
#[serde(deny_unknown_fields)]
pub struct ContextCompactionMetrics {
pub compaction_input_tokens: u32,
pub compaction_output_tokens: u32,
#[serde(default)]
pub covers_from_seq: ::std::option::Option<u64>,
#[serde(default)]
pub covers_until_seq: ::std::option::Option<u64>,
pub post_compaction_total_tokens: u32,
pub pre_compaction_total_tokens: u32,
#[serde(default)]
pub raw_tail_backfilled_count: ::std::option::Option<u32>,
#[serde(default)]
pub raw_tail_preferred_count: ::std::option::Option<u32>,
pub trimmed_context_unit_count: u32,
#[serde(default)]
pub working_context_compacted_messages: ::std::option::Option<u32>,
#[serde(default)]
pub working_context_input_messages: ::std::option::Option<u32>,
#[serde(default)]
pub working_context_preserved_recent_exchanges: ::std::option::Option<u32>,
}
#[derive(
::serde::Deserialize,
::serde::Serialize,
Clone,
Copy,
Debug,
Eq,
Hash,
Ord,
PartialEq,
PartialOrd,
)]
pub enum ContextCompactionOutcome {
#[serde(rename = "applied")]
Applied,
#[serde(rename = "no_changes")]
NoChanges,
#[serde(rename = "rejected_missing_summary")]
RejectedMissingSummary,
#[serde(rename = "trimmed_fallback_applied")]
TrimmedFallbackApplied,
#[serde(rename = "failed_context_still_too_large")]
FailedContextStillTooLarge,
#[serde(rename = "failed_provider_error")]
FailedProviderError,
#[serde(rename = "failed_internal_error")]
FailedInternalError,
}
impl ::std::fmt::Display for ContextCompactionOutcome {
fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
match *self {
Self::Applied => f.write_str("applied"),
Self::NoChanges => f.write_str("no_changes"),
Self::RejectedMissingSummary => f.write_str("rejected_missing_summary"),
Self::TrimmedFallbackApplied => f.write_str("trimmed_fallback_applied"),
Self::FailedContextStillTooLarge => f.write_str("failed_context_still_too_large"),
Self::FailedProviderError => f.write_str("failed_provider_error"),
Self::FailedInternalError => f.write_str("failed_internal_error"),
}
}
}
impl ::std::str::FromStr for ContextCompactionOutcome {
type Err = self::error::ConversionError;
fn from_str(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
match value {
"applied" => Ok(Self::Applied),
"no_changes" => Ok(Self::NoChanges),
"rejected_missing_summary" => Ok(Self::RejectedMissingSummary),
"trimmed_fallback_applied" => Ok(Self::TrimmedFallbackApplied),
"failed_context_still_too_large" => Ok(Self::FailedContextStillTooLarge),
"failed_provider_error" => Ok(Self::FailedProviderError),
"failed_internal_error" => Ok(Self::FailedInternalError),
_ => Err("invalid value".into()),
}
}
}
impl ::std::convert::TryFrom<&str> for ContextCompactionOutcome {
type Error = self::error::ConversionError;
fn try_from(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
value.parse()
}
}
impl ::std::convert::TryFrom<&::std::string::String> for ContextCompactionOutcome {
type Error = self::error::ConversionError;
fn try_from(
value: &::std::string::String,
) -> ::std::result::Result<Self, self::error::ConversionError> {
value.parse()
}
}
impl ::std::convert::TryFrom<::std::string::String> for ContextCompactionOutcome {
type Error = self::error::ConversionError;
fn try_from(
value: ::std::string::String,
) -> ::std::result::Result<Self, self::error::ConversionError> {
value.parse()
}
}
#[derive(
::serde::Deserialize,
::serde::Serialize,
Clone,
Copy,
Debug,
Eq,
Hash,
Ord,
PartialEq,
PartialOrd,
)]
pub enum ContextCompactionStage {
#[serde(rename = "preparing")]
Preparing,
#[serde(rename = "summarizing")]
Summarizing,
#[serde(rename = "rebuilding_prompt")]
RebuildingPrompt,
#[serde(rename = "trimming")]
Trimming,
#[serde(rename = "completed")]
Completed,
#[serde(rename = "failed")]
Failed,
}
impl ::std::fmt::Display for ContextCompactionStage {
fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
match *self {
Self::Preparing => f.write_str("preparing"),
Self::Summarizing => f.write_str("summarizing"),
Self::RebuildingPrompt => f.write_str("rebuilding_prompt"),
Self::Trimming => f.write_str("trimming"),
Self::Completed => f.write_str("completed"),
Self::Failed => f.write_str("failed"),
}
}
}
impl ::std::str::FromStr for ContextCompactionStage {
type Err = self::error::ConversionError;
fn from_str(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
match value {
"preparing" => Ok(Self::Preparing),
"summarizing" => Ok(Self::Summarizing),
"rebuilding_prompt" => Ok(Self::RebuildingPrompt),
"trimming" => Ok(Self::Trimming),
"completed" => Ok(Self::Completed),
"failed" => Ok(Self::Failed),
_ => Err("invalid value".into()),
}
}
}
impl ::std::convert::TryFrom<&str> for ContextCompactionStage {
type Error = self::error::ConversionError;
fn try_from(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
value.parse()
}
}
impl ::std::convert::TryFrom<&::std::string::String> for ContextCompactionStage {
type Error = self::error::ConversionError;
fn try_from(
value: &::std::string::String,
) -> ::std::result::Result<Self, self::error::ConversionError> {
value.parse()
}
}
impl ::std::convert::TryFrom<::std::string::String> for ContextCompactionStage {
type Error = self::error::ConversionError;
fn try_from(
value: ::std::string::String,
) -> ::std::result::Result<Self, self::error::ConversionError> {
value.parse()
}
}
#[derive(
::serde::Deserialize,
::serde::Serialize,
Clone,
Copy,
Debug,
Eq,
Hash,
Ord,
PartialEq,
PartialOrd,
)]
pub enum ContextCompactionTrigger {
#[serde(rename = "user_requested")]
UserRequested,
#[serde(rename = "threshold_exceeded")]
ThresholdExceeded,
#[serde(rename = "hard_threshold_exceeded")]
HardThresholdExceeded,
#[serde(rename = "budget_exceeded")]
BudgetExceeded,
#[serde(rename = "history_sections_dropped")]
HistorySectionsDropped,
#[serde(rename = "working_context_exceeded")]
WorkingContextExceeded,
}
impl ::std::fmt::Display for ContextCompactionTrigger {
fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
match *self {
Self::UserRequested => f.write_str("user_requested"),
Self::ThresholdExceeded => f.write_str("threshold_exceeded"),
Self::HardThresholdExceeded => f.write_str("hard_threshold_exceeded"),
Self::BudgetExceeded => f.write_str("budget_exceeded"),
Self::HistorySectionsDropped => f.write_str("history_sections_dropped"),
Self::WorkingContextExceeded => f.write_str("working_context_exceeded"),
}
}
}
impl ::std::str::FromStr for ContextCompactionTrigger {
type Err = self::error::ConversionError;
fn from_str(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
match value {
"user_requested" => Ok(Self::UserRequested),
"threshold_exceeded" => Ok(Self::ThresholdExceeded),
"hard_threshold_exceeded" => Ok(Self::HardThresholdExceeded),
"budget_exceeded" => Ok(Self::BudgetExceeded),
"history_sections_dropped" => Ok(Self::HistorySectionsDropped),
"working_context_exceeded" => Ok(Self::WorkingContextExceeded),
_ => Err("invalid value".into()),
}
}
}
impl ::std::convert::TryFrom<&str> for ContextCompactionTrigger {
type Error = self::error::ConversionError;
fn try_from(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
value.parse()
}
}
impl ::std::convert::TryFrom<&::std::string::String> for ContextCompactionTrigger {
type Error = self::error::ConversionError;
fn try_from(
value: &::std::string::String,
) -> ::std::result::Result<Self, self::error::ConversionError> {
value.parse()
}
}
impl ::std::convert::TryFrom<::std::string::String> for ContextCompactionTrigger {
type Error = self::error::ConversionError;
fn try_from(
value: ::std::string::String,
) -> ::std::result::Result<Self, self::error::ConversionError> {
value.parse()
}
}
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug, PartialEq)]
#[serde(deny_unknown_fields)]
pub struct ContextUsage {
#[serde(rename = "contextWindowTokens")]
pub context_window_tokens: u32,
#[serde(rename = "effectivePromptBudgetTokens")]
pub effective_prompt_budget_tokens: u32,
#[serde(rename = "measuredAt")]
pub measured_at: i64,
#[serde(rename = "usedTokens")]
pub used_tokens: u32,
}
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug, PartialEq)]
#[serde(deny_unknown_fields)]
pub struct DynamicToolResult {
pub output: ::std::string::String,
pub success: bool,
}
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug, PartialEq)]
#[serde(deny_unknown_fields)]
pub struct DynamicToolResultParams {
#[serde(rename = "toolName")]
pub tool_name: ::std::string::String,
}
#[derive(
::serde::Deserialize,
::serde::Serialize,
Clone,
Copy,
Debug,
Eq,
Hash,
Ord,
PartialEq,
PartialOrd,
)]
pub enum ErrorCode {
#[serde(rename = "invalidRequest")]
InvalidRequest,
#[serde(rename = "invalidRetryRequest")]
InvalidRetryRequest,
#[serde(rename = "unauthenticated")]
Unauthenticated,
#[serde(rename = "permissionDenied")]
PermissionDenied,
#[serde(rename = "resourceNotFound")]
ResourceNotFound,
#[serde(rename = "sessionNotFound")]
SessionNotFound,
#[serde(rename = "resourceExpired")]
ResourceExpired,
#[serde(rename = "conflict")]
Conflict,
#[serde(rename = "activeTurnRunning")]
ActiveTurnRunning,
#[serde(rename = "messageQueueFull")]
MessageQueueFull,
#[serde(rename = "messageQueueBusy")]
MessageQueueBusy,
#[serde(rename = "retrySourceCompleted")]
RetrySourceCompleted,
#[serde(rename = "retrySourceMismatch")]
RetrySourceMismatch,
#[serde(rename = "idempotencyConflict")]
IdempotencyConflict,
#[serde(rename = "invalidCursor")]
InvalidCursor,
#[serde(rename = "eventCursorExpired")]
EventCursorExpired,
#[serde(rename = "fsDisabled")]
FsDisabled,
#[serde(rename = "invalidPath")]
InvalidPath,
#[serde(rename = "pathOutsideRoot")]
PathOutsideRoot,
#[serde(rename = "symlinkNotSupported")]
SymlinkNotSupported,
#[serde(rename = "pathNotFound")]
PathNotFound,
#[serde(rename = "notDirectory")]
NotDirectory,
#[serde(rename = "invalidName")]
InvalidName,
#[serde(rename = "alreadyExists")]
AlreadyExists,
#[serde(rename = "uploadTooLarge")]
UploadTooLarge,
#[serde(rename = "unsupportedMediaType")]
UnsupportedMediaType,
#[serde(rename = "attachmentLimitExceeded")]
AttachmentLimitExceeded,
#[serde(rename = "unsupportedAttachment")]
UnsupportedAttachment,
#[serde(rename = "fileInputRejected")]
FileInputRejected,
#[serde(rename = "contextWindowExceeded")]
ContextWindowExceeded,
#[serde(rename = "sessionBudgetExceeded")]
SessionBudgetExceeded,
#[serde(rename = "usageLimitExceeded")]
UsageLimitExceeded,
#[serde(rename = "contextCompactionFailed")]
ContextCompactionFailed,
#[serde(rename = "providerUnavailable")]
ProviderUnavailable,
#[serde(rename = "toolExecutionFailed")]
ToolExecutionFailed,
#[serde(rename = "timeout")]
Timeout,
#[serde(rename = "cancelled")]
Cancelled,
#[serde(rename = "serviceUnavailable")]
ServiceUnavailable,
#[serde(rename = "runForcedAbort")]
RunForcedAbort,
#[serde(rename = "runCleanupUnconfirmed")]
RunCleanupUnconfirmed,
#[serde(rename = "internalError")]
InternalError,
}
impl ::std::fmt::Display for ErrorCode {
fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
match *self {
Self::InvalidRequest => f.write_str("invalidRequest"),
Self::InvalidRetryRequest => f.write_str("invalidRetryRequest"),
Self::Unauthenticated => f.write_str("unauthenticated"),
Self::PermissionDenied => f.write_str("permissionDenied"),
Self::ResourceNotFound => f.write_str("resourceNotFound"),
Self::SessionNotFound => f.write_str("sessionNotFound"),
Self::ResourceExpired => f.write_str("resourceExpired"),
Self::Conflict => f.write_str("conflict"),
Self::ActiveTurnRunning => f.write_str("activeTurnRunning"),
Self::MessageQueueFull => f.write_str("messageQueueFull"),
Self::MessageQueueBusy => f.write_str("messageQueueBusy"),
Self::RetrySourceCompleted => f.write_str("retrySourceCompleted"),
Self::RetrySourceMismatch => f.write_str("retrySourceMismatch"),
Self::IdempotencyConflict => f.write_str("idempotencyConflict"),
Self::InvalidCursor => f.write_str("invalidCursor"),
Self::EventCursorExpired => f.write_str("eventCursorExpired"),
Self::FsDisabled => f.write_str("fsDisabled"),
Self::InvalidPath => f.write_str("invalidPath"),
Self::PathOutsideRoot => f.write_str("pathOutsideRoot"),
Self::SymlinkNotSupported => f.write_str("symlinkNotSupported"),
Self::PathNotFound => f.write_str("pathNotFound"),
Self::NotDirectory => f.write_str("notDirectory"),
Self::InvalidName => f.write_str("invalidName"),
Self::AlreadyExists => f.write_str("alreadyExists"),
Self::UploadTooLarge => f.write_str("uploadTooLarge"),
Self::UnsupportedMediaType => f.write_str("unsupportedMediaType"),
Self::AttachmentLimitExceeded => f.write_str("attachmentLimitExceeded"),
Self::UnsupportedAttachment => f.write_str("unsupportedAttachment"),
Self::FileInputRejected => f.write_str("fileInputRejected"),
Self::ContextWindowExceeded => f.write_str("contextWindowExceeded"),
Self::SessionBudgetExceeded => f.write_str("sessionBudgetExceeded"),
Self::UsageLimitExceeded => f.write_str("usageLimitExceeded"),
Self::ContextCompactionFailed => f.write_str("contextCompactionFailed"),
Self::ProviderUnavailable => f.write_str("providerUnavailable"),
Self::ToolExecutionFailed => f.write_str("toolExecutionFailed"),
Self::Timeout => f.write_str("timeout"),
Self::Cancelled => f.write_str("cancelled"),
Self::ServiceUnavailable => f.write_str("serviceUnavailable"),
Self::RunForcedAbort => f.write_str("runForcedAbort"),
Self::RunCleanupUnconfirmed => f.write_str("runCleanupUnconfirmed"),
Self::InternalError => f.write_str("internalError"),
}
}
}
impl ::std::str::FromStr for ErrorCode {
type Err = self::error::ConversionError;
fn from_str(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
match value {
"invalidRequest" => Ok(Self::InvalidRequest),
"invalidRetryRequest" => Ok(Self::InvalidRetryRequest),
"unauthenticated" => Ok(Self::Unauthenticated),
"permissionDenied" => Ok(Self::PermissionDenied),
"resourceNotFound" => Ok(Self::ResourceNotFound),
"sessionNotFound" => Ok(Self::SessionNotFound),
"resourceExpired" => Ok(Self::ResourceExpired),
"conflict" => Ok(Self::Conflict),
"activeTurnRunning" => Ok(Self::ActiveTurnRunning),
"messageQueueFull" => Ok(Self::MessageQueueFull),
"messageQueueBusy" => Ok(Self::MessageQueueBusy),
"retrySourceCompleted" => Ok(Self::RetrySourceCompleted),
"retrySourceMismatch" => Ok(Self::RetrySourceMismatch),
"idempotencyConflict" => Ok(Self::IdempotencyConflict),
"invalidCursor" => Ok(Self::InvalidCursor),
"eventCursorExpired" => Ok(Self::EventCursorExpired),
"fsDisabled" => Ok(Self::FsDisabled),
"invalidPath" => Ok(Self::InvalidPath),
"pathOutsideRoot" => Ok(Self::PathOutsideRoot),
"symlinkNotSupported" => Ok(Self::SymlinkNotSupported),
"pathNotFound" => Ok(Self::PathNotFound),
"notDirectory" => Ok(Self::NotDirectory),
"invalidName" => Ok(Self::InvalidName),
"alreadyExists" => Ok(Self::AlreadyExists),
"uploadTooLarge" => Ok(Self::UploadTooLarge),
"unsupportedMediaType" => Ok(Self::UnsupportedMediaType),
"attachmentLimitExceeded" => Ok(Self::AttachmentLimitExceeded),
"unsupportedAttachment" => Ok(Self::UnsupportedAttachment),
"fileInputRejected" => Ok(Self::FileInputRejected),
"contextWindowExceeded" => Ok(Self::ContextWindowExceeded),
"sessionBudgetExceeded" => Ok(Self::SessionBudgetExceeded),
"usageLimitExceeded" => Ok(Self::UsageLimitExceeded),
"contextCompactionFailed" => Ok(Self::ContextCompactionFailed),
"providerUnavailable" => Ok(Self::ProviderUnavailable),
"toolExecutionFailed" => Ok(Self::ToolExecutionFailed),
"timeout" => Ok(Self::Timeout),
"cancelled" => Ok(Self::Cancelled),
"serviceUnavailable" => Ok(Self::ServiceUnavailable),
"runForcedAbort" => Ok(Self::RunForcedAbort),
"runCleanupUnconfirmed" => Ok(Self::RunCleanupUnconfirmed),
"internalError" => Ok(Self::InternalError),
_ => Err("invalid value".into()),
}
}
}
impl ::std::convert::TryFrom<&str> for ErrorCode {
type Error = self::error::ConversionError;
fn try_from(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
value.parse()
}
}
impl ::std::convert::TryFrom<&::std::string::String> for ErrorCode {
type Error = self::error::ConversionError;
fn try_from(
value: &::std::string::String,
) -> ::std::result::Result<Self, self::error::ConversionError> {
value.parse()
}
}
impl ::std::convert::TryFrom<::std::string::String> for ErrorCode {
type Error = self::error::ConversionError;
fn try_from(
value: ::std::string::String,
) -> ::std::result::Result<Self, self::error::ConversionError> {
value.parse()
}
}
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug, PartialEq)]
#[serde(tag = "type", deny_unknown_fields)]
pub enum ErrorLocalization {
#[serde(rename = "browserCapabilityUnavailable")]
BrowserCapabilityUnavailable {
operation: BrowserCapabilityOperation,
reason: BrowserCapabilityReason,
},
#[serde(rename = "computerDeletionActive")]
ComputerDeletionActive,
#[serde(rename = "computerRegistrationRemoved")]
ComputerRegistrationRemoved,
#[serde(rename = "computerDeletionUnverified")]
ComputerDeletionUnverified,
#[serde(rename = "modelNotConfigured")]
ModelNotConfigured {
model: ::std::string::String,
provider: ::std::string::String,
},
#[serde(rename = "attachmentCountExceeded")]
AttachmentCountExceeded { actual: u64, limit: u64 },
}
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug, PartialEq)]
#[serde(deny_unknown_fields)]
pub struct FileInfo {
#[serde(rename = "createdAt")]
pub created_at: i64,
#[serde(rename = "fileId")]
pub file_id: ::std::string::String,
pub metadata: ::std::collections::HashMap<::std::string::String, ::std::string::String>,
#[serde(rename = "mimeType")]
pub mime_type: ::std::string::String,
#[serde(rename = "originalFilename")]
pub original_filename: ::std::string::String,
pub scope: FileScope,
#[serde(rename = "sizeBytes")]
pub size_bytes: u64,
pub tags: ::std::vec::Vec<::std::string::String>,
#[serde(rename = "updatedAt")]
pub updated_at: i64,
}
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug, PartialEq)]
#[serde(tag = "type", content = "projectId")]
pub enum FileScope {
#[serde(rename = "personal")]
Personal,
#[serde(rename = "project")]
Project(::std::string::String),
}
#[derive(
::serde::Deserialize,
::serde::Serialize,
Clone,
Copy,
Debug,
Eq,
Hash,
Ord,
PartialEq,
PartialOrd,
)]
pub enum IdempotentCommand {
#[serde(rename = "turn_submission")]
TurnSubmission,
#[serde(rename = "turn_input")]
TurnInput,
}
impl ::std::fmt::Display for IdempotentCommand {
fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
match *self {
Self::TurnSubmission => f.write_str("turn_submission"),
Self::TurnInput => f.write_str("turn_input"),
}
}
}
impl ::std::str::FromStr for IdempotentCommand {
type Err = self::error::ConversionError;
fn from_str(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
match value {
"turn_submission" => Ok(Self::TurnSubmission),
"turn_input" => Ok(Self::TurnInput),
_ => Err("invalid value".into()),
}
}
}
impl ::std::convert::TryFrom<&str> for IdempotentCommand {
type Error = self::error::ConversionError;
fn try_from(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
value.parse()
}
}
impl ::std::convert::TryFrom<&::std::string::String> for IdempotentCommand {
type Error = self::error::ConversionError;
fn try_from(
value: &::std::string::String,
) -> ::std::result::Result<Self, self::error::ConversionError> {
value.parse()
}
}
impl ::std::convert::TryFrom<::std::string::String> for IdempotentCommand {
type Error = self::error::ConversionError;
fn try_from(
value: ::std::string::String,
) -> ::std::result::Result<Self, self::error::ConversionError> {
value.parse()
}
}
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug, PartialEq)]
#[serde(transparent)]
pub struct JsonContentValue(pub ::serde_json::Value);
impl ::std::ops::Deref for JsonContentValue {
type Target = ::serde_json::Value;
fn deref(&self) -> &::serde_json::Value {
&self.0
}
}
impl ::std::convert::From<JsonContentValue> for ::serde_json::Value {
fn from(value: JsonContentValue) -> Self {
value.0
}
}
impl ::std::convert::From<::serde_json::Value> for JsonContentValue {
fn from(value: ::serde_json::Value) -> Self {
Self(value)
}
}
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug, PartialEq)]
#[serde(deny_unknown_fields)]
pub struct ModelRef {
pub id: ::std::string::String,
pub provider: ::std::string::String,
}
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug, PartialEq)]
#[serde(deny_unknown_fields)]
pub struct ModelSelection {
#[serde(rename = "modelRef")]
pub model_ref: ModelRef,
#[serde(rename = "reasoningEffort", default)]
pub reasoning_effort: ::std::option::Option<ReasoningEffort>,
}
#[derive(
::serde::Deserialize,
::serde::Serialize,
Clone,
Copy,
Debug,
Eq,
Hash,
Ord,
PartialEq,
PartialOrd,
)]
pub enum NodeHealth {
#[serde(rename = "unknown")]
Unknown,
#[serde(rename = "healthy")]
Healthy,
#[serde(rename = "degraded")]
Degraded,
}
impl ::std::fmt::Display for NodeHealth {
fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
match *self {
Self::Unknown => f.write_str("unknown"),
Self::Healthy => f.write_str("healthy"),
Self::Degraded => f.write_str("degraded"),
}
}
}
impl ::std::str::FromStr for NodeHealth {
type Err = self::error::ConversionError;
fn from_str(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
match value {
"unknown" => Ok(Self::Unknown),
"healthy" => Ok(Self::Healthy),
"degraded" => Ok(Self::Degraded),
_ => Err("invalid value".into()),
}
}
}
impl ::std::convert::TryFrom<&str> for NodeHealth {
type Error = self::error::ConversionError;
fn try_from(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
value.parse()
}
}
impl ::std::convert::TryFrom<&::std::string::String> for NodeHealth {
type Error = self::error::ConversionError;
fn try_from(
value: &::std::string::String,
) -> ::std::result::Result<Self, self::error::ConversionError> {
value.parse()
}
}
impl ::std::convert::TryFrom<::std::string::String> for NodeHealth {
type Error = self::error::ConversionError;
fn try_from(
value: ::std::string::String,
) -> ::std::result::Result<Self, self::error::ConversionError> {
value.parse()
}
}
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug, PartialEq)]
#[serde(deny_unknown_fields)]
pub struct NodeInfo {
#[serde(rename = "createdAt")]
pub created_at: i64,
#[serde(rename = "displayName")]
pub display_name: ::std::string::String,
#[serde(default)]
pub endpoint: ::std::option::Option<::std::string::String>,
pub mode: NodeMode,
#[serde(rename = "nodeId")]
pub node_id: ::std::string::String,
#[serde(rename = "ownerUserId", default)]
pub owner_user_id: ::std::option::Option<::std::string::String>,
pub status: NodeStatus,
#[serde(rename = "systemInfo", default)]
pub system_info: ::std::option::Option<NodeSystemInfo>,
#[serde(rename = "updatedAt")]
pub updated_at: i64,
}
#[derive(
::serde::Deserialize,
::serde::Serialize,
Clone,
Copy,
Debug,
Eq,
Hash,
Ord,
PartialEq,
PartialOrd,
)]
pub enum NodeMode {
#[serde(rename = "embedded")]
Embedded,
#[serde(rename = "remote")]
Remote,
}
impl ::std::fmt::Display for NodeMode {
fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
match *self {
Self::Embedded => f.write_str("embedded"),
Self::Remote => f.write_str("remote"),
}
}
}
impl ::std::str::FromStr for NodeMode {
type Err = self::error::ConversionError;
fn from_str(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
match value {
"embedded" => Ok(Self::Embedded),
"remote" => Ok(Self::Remote),
_ => Err("invalid value".into()),
}
}
}
impl ::std::convert::TryFrom<&str> for NodeMode {
type Error = self::error::ConversionError;
fn try_from(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
value.parse()
}
}
impl ::std::convert::TryFrom<&::std::string::String> for NodeMode {
type Error = self::error::ConversionError;
fn try_from(
value: &::std::string::String,
) -> ::std::result::Result<Self, self::error::ConversionError> {
value.parse()
}
}
impl ::std::convert::TryFrom<::std::string::String> for NodeMode {
type Error = self::error::ConversionError;
fn try_from(
value: ::std::string::String,
) -> ::std::result::Result<Self, self::error::ConversionError> {
value.parse()
}
}
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug, PartialEq)]
#[serde(deny_unknown_fields)]
pub struct NodeNetworkInterface {
#[serde(rename = "macAddress")]
pub mac_address: ::std::string::String,
pub name: ::std::string::String,
}
#[derive(
::serde::Deserialize,
::serde::Serialize,
Clone,
Copy,
Debug,
Eq,
Hash,
Ord,
PartialEq,
PartialOrd,
)]
pub enum NodeOperatingSystem {
#[serde(rename = "linux")]
Linux,
#[serde(rename = "macOs")]
MacOs,
}
impl ::std::fmt::Display for NodeOperatingSystem {
fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
match *self {
Self::Linux => f.write_str("linux"),
Self::MacOs => f.write_str("macOs"),
}
}
}
impl ::std::str::FromStr for NodeOperatingSystem {
type Err = self::error::ConversionError;
fn from_str(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
match value {
"linux" => Ok(Self::Linux),
"macOs" => Ok(Self::MacOs),
_ => Err("invalid value".into()),
}
}
}
impl ::std::convert::TryFrom<&str> for NodeOperatingSystem {
type Error = self::error::ConversionError;
fn try_from(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
value.parse()
}
}
impl ::std::convert::TryFrom<&::std::string::String> for NodeOperatingSystem {
type Error = self::error::ConversionError;
fn try_from(
value: &::std::string::String,
) -> ::std::result::Result<Self, self::error::ConversionError> {
value.parse()
}
}
impl ::std::convert::TryFrom<::std::string::String> for NodeOperatingSystem {
type Error = self::error::ConversionError;
fn try_from(
value: ::std::string::String,
) -> ::std::result::Result<Self, self::error::ConversionError> {
value.parse()
}
}
#[derive(
::serde::Deserialize,
::serde::Serialize,
Clone,
Copy,
Debug,
Eq,
Hash,
Ord,
PartialEq,
PartialOrd,
)]
pub enum NodeStatus {
#[serde(rename = "enabled")]
Enabled,
#[serde(rename = "disabled")]
Disabled,
}
impl ::std::fmt::Display for NodeStatus {
fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
match *self {
Self::Enabled => f.write_str("enabled"),
Self::Disabled => f.write_str("disabled"),
}
}
}
impl ::std::str::FromStr for NodeStatus {
type Err = self::error::ConversionError;
fn from_str(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
match value {
"enabled" => Ok(Self::Enabled),
"disabled" => Ok(Self::Disabled),
_ => Err("invalid value".into()),
}
}
}
impl ::std::convert::TryFrom<&str> for NodeStatus {
type Error = self::error::ConversionError;
fn try_from(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
value.parse()
}
}
impl ::std::convert::TryFrom<&::std::string::String> for NodeStatus {
type Error = self::error::ConversionError;
fn try_from(
value: &::std::string::String,
) -> ::std::result::Result<Self, self::error::ConversionError> {
value.parse()
}
}
impl ::std::convert::TryFrom<::std::string::String> for NodeStatus {
type Error = self::error::ConversionError;
fn try_from(
value: ::std::string::String,
) -> ::std::result::Result<Self, self::error::ConversionError> {
value.parse()
}
}
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug, PartialEq)]
#[serde(deny_unknown_fields)]
pub struct NodeSystemInfo {
pub architecture: ::std::string::String,
#[serde(rename = "boardModel", default)]
pub board_model: ::std::option::Option<::std::string::String>,
#[serde(rename = "cpuModel", default)]
pub cpu_model: ::std::option::Option<::std::string::String>,
pub graphics: ::std::vec::Vec<::std::string::String>,
#[serde(default)]
pub hostname: ::std::option::Option<::std::string::String>,
#[serde(rename = "logicalCpuCount")]
pub logical_cpu_count: u32,
#[serde(rename = "memoryBytes")]
pub memory_bytes: u64,
#[serde(rename = "networkInterfaces")]
pub network_interfaces: ::std::vec::Vec<NodeNetworkInterface>,
pub os: NodeOperatingSystem,
#[serde(rename = "osVersion", default)]
pub os_version: ::std::option::Option<::std::string::String>,
#[serde(rename = "workerVersion")]
pub worker_version: ::std::string::String,
}
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug, PartialEq)]
#[serde(deny_unknown_fields)]
pub struct PendingUserAction {
#[serde(rename = "actionId")]
pub action_id: ::std::string::String,
#[serde(rename = "callId")]
pub call_id: ::std::string::String,
#[serde(rename = "itemId", default)]
pub item_id: ::std::option::Option<::std::string::String>,
pub params: UserActionParams,
pub state: UserActionState,
}
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug, PartialEq)]
#[serde(deny_unknown_fields)]
pub struct ProjectInfo {
pub created_at: i64,
pub directory: ::std::string::String,
pub name: ::std::string::String,
#[serde(rename = "nodeId")]
pub node_id: ::std::string::String,
pub project_id: ::std::string::String,
pub session_count: i64,
#[serde(default = "defaults::project_info_status")]
pub status: ProjectStatus,
pub updated_at: i64,
}
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug, PartialEq)]
#[serde(deny_unknown_fields)]
pub struct ProjectStatus {
#[serde(default)]
pub reason: ::std::option::Option<ProjectUnavailableReason>,
pub state: ProjectStatusState,
}
#[derive(
::serde::Deserialize,
::serde::Serialize,
Clone,
Copy,
Debug,
Eq,
Hash,
Ord,
PartialEq,
PartialOrd,
)]
pub enum ProjectStatusState {
#[serde(rename = "available")]
Available,
#[serde(rename = "missing")]
Missing,
#[serde(rename = "not_directory")]
NotDirectory,
#[serde(rename = "permission_denied")]
PermissionDenied,
#[serde(rename = "nodeUnavailable")]
NodeUnavailable,
}
impl ::std::fmt::Display for ProjectStatusState {
fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
match *self {
Self::Available => f.write_str("available"),
Self::Missing => f.write_str("missing"),
Self::NotDirectory => f.write_str("not_directory"),
Self::PermissionDenied => f.write_str("permission_denied"),
Self::NodeUnavailable => f.write_str("nodeUnavailable"),
}
}
}
impl ::std::str::FromStr for ProjectStatusState {
type Err = self::error::ConversionError;
fn from_str(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
match value {
"available" => Ok(Self::Available),
"missing" => Ok(Self::Missing),
"not_directory" => Ok(Self::NotDirectory),
"permission_denied" => Ok(Self::PermissionDenied),
"nodeUnavailable" => Ok(Self::NodeUnavailable),
_ => Err("invalid value".into()),
}
}
}
impl ::std::convert::TryFrom<&str> for ProjectStatusState {
type Error = self::error::ConversionError;
fn try_from(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
value.parse()
}
}
impl ::std::convert::TryFrom<&::std::string::String> for ProjectStatusState {
type Error = self::error::ConversionError;
fn try_from(
value: &::std::string::String,
) -> ::std::result::Result<Self, self::error::ConversionError> {
value.parse()
}
}
impl ::std::convert::TryFrom<::std::string::String> for ProjectStatusState {
type Error = self::error::ConversionError;
fn try_from(
value: ::std::string::String,
) -> ::std::result::Result<Self, self::error::ConversionError> {
value.parse()
}
}
#[derive(
::serde::Deserialize,
::serde::Serialize,
Clone,
Copy,
Debug,
Eq,
Hash,
Ord,
PartialEq,
PartialOrd,
)]
pub enum ProjectUnavailableReason {
#[serde(rename = "path_not_found")]
PathNotFound,
#[serde(rename = "not_directory")]
NotDirectory,
#[serde(rename = "permission_denied")]
PermissionDenied,
#[serde(rename = "nodeUnavailable")]
NodeUnavailable,
}
impl ::std::fmt::Display for ProjectUnavailableReason {
fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
match *self {
Self::PathNotFound => f.write_str("path_not_found"),
Self::NotDirectory => f.write_str("not_directory"),
Self::PermissionDenied => f.write_str("permission_denied"),
Self::NodeUnavailable => f.write_str("nodeUnavailable"),
}
}
}
impl ::std::str::FromStr for ProjectUnavailableReason {
type Err = self::error::ConversionError;
fn from_str(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
match value {
"path_not_found" => Ok(Self::PathNotFound),
"not_directory" => Ok(Self::NotDirectory),
"permission_denied" => Ok(Self::PermissionDenied),
"nodeUnavailable" => Ok(Self::NodeUnavailable),
_ => Err("invalid value".into()),
}
}
}
impl ::std::convert::TryFrom<&str> for ProjectUnavailableReason {
type Error = self::error::ConversionError;
fn try_from(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
value.parse()
}
}
impl ::std::convert::TryFrom<&::std::string::String> for ProjectUnavailableReason {
type Error = self::error::ConversionError;
fn try_from(
value: &::std::string::String,
) -> ::std::result::Result<Self, self::error::ConversionError> {
value.parse()
}
}
impl ::std::convert::TryFrom<::std::string::String> for ProjectUnavailableReason {
type Error = self::error::ConversionError;
fn try_from(
value: ::std::string::String,
) -> ::std::result::Result<Self, self::error::ConversionError> {
value.parse()
}
}
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug, PartialEq)]
#[serde(tag = "type", deny_unknown_fields)]
pub enum PromptWarning {
#[serde(rename = "bootstrapFileMissing")]
BootstrapFileMissing { file: PromptWarningFile },
#[serde(rename = "bootstrapFileTruncated")]
BootstrapFileTruncated {
file: PromptWarningFile,
#[serde(rename = "injectedChars")]
injected_chars: u32,
#[serde(rename = "rawChars")]
raw_chars: u32,
},
#[serde(rename = "bootstrapFileDropped")]
BootstrapFileDropped { file: PromptWarningFile },
#[serde(rename = "dynamicSectionsDropped")]
DynamicSectionsDropped { count: u32 },
}
#[derive(
::serde::Deserialize,
::serde::Serialize,
Clone,
Copy,
Debug,
Eq,
Hash,
Ord,
PartialEq,
PartialOrd,
)]
pub enum PromptWarningFile {
#[serde(rename = "agents")]
Agents,
#[serde(rename = "soul")]
Soul,
#[serde(rename = "identity")]
Identity,
#[serde(rename = "user")]
User,
#[serde(rename = "heartbeat")]
Heartbeat,
}
impl ::std::fmt::Display for PromptWarningFile {
fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
match *self {
Self::Agents => f.write_str("agents"),
Self::Soul => f.write_str("soul"),
Self::Identity => f.write_str("identity"),
Self::User => f.write_str("user"),
Self::Heartbeat => f.write_str("heartbeat"),
}
}
}
impl ::std::str::FromStr for PromptWarningFile {
type Err = self::error::ConversionError;
fn from_str(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
match value {
"agents" => Ok(Self::Agents),
"soul" => Ok(Self::Soul),
"identity" => Ok(Self::Identity),
"user" => Ok(Self::User),
"heartbeat" => Ok(Self::Heartbeat),
_ => Err("invalid value".into()),
}
}
}
impl ::std::convert::TryFrom<&str> for PromptWarningFile {
type Error = self::error::ConversionError;
fn try_from(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
value.parse()
}
}
impl ::std::convert::TryFrom<&::std::string::String> for PromptWarningFile {
type Error = self::error::ConversionError;
fn try_from(
value: &::std::string::String,
) -> ::std::result::Result<Self, self::error::ConversionError> {
value.parse()
}
}
impl ::std::convert::TryFrom<::std::string::String> for PromptWarningFile {
type Error = self::error::ConversionError;
fn try_from(
value: ::std::string::String,
) -> ::std::result::Result<Self, self::error::ConversionError> {
value.parse()
}
}
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug, PartialEq)]
#[serde(deny_unknown_fields)]
pub struct PromptWarningNotice {
pub message: ::std::string::String,
pub warning: PromptWarning,
}
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug, PartialEq)]
#[serde(tag = "type", deny_unknown_fields)]
pub enum QuestionAnswer {
#[serde(rename = "selectedOption")]
SelectedOption {
#[serde(rename = "optionId")]
option_id: ::std::string::String,
},
#[serde(rename = "freeForm")]
FreeForm { text: ::std::string::String },
}
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug, PartialEq)]
#[serde(deny_unknown_fields)]
pub struct QuestionOption {
pub description: ::std::string::String,
pub id: ::std::string::String,
pub label: ::std::string::String,
}
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug, PartialEq)]
#[serde(deny_unknown_fields)]
pub struct QuestionParams {
pub header: ::std::string::String,
pub options: ::std::vec::Vec<QuestionOption>,
pub question: ::std::string::String,
}
#[derive(
::serde::Deserialize,
::serde::Serialize,
Clone,
Copy,
Debug,
Eq,
Hash,
Ord,
PartialEq,
PartialOrd,
)]
pub enum ReasoningEffort {
#[serde(rename = "light")]
Light,
#[serde(rename = "medium")]
Medium,
#[serde(rename = "high")]
High,
#[serde(rename = "xhigh")]
Xhigh,
}
impl ::std::fmt::Display for ReasoningEffort {
fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
match *self {
Self::Light => f.write_str("light"),
Self::Medium => f.write_str("medium"),
Self::High => f.write_str("high"),
Self::Xhigh => f.write_str("xhigh"),
}
}
}
impl ::std::str::FromStr for ReasoningEffort {
type Err = self::error::ConversionError;
fn from_str(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
match value {
"light" => Ok(Self::Light),
"medium" => Ok(Self::Medium),
"high" => Ok(Self::High),
"xhigh" => Ok(Self::Xhigh),
_ => Err("invalid value".into()),
}
}
}
impl ::std::convert::TryFrom<&str> for ReasoningEffort {
type Error = self::error::ConversionError;
fn try_from(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
value.parse()
}
}
impl ::std::convert::TryFrom<&::std::string::String> for ReasoningEffort {
type Error = self::error::ConversionError;
fn try_from(
value: &::std::string::String,
) -> ::std::result::Result<Self, self::error::ConversionError> {
value.parse()
}
}
impl ::std::convert::TryFrom<::std::string::String> for ReasoningEffort {
type Error = self::error::ConversionError;
fn try_from(
value: ::std::string::String,
) -> ::std::result::Result<Self, self::error::ConversionError> {
value.parse()
}
}
#[derive(
::serde::Deserialize,
::serde::Serialize,
Clone,
Copy,
Debug,
Eq,
Hash,
Ord,
PartialEq,
PartialOrd,
)]
pub enum SandboxApprovalDecision {
#[serde(rename = "allowOnce")]
AllowOnce,
#[serde(rename = "deny")]
Deny,
#[serde(rename = "cancel")]
Cancel,
}
impl ::std::fmt::Display for SandboxApprovalDecision {
fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
match *self {
Self::AllowOnce => f.write_str("allowOnce"),
Self::Deny => f.write_str("deny"),
Self::Cancel => f.write_str("cancel"),
}
}
}
impl ::std::str::FromStr for SandboxApprovalDecision {
type Err = self::error::ConversionError;
fn from_str(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
match value {
"allowOnce" => Ok(Self::AllowOnce),
"deny" => Ok(Self::Deny),
"cancel" => Ok(Self::Cancel),
_ => Err("invalid value".into()),
}
}
}
impl ::std::convert::TryFrom<&str> for SandboxApprovalDecision {
type Error = self::error::ConversionError;
fn try_from(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
value.parse()
}
}
impl ::std::convert::TryFrom<&::std::string::String> for SandboxApprovalDecision {
type Error = self::error::ConversionError;
fn try_from(
value: &::std::string::String,
) -> ::std::result::Result<Self, self::error::ConversionError> {
value.parse()
}
}
impl ::std::convert::TryFrom<::std::string::String> for SandboxApprovalDecision {
type Error = self::error::ConversionError;
fn try_from(
value: ::std::string::String,
) -> ::std::result::Result<Self, self::error::ConversionError> {
value.parse()
}
}
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug, PartialEq)]
#[serde(deny_unknown_fields)]
pub struct SandboxApprovalParams {
#[serde(rename = "availableDecisions")]
pub available_decisions: ::std::vec::Vec<SandboxApprovalDecision>,
pub presentation: SandboxApprovalPresentation,
pub reason: SandboxApprovalReason,
#[serde(rename = "toolName")]
pub tool_name: ::std::string::String,
}
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug, PartialEq)]
#[serde(tag = "type", deny_unknown_fields)]
pub enum SandboxApprovalPresentation {
#[serde(rename = "command")]
Command {
command: ::std::string::String,
cwd: ::std::string::String,
#[serde(rename = "riskSummary", default)]
risk_summary: ::std::option::Option<::std::string::String>,
},
#[serde(rename = "fileSystem")]
FileSystem {
operation: SandboxFileOperation,
paths: ::std::vec::Vec<::std::string::String>,
},
#[serde(rename = "network")]
Network { scope: ::std::string::String },
}
#[derive(
::serde::Deserialize,
::serde::Serialize,
Clone,
Copy,
Debug,
Eq,
Hash,
Ord,
PartialEq,
PartialOrd,
)]
pub enum SandboxApprovalReason {
#[serde(rename = "networkAccess")]
NetworkAccess,
#[serde(rename = "fileSystemAccessOutsideWorkspace")]
FileSystemAccessOutsideWorkspace,
#[serde(rename = "sandboxBypass")]
SandboxBypass,
#[serde(rename = "riskyCommand")]
RiskyCommand,
}
impl ::std::fmt::Display for SandboxApprovalReason {
fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
match *self {
Self::NetworkAccess => f.write_str("networkAccess"),
Self::FileSystemAccessOutsideWorkspace => {
f.write_str("fileSystemAccessOutsideWorkspace")
}
Self::SandboxBypass => f.write_str("sandboxBypass"),
Self::RiskyCommand => f.write_str("riskyCommand"),
}
}
}
impl ::std::str::FromStr for SandboxApprovalReason {
type Err = self::error::ConversionError;
fn from_str(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
match value {
"networkAccess" => Ok(Self::NetworkAccess),
"fileSystemAccessOutsideWorkspace" => Ok(Self::FileSystemAccessOutsideWorkspace),
"sandboxBypass" => Ok(Self::SandboxBypass),
"riskyCommand" => Ok(Self::RiskyCommand),
_ => Err("invalid value".into()),
}
}
}
impl ::std::convert::TryFrom<&str> for SandboxApprovalReason {
type Error = self::error::ConversionError;
fn try_from(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
value.parse()
}
}
impl ::std::convert::TryFrom<&::std::string::String> for SandboxApprovalReason {
type Error = self::error::ConversionError;
fn try_from(
value: &::std::string::String,
) -> ::std::result::Result<Self, self::error::ConversionError> {
value.parse()
}
}
impl ::std::convert::TryFrom<::std::string::String> for SandboxApprovalReason {
type Error = self::error::ConversionError;
fn try_from(
value: ::std::string::String,
) -> ::std::result::Result<Self, self::error::ConversionError> {
value.parse()
}
}
#[derive(
::serde::Deserialize,
::serde::Serialize,
Clone,
Copy,
Debug,
Eq,
Hash,
Ord,
PartialEq,
PartialOrd,
)]
pub enum SandboxFileOperation {
#[serde(rename = "read")]
Read,
#[serde(rename = "write")]
Write,
}
impl ::std::fmt::Display for SandboxFileOperation {
fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
match *self {
Self::Read => f.write_str("read"),
Self::Write => f.write_str("write"),
}
}
}
impl ::std::str::FromStr for SandboxFileOperation {
type Err = self::error::ConversionError;
fn from_str(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
match value {
"read" => Ok(Self::Read),
"write" => Ok(Self::Write),
_ => Err("invalid value".into()),
}
}
}
impl ::std::convert::TryFrom<&str> for SandboxFileOperation {
type Error = self::error::ConversionError;
fn try_from(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
value.parse()
}
}
impl ::std::convert::TryFrom<&::std::string::String> for SandboxFileOperation {
type Error = self::error::ConversionError;
fn try_from(
value: &::std::string::String,
) -> ::std::result::Result<Self, self::error::ConversionError> {
value.parse()
}
}
impl ::std::convert::TryFrom<::std::string::String> for SandboxFileOperation {
type Error = self::error::ConversionError;
fn try_from(
value: ::std::string::String,
) -> ::std::result::Result<Self, self::error::ConversionError> {
value.parse()
}
}
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug, PartialEq)]
#[serde(deny_unknown_fields)]
pub struct SendMessageResult {
pub accepted: bool,
#[serde(rename = "agentId")]
pub agent_id: ::std::string::String,
pub subagent: SubagentRef,
pub turn: AgentTurnRef,
}
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug, PartialEq)]
#[serde(deny_unknown_fields)]
#[derive(Default)]
pub struct SessionConf {
#[serde(rename = "modelSelection", default)]
pub model_selection: ::std::option::Option<ModelSelection>,
#[serde(rename = "userPermissionMode", default)]
pub user_permission_mode: ::std::option::Option<UserPermissionMode>,
}
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug, PartialEq)]
#[serde(deny_unknown_fields)]
pub struct SessionInfo {
#[serde(rename = "configuredDefaultMode")]
pub configured_default_mode: UserPermissionMode,
#[serde(rename = "createdAt")]
pub created_at: u64,
#[serde(rename = "currentDirectory", default)]
pub current_directory: ::std::option::Option<::std::string::String>,
#[serde(rename = "effectiveMode")]
pub effective_mode: UserPermissionMode,
pub id: ::std::string::String,
#[serde(rename = "lastActivity")]
pub last_activity: u64,
#[serde(rename = "messageCount")]
pub message_count: u64,
#[serde(rename = "modelSelection")]
pub model_selection: ModelSelection,
#[serde(rename = "nodeId")]
pub node_id: ::std::string::String,
#[serde(rename = "projectId", default)]
pub project_id: ::std::option::Option<::std::string::String>,
#[serde(rename = "sourceProvider")]
pub source_provider: SessionSourceProvider,
#[serde(rename = "sourceType")]
pub source_type: SessionSourceType,
pub title: ::std::string::String,
#[serde(default = "defaults::session_info_usage")]
pub usage: SessionUsage,
#[serde(rename = "userId")]
pub user_id: ::std::string::String,
}
#[derive(
::serde::Deserialize,
::serde::Serialize,
Clone,
Copy,
Debug,
Eq,
Hash,
Ord,
PartialEq,
PartialOrd,
)]
pub enum SessionSourceProvider {
#[serde(rename = "http")]
Http,
#[serde(rename = "sdk")]
Sdk,
#[serde(rename = "cli")]
Cli,
#[serde(rename = "telegram")]
Telegram,
#[serde(rename = "web_socket")]
WebSocket,
#[serde(rename = "system")]
System,
}
impl ::std::fmt::Display for SessionSourceProvider {
fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
match *self {
Self::Http => f.write_str("http"),
Self::Sdk => f.write_str("sdk"),
Self::Cli => f.write_str("cli"),
Self::Telegram => f.write_str("telegram"),
Self::WebSocket => f.write_str("web_socket"),
Self::System => f.write_str("system"),
}
}
}
impl ::std::str::FromStr for SessionSourceProvider {
type Err = self::error::ConversionError;
fn from_str(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
match value {
"http" => Ok(Self::Http),
"sdk" => Ok(Self::Sdk),
"cli" => Ok(Self::Cli),
"telegram" => Ok(Self::Telegram),
"web_socket" => Ok(Self::WebSocket),
"system" => Ok(Self::System),
_ => Err("invalid value".into()),
}
}
}
impl ::std::convert::TryFrom<&str> for SessionSourceProvider {
type Error = self::error::ConversionError;
fn try_from(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
value.parse()
}
}
impl ::std::convert::TryFrom<&::std::string::String> for SessionSourceProvider {
type Error = self::error::ConversionError;
fn try_from(
value: &::std::string::String,
) -> ::std::result::Result<Self, self::error::ConversionError> {
value.parse()
}
}
impl ::std::convert::TryFrom<::std::string::String> for SessionSourceProvider {
type Error = self::error::ConversionError;
fn try_from(
value: ::std::string::String,
) -> ::std::result::Result<Self, self::error::ConversionError> {
value.parse()
}
}
#[derive(
::serde::Deserialize,
::serde::Serialize,
Clone,
Copy,
Debug,
Eq,
Hash,
Ord,
PartialEq,
PartialOrd,
)]
pub enum SessionSourceType {
#[serde(rename = "http")]
Http,
#[serde(rename = "desktop")]
Desktop,
#[serde(rename = "im")]
Im,
#[serde(rename = "cli")]
Cli,
#[serde(rename = "ws")]
Ws,
#[serde(rename = "system")]
System,
}
impl ::std::fmt::Display for SessionSourceType {
fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
match *self {
Self::Http => f.write_str("http"),
Self::Desktop => f.write_str("desktop"),
Self::Im => f.write_str("im"),
Self::Cli => f.write_str("cli"),
Self::Ws => f.write_str("ws"),
Self::System => f.write_str("system"),
}
}
}
impl ::std::str::FromStr for SessionSourceType {
type Err = self::error::ConversionError;
fn from_str(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
match value {
"http" => Ok(Self::Http),
"desktop" => Ok(Self::Desktop),
"im" => Ok(Self::Im),
"cli" => Ok(Self::Cli),
"ws" => Ok(Self::Ws),
"system" => Ok(Self::System),
_ => Err("invalid value".into()),
}
}
}
impl ::std::convert::TryFrom<&str> for SessionSourceType {
type Error = self::error::ConversionError;
fn try_from(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
value.parse()
}
}
impl ::std::convert::TryFrom<&::std::string::String> for SessionSourceType {
type Error = self::error::ConversionError;
fn try_from(
value: &::std::string::String,
) -> ::std::result::Result<Self, self::error::ConversionError> {
value.parse()
}
}
impl ::std::convert::TryFrom<::std::string::String> for SessionSourceType {
type Error = self::error::ConversionError;
fn try_from(
value: ::std::string::String,
) -> ::std::result::Result<Self, self::error::ConversionError> {
value.parse()
}
}
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug, PartialEq)]
#[serde(tag = "type", deny_unknown_fields)]
pub enum SessionTreeIdentity {
#[serde(rename = "primary")]
Primary,
#[serde(rename = "subagent")]
Subagent {
parent: AgentTurnRef,
path: AgentPath,
tree_root_session_id: ::std::string::String,
},
}
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug, PartialEq)]
#[serde(deny_unknown_fields)]
pub struct SessionUsage {
#[serde(default)]
pub context: ::std::option::Option<ContextUsage>,
pub tokens: TokenUsage,
}
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug, PartialEq)]
#[serde(tag = "status", deny_unknown_fields)]
pub enum SubagentOutcome {
#[serde(rename = "running")]
Running {
#[serde(rename = "turnId")]
turn_id: ::std::string::String,
},
#[serde(rename = "waitingUserAction")]
WaitingUserAction {
#[serde(rename = "turnId")]
turn_id: ::std::string::String,
},
#[serde(rename = "cancelling")]
Cancelling {
#[serde(rename = "turnId")]
turn_id: ::std::string::String,
},
#[serde(rename = "completed")]
Completed {
output: ::std::string::String,
truncated: bool,
#[serde(rename = "turnId")]
turn_id: ::std::string::String,
},
#[serde(rename = "failed")]
Failed {
error: ::std::string::String,
truncated: bool,
#[serde(rename = "turnId")]
turn_id: ::std::string::String,
},
#[serde(rename = "interrupted")]
Interrupted {
#[serde(rename = "turnId")]
turn_id: ::std::string::String,
},
}
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug, PartialEq)]
#[serde(deny_unknown_fields)]
pub struct SubagentRef {
pub parent: AgentTurnRef,
pub path: AgentPath,
#[serde(rename = "sessionId")]
pub session_id: ::std::string::String,
}
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug, PartialEq)]
#[serde(deny_unknown_fields)]
pub struct SubagentSnapshot {
#[serde(rename = "agentId")]
pub agent_id: ::std::string::String,
#[serde(rename = "latestUpdate", default)]
pub latest_update: ::std::option::Option<SubagentUpdate>,
pub outcome: SubagentOutcome,
pub subagent: SubagentRef,
}
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug, PartialEq)]
#[serde(deny_unknown_fields)]
pub struct SubagentSpawnResult {
#[serde(rename = "agentId")]
pub agent_id: ::std::string::String,
pub subagent: SubagentRef,
pub turn: AgentTurnRef,
}
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug, PartialEq)]
#[serde(deny_unknown_fields)]
pub struct SubagentUpdate {
pub kind: SubagentUpdateKind,
pub text: ::std::string::String,
pub truncated: bool,
}
#[derive(
::serde::Deserialize,
::serde::Serialize,
Clone,
Copy,
Debug,
Eq,
Hash,
Ord,
PartialEq,
PartialOrd,
)]
pub enum SubagentUpdateKind {
#[serde(rename = "commentary")]
Commentary,
#[serde(rename = "finalAnswer")]
FinalAnswer,
}
impl ::std::fmt::Display for SubagentUpdateKind {
fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
match *self {
Self::Commentary => f.write_str("commentary"),
Self::FinalAnswer => f.write_str("finalAnswer"),
}
}
}
impl ::std::str::FromStr for SubagentUpdateKind {
type Err = self::error::ConversionError;
fn from_str(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
match value {
"commentary" => Ok(Self::Commentary),
"finalAnswer" => Ok(Self::FinalAnswer),
_ => Err("invalid value".into()),
}
}
}
impl ::std::convert::TryFrom<&str> for SubagentUpdateKind {
type Error = self::error::ConversionError;
fn try_from(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
value.parse()
}
}
impl ::std::convert::TryFrom<&::std::string::String> for SubagentUpdateKind {
type Error = self::error::ConversionError;
fn try_from(
value: &::std::string::String,
) -> ::std::result::Result<Self, self::error::ConversionError> {
value.parse()
}
}
impl ::std::convert::TryFrom<::std::string::String> for SubagentUpdateKind {
type Error = self::error::ConversionError;
fn try_from(
value: ::std::string::String,
) -> ::std::result::Result<Self, self::error::ConversionError> {
value.parse()
}
}
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug, PartialEq)]
#[serde(tag = "type", content = "data")]
pub enum SystemNoticeContent {
#[serde(rename = "text")]
Text(::std::string::String),
#[serde(rename = "error")]
Error(ApiError),
#[serde(rename = "promptWarning")]
PromptWarning(PromptWarningNotice),
}
impl ::std::convert::From<ApiError> for SystemNoticeContent {
fn from(value: ApiError) -> Self {
Self::Error(value)
}
}
impl ::std::convert::From<PromptWarningNotice> for SystemNoticeContent {
fn from(value: PromptWarningNotice) -> Self {
Self::PromptWarning(value)
}
}
#[derive(
::serde::Deserialize,
::serde::Serialize,
Clone,
Copy,
Debug,
Eq,
Hash,
Ord,
PartialEq,
PartialOrd,
)]
pub enum TalosConnectionMode {
#[serde(rename = "embedded")]
Embedded,
#[serde(rename = "remote")]
Remote,
}
impl ::std::fmt::Display for TalosConnectionMode {
fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
match *self {
Self::Embedded => f.write_str("embedded"),
Self::Remote => f.write_str("remote"),
}
}
}
impl ::std::str::FromStr for TalosConnectionMode {
type Err = self::error::ConversionError;
fn from_str(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
match value {
"embedded" => Ok(Self::Embedded),
"remote" => Ok(Self::Remote),
_ => Err("invalid value".into()),
}
}
}
impl ::std::convert::TryFrom<&str> for TalosConnectionMode {
type Error = self::error::ConversionError;
fn try_from(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
value.parse()
}
}
impl ::std::convert::TryFrom<&::std::string::String> for TalosConnectionMode {
type Error = self::error::ConversionError;
fn try_from(
value: &::std::string::String,
) -> ::std::result::Result<Self, self::error::ConversionError> {
value.parse()
}
}
impl ::std::convert::TryFrom<::std::string::String> for TalosConnectionMode {
type Error = self::error::ConversionError;
fn try_from(
value: ::std::string::String,
) -> ::std::result::Result<Self, self::error::ConversionError> {
value.parse()
}
}
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug, PartialEq)]
#[serde(tag = "type", deny_unknown_fields)]
pub enum TalosContentItem {
#[serde(rename = "text")]
Text { text: ::std::string::String },
#[serde(rename = "json")]
Json { value: JsonContentValue },
#[serde(rename = "subagent_result")]
SubagentResult { result: CollaborationToolResult },
#[serde(rename = "file_read")]
FileRead {
content: ::std::string::String,
limit: u32,
#[serde(rename = "nextByteOffset", default)]
next_byte_offset: ::std::option::Option<u64>,
offset: u32,
path: ::std::string::String,
#[serde(default)]
total_lines: ::std::option::Option<u32>,
truncated: bool,
},
#[serde(rename = "diff")]
Diff {
files: ::std::vec::Vec<TalosToolFileDiff>,
},
#[serde(rename = "search_results")]
SearchResults {
limit: u32,
matches: ::std::vec::Vec<TalosToolSearchMatch>,
more_available: bool,
offset: u32,
partial: bool,
#[serde(default)]
query: ::std::option::Option<::std::string::String>,
#[serde(default)]
total_matches: ::std::option::Option<u32>,
},
#[serde(rename = "bash_output")]
BashOutput {
#[serde(default)]
elapsed_ms: ::std::option::Option<u64>,
#[serde(default)]
exit_code: ::std::option::Option<i32>,
#[serde(rename = "outputLog", default)]
output_log: ::std::option::Option<BashOutputLog>,
#[serde(default)]
session_id: ::std::option::Option<i64>,
status: TalosToolTaskStatus,
stderr: ::std::string::String,
stdout: ::std::string::String,
truncated: bool,
},
#[serde(rename = "web_reference")]
WebReference {
#[serde(default)]
citation_id: ::std::option::Option<::std::string::String>,
#[serde(default)]
provider_rank: ::std::option::Option<u32>,
#[serde(default)]
published_at: ::std::option::Option<::std::string::String>,
#[serde(default)]
snippet: ::std::option::Option<::std::string::String>,
#[serde(default)]
source_domain: ::std::option::Option<::std::string::String>,
#[serde(default)]
title: ::std::option::Option<::std::string::String>,
url: ::std::string::String,
},
#[serde(rename = "image")]
Image {
#[serde(rename = "fileId")]
file_id: ::std::string::String,
label: ::std::string::String,
#[serde(rename = "mimeType")]
mime_type: ::std::string::String,
},
#[serde(rename = "artifact_ref")]
ArtifactRef {
artifact_id: ::std::string::String,
#[serde(default)]
label: ::std::option::Option<::std::string::String>,
#[serde(default)]
mime_type: ::std::option::Option<::std::string::String>,
},
#[serde(rename = "mcp_resource_ref")]
McpResourceRef {
#[serde(default)]
mime_type: ::std::option::Option<::std::string::String>,
server: ::std::string::String,
uri: ::std::string::String,
},
#[serde(rename = "progress")]
Progress {
#[serde(default)]
elapsed_ms: ::std::option::Option<u64>,
message: ::std::string::String,
},
}
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug, PartialEq)]
#[serde(deny_unknown_fields)]
pub struct TalosSessionEnvironment {
#[serde(default = "defaults::talos_session_environment_connection_mode")]
pub connection_mode: TalosConnectionMode,
pub directory: ::std::string::String,
}
#[derive(
::serde::Deserialize,
::serde::Serialize,
Clone,
Copy,
Debug,
Eq,
Hash,
Ord,
PartialEq,
PartialOrd,
)]
pub enum TalosTimelineNoticeLevel {
#[serde(rename = "info")]
Info,
#[serde(rename = "warning")]
Warning,
#[serde(rename = "error")]
Error,
}
impl ::std::fmt::Display for TalosTimelineNoticeLevel {
fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
match *self {
Self::Info => f.write_str("info"),
Self::Warning => f.write_str("warning"),
Self::Error => f.write_str("error"),
}
}
}
impl ::std::str::FromStr for TalosTimelineNoticeLevel {
type Err = self::error::ConversionError;
fn from_str(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
match value {
"info" => Ok(Self::Info),
"warning" => Ok(Self::Warning),
"error" => Ok(Self::Error),
_ => Err("invalid value".into()),
}
}
}
impl ::std::convert::TryFrom<&str> for TalosTimelineNoticeLevel {
type Error = self::error::ConversionError;
fn try_from(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
value.parse()
}
}
impl ::std::convert::TryFrom<&::std::string::String> for TalosTimelineNoticeLevel {
type Error = self::error::ConversionError;
fn try_from(
value: &::std::string::String,
) -> ::std::result::Result<Self, self::error::ConversionError> {
value.parse()
}
}
impl ::std::convert::TryFrom<::std::string::String> for TalosTimelineNoticeLevel {
type Error = self::error::ConversionError;
fn try_from(
value: ::std::string::String,
) -> ::std::result::Result<Self, self::error::ConversionError> {
value.parse()
}
}
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug, PartialEq)]
#[serde(deny_unknown_fields)]
pub struct TalosToolDiffHunk {
pub lines: ::std::vec::Vec<TalosToolDiffLine>,
#[serde(default)]
pub new_lines: ::std::option::Option<u32>,
#[serde(default)]
pub new_start: ::std::option::Option<u32>,
#[serde(default)]
pub old_lines: ::std::option::Option<u32>,
#[serde(default)]
pub old_start: ::std::option::Option<u32>,
}
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug, PartialEq)]
#[serde(tag = "kind", content = "text")]
pub enum TalosToolDiffLine {
#[serde(rename = "context")]
Context(::std::string::String),
#[serde(rename = "added")]
Added(::std::string::String),
#[serde(rename = "removed")]
Removed(::std::string::String),
}
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug, PartialEq)]
#[serde(deny_unknown_fields)]
pub struct TalosToolFileDiff {
pub hunks: ::std::vec::Vec<TalosToolDiffHunk>,
#[serde(default)]
pub old_path: ::std::option::Option<::std::string::String>,
pub path: ::std::string::String,
pub truncated: bool,
}
#[derive(
::serde::Deserialize,
::serde::Serialize,
Clone,
Copy,
Debug,
Eq,
Hash,
Ord,
PartialEq,
PartialOrd,
)]
pub enum TalosToolProgressKind {
#[serde(rename = "status")]
Status,
#[serde(rename = "stdout")]
Stdout,
#[serde(rename = "stderr")]
Stderr,
}
impl ::std::fmt::Display for TalosToolProgressKind {
fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
match *self {
Self::Status => f.write_str("status"),
Self::Stdout => f.write_str("stdout"),
Self::Stderr => f.write_str("stderr"),
}
}
}
impl ::std::str::FromStr for TalosToolProgressKind {
type Err = self::error::ConversionError;
fn from_str(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
match value {
"status" => Ok(Self::Status),
"stdout" => Ok(Self::Stdout),
"stderr" => Ok(Self::Stderr),
_ => Err("invalid value".into()),
}
}
}
impl ::std::convert::TryFrom<&str> for TalosToolProgressKind {
type Error = self::error::ConversionError;
fn try_from(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
value.parse()
}
}
impl ::std::convert::TryFrom<&::std::string::String> for TalosToolProgressKind {
type Error = self::error::ConversionError;
fn try_from(
value: &::std::string::String,
) -> ::std::result::Result<Self, self::error::ConversionError> {
value.parse()
}
}
impl ::std::convert::TryFrom<::std::string::String> for TalosToolProgressKind {
type Error = self::error::ConversionError;
fn try_from(
value: ::std::string::String,
) -> ::std::result::Result<Self, self::error::ConversionError> {
value.parse()
}
}
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug, PartialEq)]
#[serde(deny_unknown_fields)]
pub struct TalosToolSearchMatch {
#[serde(default)]
pub after: ::std::vec::Vec<::std::string::String>,
#[serde(default)]
pub before: ::std::vec::Vec<::std::string::String>,
#[serde(default)]
pub column: ::std::option::Option<u32>,
pub line: u32,
pub path: ::std::string::String,
pub text: ::std::string::String,
}
#[derive(
::serde::Deserialize,
::serde::Serialize,
Clone,
Copy,
Debug,
Eq,
Hash,
Ord,
PartialEq,
PartialOrd,
)]
pub enum TalosToolTaskStatus {
#[serde(rename = "queued")]
Queued,
#[serde(rename = "running")]
Running,
#[serde(rename = "completed")]
Completed,
#[serde(rename = "failed")]
Failed,
#[serde(rename = "timed_out")]
TimedOut,
#[serde(rename = "cancelled")]
Cancelled,
}
impl ::std::fmt::Display for TalosToolTaskStatus {
fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
match *self {
Self::Queued => f.write_str("queued"),
Self::Running => f.write_str("running"),
Self::Completed => f.write_str("completed"),
Self::Failed => f.write_str("failed"),
Self::TimedOut => f.write_str("timed_out"),
Self::Cancelled => f.write_str("cancelled"),
}
}
}
impl ::std::str::FromStr for TalosToolTaskStatus {
type Err = self::error::ConversionError;
fn from_str(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
match value {
"queued" => Ok(Self::Queued),
"running" => Ok(Self::Running),
"completed" => Ok(Self::Completed),
"failed" => Ok(Self::Failed),
"timed_out" => Ok(Self::TimedOut),
"cancelled" => Ok(Self::Cancelled),
_ => Err("invalid value".into()),
}
}
}
impl ::std::convert::TryFrom<&str> for TalosToolTaskStatus {
type Error = self::error::ConversionError;
fn try_from(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
value.parse()
}
}
impl ::std::convert::TryFrom<&::std::string::String> for TalosToolTaskStatus {
type Error = self::error::ConversionError;
fn try_from(
value: &::std::string::String,
) -> ::std::result::Result<Self, self::error::ConversionError> {
value.parse()
}
}
impl ::std::convert::TryFrom<::std::string::String> for TalosToolTaskStatus {
type Error = self::error::ConversionError;
fn try_from(
value: ::std::string::String,
) -> ::std::result::Result<Self, self::error::ConversionError> {
value.parse()
}
}
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug, PartialEq)]
#[serde(tag = "type", content = "data")]
pub enum TimelineEventPayload {
#[serde(rename = "agent")]
Agent(AgentEvent),
#[serde(rename = "systemNotice")]
SystemNotice(TimelineSystemNotice),
}
impl ::std::convert::From<AgentEvent> for TimelineEventPayload {
fn from(value: AgentEvent) -> Self {
Self::Agent(value)
}
}
impl ::std::convert::From<TimelineSystemNotice> for TimelineEventPayload {
fn from(value: TimelineSystemNotice) -> Self {
Self::SystemNotice(value)
}
}
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug, PartialEq)]
#[serde(deny_unknown_fields)]
pub struct TimelineSystemNotice {
pub identity: AgentTurnRef,
pub notice: AgentSystemNotice,
#[serde(rename = "occurredAt")]
pub occurred_at: i64,
}
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug, PartialEq)]
#[serde(deny_unknown_fields)]
pub struct TokenUsage {
#[serde(default)]
pub cache_creation_input_tokens: ::std::option::Option<u32>,
#[serde(default)]
pub cache_read_input_tokens: ::std::option::Option<u32>,
pub input_tokens: u32,
pub output_tokens: u32,
pub total_tokens: u32,
}
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug, PartialEq)]
#[serde(transparent)]
pub struct ToolArguments(pub ::serde_json::Value);
impl ::std::ops::Deref for ToolArguments {
type Target = ::serde_json::Value;
fn deref(&self) -> &::serde_json::Value {
&self.0
}
}
impl ::std::convert::From<ToolArguments> for ::serde_json::Value {
fn from(value: ToolArguments) -> Self {
value.0
}
}
impl ::std::convert::From<::serde_json::Value> for ToolArguments {
fn from(value: ::serde_json::Value) -> Self {
Self(value)
}
}
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug, PartialEq)]
#[serde(deny_unknown_fields)]
#[derive(Default)]
pub struct ToolExecutionMetrics {
#[serde(rename = "executionDurationMs", default)]
pub execution_duration_ms: ::std::option::Option<f64>,
#[serde(rename = "finishedAtMs", default)]
pub finished_at_ms: ::std::option::Option<i64>,
#[serde(rename = "queueDurationMs", default)]
pub queue_duration_ms: ::std::option::Option<f64>,
#[serde(rename = "queuedAtMs", default)]
pub queued_at_ms: ::std::option::Option<i64>,
#[serde(rename = "startedAtMs", default)]
pub started_at_ms: ::std::option::Option<i64>,
}
#[derive(
::serde::Deserialize,
::serde::Serialize,
Clone,
Copy,
Debug,
Eq,
Hash,
Ord,
PartialEq,
PartialOrd,
)]
pub enum TurnCommandStatus {
#[serde(rename = "pending")]
Pending,
#[serde(rename = "accepted")]
Accepted,
#[serde(rename = "failed")]
Failed,
#[serde(rename = "failedNoFirstEvent")]
FailedNoFirstEvent,
}
impl ::std::fmt::Display for TurnCommandStatus {
fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
match *self {
Self::Pending => f.write_str("pending"),
Self::Accepted => f.write_str("accepted"),
Self::Failed => f.write_str("failed"),
Self::FailedNoFirstEvent => f.write_str("failedNoFirstEvent"),
}
}
}
impl ::std::str::FromStr for TurnCommandStatus {
type Err = self::error::ConversionError;
fn from_str(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
match value {
"pending" => Ok(Self::Pending),
"accepted" => Ok(Self::Accepted),
"failed" => Ok(Self::Failed),
"failedNoFirstEvent" => Ok(Self::FailedNoFirstEvent),
_ => Err("invalid value".into()),
}
}
}
impl ::std::convert::TryFrom<&str> for TurnCommandStatus {
type Error = self::error::ConversionError;
fn try_from(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
value.parse()
}
}
impl ::std::convert::TryFrom<&::std::string::String> for TurnCommandStatus {
type Error = self::error::ConversionError;
fn try_from(
value: &::std::string::String,
) -> ::std::result::Result<Self, self::error::ConversionError> {
value.parse()
}
}
impl ::std::convert::TryFrom<::std::string::String> for TurnCommandStatus {
type Error = self::error::ConversionError;
fn try_from(
value: ::std::string::String,
) -> ::std::result::Result<Self, self::error::ConversionError> {
value.parse()
}
}
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug, PartialEq)]
#[serde(tag = "type", content = "params")]
pub enum UserActionParams {
#[serde(rename = "dynamicToolResult")]
DynamicToolResult(DynamicToolResultParams),
#[serde(rename = "question")]
Question(QuestionParams),
#[serde(rename = "sandboxApproval")]
SandboxApproval(SandboxApprovalParams),
}
impl ::std::convert::From<DynamicToolResultParams> for UserActionParams {
fn from(value: DynamicToolResultParams) -> Self {
Self::DynamicToolResult(value)
}
}
impl ::std::convert::From<QuestionParams> for UserActionParams {
fn from(value: QuestionParams) -> Self {
Self::Question(value)
}
}
impl ::std::convert::From<SandboxApprovalParams> for UserActionParams {
fn from(value: SandboxApprovalParams) -> Self {
Self::SandboxApproval(value)
}
}
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug, PartialEq)]
#[serde(tag = "type", content = "response")]
pub enum UserActionResponse {
#[serde(rename = "dynamicToolResult")]
DynamicToolResult(DynamicToolResult),
#[serde(rename = "question")]
Question(QuestionAnswer),
#[serde(rename = "sandboxApproval")]
SandboxApproval(SandboxApprovalDecision),
}
impl ::std::convert::From<DynamicToolResult> for UserActionResponse {
fn from(value: DynamicToolResult) -> Self {
Self::DynamicToolResult(value)
}
}
impl ::std::convert::From<QuestionAnswer> for UserActionResponse {
fn from(value: QuestionAnswer) -> Self {
Self::Question(value)
}
}
impl ::std::convert::From<SandboxApprovalDecision> for UserActionResponse {
fn from(value: SandboxApprovalDecision) -> Self {
Self::SandboxApproval(value)
}
}
#[derive(
::serde::Deserialize,
::serde::Serialize,
Clone,
Copy,
Debug,
Eq,
Hash,
Ord,
PartialEq,
PartialOrd,
)]
pub enum UserActionState {
#[serde(rename = "pending")]
Pending,
#[serde(rename = "responseAccepted")]
ResponseAccepted,
#[serde(rename = "resuming")]
Resuming,
#[serde(rename = "resumeFailed")]
ResumeFailed,
#[serde(rename = "executionUnknown")]
ExecutionUnknown,
#[serde(rename = "resolved")]
Resolved,
#[serde(rename = "cancelled")]
Cancelled,
}
impl ::std::fmt::Display for UserActionState {
fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
match *self {
Self::Pending => f.write_str("pending"),
Self::ResponseAccepted => f.write_str("responseAccepted"),
Self::Resuming => f.write_str("resuming"),
Self::ResumeFailed => f.write_str("resumeFailed"),
Self::ExecutionUnknown => f.write_str("executionUnknown"),
Self::Resolved => f.write_str("resolved"),
Self::Cancelled => f.write_str("cancelled"),
}
}
}
impl ::std::str::FromStr for UserActionState {
type Err = self::error::ConversionError;
fn from_str(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
match value {
"pending" => Ok(Self::Pending),
"responseAccepted" => Ok(Self::ResponseAccepted),
"resuming" => Ok(Self::Resuming),
"resumeFailed" => Ok(Self::ResumeFailed),
"executionUnknown" => Ok(Self::ExecutionUnknown),
"resolved" => Ok(Self::Resolved),
"cancelled" => Ok(Self::Cancelled),
_ => Err("invalid value".into()),
}
}
}
impl ::std::convert::TryFrom<&str> for UserActionState {
type Error = self::error::ConversionError;
fn try_from(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
value.parse()
}
}
impl ::std::convert::TryFrom<&::std::string::String> for UserActionState {
type Error = self::error::ConversionError;
fn try_from(
value: &::std::string::String,
) -> ::std::result::Result<Self, self::error::ConversionError> {
value.parse()
}
}
impl ::std::convert::TryFrom<::std::string::String> for UserActionState {
type Error = self::error::ConversionError;
fn try_from(
value: ::std::string::String,
) -> ::std::result::Result<Self, self::error::ConversionError> {
value.parse()
}
}
#[derive(
::serde::Deserialize,
::serde::Serialize,
Clone,
Copy,
Debug,
Eq,
Hash,
Ord,
PartialEq,
PartialOrd,
)]
pub enum UserPermissionMode {
#[serde(rename = "askForApproval")]
AskForApproval,
#[serde(rename = "approveForMe")]
ApproveForMe,
#[serde(rename = "fullAccess")]
FullAccess,
}
impl ::std::fmt::Display for UserPermissionMode {
fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
match *self {
Self::AskForApproval => f.write_str("askForApproval"),
Self::ApproveForMe => f.write_str("approveForMe"),
Self::FullAccess => f.write_str("fullAccess"),
}
}
}
impl ::std::str::FromStr for UserPermissionMode {
type Err = self::error::ConversionError;
fn from_str(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
match value {
"askForApproval" => Ok(Self::AskForApproval),
"approveForMe" => Ok(Self::ApproveForMe),
"fullAccess" => Ok(Self::FullAccess),
_ => Err("invalid value".into()),
}
}
}
impl ::std::convert::TryFrom<&str> for UserPermissionMode {
type Error = self::error::ConversionError;
fn try_from(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
value.parse()
}
}
impl ::std::convert::TryFrom<&::std::string::String> for UserPermissionMode {
type Error = self::error::ConversionError;
fn try_from(
value: &::std::string::String,
) -> ::std::result::Result<Self, self::error::ConversionError> {
value.parse()
}
}
impl ::std::convert::TryFrom<::std::string::String> for UserPermissionMode {
type Error = self::error::ConversionError;
fn try_from(
value: ::std::string::String,
) -> ::std::result::Result<Self, self::error::ConversionError> {
value.parse()
}
}
pub mod defaults {
pub(super) fn project_info_status() -> super::ProjectStatus {
super::ProjectStatus {
reason: ::std::option::Option::None,
state: super::ProjectStatusState::Available,
}
}
pub(super) fn session_info_usage() -> super::SessionUsage {
super::SessionUsage {
context: ::std::option::Option::None,
tokens: super::TokenUsage {
cache_creation_input_tokens: ::std::option::Option::None,
cache_read_input_tokens: ::std::option::Option::None,
input_tokens: 0_u32,
output_tokens: 0_u32,
total_tokens: 0_u32,
},
}
}
pub(super) fn talos_session_environment_connection_mode() -> super::TalosConnectionMode {
super::TalosConnectionMode::Remote
}
}