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:
@@ -353,7 +353,6 @@ impl ChatApp {
|
||||
("open", "Alias for load"),
|
||||
("o", "Alias for load"),
|
||||
("sessions", "List saved sessions"),
|
||||
("ls", "Alias for sessions"),
|
||||
("help", "Show help documentation"),
|
||||
("h", "Alias for help"),
|
||||
("model", "Select a model"),
|
||||
@@ -363,6 +362,9 @@ impl ChatApp {
|
||||
("theme", "Switch theme"),
|
||||
("themes", "List available themes"),
|
||||
("reload", "Reload configuration and themes"),
|
||||
("e", "Edit a file"),
|
||||
("edit", "Alias for edit"),
|
||||
("ls", "List directory contents"),
|
||||
("privacy-enable", "Enable a privacy-sensitive tool"),
|
||||
("privacy-disable", "Disable a privacy-sensitive tool"),
|
||||
("privacy-clear", "Clear stored secure data"),
|
||||
@@ -1385,7 +1387,7 @@ impl ChatApp {
|
||||
}
|
||||
}
|
||||
}
|
||||
"sessions" | "ls" => {
|
||||
"sessions" => {
|
||||
// List saved sessions
|
||||
match self.controller.list_saved_sessions().await {
|
||||
Ok(sessions) => {
|
||||
@@ -1419,6 +1421,47 @@ impl ChatApp {
|
||||
self.controller.start_new_conversation(None, None);
|
||||
self.status = "Started new conversation".to_string();
|
||||
}
|
||||
"e" | "edit" => {
|
||||
if let Some(path) = args.first() {
|
||||
match self.controller.read_file(path).await {
|
||||
Ok(content) => {
|
||||
let message = format!(
|
||||
"The content of file `{}` is:\n```\n{}\n```",
|
||||
path, content
|
||||
);
|
||||
self.controller
|
||||
.conversation_mut()
|
||||
.push_user_message(message);
|
||||
self.pending_llm_request = true;
|
||||
}
|
||||
Err(e) => {
|
||||
self.error =
|
||||
Some(format!("Failed to read file: {}", e));
|
||||
}
|
||||
}
|
||||
} else {
|
||||
self.error = Some("Usage: :e <path>".to_string());
|
||||
}
|
||||
}
|
||||
"ls" => {
|
||||
let path = args.first().copied().unwrap_or(".");
|
||||
match self.controller.list_dir(path).await {
|
||||
Ok(entries) => {
|
||||
let message = format!(
|
||||
"Directory listing for `{}`:\n```\n{}\n```",
|
||||
path,
|
||||
entries.join("\n")
|
||||
);
|
||||
self.controller
|
||||
.conversation_mut()
|
||||
.push_user_message(message);
|
||||
}
|
||||
Err(e) => {
|
||||
self.error =
|
||||
Some(format!("Failed to list directory: {}", e));
|
||||
}
|
||||
}
|
||||
}
|
||||
"theme" => {
|
||||
if args.is_empty() {
|
||||
self.error = Some("Usage: :theme <name>".to_string());
|
||||
|
||||
Reference in New Issue
Block a user