Documentation
¶
Index ¶
Constants ¶
View Source
const ( SeverityInfo = "info" SeverityWarning = "warning" SeverityCritical = "critical" )
View Source
const ( KindPendingDecision = "pending_decision" KindGuardrailBlocked = "guardrail_blocked" KindSessionState = "session_state" )
Variables ¶
This section is empty.
Functions ¶
func SeverityMeetsThreshold ¶ added in v0.8.5
SeverityMeetsThreshold reports whether the actual severity meets or exceeds the minimum threshold.
Types ¶
type Config ¶
type Config struct {
// Enabled is the master switch for notifications and alerts.
Enabled bool `yaml:"enabled"`
// Bell enables emitting the ASCII BEL character (\a) to the terminal.
Bell bool `yaml:"bell"`
// Desktop enables native operating-system desktop notifications.
Desktop bool `yaml:"desktop"`
// MinSeverity specifies the minimum severity required to trigger alerts ("info", "warning", "critical").
MinSeverity string `yaml:"min_severity,omitempty"`
// Webhooks defines remote webhook endpoints.
Webhooks []WebhookConfig `yaml:"webhooks,omitempty"`
}
Config controls operator alert and notification behavior.
func DefaultConfig ¶
func DefaultConfig() Config
DefaultConfig returns the default notification settings (local bell & desktop enabled, no webhooks).
func DisabledConfig ¶
func DisabledConfig() Config
DisabledConfig returns settings with all notifications disabled.
type HTTPPoster ¶ added in v0.3.0
HTTPPoster abstracts HTTP POST execution for testing.
type Notification ¶
type Notification struct {
Title string `json:"title"`
Body string `json:"body"`
SessionID string `json:"session_id,omitempty"`
AgentName string `json:"agent_name,omitempty"`
Reason string `json:"reason,omitempty"`
EventID string `json:"event_id,omitempty"`
Kind string `json:"kind,omitempty"`
Severity string `json:"severity,omitempty"`
Details string `json:"details,omitempty"`
Timestamp time.Time `json:"timestamp"`
}
Notification carries display-safe information about an event needing operator attention.
type Notifier ¶
type Notifier interface {
Notify(Notification)
}
Notifier delivers operator notifications and alerts.
type WebhookConfig ¶ added in v0.3.0
type WebhookConfig struct {
Name string `yaml:"name,omitempty"`
URL string `yaml:"url"`
Format string `yaml:"format"` // "generic", "slack", "discord" (default: "generic")
MinSeverity string `yaml:"min_severity"` // "info", "warning", "critical" (default: "warning")
Timeout string `yaml:"timeout"` // e.g. "5s" (default: "5s")
Headers map[string]string `yaml:"headers,omitempty"`
}
WebhookConfig specifies an HTTP webhook destination for notifications.
type WebhookFormat ¶ added in v0.3.0
type WebhookFormat string
WebhookFormat defines the target service serialization schema.
const ( FormatGeneric WebhookFormat = "generic" FormatSlack WebhookFormat = "slack" FormatDiscord WebhookFormat = "discord" )
Click to show internal directories.
Click to hide internal directories.