notification

package
v0.4.0 Latest Latest
Warning

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

Go to latest
Published: Mar 10, 2026 License: MIT Imports: 4 Imported by: 0

Documentation

Overview

Package notification provides lightweight team context change detection.

Design: CLI checks file mtimes directly. Git updates mtime when it writes files during pull, so no daemon-side touching is needed.

Cost: ~1μs per file (stat only). Safe to call on every command.

Index

Constants

View Source
const ClockSkewTolerance = 5 * time.Second

ClockSkewTolerance is the tolerance for clock skew between daemon and CLI. Files with mtime within this window of lastNotified are considered changed.

Variables

View Source
var TeamContextFiles = []string{
	"AGENTS.md",
	"CLAUDE.md",
	"agent-context/distilled-discussions.md",
	"coworkers/AGENTS.md",
	"coworkers/CLAUDE.md",
}

TeamContextFiles lists files agents should re-read when updated. Paths are relative to team context root.

TODO: revisit whether manually listing files is the right long-term approach. This works for now with a small set of known files, but may not scale as team context structure evolves. Consider glob patterns or directory watches.

Functions

func CheckForUpdates

func CheckForUpdates(teamContextPath string, lastNotified time.Time) (time.Time, []string)

CheckForUpdates checks if any team context files have been modified.

Returns: - latestMtime: the most recent mtime across all files (for updating session marker) - updatedFiles: full paths to files newer than lastNotified (for agent to re-read)

Cost: ~1μs per file (stat only, no disk reads). Safe to call on every command.

On first run (lastNotified.IsZero()), returns no updated files to avoid notification spam. The latestMtime is still returned for initialization.

Types

This section is empty.

Jump to

Keyboard shortcuts

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