feat(hn-monitor): unify Slack + Telegram into single dual-transport agent
Merged
KH
4mo ago+635+635+012345678901234567890123456789-241-241-012345678901234567890123456789
Summary
Replaces the separate hn-monitor and hn-monitor-telegram directories with a single agent that delivers to Slack, Telegram, or both — configuration-driven via SLACK_CHANNEL and TELEGRAM_CHAT inputs (both optional).
Depends on workforce#250 for the @agentworkforce/delivery package.
Changes
- Single agent.ts — imports
createDeliveryfrom@agentworkforce/delivery, auto-detects configured transports - Non-blocking parentRef threading — header published with 0ms timeout, body threaded via parentRef (x-reply-radar pattern)
- Backported Telegram improvements:
fetchWithTimeout(8s AbortController),withTimeoutfor LLM, pending thread body recovery - Shared helpers (
input,list,withTimeout,fetchWithTimeout) now imported from@agentworkforce/delivery - Persona declares both
slackandtelegramintegrations, both inputsoptional: true
What this enables
Once @agentworkforce/delivery is published, the same unification pattern can be applied to the remaining 3 paired agents (inbox-buddy, joke-bot, spotify-releases).
Summary by cubic
Unifies hn-monitor into one agent that sends Hacker News digests to Slack, Telegram, or both using the published @agentworkforce/delivery. Adds non‑blocking header publish, transport‑scoped Q&A (relay and Telegram), and reliable recovery for threaded posts.
-
New Features
- Single dual-transport
agent.tsusingcreateDeliveryfrom@agentworkforce/delivery; auto-detectsSLACK_CHANNEL/TELEGRAM_CHAT. - Posts digests to Slack and/or Telegram; Q&A via Telegram and relay; replies scoped to the origin transport.
- Non-blocking header publish with threaded body via parentRef/
replyTo; bounded timeouts for HN fetch (8s) and LLM.
- Single dual-transport
-
Bug Fixes
- Scoped Q&A replies to the origin using
createDelivery(onlyTargets)to prevent cross‑post leakage. - Built and persisted pending thread bodies before send; retry now checks all target refs and clears stale records if targets change. Added recovery tests and exported
retryPendingThreadBody.
- Scoped Q&A replies to the origin using