diff --git a/AGENTS.md b/AGENTS.md
index 7f6363c..ec2d681 100644
--- a/AGENTS.md
+++ b/AGENTS.md
@@ -21,7 +21,7 @@ a Tauri 2 shell (planned). Status: Phase 0, pre-alpha. See
| `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) |
| `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` + `snapshot.ts` + `components/LivePanel.tsx` (Connect AI), `chat.ts` + `components/ChatPanel.tsx` + `markdown.ts` (AI chat), `voice/` (dictation; `board.ts` + `VoiceBoard.tsx`: Voice on the board), `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` |
diff --git a/apps/board/scripts/gen-icons.mjs b/apps/board/scripts/gen-icons.mjs
index 93bb9b4..771ae4f 100644
--- a/apps/board/scripts/gen-icons.mjs
+++ b/apps/board/scripts/gen-icons.mjs
@@ -93,6 +93,23 @@ function body(name) {
return null;
}
+// Composed icons: a Solar icon made smaller in the top-left corner, with a
+// mark drawn in the free bottom-right corner (same stroke as the variant).
+// voiceText: the Voice text tool (src/voice/board.ts), a mic with a T.
+const COMPOSE = {
+ voiceText: { base: "microphone", mark: "M14.5 15H21.5M18 15V21.5" },
+};
+const STROKED = new Set(["linear", "line-duotone", "broken"]);
+
+function compose({ base, mark }, v) {
+ const k = 0.74;
+ let b = body(`${base}-${v}`);
+ // Keep the stroke width the eye expects after scaling down.
+ if (STROKED.has(v)) b = b.replace(/stroke-width="1\.5"/g, `stroke-width="${(1.5 / k).toFixed(2)}"`);
+ const w = STROKED.has(v) ? 1.5 : 2;
+ return `${b}`;
+}
+
const out = {};
const missing = [];
for (const [logical, candidates] of Object.entries(MAP)) {
@@ -103,6 +120,13 @@ for (const [logical, candidates] of Object.entries(MAP)) {
}
out[logical] = Object.fromEntries(VARIANTS.map((v) => [v, body(`${base}-${v}`)]));
}
+for (const [logical, spec] of Object.entries(COMPOSE)) {
+ if (!VARIANTS.every((v) => body(`${spec.base}-${v}`))) {
+ missing.push(logical);
+ continue;
+ }
+ out[logical] = Object.fromEntries(VARIANTS.map((v) => [v, compose(spec, v)]));
+}
if (missing.length) {
console.error("missing icons:", missing.join(", "));
process.exit(1);
diff --git a/apps/board/src/App.tsx b/apps/board/src/App.tsx
index 0ffbfcd..e8c3025 100644
--- a/apps/board/src/App.tsx
+++ b/apps/board/src/App.tsx
@@ -20,6 +20,7 @@ import { registerSettingsOpener } from "./components/ToText";
import LivePanel from "./components/LivePanel";
import ChatPanel from "./components/ChatPanel";
import VoiceLayer from "./voice/VoiceLayer";
+import VoiceBoard from "./voice/VoiceBoard";
import { LibraryRoot } from "./components/Library";
import { UpgradeHost } from "./components/Billing";
import { openUpgrade, refreshBilling, takeBillingParams } from "./cloud/billing";
@@ -163,6 +164,8 @@ export default function App() {
+ {/* Voice text: speak, and the words go on the board (voice/board.ts). */}
+
setObjectDialog(true)} onSettings={() => openSettings()} />
diff --git a/apps/board/src/components/Dock.tsx b/apps/board/src/components/Dock.tsx
index 5cf22b3..e3c9236 100644
--- a/apps/board/src/components/Dock.tsx
+++ b/apps/board/src/components/Dock.tsx
@@ -37,6 +37,7 @@ import { MarkerOpacity, SizeControl, StylePicker } from "./InkOptions";
import { StampIcon, StampsPanel } from "./Stamps";
import { brushInfo, brushOf } from "../brushes";
import { celebrate, currentStamp } from "../stamps";
+import { dockClickConsumed, dockPress, dockRelease, pickVoiceTool, voiceListening } from "../voice/board";
const META = new Map(TOOLBAR_ITEMS.map((t) => [t.id, t]));
const INK_TOOLS: Tool[] = ["pen", "highlighter", "rect", "ellipse", "line", "arrow", "shape"];
@@ -62,14 +63,14 @@ type Group = "ink" | "colors" | "create" | "point" | "context" | "history" | "na
type Kind = "tool" | "colors" | "shapes" | "smartink" | "undo" | "redo" | "pager" | "replay" | "exit" | "context" | "more";
interface Entry { key: string; kind: Kind; group: Group; id?: ToolbarItem }
const GROUP: Partial> = {
- pen: "ink", highlighter: "ink", eraser: "ink", smartink: "create", text: "create", stamp: "create",
+ pen: "ink", highlighter: "ink", eraser: "ink", smartink: "create", text: "create", voice: "create", stamp: "create",
lasso: "point", laser: "point", hand: "point", interact: "point", undo: "history", redo: "history", pager: "nav", replay: "nav", exit: "exit",
};
/** On a phone, what moves into ⋯ first when the dock is too long for the
* screen ("colors:N" keeps N recent colours). Pen, eraser, the pager and ⋯
* always stay; exit and undo go last (on the narrowest phones in Teach). */
-const PHONE_DROP = ["redo", "hand", "laser", "stamp", "colors:2", "lasso", "colors:1", "smartink", "interact", "replay", "text", "shapes", "highlighter", "colors:0", "exit", "undo"];
+const PHONE_DROP = ["redo", "hand", "laser", "voice", "stamp", "colors:2", "lasso", "colors:1", "smartink", "interact", "replay", "text", "shapes", "highlighter", "colors:0", "exit", "undo"];
/** Phone dock metrics (Dock.css): 44px cells with no gap; a 1px separator with 1.5px margins. */
const PHONE_CELL = 44, PHONE_SEP = 4;
@@ -527,14 +528,18 @@ export default function Dock(props: { onSettings?: (section?: string) => void })
ref={btn}
class="tool"
data-tour={p.id === "pen" ? "pen" : undefined}
- classList={{ on: on(), "has-options": options }}
- title={tipOf(p.id, p.id === "stamp" ? " · tap again for all stamps" : options ? " · tap again for styles, colours and sizes" : "")}
+ classList={{ on: on(), "has-options": options, listening: p.id === "voice" && voiceListening() }}
+ title={tipOf(p.id, p.id === "stamp" ? " · tap again for all stamps" : p.id === "voice" ? " · tap the page and speak; hold to talk" : options ? " · tap again for styles, colours and sizes" : "")}
aria-label={labelOf(p.id)}
aria-pressed={on()}
aria-haspopup={options ? "dialog" : undefined}
- onPointerDown={options ? lp.onPointerDown : undefined}
+ onPointerDown={options ? lp.onPointerDown : p.id === "voice" ? dockPress : undefined}
+ onPointerUp={p.id === "voice" ? dockRelease : undefined}
+ onPointerCancel={p.id === "voice" ? dockRelease : undefined}
onClick={() => {
if (lp.consumed()) return;
+ // Voice text (voice/board.ts): a hold was push-to-talk, a tap picks the tool.
+ if (p.id === "voice") { if (!dockClickConsumed()) { setPop(null); pickVoiceTool(); } return; }
if (options && on()) toggle(p.id as Pop["kind"], btn);
else {
setPop(null);
diff --git a/apps/board/src/controller.ts b/apps/board/src/controller.ts
index cb53acc..a105ad7 100644
--- a/apps/board/src/controller.ts
+++ b/apps/board/src/controller.ts
@@ -311,16 +311,16 @@ export class Controller {
setTool(t: Tool) {
// Student view: only panning and using Smart Objects.
- if (isView() && t !== "interact") t = "hand";
+ if (isView() && t !== "interact" && t !== "voice") t = "hand";
// Leaving "use objects": take keyboard focus back from any object iframe so
// shortcuts and the clicker reach the board again.
if (t !== "interact" && document.activeElement instanceof HTMLIFrameElement) document.activeElement.blur();
setTool(t);
- if (t === "interact" || t === "text" || t === "stamp") {
+ if (t === "interact" || t === "text" || t === "stamp" || t === "voice") {
// A just-placed object stays selected in "use objects" so it can be
// resized right away; the text tool starts fresh.
this.board.set_tool("lasso");
- if (t === "text" || t === "stamp") this.board.select_json("[]");
+ if (t === "text" || t === "stamp" || t === "voice") this.board.select_json("[]");
} else {
this.board.set_tool(t === "shape" ? shapeToolName() : t);
}
diff --git a/apps/board/src/icons.generated.ts b/apps/board/src/icons.generated.ts
index fc2d631..d4cda40 100644
--- a/apps/board/src/icons.generated.ts
+++ b/apps/board/src/icons.generated.ts
@@ -1,5 +1,5 @@
// Generated by scripts/gen-icons.mjs from Solar icons (CC BY 4.0, 480 Design).
// Do not edit by hand.
export type IconVariant = "linear" | "line-duotone" | "broken" | "bold" | "bold-duotone" | "outline";
-export type IconName = "pen" | "highlighter" | "eraser" | "select" | "laser" | "text" | "rect" | "ellipse" | "line" | "arrow" | "hand" | "interact" | "undo" | "redo" | "save" | "open" | "pdf" | "image" | "object" | "replay" | "play" | "pause" | "fullscreen" | "settings" | "sun" | "moon" | "plus" | "trash" | "close" | "sidebar" | "zoomIn" | "zoomOut" | "download" | "palette" | "layers" | "monitor" | "keyboard" | "info" | "insert" | "more" | "duplicate" | "front" | "prev" | "next" | "eye" | "up" | "down" | "group" | "ungroup" | "merge" | "import" | "export" | "restart" | "exit" | "overlay" | "smartink" | "totext" | "grow" | "shrink" | "broom" | "pin" | "pages" | "video" | "audio" | "cube" | "globe" | "volume" | "mute" | "openLink" | "replace" | "camera3d" | "stamp" | "celebrate" | "heart";
-export const ICONS: Record> = {"pen":{"linear":"","line-duotone":"","broken":"","bold":"","bold-duotone":"","outline":""},"highlighter":{"linear":"","line-duotone":"","broken":"","bold":"","bold-duotone":"","outline":""},"eraser":{"linear":"","line-duotone":"","broken":"","bold":"","bold-duotone":"","outline":""},"select":{"linear":"","line-duotone":"","broken":"","bold":"","bold-duotone":"","outline":""},"laser":{"linear":"","line-duotone":"","broken":"","bold":"","bold-duotone":"","outline":""},"text":{"linear":"","line-duotone":"","broken":"","bold":"","bold-duotone":"","outline":""},"rect":{"linear":"","line-duotone":"","broken":"","bold":"","bold-duotone":"","outline":""},"ellipse":{"linear":"","line-duotone":"","broken":"","bold":"","bold-duotone":"","outline":""},"line":{"linear":"","line-duotone":"","broken":"","bold":"","bold-duotone":"","outline":""},"arrow":{"linear":"","line-duotone":"","broken":"","bold":"","bold-duotone":"","outline":""},"hand":{"linear":"","line-duotone":"","broken":"","bold":"","bold-duotone":"","outline":""},"interact":{"linear":"","line-duotone":"","broken":"","bold":"","bold-duotone":"","outline":""},"undo":{"linear":"","line-duotone":"","broken":"","bold":"","bold-duotone":"","outline":""},"redo":{"linear":"","line-duotone":"","broken":"","bold":"","bold-duotone":"","outline":""},"save":{"linear":"","line-duotone":"","broken":"","bold":"","bold-duotone":"","outline":""},"open":{"linear":"","line-duotone":"","broken":"","bold":"","bold-duotone":"","outline":""},"pdf":{"linear":"","line-duotone":"","broken":"","bold":"","bold-duotone":"","outline":""},"image":{"linear":"","line-duotone":"","broken":"","bold":"","bold-duotone":"","outline":""},"object":{"linear":"","line-duotone":"","broken":"","bold":"","bold-duotone":"","outline":""},"replay":{"linear":"","line-duotone":"","broken":"","bold":"","bold-duotone":"","outline":""},"play":{"linear":"","line-duotone":"","broken":"","bold":"","bold-duotone":"","outline":""},"pause":{"linear":"","line-duotone":"","broken":"","bold":"","bold-duotone":"","outline":""},"fullscreen":{"linear":"","line-duotone":"","broken":"","bold":"","bold-duotone":"","outline":""},"settings":{"linear":"","line-duotone":"","broken":"","bold":"","bold-duotone":"","outline":""},"sun":{"linear":"","line-duotone":"","broken":"","bold":"","bold-duotone":"","outline":""},"moon":{"linear":"","line-duotone":"","broken":"","bold":"","bold-duotone":"","outline":""},"plus":{"linear":"","line-duotone":"","broken":"","bold":"","bold-duotone":"","outline":""},"trash":{"linear":"","line-duotone":"","broken":"","bold":"","bold-duotone":"","outline":""},"close":{"linear":"","line-duotone":"","broken":"","bold":"","bold-duotone":"","outline":""},"sidebar":{"linear":"","line-duotone":"","broken":"","bold":"","bold-duotone":"","outline":""},"zoomIn":{"linear":"","line-duotone":"","broken":"","bold":"","bold-duotone":"","outline":""},"zoomOut":{"linear":"","line-duotone":"","broken":"","bold":"","bold-duotone":"","outline":""},"download":{"linear":"","line-duotone":"","broken":"","bold":"","bold-duotone":"","outline":""},"palette":{"linear":"","line-duotone":"","broken":"","bold":"","bold-duotone":"","outline":""},"layers":{"linear":"","line-duotone":"","broken":"","bold":"","bold-duotone":"","outline":""},"monitor":{"linear":"","line-duotone":"","broken":"","bold":"","bold-duotone":"","outline":""},"keyboard":{"linear":"","line-duotone":"","broken":"","bold":"","bold-duotone":"","outline":""},"info":{"linear":"","line-duotone":"","broken":"","bold":"","bold-duotone":"","outline":""},"insert":{"linear":"","line-duotone":"","broken":"","bold":"","bold-duotone":"","outline":""},"more":{"linear":"","line-duotone":"","broken":"","bold":"","bold-duotone":"","outline":""},"duplicate":{"linear":"","line-duotone":"","broken":"","bold":"","bold-duotone":"","outline":""},"front":{"linear":"","line-duotone":"","broken":"","bold":"","bold-duotone":"","outline":""},"prev":{"linear":"","line-duotone":"","broken":"","bold":"","bold-duotone":"","outline":""},"next":{"linear":"","line-duotone":"","broken":"","bold":"","bold-duotone":"","outline":""},"eye":{"linear":"","line-duotone":"","broken":"","bold":"","bold-duotone":"","outline":""},"up":{"linear":"","line-duotone":"","broken":"","bold":"","bold-duotone":"","outline":""},"down":{"linear":"","line-duotone":"","broken":"","bold":"","bold-duotone":"","outline":""},"group":{"linear":"","line-duotone":"","broken":"","bold":"","bold-duotone":"","outline":""},"ungroup":{"linear":"","line-duotone":"","broken":"","bold":"","bold-duotone":"","outline":""},"merge":{"linear":"","line-duotone":"","broken":"","bold":"","bold-duotone":"","outline":""},"import":{"linear":"","line-duotone":"","broken":"","bold":"","bold-duotone":"","outline":""},"export":{"linear":"","line-duotone":"","broken":"","bold":"","bold-duotone":"","outline":""},"restart":{"linear":"","line-duotone":"","broken":"","bold":"","bold-duotone":"","outline":""},"exit":{"linear":"","line-duotone":"","broken":"","bold":"","bold-duotone":"","outline":""},"overlay":{"linear":"","line-duotone":"","broken":"","bold":"","bold-duotone":"","outline":""},"smartink":{"linear":"","line-duotone":"","broken":"","bold":"","bold-duotone":"","outline":""},"totext":{"linear":"","line-duotone":"","broken":"","bold":"","bold-duotone":"","outline":""},"grow":{"linear":"","line-duotone":"","broken":"","bold":"","bold-duotone":"","outline":""},"shrink":{"linear":"","line-duotone":"","broken":"","bold":"","bold-duotone":"","outline":""},"broom":{"linear":"","line-duotone":"","broken":"","bold":"","bold-duotone":"","outline":""},"pin":{"linear":"","line-duotone":"","broken":"","bold":"","bold-duotone":"","outline":""},"pages":{"linear":"","line-duotone":"","broken":"","bold":"","bold-duotone":"","outline":""},"video":{"linear":"","line-duotone":"","broken":"","bold":"","bold-duotone":"","outline":""},"audio":{"linear":"","line-duotone":"","broken":"","bold":"","bold-duotone":"","outline":""},"cube":{"linear":"","line-duotone":"","broken":"","bold":"","bold-duotone":"","outline":""},"globe":{"linear":"","line-duotone":"","broken":"","bold":"","bold-duotone":"","outline":""},"volume":{"linear":"","line-duotone":"","broken":"","bold":"","bold-duotone":"","outline":""},"mute":{"linear":"","line-duotone":"","broken":"","bold":"","bold-duotone":"","outline":""},"openLink":{"linear":"","line-duotone":"","broken":"","bold":"","bold-duotone":"","outline":""},"replace":{"linear":"","line-duotone":"","broken":"","bold":"","bold-duotone":"","outline":""},"camera3d":{"linear":"","line-duotone":"","broken":"","bold":"","bold-duotone":"","outline":""},"stamp":{"linear":"","line-duotone":"","broken":"","bold":"","bold-duotone":"","outline":""},"celebrate":{"linear":"","line-duotone":"","broken":"","bold":"","bold-duotone":"","outline":""},"heart":{"linear":"","line-duotone":"","broken":"","bold":"","bold-duotone":"","outline":""}};
+export type IconName = "pen" | "highlighter" | "eraser" | "select" | "laser" | "text" | "rect" | "ellipse" | "line" | "arrow" | "hand" | "interact" | "undo" | "redo" | "save" | "open" | "pdf" | "image" | "object" | "replay" | "play" | "pause" | "fullscreen" | "settings" | "sun" | "moon" | "plus" | "trash" | "close" | "sidebar" | "zoomIn" | "zoomOut" | "download" | "palette" | "layers" | "monitor" | "keyboard" | "info" | "insert" | "more" | "duplicate" | "front" | "prev" | "next" | "eye" | "up" | "down" | "group" | "ungroup" | "merge" | "import" | "export" | "restart" | "exit" | "overlay" | "smartink" | "totext" | "grow" | "shrink" | "broom" | "pin" | "pages" | "video" | "audio" | "cube" | "globe" | "volume" | "mute" | "openLink" | "replace" | "camera3d" | "stamp" | "celebrate" | "heart" | "voiceText";
+export const ICONS: Record> = {"pen":{"linear":"","line-duotone":"","broken":"","bold":"","bold-duotone":"","outline":""},"highlighter":{"linear":"","line-duotone":"","broken":"","bold":"","bold-duotone":"","outline":""},"eraser":{"linear":"","line-duotone":"","broken":"","bold":"","bold-duotone":"","outline":""},"select":{"linear":"","line-duotone":"","broken":"","bold":"","bold-duotone":"","outline":""},"laser":{"linear":"","line-duotone":"","broken":"","bold":"","bold-duotone":"","outline":""},"text":{"linear":"","line-duotone":"","broken":"","bold":"","bold-duotone":"","outline":""},"rect":{"linear":"","line-duotone":"","broken":"","bold":"","bold-duotone":"","outline":""},"ellipse":{"linear":"","line-duotone":"","broken":"","bold":"","bold-duotone":"","outline":""},"line":{"linear":"","line-duotone":"","broken":"","bold":"","bold-duotone":"","outline":""},"arrow":{"linear":"","line-duotone":"","broken":"","bold":"","bold-duotone":"","outline":""},"hand":{"linear":"","line-duotone":"","broken":"","bold":"","bold-duotone":"","outline":""},"interact":{"linear":"","line-duotone":"","broken":"","bold":"","bold-duotone":"","outline":""},"undo":{"linear":"","line-duotone":"","broken":"","bold":"","bold-duotone":"","outline":""},"redo":{"linear":"","line-duotone":"","broken":"","bold":"","bold-duotone":"","outline":""},"save":{"linear":"","line-duotone":"","broken":"","bold":"","bold-duotone":"","outline":""},"open":{"linear":"","line-duotone":"","broken":"","bold":"","bold-duotone":"","outline":""},"pdf":{"linear":"","line-duotone":"","broken":"","bold":"","bold-duotone":"","outline":""},"image":{"linear":"","line-duotone":"","broken":"","bold":"","bold-duotone":"","outline":""},"object":{"linear":"","line-duotone":"","broken":"","bold":"","bold-duotone":"","outline":""},"replay":{"linear":"","line-duotone":"","broken":"","bold":"","bold-duotone":"","outline":""},"play":{"linear":"","line-duotone":"","broken":"","bold":"","bold-duotone":"","outline":""},"pause":{"linear":"