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

@@ -250,6 +250,7 @@ function mcpServersEditor(f, value) {
// The background collection targets: one row each (admin.spec.md, "Background collection").
const KIND = { site: "사이트", search: "검색어", rss: "RSS" };
const NOTIFY = { off: "알리지 않음", now: "바로", daily: "하루 요약" };
function collectTargetsEditor(f, value) {
const body = h("tbody");
const addRow = (t = {}) => {
@@ -261,11 +262,13 @@ function collectTargetsEditor(f, value) {
hint();
const on = h("input", { type: "checkbox", "data-k": "enabled" });
on.checked = t.enabled ?? true;
const notify = h("select", { "data-k": "notify" }, Object.entries(NOTIFY).map(([k, label]) =>
h("option", { value: k, selected: (t.notify ?? "off") === k }, label)));
const tr = h("tr", {},
h("td", {}, h("input", { type: "text", value: t.name ?? "", placeholder: "이름 (글자, 숫자, - _)", "data-k": "name" })),
h("td", {}, kind), h("td", {}, val),
h("td", {}, h("input", { type: "number", min: 15, max: 10080, value: t.everyMinutes ?? 60, "data-k": "everyMinutes" })),
h("td", {}, on),
h("td", {}, on), h("td", {}, notify),
h("td", {}, h("button", { class: "btn", onclick: () => tr.remove() }, "삭제")));
body.append(tr);
};
@@ -275,9 +278,9 @@ function collectTargetsEditor(f, value) {
const every = Number(k("everyMinutes").value);
if (!Number.isInteger(every)) throw new Error(`${f.label}: 주기는 분 단위 정수`);
return { name: k("name").value.trim(), kind: k("kind").value, value: k("value").value.trim(),
everyMinutes: every, enabled: k("enabled").checked };
everyMinutes: every, enabled: k("enabled").checked, notify: k("notify").value };
});
const table = h("table", {}, h("thead", {}, h("tr", {}, ["이름", "종류", "주소 또는 검색어", "주기(분)", "켜기", ""]
const table = h("table", {}, h("thead", {}, h("tr", {}, ["이름", "종류", "주소 또는 검색어", "주기(분)", "켜기", "새 글 알림", ""]
.map((x) => h("th", {}, x)))), body);
return { el: h("div", {}, h("div", { class: "hint" }, "기본 수집 대상은 없습니다. 모은 내용은 데이터 폴더의 collect 폴더에만 저장됩니다."),
table, h("button", { class: "btn", onclick: () => addRow() }, "대상 추가")), read, wide: true };
@@ -377,7 +380,7 @@ function notesScreen() {
const ACTIVITY = { "chat.send": "채팅 보내기", "chat.edit": "채팅 고치기", "chat.react": "반응 달기",
"chat.delete": "채팅 지우기", "chat.pin": "고정", "chat.unpin": "고정 풀기",
"schedule.remind": "예약 알림 전달", "schedule.task": "정기 작업 전달" };
"schedule.remind": "예약 알림 전달", "schedule.task": "정기 작업 전달", "collect.notify": "수집 소식 알림" };
/** What Jarvis did outside its answers (admin.spec.md, "Activity"): kind, target, who asked, outcome. */
function activityScreen() {
const list = h("div");