yao/agent/robot/executor/standard/delivery.go
Max 6c45cc41be Enhance Delivery Result Structure and Update Test Cases
- Modified the DeliveryResult structure across multiple executors to include RequestID and Content fields, providing detailed summaries and bodies for dry-run, sandbox, and standard deliveries.
- Updated related test cases to reflect changes in the DeliveryResult structure, ensuring accurate validation of delivery types and content handling.
- Revised input formatting to display delivery summaries instead of types, improving clarity in execution summaries.
2026-01-18 17:21:21 +08:00

36 lines
917 B
Go

package standard
import (
robottypes "github.com/yaoapp/yao/agent/robot/types"
)
// RunDelivery executes P4: Delivery phase
// Delivers results to configured targets
//
// Input:
// - TaskResults (from P3)
// - Delivery config from robot
//
// Output:
// - DeliveryResult with success status
//
// Delivery Types:
// - DeliveryEmail: Send email
// - DeliveryNotify: Send notification
// - DeliveryWebhook: Call webhook
// - DeliveryStore: Store to database
//
// TODO: Implement real delivery
func (e *Executor) RunDelivery(ctx *robottypes.Context, exec *robottypes.Execution, _ interface{}) error {
e.simulateStreamDelay()
exec.Delivery = &robottypes.DeliveryResult{
RequestID: "delivery-" + exec.ID,
Content: &robottypes.DeliveryContent{
Summary: "Delivery completed (placeholder)",
Body: "# Delivery\n\nTODO: Implement real delivery logic.",
},
Success: true,
}
return nil
}