alerts

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Jul 18, 2026 License: AGPL-3.0 Imports: 7 Imported by: 0

Documentation

Overview

Package alerts provides a global pub/sub bus for agent-generated alerts and persists them to disk for reconnection replay.

Index

Constants

This section is empty.

Variables

View Source
var Global = newBus()

Functions

func Publish

func Publish(agentID, workspace, message, sessionID string)

Publish is a package-level convenience wrapper around Global.Publish.

Types

type Alert

type Alert struct {
	ID        string `json:"id"`
	AgentID   string `json:"agentId"`
	Workspace string `json:"workspace"`
	Message   string `json:"message"`
	SessionID string `json:"sessionId"`
	Offset    int64  `json:"_off,omitempty"`
	Timestamp string `json:"timestamp"`
}

Alert is emitted when an agent calls the send_alert tool.

func Tail

func Tail(fromOffset int64) ([]Alert, int64)

Tail reads alerts from the file starting at fromOffset. Returns (alerts, endOffset).

Jump to

Keyboard shortcuts

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