feat(app): an activity log of what Jarvis did (chat actions, schedule deliveries)

Each chat channel action the brain's tool asked for and each schedule
delivery is recorded in activity/<day>.jsonl by kind, target, who asked and
outcome, never its text, kept 30 days. The worker's chat_action carries the
asker. A 한 일 screen lists the newest entries.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
javis-bot
2026-11-14 16:51:18 +09:00
parent e8db417752
commit 04b603facd
17 changed files with 282 additions and 17 deletions

View File

@@ -350,6 +350,30 @@ async function permissionsCard() {
h("div", { class: "hint" }, "채팅 채널 권한은 \"채팅 채널\" 화면에서 바꿉니다."));
}
const ACTIVITY = { "chat.send": "채팅 보내기", "chat.edit": "채팅 고치기", "chat.react": "반응 달기",
"chat.delete": "채팅 지우기", "chat.pin": "고정", "chat.unpin": "고정 풀기",
"schedule.remind": "예약 알림 전달", "schedule.task": "정기 작업 전달" };
/** What Jarvis did outside its answers (admin.spec.md, "Activity"): kind, target, who asked, outcome. */
function activityScreen() {
const list = h("div");
const load = async () => {
try {
const { items } = await api("activity_list", { limit: 200 });
list.replaceChildren(items.length ? h("table", {}, h("tbody", {}, items.map((e) => h("tr", {},
h("td", { class: "small muted" }, (e.at || "").replace("T", " ").slice(0, 19)),
h("td", {}, ACTIVITY[e.kind] || e.kind),
h("td", { class: "small" }, e.target),
h("td", { class: "small" }, e.by || ""),
h("td", { class: "small" }, e.ok ? "됨" : "실패" + (e.note ? ` (${e.note})` : ""))))))
: h("div", { class: "muted" }, "아직 기록이 없습니다."));
} catch (err) { fail(err); }
};
load();
return h("div", {}, h("h1", {}, "한 일"), h("div", { class: "card" },
h("div", { class: "hint" }, "자비스가 채팅 채널에서 한 동작과 예약 전달을 종류, 대상, 시킨 사람, 결과만 남깁니다. 내용은 남기지 않고 30일 뒤 지웁니다."),
h("div", { class: "field" }, h("button", { class: "btn", onclick: load }, "새로 고침")), list));
}
async function settingsScreen(screen, title, extra) {
const [all, view] = await Promise.all([fields(), api("settings_view")]);
const list = all.filter((f) => f.screen === screen);
@@ -666,6 +690,7 @@ async function show(name) {
try {
if (name === "dashboard") { screen.replaceChildren(); await refresh(); ticker = setInterval(refresh, 1000); return; }
if (name === "logs") { const l = logsScreen(); screen.replaceChildren(l.view); ticker = setInterval(l.tick, 1000); return; }
if (name === "activity") { screen.replaceChildren(activityScreen()); return; }
if (name === "update") { const u = updateScreen(); screen.replaceChildren(u.view); ticker = setInterval(u.tick, 1000); return; }
const titles = { bot: "봇", channels: "채널·호출", chat: "채팅 채널", memory: "대화 기억", model: "모델", features: "기능",
collect: "백그라운드 수집", game: "게임 모드", schedule: "예약", pcControl: "PC 제어" };