Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
- [ ] `cargo fmt --all --check` and `cargo clippy --workspace -- -D warnings` are clean; the wasm build still works.
- [ ] **Perf-sensitive change?** (ink, core, render, the engine's pointer path, package I/O) I ran `cargo run -p rupok-bench --release` before and after and pasted both budget tables below. Otherwise: not perf-sensitive.
- [ ] **Format, protocol or SDK change?** `spec/` (and `packages/object-sdk/index.d.ts`) is updated in this PR, with a link to the accepted RFC. Otherwise: no spec impact.
- [ ] **Agent-controllable:** live op / MCP tool added (and a row in `docs/agent-capabilities.md`), or marked *teacher only* with a reason. Otherwise: no user-facing change.
- [ ] Docs updated (README, ROADMAP status, plan doc) if behaviour or status changed.

<details>
Expand Down
25 changes: 22 additions & 3 deletions AGENTS.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,12 @@ a Tauri 2 shell (planned). Status: Phase 0, pre-alpha. See
| `crates/rupok-ink` | Pen input pipeline, wasm-safe | `StrokeBuilder` (wet ink), `filter::OneEuro2`, `pressure::PressureCurve`, `simplify`, `codec::{encode_points, decode_points}` (point codec v1), `MIN_WIDTH_RATIO`, `point_radius`, `math` (handwritten maths → LaTeX), `write` (text + LaTeX → timed handwriting strokes) |
| `crates/rupok-core` | Lesson document on Loro | `Lesson` (`doc.rs`: all mutations), model types (`model.rs`: `ItemData`, `StrokeData`, `ObjectData`, `PageSpec`…), `Scene` (`scene.rs`: R*-tree hit-test, eraser, lasso), `DOC_FORMAT` |
| `crates/rupok-format` | `.rpk` package and Smart Object bundles (Apache-2.0) | `Package::{read, write, from_lesson, add_asset, content_markdown}`, `readable` (derived `README.md`/`content.md`/`content.json`), `ObjectBundle::{from_single_html, from_files, from_dir, validate}`, `LIBS`, `safe_path`, `FORMAT_VERSION`, `MIMETYPE`, `media` (embed allowlist, `parse_link`, `embed_url`, `prepare`), `model3d` (3D viewer object) |
| `crates/rupok-live` | Live agent bridge shared by the board and `rupok mcp --live` | `protocol.rs` (WebSocket protocol v1: channels, ports, origin/host checks), `op.rs` (`Op`), `apply.rs` (`apply`: one attributed commit per agent op), `attribution.rs`, `sync` |
| `crates/rupok-live` | Live agent bridge shared by the board and `rupok mcp --live` | `protocol.rs` (WebSocket protocol v1: channels, ports, origin/host checks), `op.rs` (`Op`), `apply.rs` (`apply`: one attributed commit per agent op), `items.rs` (pages and items: move, align, restyle, scale, draw…), `stamps.rs` (built-in and custom stamps, Smart stamps), `attribution.rs`, `sync` |
| `crates/rupok-render` | wgpu ink renderer | `InkRenderer` (SDF capsules, chunk culling, cached dry layer, wet layer), `Camera`, `Gpu::headless`, `ink.wgsl` |
| `crates/rupok-wasm` | Board engine and wasm-bindgen API | `engine.rs` (`Engine`: tools, gestures, selection), `lib.rs` (`Board` JS API), `replay.rs`, `shapes.rs` |
| `crates/rupok-cli` | `rupok` binary: CLI and MCP server | `cli.rs` (clap), `ops.rs` (shared operations), `mcp.rs` + `tools.rs` (15 MCP tools), `workspace.rs` (path sandbox), `spec.rs`, `live/` (`LiveHub`: loopback WebSocket, pairing, Loro mirror) + `mcp_live.rs` (live tools; docs/ai-agents.md), `chat/` (`rupok agent`: ACP client relaying the in-app chat) + `mcp_http.rs` (MCP over loopback HTTP for it) |
| `crates/rupok-cli` | `rupok` binary: CLI and MCP server | `cli.rs` (clap), `ops.rs` (shared operations), `mcp.rs` + `tools.rs` (lesson tools), `mcp_agent.rs` (agent control: pages, items, stamps, modes, export, library, settings, dock; docs/agent-capabilities.md), `workspace.rs` (path sandbox), `spec.rs`, `live/` (`LiveHub`: loopback WebSocket, pairing, Loro mirror) + `mcp_live.rs` (live tools; docs/ai-agents.md), `chat/` (`rupok agent`: ACP client relaying the in-app chat) + `mcp_http.rs` (MCP over loopback HTTP for it) |
| `bench/` | Performance harness and budgets | `cargo run -p rupok-bench --release [-- --check]` |
| `apps/board` | SolidJS board UI (Vite) | `controller.ts`, `objects.ts` (Smart Object host), `media/` + `components/Media*.tsx` (YouTube, video, audio, web embeds), `pdf.ts`, `storage.ts`, `live.ts` + `snapshot.ts` + `components/LivePanel.tsx` (Connect AI), `chat.ts` + `components/ChatPanel.tsx` + `markdown.ts` (AI chat), `components/` |
| `apps/board` | SolidJS board UI (Vite) | `controller.ts`, `objects.ts` (Smart Object host), `media/` + `components/Media*.tsx` (YouTube, video, audio, web embeds), `pdf.ts`, `storage.ts`, `live.ts` + `agentControl.ts` + `snapshot.ts` + `components/LivePanel.tsx` (Connect AI; board-side agent ops), `customStamps.ts` + `stampLib.ts` + `components/StampEditor.tsx` (My stamps), `components/DockEditor.tsx` (Customize dock), `agentSettings.ts` (settings an agent may change), `chat.ts` + `components/ChatPanel.tsx` + `markdown.ts` (AI chat), `components/` |
| `packages/object-sdk` | In-object SDK, `window.rupok` (Apache-2.0) | `sdk.js` (ES2019 IIFE), `index.d.ts`, `test/` |
| `spec/` | Normative specs (Apache-2.0) | `rupok-format.md`, `smart-object.md` |
| `examples/objects/` | Validated example Smart Objects | checked by `crates/rupok-format/tests/examples.rs` |
Expand Down Expand Up @@ -103,3 +103,22 @@ The toolchain (1.100, edition 2024) is pinned in `rust-toolchain.toml`.
asks.
7. **Stay in scope.** Other contributors (human or agent) may be editing
other parts of the tree; change only what your task needs.
8. **Agent-first: every feature is agent-controllable.** Anything a teacher
can do, their AI agent must be able to do on their behalf. A new
user-facing feature ships, in the same pull request, with matching live
op(s) in `crates/rupok-live` (`op.rs`, run in `apply`/`items.rs`/… or
the board's `agentControl.ts`), MCP tool(s) (`crates/rupok-cli/src/
mcp*.rs`, working on a file and with `path: "live"` where that makes
sense), docs in `docs/ai-agents.md` and `skills/rupok-live-board/
SKILL.md`, tests, and a row in `docs/agent-capabilities.md`
(`tests/agent_capabilities.rs` fails CI for a setting, dock button or op
without one). Guardrails, always:
- one attributed undo step per agent action (one Loro commit tagged
with `rupok_live::commit_message`);
- respect **Allow AI to edit live** and Student view (the op's `Access`);
- settings and mode changes ask the teacher's permission in the chat like
edits, and can be undone from the AI chip;
- agent-written code runs only in the Smart Object sandbox;
- AI keys, accounts, payments, storage locations and permissions stay
teacher only. When an agent must not do something, mark it *teacher
only* in the matrix with the reason.
11 changes: 10 additions & 1 deletion CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,16 @@ node --test "packages/object-sdk/test/*.test.mjs"
6. If the change touches the file format, the Smart Object protocol or the
SDK API, update `spec/` in the same PR. A non-editorial spec change needs
an accepted RFC.
7. Open the PR. On your first PR, sign the Contributor License Agreement
7. **Agent-first.** A user-facing feature ships with its agent path: a live
op and an MCP tool (on a file and live where that makes sense), docs in
`docs/ai-agents.md` and the `rupok-live-board` skill, tests, and a row in
`docs/agent-capabilities.md` (CI checks settings, dock buttons and live
ops against it). Agent actions are one attributed undo step, respect
*Allow AI to edit live* and Student view, ask permission for settings and
mode changes, and run agent code only in the Smart Object sandbox. AI
keys, accounts, payments and permissions stay teacher only: mark such
rows *teacher only* with the reason. See AGENTS.md, rule 8.
8. Open the PR. On your first PR, sign the Contributor License Agreement
(CLA, below); a bot will ask. CI must be green.

Commit messages: an imperative subject of 72 characters or fewer, with an area
Expand Down
1 change: 1 addition & 0 deletions ROADMAP.md
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,7 @@ first (see [CONTRIBUTING.md](CONTRIBUTING.md#rfcs)).
| 💡 | Brand kit: school colours, fonts and logo as theme tokens for every object | | |
| ✅ | Agent panel (ACP): chat with your own AI agent inside Rupok (v0.2.0: Claude, Codex, OpenCode through `rupok agent`) | [acp-agent-panel](docs/roadmap/acp-agent-panel.md) | advanced |
| ✅ | Live agent edits during class, merged into the open lesson (v0.2.0, `rupok mcp --live`, [docs/ai-agents.md](docs/ai-agents.md)) | [acp-agent-panel § Live edits](docs/roadmap/acp-agent-panel.md#live-edits) | advanced |
| 🚧 | Agent-first: every part of Rupok controllable by the teacher's agent (pages, items, stamps, modes, export, Library, settings, Smart Dock), checked in CI against [docs/agent-capabilities.md](docs/agent-capabilities.md); custom stamps and Smart stamps; a customisable dock (groups, split dock, sizes, named layouts). Format keys (root `stamps`) and Smart stamps need the RFC | `crates/rupok-live` (`items.rs`, `stamps.rs`), `crates/rupok-cli/src/mcp_agent.rs`, `apps/board/src/agentControl.ts`, [spec § Custom stamps](spec/rupok-format.md#custom-stamps) | advanced |
| 📋 | Replay with audio | [replay-audio](docs/roadmap/replay-audio.md) | intermediate |
| 📋 | LAN "send to board" from laptop or phone | [lan-send](docs/roadmap/lan-send.md) | intermediate |
| 🚧 | Web viewer (PWA): open any `.rpk` in a browser, offline. Read-only student view at `/board/?view` done; the `/open/` page hands a picked file to it; installed-PWA "Open with" (`launchQueue`) done; offline service worker done ([offline.md](docs/offline.md)) | [web-viewer](docs/roadmap/web-viewer.md) | intermediate |
Expand Down
4 changes: 4 additions & 0 deletions apps/board/src/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,8 @@ import { isPhone, pagesDrawer, pagesShown } from "./viewport";
import { PageDesignHost } from "./components/PageDesign";
import { drawCursor } from "./wetInk";
import { Celebrate, QuickMenu } from "./components/Stamps";
import { DockEditor } from "./components/DockEditor";
import { StampEditorHost } from "./components/StampEditor";
import { UpdateNotice } from "./updates/UpdateNotice";
import { startUpdateChecks } from "./updates/updates";
import { Tour } from "./tour/Tour";
Expand Down Expand Up @@ -174,6 +176,8 @@ export default function App() {
<Dock onSettings={openSettings} />
<QuickMenu />
<Celebrate />
<DockEditor />
<StampEditorHost />
<StatusChips />
{/* Connect AI: the teacher's own agent edits the board live (live.ts). */}
<LivePanel />
Expand Down
Loading
Loading