feat: news notifications for the background collection and a collectedNews tool

Each collection target can announce new items at once or in a daily digest
(off by default) in collect.notifyChannel, as titles and links only, with no
LLM; each post is recorded in the activity log. The brain gets a read-only
collectedNews tool (every target's newest items by default, fenced as
untrusted web content), offered with the app's collection file and the
collection feature, and available to scheduled tasks.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
javis-bot
2026-11-14 17:22:54 +09:00
parent a5bd25b86f
commit 324fd2ea0a
21 changed files with 653 additions and 28 deletions

View File

@@ -157,7 +157,7 @@ MCP_ENV_VAR = "JARVIS_MCP_ENV"
V2_HOST_TOOLS = ("localFiles", "screenshot")
# The only tools a scheduled task may use: it runs with nobody there to ask, so it only looks
# things up (schedule.spec.md, "Tasks"). No MCP tools either: what they do is not known.
TASK_TOOLS = ("getWeather", "webSearch", "fetchWebPage", "fetchMeals", "toolSearchTool")
TASK_TOOLS = ("getWeather", "webSearch", "fetchWebPage", "fetchMeals", "collectedNews", "toolSearchTool")
def take_mcp_env() -> dict:

View File

@@ -392,7 +392,10 @@ still deleted (below).
failure. Characters outside ASCII (and spaces) in the path and words go as UTF-8 `%HH`; existing
`%HH` and separators stay. The check logs nothing about the address. The collected text is web
content: it goes only to `<dir>/<name>/<YYYY-MM-DD>.jsonl` (one JSON object per line: `at`, then
`title`, `url`, `text` as the kind has them), never to the brain or a log.
`title`, `url`, `text` as the kind has them), never to a log. The collector itself never hands it
to the brain; the brain reads it only through its `collectedNews` tool, fenced as untrusted web
content (`src/jarvis/tools/builtin/collected_news.spec.md`), and the app announces new titles and
links when asked to (`app/src/admin.spec.md`, "News notifications").
- Day files older than `keepDays` are deleted in every folder of `dir` at each check, also of
targets no longer listed.
- Each run is a `notice` line (category `voice_worker`): the target's name and how many new items, or