Documentation
¶
Overview ¶
Package notify sends best-effort desktop/terminal notifications to external tools. Currently it integrates with cmux (manaflow-ai/cmux), a macOS terminal app that surfaces notifications for AI coding agents, mirroring how Claude Code's hooks forward alerts into cmux.
Index ¶
Constants ¶
const ( FormatNtfy = "ntfy" FormatSlack = "slack" FormatDiscord = "discord" )
Webhook formats.
Variables ¶
This section is empty.
Functions ¶
func CMuxAvailable ¶
func CMuxAvailable() bool
CMuxAvailable reports whether a cmux instance is reachable. cmux is macOS-only, so this is always false on other platforms.
func Host ¶ added in v0.7.0
Host returns only the host of a webhook URL, for messages: the rest of the URL may hold a secret token. "" when the URL is empty, "invalid URL" when it cannot be used.
func Send ¶ added in v0.7.0
func Send(cfg config.NotifyConfig, n Note)
Send delivers n through the default sender. It never blocks on the network and never fails: every channel is best-effort. It does nothing under "go test", so tests never ring the bell of the developer's terminal.
Types ¶
type Deps ¶ added in v0.7.0
type Deps struct {
CMux func(title, subtitle, body string)
Exec func(ctx context.Context, name string, args ...string) error
LookPath func(name string) (string, error)
HTTP Doer
OpenTTY func() (io.WriteCloser, error)
GOOS string
Getenv func(key string) string
Now func() time.Time
Go func(func()) // runs one channel; tests pass a synchronous runner
}
Deps are the side effects of a Sender. Zero fields get real implementations.
type Level ¶ added in v0.7.0
type Level int
Level says how much a note needs the user. It picks the ntfy priority and tags and the desktop urgency.
type Sender ¶ added in v0.7.0
type Sender struct {
// contains filtered or unexported fields
}
Sender delivers notes to the enabled channels.