A workout check-in agent for Rokid Glasses (AIUI 0.17.0, monochrome green, 480 × 352). Browse the plan by date and tick off each set with a temple tap; weights, reps, and cardio minutes stay on the glasses.
The AIUI project root is the agent/ subdirectory (it contains app.json directly), not the repository root:
Repository: https://github.com/cnYui/doubletraining
Ref: main
AIUI project directory: agent
In Studio, open the New Agent menu at the top left, choose GitHub Import, and enter https://github.com/cnYui/doubletraining/tree/main/agent.
| Page | What it shows | Temple input |
|---|---|---|
pages/dates/index training calendar |
A date wheel: the selected day is enlarged with two days on each side, each showing its focus and progress | Swipe forward = previous day, swipe back = next day, tap = open that day, double tap = exit |
pages/day/index day plan |
Exercises with one box per set, and a summary when everything is done | See below |
pages/build/index manual planner |
Choose the day's body part, pick exercises from that part's list, set sets / reps / weight, save (fixed logic, no voice or model) | See "Planning a day by hand" |
pages/plan/index plan editor |
The day being edited, one row per exercise; changes arrive by voice | Tap or wake word = speak, swipe = move (or change a weight while adjusting), double tap = done |
Day plan states:
| State | Tap | Double tap | Swipe forward / back |
|---|---|---|---|
| Ready (a planned day, nothing logged) | Start training, or Edit plan (opens the planner) | Back to the calendar | Choose Start training / Edit plan |
| Empty or rest day | Open the planner for this day | Back to the calendar | — |
| List | Log one set of the focused exercise at the planned weight and reps and tick its box; after the last set the focus moves to the next open exercise; on a cardio item, mark it done | Back to the calendar | Previous / next exercise |
| Done | Back to the calendar | Back to the calendar | — |
The done state shows sets, volume (Σ weight × reps), time, cardio minutes, and the weight change against the last session with the same focus.
The rest countdown between sets (tap to skip, double tap to undo, swipe to adjust the next set's weight) is still in the code but switched off: REST_TIMER_ENABLED = false in pages/day/index.ink.
Open a day from the calendar. An empty day offers the planner with a tap; a planned day shows its exercises with Start training and Edit plan. Everything is done with the temple touchpad (tap = select, double tap = back, swipe = move or change a value) and the logic is fixed: no voice, no model.
- Body part: swipe through Chest, Back, Legs, Shoulders, Arms, Biceps, Triceps, Glutes, Calves, Abs, Cardio, Rest day; tap to choose. Choosing a different part clears the day's exercises.
- List: the day's exercises,
+ Add exercise,Save. Tap an exercise to edit or remove it. - Add: the built-in library of that body part only (about 200 exercises in
lib/exercises.js; a switch row shows the cardio list on any day). Swipe, tap to tick, thenSave (N). - Set up: each picked exercise in turn: sets, reps (seconds for timed holds), weight. Swipe forward adds, swipe back subtracts, a run of swipes takes bigger weight steps, tap goes to the next field, then Save or Remove. A new exercise starts from its last planned or logged setup, else a library default.
- Train: Save returns to the day; Start training, then tap to tick each set / cardio item as it is done.
A day with logged sets is locked. The state machine is lib/build.js (pure, tested in tests/build.test.js).
Say "edit today's plan" (or "plan Monday") to open the editor, then speak one change at a time:
| Say | What happens |
|---|---|
| "my week is chest, back, rest, legs, shoulders, rest, rest" | Assigns the templates Monday to Sunday (days that are over or have logged sets keep their plan) |
| "set Monday as leg day" / "tomorrow is a rest day" | One day gets a template |
| "add squat, five sets of five at a hundred" | New exercise; without a weight it is added as bodyweight and the editor switches to adjusting |
| "bench press eighty-two point five" / "pec deck fifteen reps" | Changes one number |
| "adjust squat" | Swipe forward / back moves the weight by one plate step; tap keeps it |
| "remove cable crossover" | Removes the exercise (not if it has logged sets) |
| "undo", "done" | Reverts the last change; saves and opens the day plan |
The Page listens with the host's speech recognition (SpeechRecognition), parses the common phrasings itself (lib/grammar.js, spoken numbers included), and sends anything else to the on-device language model (LanguageModel with tool declarations, lib/interpret.js). Every change is applied by lib/plan.js, highlighted on screen, and saved; the last 20 changes can be undone. In the Studio simulator the model took 7–90 s per answer, so the header counts the seconds and a double tap cancels.
In the simulator, a tap and each swipe send GlobalHook first and then the gesture key: tap → Enter, swipe forward → ArrowUp, swipe back → ArrowDown. The Pages act only on gesture keys. A lone GlobalHook (physical glasses may send only that) counts as one tap after 280 ms, and a GlobalHook that arrives right after a gesture key is ignored; see agent/lib/temple.js.
A double tap never reaches agent Pages in the simulator: the Page logs show neither GlobalHook nor Backspace. "Double tap to go back" therefore cannot be tested in Studio, and whether physical glasses deliver it as Backspace is not verified yet.
agent/ AIUI Studio import root
AGENTS.md Agent identity, voice routing rules, capability limits
app.json pages: dates, day, build, plan, setplan
pages/dates/index.ink Training calendar
pages/day/index.ink Day plan (ready / list / done; rest countdown switched off)
pages/build/index.ink Manual planner (body part, exercises, sets, reps, weight)
pages/plan/index.ink Plan editor (voice in, temple to adjust)
lib/ Pure logic: dates, workout model, plan editing, grammar, model calls, storage, temple input
aiui-audit-claims.json
docs/aiui-audit.md UX and capability audit (every row BLOCKED until device evidence exists)
tests/ Node unit tests (not imported into Studio)
npm testRequires Node 20+. The tests cover all pure logic in agent/lib/; Page behavior needs the Studio simulator and physical glasses.
- What has been checked in the Studio simulator is recorded in
CLAUDE.mdand the commit history; nothing has been verified on physical glasses yet (optics, key order, nod, storage persistence). - The assistant only opens Pages with a date; slot filling does not work for draft agents in the simulator and needs Studio's build-and-review flow first. Plan changes are spoken to the editor Page itself. Voice logging of sets ("log 80 kg for 6 reps") is not built.
- Whether the glasses need
RECORD_AUDIOdeclared for the editor's speech recognition is not verified; the simulator did not. - The first launch writes an example plan (chest / back / legs / shoulders / rest) to
localStorage, on the glasses only.