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

Function NewExecutionPlan

pkg/executionplan/types.go:118–133  ·  view source on GitHub ↗

NewExecutionPlan 创建新的执行计划

(description string)

Source from the content-addressed store, hash-verified

116
117// NewExecutionPlan 创建新的执行计划
118func NewExecutionPlan(description string) *ExecutionPlan {
119 now := time.Now()
120 return &ExecutionPlan{
121 ID: generatePlanID(),
122 Description: description,
123 Steps: []Step{},
124 Status: StatusDraft,
125 CurrentStep: 0,
126 CreatedAt: now,
127 UpdatedAt: now,
128 Options: &ExecutionOptions{
129 RequireApproval: true,
130 StopOnError: true,
131 },
132 }
133}
134
135// AddStep 添加步骤
136func (p *ExecutionPlan) AddStep(toolName, description string, params map[string]any) *Step {

Callers 15

manualPlanExampleFunction · 0.92
executionExampleFunction · 0.92
dependencyExampleFunction · 0.92
TestNewExecutionPlanFunction · 0.85
TestAddStepFunction · 0.85
TestGetStepFunction · 0.85
TestGetCurrentStepFunction · 0.85
TestIsCompletedFunction · 0.85
TestIsApprovedFunction · 0.85
TestCanExecuteFunction · 0.85
TestApproveFunction · 0.85
TestRejectFunction · 0.85

Calls 1

generatePlanIDFunction · 0.85

Tested by 15

TestNewExecutionPlanFunction · 0.68
TestAddStepFunction · 0.68
TestGetStepFunction · 0.68
TestGetCurrentStepFunction · 0.68
TestIsCompletedFunction · 0.68
TestIsApprovedFunction · 0.68
TestCanExecuteFunction · 0.68
TestApproveFunction · 0.68
TestRejectFunction · 0.68
TestMarkStepStartedFunction · 0.68
TestMarkStepCompletedFunction · 0.68
TestMarkStepFailedFunction · 0.68