Add template expansion to interactive prompts
Apply {{today}} and other template variables to user input in:
- Interactive mode (single and multiline)
- Accumulative mode requirements
This commit is contained in:
@@ -17,6 +17,7 @@ use crate::simple_output::SimpleOutput;
|
||||
use crate::ui_writer_impl::ConsoleUiWriter;
|
||||
use g3_core::ui_writer::UiWriter;
|
||||
use crate::utils::load_config_with_cli_overrides;
|
||||
use crate::template::process_template;
|
||||
|
||||
/// Run accumulative autonomous mode - accumulates requirements from user input
|
||||
/// and runs autonomous mode after each input.
|
||||
@@ -75,7 +76,8 @@ pub async fn run_accumulative_mode(
|
||||
let readline = rl.readline("requirement> ");
|
||||
match readline {
|
||||
Ok(line) => {
|
||||
let input = line.trim().to_string();
|
||||
// Apply template expansion (e.g., {{today}} -> 2026-01-26 (Monday))
|
||||
let input = process_template(line.trim());
|
||||
|
||||
if input.is_empty() {
|
||||
continue;
|
||||
|
||||
@@ -17,6 +17,7 @@ use crate::g3_status::{G3Status, Status};
|
||||
use crate::project::Project;
|
||||
use crate::project_files::extract_readme_heading;
|
||||
use crate::simple_output::SimpleOutput;
|
||||
use crate::template::process_template;
|
||||
use crate::task_execution::execute_task_with_retry;
|
||||
use crate::utils::display_context_progress;
|
||||
|
||||
@@ -209,10 +210,11 @@ pub async fn run_interactive<W: UiWriter>(
|
||||
break;
|
||||
}
|
||||
|
||||
// Process the multiline input
|
||||
// Process the multiline input (with template expansion)
|
||||
let processed_input = process_template(&input);
|
||||
execute_task_with_retry(
|
||||
&mut agent,
|
||||
&input,
|
||||
&processed_input,
|
||||
show_prompt,
|
||||
show_code,
|
||||
&output,
|
||||
@@ -248,10 +250,11 @@ pub async fn run_interactive<W: UiWriter>(
|
||||
}
|
||||
}
|
||||
|
||||
// Process the single line input
|
||||
// Process the single line input (with template expansion)
|
||||
let processed_input = process_template(&input);
|
||||
execute_task_with_retry(
|
||||
&mut agent,
|
||||
&input,
|
||||
&processed_input,
|
||||
show_prompt,
|
||||
show_code,
|
||||
&output,
|
||||
|
||||
Reference in New Issue
Block a user