Implement recipe loading, parsing, and running infrastructure. Add initial result-refactor recipe for converting Go error handling to monadic Result[T] style. Includes markdown recipe definition, YAML frontmatter parsing, step extraction, and basic runner.
23 lines
527 B
Go
23 lines
527 B
Go
package recipe
|
|
|
|
import "fmt"
|
|
|
|
type Runner struct {
|
|
Recipe *Recipe
|
|
}
|
|
|
|
func NewRunner(r *Recipe) *Runner {
|
|
return &Runner{Recipe: r}
|
|
}
|
|
|
|
func (r *Runner) Run() error {
|
|
fmt.Printf("🍳 Starting recipe: %s v%s\n", r.Recipe.Name, r.Recipe.Version)
|
|
for _, step := range r.Recipe.Steps {
|
|
fmt.Printf("Step %d/%d: %s\n", step.Number, len(r.Recipe.Steps), step.Title)
|
|
// TODO: here we will send step.Instructions to the LLM
|
|
// and handle the response according to Expected
|
|
}
|
|
fmt.Println("✅ Recipe complete.")
|
|
return nil
|
|
}
|