#[derive(Debug, thiserror::Error)]
pub enum DevToolError {
#[error("path '{0}' escapes the workspace root")]
PathEscape(String),
#[error("workspace is read-only; '{0}' is not permitted")]
ReadOnly(&'static str),
#[error("bash execution is disabled for this workspace")]
BashDisabled,
#[error("file '{0}' must be read with read_file before it can be edited")]
NotRead(String),
#[error("no occurrence of the target string was found in '{0}'")]
NoMatch(String),
#[error(
"the target string occurs {count} times in '{path}'; pass replace_all=true \
or provide a more specific string"
)]
Ambiguous {
path: String,
count: usize,
},
#[error("command timed out after {0:?}")]
Timeout(std::time::Duration),
#[error(transparent)]
Io(#[from] std::io::Error),
#[error("{0}")]
Other(String),
}
impl From<DevToolError> for adk_core::AdkError {
fn from(e: DevToolError) -> Self {
adk_core::AdkError::tool(e.to_string())
}
}