Documentation
¶
Overview ¶
Package trigger implements cron scheduling and webhook handling for agent execution.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AgentRunner ¶
type AgentRunner interface {
RunFromTrigger(ctx context.Context, agentName, prompt, invocationType string) error
}
AgentRunner is the interface for executing agent runs from triggers.
type Scheduler ¶
type Scheduler struct {
// contains filtered or unexported fields
}
Scheduler manages cron-based agent execution.
func NewScheduler ¶
func NewScheduler(runner AgentRunner) *Scheduler
NewScheduler creates a scheduler backed by the given runner. Cron expressions use the standard 5-field format: minute hour day-of-month month day-of-week (e.g. "0 9 * * 1-5" for 09:00 on weekdays). Do not use WithSeconds() so docs and configs match.
func (*Scheduler) RegisterSchedules ¶
RegisterSchedules adds cron entries from the policy's trigger configuration.
type WebhookHandler ¶
type WebhookHandler struct {
// contains filtered or unexported fields
}
WebhookHandler handles incoming webhook triggers.
func NewWebhookHandler ¶
func NewWebhookHandler(runner AgentRunner, pol *policy.Policy) *WebhookHandler
NewWebhookHandler creates a handler from the policy's webhook configuration.
func (*WebhookHandler) HandleWebhook ¶
func (wh *WebhookHandler) HandleWebhook(w http.ResponseWriter, r *http.Request)
HandleWebhook processes an incoming webhook trigger.