NewExecutionPlan 创建新的执行计划
(description string)
| 116 | |
| 117 | // NewExecutionPlan 创建新的执行计划 |
| 118 | func 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 添加步骤 |
| 136 | func (p *ExecutionPlan) AddStep(toolName, description string, params map[string]any) *Step { |