Skip to content

feat: push notifications for Bots (notify_user) - #842

Draft
dingchenhui0618-arch wants to merge 1 commit into
Fei2411:devfrom
dingchenhui0618-arch:feat/notify-user
Draft

dingchenhui0618-arch wants to merge 1 commit into
Fei2411:devfrom
dingchenhui0618-arch:feat/notify-user

Conversation

@dingchenhui0618-arch

Copy link
Copy Markdown

What this changes

Adds an outbound push channel: the
otify_user tool lets a Bot send one short message to the user's phone (Bark, ntfy, ServerChan or a webhook).

A scheduled task, or a long job, can end while the page is closed. Today the result only waits in the chat, and the user learns about it when they next open the app. With this tool a Bot can say it is done.

Channels are read from <DSH_HOME>/bot/notify.json ({channels: [{kind: ntfy, topic: ...}]}), else from BARK_URL, NTFY_TOPIC (+ NTFY_SERVER), SERVERCHAN_KEY, PUSH_WEBHOOK. Those are the four names the dsh-chat bridge already uses, so one set of credentials serves both.

Notes

  • Plain text only; the phone does not render Markdown.
  • A channel that fails names itself in the tool result instead of hiding the others' success.
  • ntfy uses the JSON publish endpoint, because a non-ASCII title cannot go in an HTTP header.
  • Web search, secrets and the browser bridge are untouched.

Changelog

Bots can push a short message to the user's phone with
otify_user, so a scheduled task that ends while the page is closed still reaches them.

Related

Part of the gap in #314 (a decision request sits unseen in the chat stream): this gives Bots a way out to the user. It does not change �sk_user itself.

A scheduled task or a long job ends while the page is closed, so the result
waits unseen in the chat. notify_user sends the outcome to the user's phone
through Bark, ntfy, ServerChan or a webhook.

Channels come from <DSH_HOME>/bot/notify.json, else from BARK_URL, NTFY_TOPIC,
SERVERCHAN_KEY and PUSH_WEBHOOK: the same four names the dsh-chat bridge uses,
so one set of credentials serves both.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant