agents

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 DefaultWaitDuration = 60 * time.Second

Variables

This section is empty.

Functions

This section is empty.

Types

type PostMortemAgent

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

PostMortemAgent auto-drafts a post-mortem when an incident resolves.

func NewPostMortemAgent

func NewPostMortemAgent(deps PostMortemAgentDeps) *PostMortemAgent

NewPostMortemAgent creates a PostMortemAgent. WaitDuration == 0 means skip the wait entirely (test/no-wait mode). Production code passes DefaultWaitDuration explicitly.

func (*PostMortemAgent) Handle

func (a *PostMortemAgent) Handle(ctx context.Context, incidentID uuid.UUID)

Handle is called by the AICoordinator when an incident resolves.

type PostMortemAgentDeps

type PostMortemAgentDeps struct {
	AgentUserID  uuid.UUID
	AISvc        interface{ IsEnabled() bool }
	IncidentRepo interface {
		GetByID(uuid.UUID) (*models.Incident, error)
	}
	PostMortemSvc interface {
		GetPostMortem(uuid.UUID) (*models.PostMortem, error)
		GeneratePostMortem(*models.Incident, *uuid.UUID, string) (*models.PostMortem, error)
	}
	TimelineRepo repository.TimelineRepository // nil in tests
	SlackSvc     services.ChatService          // nil if not configured
	TeamsSvc     interface {
		PostToConversation(conversationID string, msg services.Message) (string, error)
	}
	MultiChat    services.ChatService      // for DM to commander; nil if not configured
	UserRepo     repository.UserRepository // for commander lookup; nil in tests
	FrontendURL  string
	WaitDuration time.Duration
}

PostMortemAgentDeps holds all dependencies for the Post-Mortem Agent. WaitDuration is configurable so tests can set it to 0 (skip the wait). Production callers pass DefaultWaitDuration explicitly.

Jump to

Keyboard shortcuts

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