@@ -11,8 +11,6 @@ import (
1111 "path/filepath"
1212 "strconv"
1313 "time"
14-
15- "github.com/aoagents/agent-orchestrator/backend/internal/ports"
1614)
1715
1816const (
@@ -52,46 +50,6 @@ type Config struct {
5250 // DataDir is the directory holding durable state (the SQLite database and
5351 // the CDC JSONL log). It is created on first use by the storage layer.
5452 DataDir string
55- // Notifications controls the central notifier runtime. The dashboard is the
56- // durable notifications table itself; desktop delivery is handed off to the
57- // AO Electron app via notification_deliveries rows.
58- Notifications NotificationConfig
59- }
60-
61- // NotificationConfig contains the global notification settings used by the
62- // central notifier runtime. It intentionally starts global (not per-project) so
63- // the routing model can grow without changing lifecycle reactions.
64- type NotificationConfig struct {
65- Enabled bool
66- Dashboard DashboardNotificationConfig
67- Desktop DesktopNotificationConfig
68- Routing NotificationRoutingConfig
69- Retry NotificationRetryConfig
70- }
71-
72- type DashboardNotificationConfig struct {
73- Enabled bool
74- Limit int
75- }
76-
77- type DesktopNotificationConfig struct {
78- Enabled bool
79- Priorities []ports.Priority
80- SoundPriorities []ports.Priority
81- }
82-
83- type NotificationRoutingConfig struct {
84- // Priorities maps notification priority to built-in route names. The
85- // notifier currently implements dashboard and desktop only.
86- Priorities map [ports.Priority ][]string
87- }
88-
89- type NotificationRetryConfig struct {
90- MaxAttempts int
91- BaseDelay time.Duration
92- MaxDelay time.Duration
93- LeaseTTL time.Duration
94- BatchSize int
9553}
9654
9755// Addr returns the host:port the HTTP server binds. It uses net.JoinHostPort so
@@ -119,7 +77,6 @@ func Load() (Config, error) {
11977 Port : DefaultPort ,
12078 RequestTimeout : DefaultRequestTimeout ,
12179 ShutdownTimeout : DefaultShutdownTimeout ,
122- Notifications : DefaultNotificationConfig (),
12380 }
12481
12582 if raw := os .Getenv ("AO_PORT" ); raw != "" {
@@ -164,35 +121,6 @@ func Load() (Config, error) {
164121 return cfg , nil
165122}
166123
167- // DefaultNotificationConfig returns the safe zero-setup notification settings.
168- func DefaultNotificationConfig () NotificationConfig {
169- return NotificationConfig {
170- Enabled : true ,
171- Dashboard : DashboardNotificationConfig {
172- Enabled : true ,
173- Limit : 50 ,
174- },
175- Desktop : DesktopNotificationConfig {
176- Enabled : true ,
177- Priorities : []ports.Priority {ports .PriorityUrgent , ports .PriorityAction },
178- SoundPriorities : []ports.Priority {ports .PriorityUrgent },
179- },
180- Routing : NotificationRoutingConfig {Priorities : map [ports.Priority ][]string {
181- ports .PriorityUrgent : []string {"dashboard" , "desktop" },
182- ports .PriorityAction : []string {"dashboard" , "desktop" },
183- ports .PriorityWarning : []string {"dashboard" },
184- ports .PriorityInfo : []string {"dashboard" },
185- }},
186- Retry : NotificationRetryConfig {
187- MaxAttempts : 5 ,
188- BaseDelay : time .Second ,
189- MaxDelay : 5 * time .Minute ,
190- LeaseTTL : 30 * time .Second ,
191- BatchSize : 50 ,
192- },
193- }
194- }
195-
196124// parsePositiveDuration rejects zero and negative durations: a zero
197125// RequestTimeout would expire every request instantly, and a non-positive
198126// ShutdownTimeout would defeat graceful shutdown.
0 commit comments