core/config: add the [notify] section

`[notify]` decides what the CLI does when a prompt is waiting on the human:
`grace_seconds` (default 5s, roughly Claude Code's permission notice) before
anything is shown, `min_interval_seconds` between two notifications,
`channels` (`auto` = desktop then terminal), `actions` for the allow/deny/review
buttons, `include_reason` for the one-line reason, and `protocol` to pin the
terminal escape protocol.

The reason stays out by default because it names commands, argv and URLs, and a
notification outlives the prompt and may be mirrored to a lock screen. Unknown
keys degrade to the defaults, the way `[mcp]` does, and `reload()` re-reads the
section.

Desktop notifications need the optional `notify` extra (`desktop-notifier`),
which is the only new dependency and stays off the default install.
This commit is contained in:
2026-10-21 19:53:19 +08:00
parent 557300ff4f
commit 10402f5be6
5 changed files with 139 additions and 0 deletions
+4
View File
@@ -22,6 +22,10 @@ requires-python = ">=3.14,<4"
readme = "README.md"
license = { text = "MIT" }
[project.optional-dependencies]
# Desktop notifications while a prompt waits on the human (see `[notify]`).
notify = ["desktop-notifier>=6.2.0"]
[project.scripts]
plyngent = "plyngent.cli:main"