monitor

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Apr 10, 2026 License: MIT Imports: 11 Imported by: 0

Documentation

Overview

Package monitor watches URLs for meaningful content changes and alerts the user when something important changes. Supports configurable check intervals and noise filtering to reduce false positives.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Module

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

Module implements the monitoring module.

func New

func New(cfg *config.Config, mem *memory.Store, ag *agent.Agent) *Module

New creates and initialises a monitor module, registering its tools with the agent.

func (*Module) Description

func (m *Module) Description() string

func (*Module) Init

func (m *Module) Init(cfg map[string]any, mem *memory.Store) error

func (*Module) Name

func (m *Module) Name() string

func (*Module) ScheduledTasks

func (m *Module) ScheduledTasks() []ScheduledTask

func (*Module) Tools

func (m *Module) Tools() []agent.Tool

type ScheduledTask

type ScheduledTask struct {
	Name string
	Cron string
	Task func(ctx context.Context, a *agent.Agent) error
}

ScheduledTask matches the interface expected by the module system.

type Snapshot

type Snapshot struct {
	Hash    string `json:"hash"`
	Content string `json:"content"`
	FetchAt string `json:"fetch_at"`
}

Snapshot stores the content hash and raw text of the last fetch.

type Watcher

type Watcher struct {
	Name      string `json:"name"`
	URL       string `json:"url"`
	Selector  string `json:"selector,omitempty"`
	Interval  string `json:"interval"`
	LastCheck string `json:"last_check,omitempty"`
	Status    string `json:"status,omitempty"`
}

Watcher describes a single URL to monitor for changes.

Jump to

Keyboard shortcuts

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