notify

package
v0.314.1 Latest Latest
Warning

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

Go to latest
Published: May 22, 2026 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Error

func Error(source Source, msg string)

Error publishes a permanent error notification (TTL=0, dismissed manually).

func Info

func Info(source Source, msg string, ttl time.Duration)

Info publishes an informational notification with a TTL after which it can be automatically dismissed.

func Subscribe

func Subscribe(ctx context.Context) <-chan pubsub.Event[Notification]

Subscribe returns a channel that receives Notification events while ctx is live.

func Warn

func Warn(source Source, msg string, ttl time.Duration)

Warn publishes a warning notification with a TTL.

Types

type Level

type Level string

Level represents the severity of a notification.

const (
	LevelInfo  Level = "info"
	LevelWarn  Level = "warn"
	LevelError Level = "error"
)

type Notification

type Notification struct {
	ID      string        `json:"id"`
	Time    time.Time     `json:"time"`
	Level   Level         `json:"level"`
	Source  Source        `json:"source"`
	Message string        `json:"message"`
	TTL     time.Duration `json:"ttl,omitempty"` // 0 = permanent until dismissed
}

Notification is a user-facing event (not a debug log) that should be surfaced in the TUI, the Web UI via SSE, and the ACP protocol.

type Source

type Source string

Source identifies the component that emitted the notification.

const (
	SourceLLMProvider Source = "llm_provider"
	SourceTool        Source = "tool"
	SourceLSP         Source = "lsp"
	SourceAgent       Source = "agent"
	SourceSystem      Source = "system"
)

Jump to

Keyboard shortcuts

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