MCPcopy Create free account
hub / github.com/astercloud/aster / manualPlanExample

Function manualPlanExample

examples/execution-plan/main.go:32–56  ·  view source on GitHub ↗

manualPlanExample demonstrates manual plan creation

()

Source from the content-addressed store, hash-verified

30
31// manualPlanExample demonstrates manual plan creation
32func 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
59func executionExample() {

Callers 1

mainFunction · 0.85

Calls 5

AddStepMethod · 0.95
SummaryMethod · 0.95
NewExecutionPlanFunction · 0.92
FormatPlanFunction · 0.92
PrintfMethod · 0.80

Tested by

no test coverage detected