yao/agent/robot/executor/standard/run.go
Max 41e0544aba Refactor Executor Architecture and Update Documentation
- Introduced multiple executor modes (Standard, DryRun, Sandbox) to accommodate various use cases, enhancing flexibility in execution strategies.
- Updated DESIGN.md to reflect the new executor modes and their respective use cases, including detailed descriptions and configuration examples.
- Revised TECHNICAL.md to outline the new executor package structure, emphasizing the modular design for future enhancements.
- Enhanced the TODO.md to track the progress of executor mode implementations and related tasks.
- Removed outdated executor stub files and tests, streamlining the codebase for improved maintainability.
- Updated integration tests to utilize the new DryRun executor, ensuring comprehensive coverage of execution scenarios without real agent calls.
2026-01-16 15:27:46 +08:00

39 lines
959 B
Go

package standard
import (
robottypes "github.com/yaoapp/yao/agent/robot/types"
)
// RunExecution executes P3: Run phase
// Executes each task using the appropriate executor (Assistant, Process, or Function)
//
// Input:
// - Tasks (from P2)
//
// Output:
// - TaskResult for each task with output and validation
//
// Executor Types:
// - ExecutorAssistant: Call AI assistant
// - ExecutorMCP: Call MCP tool
// - ExecutorProcess: Run Yao process
// - ExecutorFunction: Call JavaScript function
//
// TODO: Implement real task execution
func (e *Executor) RunExecution(ctx *robottypes.Context, exec *robottypes.Execution, _ interface{}) error {
e.simulateStreamDelay()
exec.Results = []robottypes.TaskResult{
{
TaskID: "task-1",
Success: true,
Output: map[string]interface{}{"status": "completed"},
Duration: 100,
Validation: &robottypes.ValidationResult{
Passed: true,
Score: 0.95,
},
},
}
return nil
}