Repository navigation
Agent-first: every part of Rupok controllable by agents, custom and Smart stamps, a customisable dock - #27
Merged
Merged
Conversation
Every part of the lesson an agent can change, as one attributed undo step, on a lesson file and on the live board with the same code: - pages: list_pages, move_pages, delete_pages, duplicate_pages, set_page_title - items: select_items, move_items, align_items (align and distribute, groups move as one), restyle_items (colour, width, brush, fill, dash, opacity, text size), scale_items, group/ungroup, reorder_items, delete_items, draw_stroke, update_text - stamps: list_stamps, add_stamp (built-in or custom), create_stamp, update_stamp, delete_stamp; custom stamps with sanitised SVG, emoji or a label, declarative behaviour, and Smart stamps (a tiny Smart Object bundle, validated, no network) - board-app ops (modes, view, replay, export, library, settings, dock) are typed in Op and refused by the document Core: Edits gains texts and stamp_defs; the lesson's root stamps map holds custom stamp definitions (proposed, pending RFC).
mcp_agent.rs adds the agent-control tools: pages, items, stamps (file and live, path optional), modes, zoom, replay, celebrate, set_tool, undo_last_change, export_pdf (the board makes it, the server saves it in the workspace), the Library, settings (allowlist; secrets refused before they reach the board) and the Smart Dock (live). doc_op runs any document op on a lesson file. Tests: MCP e2e on files, the fake ACP agent's /stamp flow in the chat test, and agent_capabilities.rs, which fails CI when a setting, dock button or live op has no row in docs/agent-capabilities.md.
- My stamps: the teacher's stamps in IndexedDB and in lessons that use them; a stamp editor (preview, name, artwork, colour, size, animation, burst, sound, fade, counter); stamp packs; Make a stamp with AI (/stamp). Custom SVG is drawn only as an image; Smart stamps run as sandboxed Smart Objects; behaviour plays on placement (sounds honour a new switch). - Smart Dock: ordered groups, a split second dock, button sizes, large icons, per mode; named layouts (Left-handed, Minimal teaching, Maths class, the teacher's own); a Customize dock editor (drag, keyboard, reset), from the dock's menu, a long press on the grip or Settings; Customize dock with AI (/dock). - agentControl.ts runs the board-app ops for agents (modes, view, replay, export, Library, settings allowlist, dock) with Undo from the AI chip.
AGENTS.md rule 8 and CONTRIBUTING: every user-facing feature ships with a live op, an MCP tool, docs, tests and a row in docs/agent-capabilities.md, with the guardrails. PR template checkbox. ai-agents.md and the skill gain the full tool list, examples, a stamp design guide and the dock guide. Spec: the root stamps map and Smart stamps (proposed, pending RFC); ui-config.md documents dock groups, split, sizes and saved layouts.
shaitrish37
added a commit
that referenced
this pull request
Nov 24, 2026
…ting Joined with #26 and #27: - show_progress and the AI in action, Class mode and students-ask settings get rows in docs/agent-capabilities.md; the four presentation settings (progress, sparkle, chime, line-by-line solutions) join the agent allowlist, Class mode and what students may ask stay the teacher's. - MCP annotations: the annotations test covers the agent-control tools; every write tool from #26/#27 declares idempotentHint, destructiveHint is kept for real deletes (delete_items, delete_pages, delete_stamp, library_trash) and dropped from undo_last_change (it only takes back the agent's own step); library_list counts as a read. - Class mode confirms the new destructive ops (delete_pages, delete_stamp, library_trash, dock layout changes) like the others. - update_text fits new words or a new size inside the page like add_text (never spilling onto a new page), with a regression test. - show_progress is a board-only op, like the voice ops. - Clippy (all targets): slice::from_ref in a voice test. # Conflicts: # AGENTS.md # apps/board/src/live.ts # crates/rupok-cli/src/lib.rs # crates/rupok-cli/src/mcp.rs # crates/rupok-cli/tests/fake-acp-agent.mjs # crates/rupok-live/src/op.rs # docs/ai-agents.md
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What and why
The founder's ask: every part of Rupok controllable by an AI agent, and custom stamps made by the agent (look, behaviour, and even logic). Then two more: a fully customisable Smart Dock (by hand or "make my dock like this"), and making agent-first a permanent rule for contributors.
Agent control
docs/agent-capabilities.md: the capability matrix, before and after, for every feature area, every setting, every dock button and every live op. Teacher only rows carry the reason (security, physical input, account or payments).crates/rupok-live(items.rs,stamps.rs): pages (list, move, delete, duplicate, rename), items (select, move, align and distribute, restyle including fill and dash, scale, group, reorder, delete, draw strokes, edit text) and stamps. They run inapplyon the board and on.rpkfiles with the same code. Each one is a single attributed undo step.apps/board/src/agentControl.ts): modes (leaving Student view is refused), zoom and fit, replay, celebrate, set tool, the agent's own undo, PDF export, the Library (list, open, create, move, rename, trash), settings (an allowlist inagentSettings.ts) and the dock. Settings and dock changes are undone from the AI chip.crates/rupok-cli/src/mcp_agent.rs). Document tools take an optionalpath(omit it for the live board).export_pdfsaves the PDF the board makes into the workspace. Secrets are refused by the server before anything reaches the board.Custom stamps and Smart stamps
art: "smart"plus HTML. This is an ordinary validated Smart Object bundle with no network, placed like a stamp, and it runs only in the sandbox. Custom SVG is drawn only through an image, never inline.stampsmap, plus the bundle, deduplicated), so a shared lesson shows it. Stamp packs (JSON) can be imported and exported./stamp).Customisable dock
modes.tsDockConfigis extended additively: orderedgroups, an optionalsplitsecond dock,size, per-buttonsizes,largeicons, per mode, plus named layouts (Left-handed, Minimal teaching, Maths class, Default, the teacher's own). The core tools always stay, and warnings appear when nothing leads back to Settings./dock) in the ⋯ menu.Agent-first, permanently
crates/rupok-cli/tests/agent_capabilities.rs(runs incargo test) fails when:set_settingrows differ from the board's allowlist.Format
Additive, approved by the founder, proposed, pending RFC: the root
stampsmap (spec/rupok-format.md§ Custom stamps) and Smart stamps (spec/smart-object.md). There is a ROADMAP row for this work. Core change:Edits.textsandEdits.stamp_defs(off the ink path).How it was tested
cargo fmt --all --check,cargo clippy --workspace --all-targets -- -D warnings,cargo test --workspace(all green).rupok-live/src/agent_ops_tests.rs(13 tests): every new write is one attributed undo step; validation; Student view; board ops refused by the document; stamp lifecycle; Smart stamp sandbox rules and dedup; device-library defs./stampflow intests/chat.rs.release-wasm) + wasm-bindgen;tsc --noEmit;vite build.bench/latency/pen-latency.mjs --swiftshader --check: all budgets pass. On a machine with load average 23, earlier runs had one noisy "first frame of next stroke" result; it passed on the final run. The dock and stamps are outside the pen path.cargo run -p rupok-bench --release(core touched): stroke commit p99 0.04 ms, pen → wet 0.11 ms, wet vs dry 0.00 %. The frame budgets failed only from machine load.agent-control.mjs, realrupok mcp --livepaired with Chrome): 40/40 pass. It covers:allow-same-origin;Checklist
Editsgained two fields (not on the ink path). Bench and pen-latency were run; results are above.docs/agent-capabilities.md.Limitations
add_shape/add_tableremain live-only (the engine owns shape geometry).restyle_itemssets a shape's width without regenerating arrowheads;scale_itemsis uniform.update_smart_object).library_create_lessonwithopen: falsebriefly opens the new lesson and returns to the previous one.