coordinator

package
v0.15.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 24, 2026 License: AGPL-3.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

View Source
const PostMortemAgentEmail = "agent-postmortem@system.internal"

Variables

This section is empty.

Functions

func DemoDataExists

func DemoDataExists(incidentRepo repository.IncidentRepository) (bool, error)

DemoDataExists returns true if the demo dataset has already been seeded.

func SeedAgents

func SeedAgents(userRepo repository.UserRepository) error

SeedAgents ensures all AI agent user accounts exist in the database. Safe to call on every startup — existing agents are left unchanged.

func SeedDemoData

func SeedDemoData(
	scheduleRepo repository.ScheduleRepository,
	escalationRepo repository.EscalationPolicyRepository,
	routingRepo repository.RoutingRuleRepository,
	incidentRepo repository.IncidentRepository,
	timelineRepo repository.TimelineRepository,
) error

SeedDemoData creates a representative dataset so new installs feel populated. Safe to call only when DemoDataExists() returns false.

Types

type AICoordinator

type AICoordinator struct {
	// contains filtered or unexported fields
}

AICoordinator subscribes to Redis and routes incident events to agents.

func New

func New(redisClient *redis.Client, postMortemAgent Agent) *AICoordinator

New creates an AICoordinator wired to real Redis and the provided agents.

func NewTestCoordinator

func NewTestCoordinator(postMortemAgent Agent) *AICoordinator

NewTestCoordinator creates an AICoordinator for unit tests (no Redis).

func (*AICoordinator) RoutePayload

func (c *AICoordinator) RoutePayload(ctx context.Context, channel string, payload []byte)

RoutePayload parses a raw event payload and dispatches to the correct agent. Exported for testability (called from Start and unit tests).

func (*AICoordinator) Start

func (c *AICoordinator) Start(ctx context.Context)

Start subscribes to the event stream and blocks until ctx is cancelled. Run this in a goroutine: go coordinator.Start(appCtx)

type Agent

type Agent interface {
	Handle(ctx context.Context, incidentID uuid.UUID)
}

Agent is the interface all AI agents implement.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL