Expand description
Best-effort per-turn completion notifier.
Fires after each agent turn completes via two independent channels:
- macOS native —
osascriptbanner via stdin (no argument-injection risk) - ntfy webhook — JSON POST to an ntfy-compatible endpoint
All notifications are fire-and-forget: failures are logged at warn level and
never propagated to the caller. Secrets are redacted before any payload leaves
the process.
§Gating
Notifier::should_fire applies all gate conditions in order:
- Master
enabledswitch must betrue llm_requests == 0→ skip (slash commands, cache-only, security-blocked turns)only_on_error && !is_error→ skip- Duration gate (
min_turn_duration_ms) applies only to successful turns; error turns always fire regardless of duration
§Examples
use zeph_core::notifications::{Notifier, TurnSummary, TurnExitStatus};
use zeph_config::NotificationsConfig;
let cfg = NotificationsConfig {
enabled: true,
macos_native: true,
..Default::default()
};
let notifier = Notifier::new(cfg);
let summary = TurnSummary {
duration_ms: 5000,
preview: "Done. Files updated.".to_owned(),
tool_calls: 2,
llm_requests: 1,
exit_status: TurnExitStatus::Success,
};
// Fire and forget — errors are logged, never propagated.
notifier.fire(&summary);Structs§
- Notifier
- Per-turn completion notifier.
- Turn
Summary - Lightweight summary of a completed agent turn used as notification input.
Enums§
- Notify
Test Error - Error returned by
Notifier::fire_test. - Turn
Exit Status - Whether a turn completed successfully or with an error.
Functions§
- sanitize_
applescript_ payload - Sanitize a string for safe inclusion inside an
AppleScript"..."literal.