Repository navigation
Auto-focus (timed + calls), config.env hardening, CI/tests, focus-mute bugfix - #1
Merged
Merged
Conversation
The chat webhook is a 'whoever-has-it-can-post' secret; settings.json is easy to sync/share/screenshot. The hook now sources ~/.config/agent-notify/config.env (a mode-600 shell file) for AGENT_NOTIFY_* vars. Adds config.env.example, installer seeding, gitignore, and doc guidance to rotate exposed webhooks.
New muted_until epoch in state forces speech off until it passes, independent of the manual enabled flag. CLI: `agent-notify off 30m|1h|90s`; status shows the countdown. Menu bar: 'Focus for…' submenu (15/30/60 min) + Cancel timer, live countdown in the Focus item, icon self-restores on expiry. Hook honors the window.
The menu-bar app detects the default input device running (CoreAudio via ctypes, no extra deps) and writes a freshness-stamped sentinel; the hook suppresses speech while it's fresh (<60s), so a dead app never leaves you stuck muted. Toggle with the 'Auto-mute in calls' menu item or `agent-notify autocall on|off` (default on). DND detection omitted — not reliably readable on macOS 26+.
Fix: the hook read booleans with `.key // empty`, but jq's // treats false as empty — so enabled/banner/chat/japanese=false were silently dropped and focus mode never actually muted. Now read via has()+tostring. Caught by the new tests. Also: extract the settings.json register/unregister jq into lib/register.sh (shared by install/uninstall/tests), add tests/run.sh (CLI + hook gating via AGENT_NOTIFY_DRY + register idempotency), a GitHub Actions workflow (shellcheck + py_compile on Linux, smoke tests on macOS), a CI badge, and a Development section.
An older state.json (predating muted_until/auto_call) made `get`/status report a missing key as its falsy value (e.g. 'auto-call: off' when the effective default is on). ensure() now merges defaults into an existing file (existing values win), rewriting only when something was missing.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Three improvements plus a bug fix found by the new tests.
Auto-focus (serves the "meeting / music" use case)
agent-notify off 30m(also1h/90s) mutes then auto-unmutes; menu bar has a Focus for… submenu (15/30/60 min) with a live countdown; the icon self-restores on expiry. Newmuted_untilepoch in state.autocall on|off/ menu item (default on). DND omitted — not reliably readable on macOS 26+.Hardening
settings.json— the hook now sources~/.config/agent-notify/config.env(mode 600) forAGENT_NOTIFY_*vars, the right home for the chat webhook. Addsconfig.env.example, installer seeding, and rotation guidance.tests/run.sh(CLI, hook mute-gating via newAGENT_NOTIFY_DRY=1, and the register/unregister jq filters, now shared inlib/register.sh). GitHub Actions: shellcheck +py_compileon Linux, smoke tests on macOS.Bug fix (caught by the new tests)
The hook read booleans with
.key // empty, but jq's//treatsfalseas empty — soenabled/banner/chat/japanese: falsewere silently dropped and focus mode wasn't actually muting. Now read viahas()+tostring.Test plan
bash tests/run.sh— all pass (CLI, hook gating incl. focus/timed/call, register idempotency).shellcheck --severity=warningclean;install.sh --dry-runverified.