Whiteboard Intents
WhiteboardIntent derives CommandTool, making each variant both a reduce command and an AI tool. Variants marked #[tool(hidden)] are dispatchable but excluded from AI tool definitions.
Dispatch path from Dart or AI:
session.dispatch(Command::Intent(SessionIntent::Modality(WhiteboardIntent::...)));Property Schema CRUD
Section titled “Property Schema CRUD”These intents manage the template’s property schema — the set of configurable properties that component bindings reference.
| Intent | Parameters | Purpose |
|---|---|---|
ListProperties | — | List all properties with types and defaults |
AddProperty | name, property_type, description?, icon?, default_value?, options?, multiple?, min?, max?, max_length?, expression? | Add a new property to the schema |
UpdateProperty | key, name?, description?, icon?, default_value? | Update an existing property |
RemoveProperty | key | Remove a property from the schema |
Supported property_type values: text, number, boolean, color, date, url, json, select, cloze, formula.
For select type, pass options as comma-separated names and multiple: true for multi-select. For number, pass min/max bounds. For formula, pass a expression (CEL).
Component Placement CRUD
Section titled “Component Placement CRUD”These intents manage component instances on the canvas.
| Intent | Parameters | Purpose |
|---|---|---|
ListComponents | — | List available component types (built-in widgets) |
ListPlacements | — | List all placements on the current template |
AddPlacement | component_id, x?, y?, width?, height?, rotation?, z_index?, bindings? | Add a component to the canvas |
UpdatePlacement | id, x?, y?, width?, height?, rotation?, z_index?, bindings? | Update placement position/bindings |
RemovePlacement | id | Remove a placement from the canvas |
Default position: (0, 0) at 400x300 with no rotation. Bindings map property keys to PropertyBinding specs.
Binding Updates
Section titled “Binding Updates”| Intent | Parameters | Purpose |
|---|---|---|
UpdateBinding | placement_id, key, value | Update a single binding value on a placement |
Element Creation
Section titled “Element Creation”Typed intents for creating canvas elements from UI gestures.
| Intent | Parameters | Purpose |
|---|---|---|
AddPathElement | points, color, thickness, x, y, width, height, z_index?, is_eraser? | Freehand drawing path |
AddShapeElement | shape_type, color, x, y, width, height, z_index? | Geometric shape (rect, circle, triangle, line) |
AddTextElement | x, y, width?, height?, z_index? | Text box at position |
Bulk Operations
Section titled “Bulk Operations”| Intent | Parameters | Purpose |
|---|---|---|
MoveElements | ids, dx, dy | Move elements by delta offset |
RemoveElements | ids | Remove multiple elements |
ResizeElement | id, x, y, width, height | Resize element, rescaling path points |
ReorderElement | id, action | Change z-ordering (ZAction) |
Element Property Updates
Section titled “Element Property Updates”Typed updates for element-specific visual properties.
| Intent | Parameters | Hidden | Purpose |
|---|---|---|---|
UpdatePathProperties | id, color?, thickness?, is_eraser? | No | Path stroke properties |
UpdateShapeProperties | id, shape_type?, fill?, color?, stroke_color?, stroke_width?, start_arrow?, end_arrow?, rotation? | No | Shape visual properties |
UpdateTextContent | id, prose_bytes | Yes | Loro prose document bytes |
UpdateTextProperties | id, font_family?, text_align? | No | Text formatting |
UpdateFileProperties | id, url?, file_type?, thumbnail_url?, file_name?, rotation? | Yes | File element metadata |
UpdateUrlProperties | id, url_type?, url?, title?, description?, thumbnail_url? | Yes | URL element metadata |
UpdateGeogebraProperties | id, geogebra_type?, material_id?, commands? | Yes | GeoGebra applet config |
UpdateMaskProperties | id, image_url?, mask_path? | Yes | Mask element properties |
UI State (Hidden)
Section titled “UI State (Hidden)”These intents manage UI-only state and are hidden from AI tools.
| Intent | Parameters | Purpose |
|---|---|---|
SelectTool | tool: ToolType | Set active drawing tool |
SetToolColor | color: Color | Set pen/shape stroke color |
SetToolThickness | thickness: f64 | Set pen stroke thickness |
SetToolShapeType | shape_type: ShapeType | Set default shape type |
SetToolFontFamily | font_family: TextFontFamily | Set default font family |
SelectElements | ids: Vec<String> | Select elements by placement ID |
DeselectAll | — | Clear selection |
SetCanvas | zoom?, pan_x?, pan_y?, width?, height? | Update viewport |
Prose Editing (Hidden)
Section titled “Prose Editing (Hidden)”These intents support inline text editing via embedded Prose reducers (the Embedded Prose RFC).
| Intent | Parameters | Purpose |
|---|---|---|
FocusTextEditor | id: Option<String> | Focus a text element for inline editing, or None to unfocus |
TextEdit | id, intent: ProseIntent | Dispatch a prose intent to an embedded text element’s editor |
Internal (Hidden)
Section titled “Internal (Hidden)”| Intent | Purpose |
|---|---|
Recompile | Force recompilation of all placements |
Metadata
Section titled “Metadata”| Intent | Parameters | Purpose |
|---|---|---|
ClearAll | — | Remove all placements from the whiteboard |
UpdateName | name | Update whiteboard name |
UpdateDescription | description? | Update or clear description |
Tool Output Types
Section titled “Tool Output Types”Intent handlers emit structured output via fx.services().agent.tool_output() for the AI bridge:
pub struct PropertyListOutput { pub properties: Vec<PropertyInfo>,}
pub struct MutationOutput { pub ok: bool, pub id: Option<String>, pub message: Option<String>,}Related
Section titled “Related”- Overview — struct, types, compilation flow
- Components — the
WhiteboardComponentsubtrait Command— the universal envelope wrapping intentsBridge— how intents become AI tools