manualPlanExample demonstrates manual plan creation
()
| 30 | |
| 31 | // manualPlanExample demonstrates manual plan creation |
| 32 | func manualPlanExample() { |
| 33 | // Create a new execution plan |
| 34 | plan := executionplan.NewExecutionPlan("Search for files and analyze content") |
| 35 | |
| 36 | // Add steps |
| 37 | plan.AddStep("search_files", "Search for Go files in the project", map[string]any{ |
| 38 | "pattern": "*.go", |
| 39 | "path": "./pkg", |
| 40 | }) |
| 41 | |
| 42 | plan.AddStep("read_file", "Read the content of the main file", map[string]any{ |
| 43 | "file_path": "main.go", |
| 44 | }) |
| 45 | |
| 46 | plan.AddStep("analyze", "Analyze the code structure", map[string]any{ |
| 47 | "type": "structure", |
| 48 | }) |
| 49 | |
| 50 | // Print the plan |
| 51 | fmt.Println(executionplan.FormatPlan(plan)) |
| 52 | |
| 53 | // Get summary |
| 54 | summary := plan.Summary() |
| 55 | fmt.Printf("Plan Summary: %d steps, Status: %s\n", summary.TotalSteps, summary.Status) |
| 56 | } |
| 57 | |
| 58 | // executionExample demonstrates plan execution with approval |
| 59 | func executionExample() { |
no test coverage detected