feat(theme): add tool_output color to themes
- Added a `tool_output` color to the `Theme` struct. - Updated all built-in themes to include the new color. - Modified the TUI to use the `tool_output` color for rendering tool output.
This commit is contained in:
@@ -65,7 +65,7 @@ fn sanitize_path(path: &str, root: &Path) -> Result<PathBuf, JsonRpcError> {
|
||||
.map_err(|_| JsonRpcError {
|
||||
code: -32602,
|
||||
message: "Invalid path".to_string(),
|
||||
})?
|
||||
})?
|
||||
.to_path_buf()
|
||||
} else {
|
||||
path.to_path_buf()
|
||||
@@ -86,11 +86,10 @@ fn sanitize_path(path: &str, root: &Path) -> Result<PathBuf, JsonRpcError> {
|
||||
async fn resources_list(path: &str, root: &Path) -> Result<serde_json::Value, JsonRpcError> {
|
||||
let full_path = sanitize_path(path, root)?;
|
||||
|
||||
let entries = fs::read_dir(full_path)
|
||||
.map_err(|e| JsonRpcError {
|
||||
code: -32000,
|
||||
message: format!("Failed to read directory: {}", e),
|
||||
})?;
|
||||
let entries = fs::read_dir(full_path).map_err(|e| JsonRpcError {
|
||||
code: -32000,
|
||||
message: format!("Failed to read directory: {}", e),
|
||||
})?;
|
||||
|
||||
let mut result = Vec::new();
|
||||
for entry in entries {
|
||||
@@ -150,13 +149,19 @@ async fn main() -> anyhow::Result<()> {
|
||||
|
||||
match handle_request(req, &root).await {
|
||||
Ok(result) => {
|
||||
let resp = Response { id: request_id, result };
|
||||
let resp = Response {
|
||||
id: request_id,
|
||||
result,
|
||||
};
|
||||
let resp_str = serde_json::to_string(&resp)?;
|
||||
stdout.write_all(resp_str.as_bytes()).await?;
|
||||
stdout.write_all(b"\n").await?;
|
||||
}
|
||||
Err(error) => {
|
||||
let err_resp = ErrorResponse { id: request_id, error };
|
||||
let err_resp = ErrorResponse {
|
||||
id: request_id,
|
||||
error,
|
||||
};
|
||||
let resp_str = serde_json::to_string(&err_resp)?;
|
||||
stdout.write_all(resp_str.as_bytes()).await?;
|
||||
stdout.write_all(b"\n").await?;
|
||||
@@ -172,4 +177,4 @@ async fn main() -> anyhow::Result<()> {
|
||||
}
|
||||
|
||||
Ok(())
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user