Frontend tools
UI elements and Vue: convert HTML into element trees, create and update individual elements, inspect element hierarchies, broadcast live element commands to connected editors, and publish client-side bundles.
These tools live in the on-demand catalog rather than the default tool list, keeping the connected client's context small. Discover them with search_tools (e.g. search_tools(queries: ["frontend"])) and run them with execute_tools — or call them directly if your client has already loaded them.
HTML to Elements
html_to_elements
via execute_tools
Convert HTML to Stellify elements.
SILENT GOTCHA: non-ASCII text is mangled by DOMDocument (£→£, em-dash→â) — use ASCII, prefer SVG over emoji, or set such text afterwards with update_element. (@event handlers like @click/@keyup.enter ARE captured on creation — you do NOT need to re-set them; pass 'file' to auto-resolve @click="methodName" to its method UUID.)
Placement: pass 'page' (route UUID) for SSR/Blade pages — elements attach to the route (the common case); pass 'selection' (element UUID) to nest under an existing element; omit both for standalone Vue elements (use the returned UUIDs in save_file's template array). Multiple root elements: only the FIRST attaches to a route — make one call per root element, or wrap them in a single container div.
@click auto-wiring: pass 'file' to resolve @click="methodName" (methods must exist first). Do NOT pass raw Blade in text/attributes (stored literally) — create clean elements, then add dynamic behaviour with update_element (textField/hrefField for {{ $item->field }}, hrefExpression for prefixed paths, statements[] for Blade code, s-directive siblings for loops/conditionals; default loop var is $item).
Parameters
-
- Name
elements- Type
- string
- Required
- required
- Description
-
HTML string to convert
-
- Name
page- Type
- string
- Description
-
Route UUID to attach elements to. REQUIRED for SSR/Blade pages (WordPress imports, static content, layouts). Only omit for Vue component templates.
-
- Name
selection- Type
- string
- Description
-
Parent element UUID to attach to (alternative to page). Use when adding children to existing elements.
-
- Name
file- Type
- string
- Description
-
Vue component file UUID. Pass this to auto-wire @click handlers to method UUIDs.
-
- Name
test- Type
- boolean
- Description
-
If true, returns structure without creating elements
Create Element
create_element
via execute_tools
Create a UI element. Provide page (route UUID) for root elements, or parent (element UUID) for children.
s-slot elements (for layouts):
Use type='s-slot' to create a slot placeholder in a layout. When a page uses the layout via <x-layout-name>, the page's children are injected where the s-slot is. Set 'name' property on the s-slot for named slots (default slot has name='default').
Parameters
-
- Name
type- Type
- string
- Required
- required
- Description
-
Element type - must be one of the valid Stellify element types
-
- Name
page- Type
- string
- Description
-
UUID of the page/route to add the element to (for root elements)
-
- Name
parent- Type
- string
- Description
-
UUID of the parent element (for child elements)
Update Element
update_element
via execute_tools
Update a UI element. Data object: tag, classes, text, event handlers (method UUIDs), classBindings. Set 'name' on root elements to create Blade views (e.g. name="notes.index" → view('notes.index')).
Slots: set 'name' on an s-slot to define a slot (name="default" is the default); set 'slot' on an element to inject it into a named slot.
Inside @foreach loops (SSR/Blade, loop var defaults to $item):
- textField/hrefField/srcField → simple field access, e.g. textField:"title" outputs
{{ $item->title }}(field value ONLY, no prefix). - For prefixed/complex paths use hrefExpression/srcExpression/altExpression, e.g. hrefExpression:"/post/{{ $item->slug }}" or "{{ route('posts.show', $item->slug) }}". (There is NO hrefPrefix.)
- For Blade text content, pass the statements[] array with statement UUIDs whose code is output for Blade to evaluate.
Parameters
-
- Name
uuid- Type
- string
- Required
- required
- Description
-
UUID of the element to update
-
- Name
data- Type
- object
- Required
- required
- Description
-
HTML attributes and Stellify fields (tag, classes, text, classBindings, click, submit). Context fields: summary, rationale, references, decisions.
Get Element
get_element
read-only
via execute_tools
Get a single element by UUID. Returns the element data with all its attributes.
Parameters
-
- Name
uuid- Type
- string
- Required
- required
- Description
-
UUID of the element to retrieve
Get Element Tree
get_element_tree
read-only
via execute_tools
Get an element with all its descendants (children, grandchildren, etc.) as a hierarchical tree structure.
Parameters
-
- Name
uuid- Type
- string
- Required
- required
- Description
-
UUID of the root element
Delete Element
delete_element
via execute_tools
Delete an element and all its children (CASCADE). Returns the count of deleted elements.
Parameters
-
- Name
uuid- Type
- string
- Required
- required
- Description
-
UUID of the element to delete
Search Elements
search_elements
read-only
via execute_tools
Search for elements in the project. Useful for finding elements by name, type, or content.
Note: To reorder elements, use update_element to modify the parent element's 'data' array with the new order of child UUIDs.
Parameters
-
- Name
search- Type
- string
- Description
-
Search query to match against element name, type, or content
-
- Name
type- Type
- string
- Description
-
Filter by element type (e.g., s-wrapper, s-input)
-
- Name
include_metadata- Type
- boolean
- Description
-
Include additional metadata
-
- Name
per_page- Type
- number
- Description
-
Results per page (1-100)
Broadcast Element Command
broadcast_element_command
via execute_tools
Push real-time UI updates via WebSocket. Use for SHOW/DISPLAY/DEMONSTRATE requests.
Actions: update (modify element), create (ephemeral element), batch (multiple updates), delete.
Changes are EPHEMERAL (not saved). For persistent changes, use update_element or html_to_elements.
Parameters
-
- Name
action- Type
- string
- Required
- required
- Description
-
The type of command to broadcast
-
- Name
element- Type
- string
- Description
-
UUID of the element to modify (required for update, delete, create)
-
- Name
changes- Type
- object
- Description
-
Object containing attribute changes (e.g., { classes: ["bg-blue-500"], text: "Hello" })
-
- Name
updates- Type
- array
- Description
-
Array of updates for batch action: [{ element: "uuid", changes: {...} }]
Publish
publish
via execute_tools
Bundle a Vue component tree into an ESM loader served at /esm and attach its import-map to a page route, so the component renders in the browser without the editor. Pass the entry file UUID (the app.js mount file) and the route UUID of the page that hosts it. Run this after building a Vue component + its app.js mount and wiring a page route, to make the component actually render.
Parameters
-
- Name
uuid- Type
- string
- Required
- required
- Description
-
UUID of the entry file (the app.js mount file that imports/mounts the component)
-
- Name
route- Type
- string
- Description
-
UUID of the page route that hosts the component (the import-map/loader is attached to it)
-
- Name
filename- Type
- string
- Description
-
Bundle filename slug (lowercase, digits, hyphens). Defaults to the entry file name.
-
- Name
mode- Type
- string
- Description
-
Bundle mode (default: bundle). "esm" emits a vue3-sfc-loader loader with an esm.sh import-map.