cosmetic tool call stuff
This commit is contained in:
@@ -280,8 +280,12 @@ fn extract_readme_heading(readme_content: &str) -> Option<String> {
|
||||
for line in content.lines().take(5) {
|
||||
let trimmed = line.trim();
|
||||
// Skip empty lines, other heading markers, and metadata
|
||||
if !trimmed.is_empty() && !trimmed.starts_with("📚") && !trimmed.starts_with('#')
|
||||
&& !trimmed.starts_with("==") && !trimmed.starts_with("--") {
|
||||
if !trimmed.is_empty()
|
||||
&& !trimmed.starts_with("📚")
|
||||
&& !trimmed.starts_with('#')
|
||||
&& !trimmed.starts_with("==")
|
||||
&& !trimmed.starts_with("--")
|
||||
{
|
||||
// Limit length for display
|
||||
return Some(if trimmed.len() > 100 {
|
||||
format!("{}...", &trimmed[..97])
|
||||
@@ -334,7 +338,10 @@ async fn run_interactive_retro(
|
||||
} else {
|
||||
"PROJECT DOCUMENTATION LOADED".to_string()
|
||||
};
|
||||
tui.output(&format!("SYSTEM: PROJECT README LOADED - {}\n\n", readme_snippet));
|
||||
tui.output(&format!(
|
||||
"SYSTEM: PROJECT README LOADED - {}\n\n",
|
||||
readme_snippet
|
||||
));
|
||||
}
|
||||
tui.output("SYSTEM: READY FOR INPUT\n\n");
|
||||
tui.output("\n\n");
|
||||
@@ -561,27 +568,10 @@ async fn run_interactive<W: UiWriter>(
|
||||
let output = SimpleOutput::new();
|
||||
|
||||
output.print("");
|
||||
output.print("🪿 G3 AI Coding Agent - Interactive Mode");
|
||||
output.print("I solve problems by writing and executing code. what shall we build today?");
|
||||
output.print("🪿 G3 AI Coding Agent");
|
||||
output.print(" >> what shall we build today?");
|
||||
output.print("");
|
||||
|
||||
// Display message if README was loaded
|
||||
if readme_content.is_some() {
|
||||
// Extract the first heading or title from the README
|
||||
let readme_snippet = if let Some(ref content) = readme_content {
|
||||
extract_readme_heading(content)
|
||||
.unwrap_or_else(|| "Project documentation loaded".to_string())
|
||||
} else {
|
||||
"Project documentation loaded".to_string()
|
||||
};
|
||||
|
||||
output.print(&format!("📚 Project README loaded: {}", readme_snippet));
|
||||
if readme_snippet.len() > 80 {
|
||||
output.print(" (Full README available in context)");
|
||||
}
|
||||
output.print("");
|
||||
}
|
||||
|
||||
// Display provider and model information
|
||||
match agent.get_provider_info() {
|
||||
Ok((provider, model)) => {
|
||||
@@ -592,8 +582,19 @@ async fn run_interactive<W: UiWriter>(
|
||||
}
|
||||
}
|
||||
|
||||
output.print("");
|
||||
output.print("CTRL-D to quit; ↑/↓ for history");
|
||||
// Display message if README was loaded
|
||||
if readme_content.is_some() {
|
||||
// Extract the first heading or title from the README
|
||||
let readme_snippet = if let Some(ref content) = readme_content {
|
||||
extract_readme_heading(content)
|
||||
.unwrap_or_else(|| "Project documentation loaded".to_string())
|
||||
} else {
|
||||
"Project documentation loaded".to_string()
|
||||
};
|
||||
|
||||
output.print(&format!("📚 detected: {}", readme_snippet));
|
||||
}
|
||||
|
||||
output.print("");
|
||||
|
||||
// Initialize rustyline editor with history
|
||||
|
||||
@@ -98,12 +98,12 @@ impl UiWriter for ConsoleUiWriter {
|
||||
}
|
||||
|
||||
fn print_tool_output_line(&self, line: &str) {
|
||||
println!("│ {}", line);
|
||||
println!("│ \x1b[2m{}\x1b[0m", line);
|
||||
}
|
||||
|
||||
fn print_tool_output_summary(&self, hidden_count: usize) {
|
||||
println!(
|
||||
"│ ... ({} more line{})",
|
||||
"│ \x1b[2m... ({} more line{})\x1b[0m",
|
||||
hidden_count,
|
||||
if hidden_count == 1 { "" } else { "s" }
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user