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:
javis-bot
2026-11-14 16:27:42 +09:00
parent 3d75d74f92
commit ea2d3ba958
32 changed files with 1568 additions and 59 deletions

View File

@@ -0,0 +1,49 @@
# schedule tool spec (v2)
Reminders, timers and scheduled tasks of the person asking. Product rules: `docs/v2/proactive.md`
(제안 1). The app keeps the schedules, fires them and delivers them (`app/src/admin.spec.md`,
"Schedules"); this tool only asks it to add, list or delete.
## Principles
- **Only in v2, only the asker's own.** The tool exists for a turn only when the v2 voice worker's
brain put a schedule backend in the turn state (`turn_state.set_schedule`). Without one (v1, evals
without a backend, and scheduled tasks themselves) it is not offered and refuses. The backend acts
for the person asking only: they list and delete only what they scheduled themselves.
- **Never claimed without the tool.** The description tells the model to call it for reminders,
timers, alarms and things to check at a time or regularly, and never to say something was
scheduled unless the tool said so (the "5분 타이머" confabulation, `docs/v2/decisions.md`).
- **Tasks only look things up.** A `task` runs at its time with nobody there to ask, so it gets the
read-only tools only (voice worker `TASK_TOOLS`: weather, web search, reading a page, the asker's
meals, the tool search) and no MCP tools. It cannot send, delete, schedule or operate anything.
- **Raw data.** The tool returns plain text for the reply model; no LLM call inside.
## Schema
| action | needs | does |
|---|---|---|
| `add` | `text`, `at` or `in_minutes` (`kind`, `repeat`) | schedules it; returns its id, kind, next time and repeat |
| `list` | | the asker's schedules, soonest first |
| `delete` | `id` | deletes one of the asker's schedules |
- `kind`: `remind` (default) tells `text` at the time; `task` does `text` at the time and tells the
result.
- `at`: local time of this PC, `YYYY-MM-DD HH:MM` (a `T` between and seconds are accepted).
`in_minutes`: minutes from now (above 0), used instead of `at` when given; it spares the model
the arithmetic for timers.
- `repeat`: `none` (default), `daily`, `weekdays` (Monday to Friday), `weekly` (the weekday of `at`).
A time that has passed is refused unless it repeats (the app then takes the next one).
- `text`: whitespace collapsed, 1-500 characters.
- `action`, `kind` and `repeat` are read as their first known word, so planner forms like
`add_reminder` work. A refused add never reaches the app.
- Lines: `- id <id>: <kind> at YYYY-MM-DD HH:MM (<weekday>)[, repeats <repeat>]: <text>`.
## Backend
`turn_state.get_schedule()` returns an object with `act(action, **fields) -> dict` (add: `kind`,
`text`, `at`, `repeat`; delete: `schedule`, the schedule's id): `{"ok": true,
"item": {...}}` for add and delete, `{"ok": true, "items": [...]}` for list, `{"ok": false, "error":
"..."}` on failure. Items carry `id`, `kind`, `text`, `next` (Unix time) and `repeat`. The voice
worker implements it (`voice_worker/schedule_bridge.py`): each action goes to the app as
`schedule_action` with the asker and where they asked (voice_worker.spec.md, "Schedules").
Failures come back as `Error: ...` text with `success=False`.