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:
@@ -63,7 +63,8 @@ manages the MCP servers it connects.
|
||||
collection, below; no brain tool) and `browser` (the bot browser, below "Bot browser", and its
|
||||
brain tool `botBrowser`, `src/jarvis/tools/builtin/bot_browser.spec.md`), also on by default;
|
||||
`browserShare` (봇용 크롬창 화면공유 선택 표시, the bot browser on the virtual monitor, below
|
||||
"Virtual monitor"), off by default. The tools of a feature that
|
||||
"Virtual monitor"), off by default; `schedule` (reminders and scheduled tasks, below
|
||||
"Schedules", and the brain tool `schedule`), on by default. The tools of a feature that
|
||||
is off go into the brain's `disabled_tools`: they are neither offered nor run
|
||||
(`voice_worker.spec.md`, "Tools"). The other features of the 기능 screen (PC control, screen
|
||||
viewing) come with their milestone (M7).
|
||||
@@ -103,6 +104,39 @@ sites, search words and RSS feeds on a schedule; there are **no targets by defau
|
||||
first), each item with its `target`; a name that is not a valid target name is refused, so no
|
||||
other folder is read. Lines that do not parse are skipped.
|
||||
|
||||
## Schedules (`app/src/schedule.rs`)
|
||||
|
||||
`docs/v2/proactive.md` (제안 1). People ask Jarvis by voice or chat to remind them, set a timer or
|
||||
check something at a time or regularly; the brain's `schedule` tool
|
||||
(`src/jarvis/tools/builtin/schedule.spec.md`) asks the app, which keeps, fires and delivers them.
|
||||
|
||||
- **Store**: `config/schedules.json` in the data folder, `{nextId, items}`; each item `{id, user,
|
||||
name, kind, text, repeat, next, via, channel, created, last}`. Read and written whole, one change
|
||||
at a time in the process (the services' loop and the screen share it). Text 1-500 characters
|
||||
(whitespace collapsed), `kind` `remind|task`, `repeat` `none|daily|weekdays|weekly`, `via`
|
||||
`voice|chat` (chat needs the channel it was asked in), at most 50 per person. A one-off time that
|
||||
has passed is refused; a repeating one starts at its first time after now (`weekdays` skips
|
||||
Saturday and Sunday, `weekly` keeps the weekday). Repeats keep the local wall time.
|
||||
- **The brain's actions** (`schedule_action`, `voice_worker.spec.md`, "Schedules") are done for the
|
||||
person named in it only: `add` (named as Discord shows them now), `list` (their schedules that
|
||||
still fire, soonest first), `delete` (one of theirs). The answer carries `{id, kind, text, next,
|
||||
repeat}`; a refusal says why. With `features.schedule` off the tool is not offered; schedules
|
||||
already kept still fire and can be deleted on the screen.
|
||||
- **Firing**: while the services run, every 5 s the due ones are taken (a repeating one moves on to
|
||||
its next time at once; a one-off one stops firing). One more than 15 minutes late (the app was
|
||||
off, the PC asleep) is not delivered and is kept as missed. Each delivery runs on its own task.
|
||||
- **Delivery**: a `task` first runs in the brain (`reply` `via: "task"`: read-only tools, its own
|
||||
short-term memory, at most 300 s); no answer is a failure. The text sent is `<name>님, <reminder or
|
||||
answer>`. Asked by voice: spoken when the person is in Jarvis's voice channel, else posted in
|
||||
`schedule.chatChannel`; asked in chat: posted in that channel. Posts ping nobody and need the
|
||||
channel's send switch. A delivered one-off schedule is removed; one that failed, or was missed,
|
||||
stays (not firing again) with its outcome `last: {at, ok, note}` for the screen, and a repeating
|
||||
one keeps its latest outcome.
|
||||
- `schedule.chatChannel` (new section, null by default): a registered chat channel with sending on
|
||||
(anything else is refused), for voice schedules whose person is not in the voice channel. Null:
|
||||
those are not delivered (and the screen says so).
|
||||
- Logs (tab `conversation`): ids, kinds, repeats, channel ids, counts and outcomes, never the text.
|
||||
|
||||
## Secrets (`app/src/secrets.rs`)
|
||||
|
||||
`config/secrets.dat` holds a JSON object of named secrets (`discordToken`, the MCP servers'
|
||||
@@ -120,7 +154,7 @@ headless runs).
|
||||
`debug_log!` and `error_log!` keep printing to stderr and also feed the log hub once the app
|
||||
installs one (`logs::install`). Each line has a time, a level (`error`, `warn`, `info`, `debug`), a
|
||||
service tab and its text. The tab comes from the line's category: `app`, `discord` (`voice`,
|
||||
`receive`, `play`, `discord`), `chat`, `conversation`, `worker` (the voice worker's own lines; its
|
||||
`receive`, `play`, `discord`), `chat`, `conversation` (also `schedule`), `worker` (the voice worker's own lines; its
|
||||
STT, LLM and TTS lines go to `stt`, `llm`, `tts` by their worker category), `browser`, `capture`,
|
||||
`game` (the last three from M6-M7). Unknown categories go to `app`.
|
||||
|
||||
@@ -496,6 +530,7 @@ back as Korean messages for the screen. The Tauri shell passes the screens' `inv
|
||||
| `settings_fields` / `settings_view` / `settings_apply` `{changes}` | the settings editor above; `restartNeeded` when the services run; `sync` with the chat channels sent to Discord (below) |
|
||||
| `service_start` / `service_stop` / `service_restart` / `dashboard` | the controller and its snapshot; start and restart run in the background, stop also cancels a start |
|
||||
| `discord_channel_info` `{id}` / `channel_sync_status` | a channel's Discord name and topic / each synced chat channel's last result (above) |
|
||||
| `schedules_list` / `schedule_delete` `{id}` | every person's schedules (above), soonest first, with IDs as strings / delete one |
|
||||
| `collect_results` `{target, limit}` | `{targets, items}`: every target folder with results, and the collected items newest first (`target` null: every target; `limit` 1-500, default 100) |
|
||||
| `mcp_env_status` / `mcp_env_set` `{server, name, value}` | which MCP environment values are stored (`{server: {NAME: bool}}`, never the values) / store one (an empty value removes it); only for a saved server and name |
|
||||
| `display_driver_status` / `display_driver_install` / `display_driver_uninstall` | the virtual monitor's driver: `{supported, installed, leftover, other, action}` (Windows only, above) / install or remove it elevated (above), then its status; refused unless the services are stopped or failed, and `service_start` / `service_restart` are refused meanwhile |
|
||||
@@ -524,7 +559,7 @@ Plain HTML, CSS and an ES module, no build step, dark theme after `DESIGN.md`. A
|
||||
Strata's last line, and stop in the header; the header with start, restart and stop is rebuilt
|
||||
only when the state changes, so a click is never lost to the refresh. Every screen change starts
|
||||
a new generation: an answer that arrives after the user moved to another screen is dropped.
|
||||
- **Settings screens** (봇, 채널·호출, 채팅 채널, 대화 기억, 모델, 기능, 백그라운드 수집, 게임 모드): built from `settings_fields`; only
|
||||
- **Settings screens** (봇, 채널·호출, 채팅 채널, 대화 기억, 모델, 기능, 백그라운드 수집, 예약, 게임 모드): built from `settings_fields`; only
|
||||
changed fields are sent; the server and voice channel are pickers (choosing another server clears
|
||||
the voice channel and lists only that server's channels); the chat channels are a table
|
||||
with their switches; the bot screen also changes the token; the 기능 screen has the feature
|
||||
@@ -534,7 +569,9 @@ Plain HTML, CSS and an ES module, no build step, dark theme after `DESIGN.md`. A
|
||||
state and the button its `action` names, so a leftover can always be removed). The 백그라운드 수집 screen has the targets (a table: name, kind,
|
||||
address or words, interval in minutes, on/off, delete), the keep days, and the results (the
|
||||
newest 100, filtered by any target that has results, each with its time, title, link and the start of its text shown
|
||||
as plain text).
|
||||
as plain text). The 예약 screen has `schedule.chatChannel` and every person's schedules (next time
|
||||
or "다시 울리지 않음", repeat, who and how they asked, kind and text as plain text, the last
|
||||
outcome, delete).
|
||||
- **업데이트**: the version here, the state, "다시 확인", "받기" (with its percentage) and "설치하고
|
||||
다시 시작", and the release's notes as plain text. The app checks once when the main screens open;
|
||||
a newer release renames the button "업데이트 (새 버전)" and says so once.
|
||||
|
||||
Reference in New Issue
Block a user