Refactored, added comprehensive testing.
All checks were successful
Release / release (push) Successful in 3m17s

This commit is contained in:
Jay
2025-10-26 23:23:43 -04:00
parent ec32b75267
commit 1936f055e2
61 changed files with 4678 additions and 769 deletions

32
input/aggregate.go Normal file
View File

@@ -0,0 +1,32 @@
package input
// AggregatePrompts combines prompt sources with stdin based on role.
func AggregatePrompts(prompts []string, stdin string, role StdinRole) []string {
switch role {
case StdinAsPrompt:
if stdin != "" {
return []string{stdin}
}
return prompts
case StdinAsPrefixedContent:
if stdin != "" {
return append(prompts, stdin)
}
return prompts
case StdinAsFile:
return prompts
default:
return prompts
}
}
// AggregateFiles combines file sources with stdin based on role.
func AggregateFiles(files []FileData, stdin string, role StdinRole) []FileData {
if role == StdinAsFile && stdin != "" {
return append([]FileData{{Path: "input", Content: stdin}}, files...)
}
return files
}