feat: reminders and scheduled tasks (schedule tool, app store and delivery)
The brain gets a schedule tool (add, list, delete the asker's own reminders, timers and tasks) offered only with a schedule backend. The voice worker asks the app through schedule_action and runs fired tasks as reply via task with read-only tools, no MCP and a fresh short-term memory. The app keeps the schedules in config/schedules.json, fires them every 5 s, speaks them when the person is in Jarvis's voice channel and otherwise posts in the chat channel they asked in (or schedule.chatChannel for voice). A feature switch and a 예약 screen list and delete everyone's schedules. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -306,6 +306,32 @@ async function collectResults() {
|
||||
h("div", { class: "field" }, h("label", {}, "대상"), pick, h("button", { class: "btn", onclick: load }, "새로 고침")), list);
|
||||
}
|
||||
|
||||
const SCHEDULE_KIND = { remind: "알림", task: "작업" };
|
||||
const REPEAT = { none: "한 번", daily: "매일", weekdays: "평일", weekly: "매주" };
|
||||
/** Everyone's reminders and scheduled tasks (admin.spec.md, "Schedules"); the text is shown as plain text. */
|
||||
async function scheduleList() {
|
||||
const list = h("div");
|
||||
const when = (t) => t == null ? "다시 울리지 않음" : new Date(t * 1000).toLocaleString("ko-KR",
|
||||
{ month: "numeric", day: "numeric", weekday: "short", hour: "2-digit", minute: "2-digit" });
|
||||
const load = async () => {
|
||||
try {
|
||||
const { items } = await api("schedules_list");
|
||||
list.replaceChildren(items.length ? h("table", {}, h("tbody", {}, items.map((i) => h("tr", {},
|
||||
h("td", { class: "small" }, when(i.next), h("div", { class: "small muted" }, REPEAT[i.repeat] || i.repeat)),
|
||||
h("td", { class: "small" }, i.name, h("div", { class: "small muted" }, i.via === "chat" ? "채팅으로 맡김" : "음성으로 맡김")),
|
||||
h("td", {}, h("div", {}, (SCHEDULE_KIND[i.kind] || i.kind) + ": " + i.text),
|
||||
i.last ? h("div", { class: "small muted" }, i.last.ok ? "지난번: 전함" : "지난번: 전하지 못함" + (i.last.note ? ` (${i.last.note})` : "")) : null),
|
||||
h("td", {}, h("button", { class: "btn", onclick: async () => {
|
||||
try { await api("schedule_delete", { id: i.id }); toast("지웠습니다"); load(); } catch (e) { fail(e); }
|
||||
} }, "삭제")))))) : h("div", { class: "muted" }, "예약이 없습니다. 음성이나 채팅으로 \"내일 7시에 회의 알려 줘\"처럼 맡기면 여기에 나옵니다."));
|
||||
} catch (e) { fail(e); }
|
||||
};
|
||||
load();
|
||||
return h("div", { class: "card" }, h("h2", {}, "예약 목록"),
|
||||
h("div", { class: "hint" }, "정기 작업은 날씨, 웹 검색처럼 찾아보는 기능만 씁니다. 보내기, 지우기, PC 조작은 하지 않습니다."),
|
||||
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);
|
||||
@@ -624,10 +650,11 @@ async function show(name) {
|
||||
if (name === "logs") { const l = logsScreen(); screen.replaceChildren(l.view); ticker = setInterval(l.tick, 1000); 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: "게임 모드" };
|
||||
collect: "백그라운드 수집", game: "게임 모드", schedule: "예약" };
|
||||
const extra = name === "bot" ? await tokenCard() : name === "features" ? await displayDriverCard() : null;
|
||||
const view = await settingsScreen(name, titles[name], extra);
|
||||
if (name === "collect") view.append(await collectResults());
|
||||
if (name === "schedule") view.append(await scheduleList());
|
||||
if (my === gen) screen.replaceChildren(view);
|
||||
} catch (e) { fail(e); }
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user