| .. | ||
| icon.lua | ||
| plugin.lua | ||
| README.md | ||
Assistant Plugin Reference
This folder keeps the Lua manifest (plugin.lua) that defines a custom assistant. Treat it as the single source of truth for how AI Studio renders your assistant UI and builds the submitted prompt.
Table of Contents
- Assistant Plugin Reference
How to Use This Documentation
Use this README in layers. The early sections are a quick reference for the overall assistant manifest shape and the available component types, while the later ... reference sections are the full detail for each component and advanced behavior.
When you build a plugin, start with the directory layout and the Structure section, then jump to the component references you actually use. The resource links at the end are the primary sources for Lua and MudBlazor behavior, and the General Tips section collects the practical rules and gotchas that matter most while authoring plugin.lua.
Directory Structure
Each assistant plugin lives in its own directory under the assistants plugin root. In practice, you usually keep the manifest in plugin.lua, optional icon rendering in icon.lua, and any bundled media in assets/.
.
└── com.github.mindwork-ai.ai-studio/
└── data/
└── plugins/
└── assistants/
└── your-assistant-directory/
├── assets/
│ └── your-media-files.jpg
├── icon.lua
└── plugin.lua
Structure
ASSISTANTis the root table. It must containTitle,Description,SystemPrompt,SubmitText,AllowProfiles, and the nestedUIdefinition.UI.Typeis always"FORM"andUI.Childrenis a list of component tables.- Each component table declares
Type, an optionalChildrenarray, and aPropstable that feeds the component’s parameters.
Example: Minimal Requirements Assistant Table
ASSISTANT = {
["Title"] = "",
["Description"] = "",
["SystemPrompt"] = "",
["SubmitText"] = "",
["AllowProfiles"] = true,
["UI"] = {
["Type"] = "FORM",
["Children"] = {
-- Components
}
},
}
Supported types (matching the Blazor UI components):
TEXT_AREA: user input field based onMudTextField; requiresName,Label, and may includeHelperText,HelperTextOnFocus,Adornment,AdornmentIcon,AdornmentText,AdornmentColor,Counter,MaxLength,IsImmediate,UserPrompt,PrefillText,IsSingleLine,ReadOnly,Class,Style.DROPDOWN: selects between variants;Propsmust includeName,Label,Default,Items, and optionallyValueTypeplusUserPrompt.BUTTON: invokes a Lua callback;Propsmust includeName,Text,Action, and may includeVariant,Color,IsFullWidth,Size,StartIcon,EndIcon,IconColor,IconSize,Class,Style.BUTTON_GROUP: groups multipleBUTTONchildren in aMudButtonGroup;Childrenmust contain onlyBUTTONcomponents andPropsmay includeVariant,Color,Size,OverrideStyles,Vertical,DropShadow,Class,Style.LAYOUT_GRID: renders aMudGrid;Childrenmust contain onlyLAYOUT_ITEMcomponents andPropsmay includeJustify,Spacing,Class,Style.LAYOUT_ITEM: renders aMudItem; use it insideLAYOUT_GRIDand configure breakpoints withXs,Sm,Md,Lg,Xl,Xxl, plus optionalClass,Style.LAYOUT_PAPER: renders aMudPaper; may includeElevation,Height,MaxHeight,MinHeight,Width,MaxWidth,MinWidth,IsOutlined,IsSquare,Class,Style.LAYOUT_STACK: renders aMudStack; may includeIsRow,IsReverse,Breakpoint,Align,Justify,Stretch,Wrap,Spacing,Class,Style.SWITCH: boolean option; requiresName,Label,Value, and may includeDisabled,UserPrompt,LabelOn,LabelOff,LabelPlacement,Icon,IconColor,CheckedColor,UncheckedColor,Class,Style.COLOR_PICKER: color input based onMudColorPicker; requiresName,Label, and may includePlaceholder,ShowAlpha,ShowToolbar,ShowModeSwitch,PickerVariant,UserPrompt,Class,Style.PROVIDER_SELECTION/PROFILE_SELECTION: hooks into the shared provider/profile selectors.WEB_CONTENT_READER: rendersReadWebContent; includeName,UserPrompt,Preselect,PreselectContentCleanerAgent.FILE_CONTENT_READER: rendersReadFileContent; includeName,UserPrompt.IMAGE: embeds a static illustration;Propsmust includeSrcplus optionallyAltandCaption.Srccan be an HTTP/HTTPS URL, adata:URI, or a plugin-relative path (plugin://assets/your-image.png). The runtime will convert plugin-relative paths intodata:URLs (base64).HEADING,TEXT,LIST: descriptive helpers.
Images referenced via the plugin:// scheme must exist in the plugin directory (e.g., assets/example.png). Drop the file there and point Src at it. The component will read the file at runtime, encode it as Base64, and render it inside the assistant UI.
| Component | Required Props | Optional Props | Renders |
|---|---|---|---|
TEXT_AREA |
Name, Label |
HelperText, HelperTextOnFocus, Adornment, AdornmentIcon, AdornmentText, AdornmentColor, Counter, MaxLength, IsImmediate, UserPrompt, PrefillText, IsSingleLine, ReadOnly, Class, Style |
MudTextField |
DROPDOWN |
Name, Label, Default, Items |
IsMultiselect, HasSelectAll, SelectAllText, HelperText, OpenIcon, CloseIcon, IconColor, IconPositon, Variant, ValueType, UserPrompt |
MudSelect |
BUTTON |
Name, Text, Action |
Variant, Color, IsFullWidth, Size, StartIcon, EndIcon, IconColor, IconSize, Class, Style |
MudButton |
SWITCH |
Name, Label, Value |
Disabled, UserPrompt, LabelOn, LabelOff, LabelPlacement, Icon, IconColor, CheckedColor, UncheckedColor, Class, Style |
MudSwitch |
PROVIDER_SELECTION |
None |
None |
internal |
PROFILE_SELECTION |
None |
None |
internal |
FILE_CONTENT_READER |
Name |
UserPrompt |
internal |
WEB_CONTENT_READER |
Name |
UserPrompt |
internal |
COLOR_PICKER |
Name, Label |
Placeholder, ShowAlpha, ShowToolbar, ShowModeSwitch, PickerVariant, UserPrompt, Class, Style |
MudColorPicker |
HEADING |
Text |
Level |
MudText Typo="Typo.<h2|h3|h4|h5|h6>" |
TEXT |
Content |
None |
MudText Typo="Typo.body1" |
LIST |
Type, Text |
Href |
MudList |
IMAGE |
Src |
Alt, Caption,Src |
MudImage |
BUTTON_GROUP |
None |
Variant, Color, Size, OverrideStyles, Vertical, DropShadow, Class, Style |
MudButtonGroup |
LAYOUT_PAPER |
None |
Elevation, Height, MaxHeight, MinHeight, Width, MaxWidth, MinWidth, IsOutlined, IsSquare, Class, Style |
MudPaper |
LAYOUT_ITEM |
None |
Xs, Sm, Md, Lg, Xl, Xxl, Class, Style |
MudItem |
LAYOUT_STACK |
None |
IsRow, IsReverse, Breakpoint, Align, Justify, Stretch, Wrap, Spacing, Class, Style |
MudStack |
LAYOUT_GRID |
None |
Justify, Spacing, Class, Style |
MudGrid |
| More information on rendered components can be found here. |
Component References
TEXT_AREA reference
- Use
Type = "TEXT_AREA"to render a MudBlazor text input or textarea. - Required props:
Name: unique state key used in prompt assembly andBuildPrompt(input.fields).Label: visible field label.
- Optional props:
HelperText: helper text rendered below the input.HelperTextOnFocus: defaults tofalse; show helper text only while the field is focused.Adornment: one ofStart,End,None; invalid or omitted values fall back toStart.AdornmentIcon: MudBlazor icon identifier string for the adornment.AdornmentText: plain adornment text. Do not set this together withAdornmentIcon.AdornmentColor: one of the MudBlazorColorenum names such asPrimary,Secondary,Warning; invalid or omitted values fall back toDefault.Counter: nullable integer. Omit it to hide the counter entirely. Set0to show only the current character count. Set1or higher to showcurrent/max.MaxLength: maximum number of characters allowed; defaults to524288.IsImmediate: defaults tofalse; updates the bound value on each input event instead of on blur/change.UserPrompt: prompt context text for this field.PrefillText: initial input value.IsSingleLine: defaults tofalse; render as a one-line input instead of a textarea.ReadOnly: defaults tofalse; disables editing.Class,Style: forwarded to the rendered component for layout/styling.
Example Textarea component
{
["Type"] = "TEXT_AREA",
["Props"] = {
["Name"] = "Budget",
["Label"] = "Budget",
["HelperText"] = "Enter the expected amount.",
["Adornment"] = "Start",
["AdornmentIcon"] = "Icons.Material.Filled.AttachMoney",
["AdornmentColor"] = "Success",
["Counter"] = 0,
["MaxLength"] = 100,
["IsImmediate"] = true,
["UserPrompt"] = "Use this budget information in your answer.",
["PrefillText"] = "",
["IsSingleLine"] = true
}
}
DROPDOWN reference
- Use
Type = "DROPDOWN"to render a MudBlazor select field. - Required props:
Name: unique state key used in prompt assembly, button actions, andBuildPrompt(input.fields).Label: visible field label.Default: dropdown item table with the shape{ ["Value"] = "<internal value>", ["Display"] = "<visible label>" }.Items: array of dropdown item tables with the same shape asDefault.
- Optional props:
UserPrompt: prompt context text for this field.ValueType: one ofstring,int,double,bool; currently the dropdown values exposed to prompt building and button actions are handled as the configured itemValues, with typical usage beingstring.IsMultiselect: defaults tofalse; whentrue, the component allows selecting multiple items.HasSelectAll: defaults tofalse; enables MudBlazor's select-all behavior for multiselect dropdowns.SelectAllText: custom label for the select-all action in multiselect mode.HelperText: helper text rendered below the dropdown.OpenIcon: MudBlazor icon identifier used while the dropdown is closed.CloseIcon: MudBlazor icon identifier used while the dropdown is open.IconColor: one of the MudBlazorColorenum names such asPrimary,Secondary,Warning; invalid or omitted values fall back toDefault.IconPositon: one ofStartorEnd; controls where the icon adornment is rendered.Variant: one of the MudBlazorVariantenum names such asText,Filled,Outlined; invalid or omitted values fall back toOutlined.Class,Style: forwarded to the rendered component for layout/styling.
- Dropdown item shape:
Value: the internal raw value stored in component state and passed to prompt building.Display: the visible label shown to the user in the menu and selection text.
- Behavior notes:
- For single-select dropdowns,
input.fields.<Name>is a single raw value such asgermany. - For multiselect dropdowns,
input.fields.<Name>is an array-like Lua table of raw values. - The UI shows the
Displaytext, while prompt assembly andBuildPrompt(input)receive the rawValue. Defaultshould usually also exist inItems. If it is missing there, the runtime currently still renders it as an available option.
- For single-select dropdowns,
Example Dropdown component
{
["Type"] = "DROPDOWN",
["Props"] = {
["Name"] = "targetCountries",
["Label"] = "Target countries",
["UserPrompt"] = "Use the selected countries in your answer.",
["ValueType"] = "string",
["IsMultiselect"] = true,
["HasSelectAll"] = true,
["SelectAllText"] = "Select all countries",
["HelperText"] = "Pick one or more countries.",
["OpenIcon"] = "Icons.Material.Filled.ArrowDropDown",
["CloseIcon"] = "Icons.Material.Filled.ArrowDropUp",
["IconColor"] = "Secondary",
["IconPositon"] = "End",
["Variant"] = "Filled",
["Default"] = { ["Value"] = "germany", ["Display"] = "Germany" },
["Items"] = {
{ ["Value"] = "germany", ["Display"] = "Germany" },
{ ["Value"] = "austria", ["Display"] = "Austria" },
{ ["Value"] = "france", ["Display"] = "France" }
},
["Class"] = "mb-3",
["Style"] = "min-width: 16rem;"
}
}
BUTTON reference
- Use
Type = "BUTTON"to render a clickable action button. - Required props:
Name: unique identifier used to track execution state and logging.Text: visible button label.Action: Lua function called on button click.
- Optional props:
Variant: one of the MudBlazorVariantenum names such asFilled,Outlined,Text; omitted values fall back toFilled.Color: one of the MudBlazorColorenum names such asDefault,Primary,Secondary,Info; omitted values fall back toDefault.IsFullWidth: defaults tofalse; whentrue, the button expands to the available width.Size: one of the MudBlazorSizeenum names such asSmall,Medium,Large; omitted values fall back toMedium.StartIcon: MudBlazor icon identifier string rendered before the button text.EndIcon: MudBlazor icon identifier string rendered after the button text.IconColor: one of the MudBlazorColorenum names; omitted values fall back toInherit.IconSize: one of the MudBlazorSizeenum names; omitted values fall back toMedium.Class,Style: forwarded to the rendered component for layout/styling.
Action(input) interface
- The function receives the same
inputstructure asASSISTANT.BuildPrompt(input). - Return
nilfor no state update. - To update component state, return a table with a
fieldstable. fieldskeys must reference existing componentNamevalues.- Supported write targets:
TEXT_AREA, single-selectDROPDOWN,WEB_CONTENT_READER,FILE_CONTENT_READER,COLOR_PICKER: string values- multiselect
DROPDOWN: array-like Lua table of strings SWITCH: boolean values
- Unknown field names and wrong value types are ignored and logged.
Example Button component
{
["Type"] = "BUTTON",
["Props"] = {
["Name"] = "buildEmailOutput",
["Text"] = "Build output",
["Variant"] = "Filled",
["Color"] = "Primary",
["IsFullWidth"] = false,
["Size"] = "Medium",
["StartIcon"] = "Icons.Material.Filled.AutoFixHigh",
["EndIcon"] = "Icons.Material.Filled.ArrowForward",
["IconColor"] = "Inherit",
["IconSize"] = "Medium",
["Action"] = function(input)
local email = input.fields.emailContent or ""
local translate = input.fields.translateEmail or false
local output = email
if translate then
output = output .. "\n\nTranslate this email:"
end
return {
fields = {
outputTextField = output
}
}
end,
["Class"] = "mb-3",
["Style"] = "min-width: 12rem;"
}
}
BUTTON_GROUP reference
- Use
Type = "BUTTON_GROUP"to render multipleBUTTONchildren as a single MudBlazor button group. - Required structure:
Children: array ofBUTTONcomponent tables. Other child component types are ignored.
- Optional props:
Variant: one of the MudBlazorVariantenum names such asFilled,Outlined,Text; omitted values fall back toFilled.Color: one of the MudBlazorColorenum names such asDefault,Primary,Secondary,Info; omitted values fall back toDefault.Size: one of the MudBlazorSizeenum names such asSmall,Medium,Large; omitted values fall back toMedium.OverrideStyles: defaults tofalse; enables MudBlazor button-group style overrides.Vertical: defaults tofalse; whentrue, buttons are rendered vertically instead of horizontally.DropShadow: defaults totrue; controls the group shadow.Class,Style: forwarded to the renderedMudButtonGroupfor layout/styling.
- Child buttons use the existing
BUTTONprops and behavior, including LuaAction(input).
Example Button-Group component
{
["Type"] = "BUTTON_GROUP",
["Props"] = {
["Variant"] = "Filled",
["Color"] = "Primary",
["Size"] = "Medium",
["OverrideStyles"] = false,
["Vertical"] = false,
["DropShadow"] = true
},
["Children"] = {
{
["Type"] = "BUTTON",
["Props"] = {
["Name"] = "buildEmailOutput",
["Text"] = "Build output",
["Action"] = function(input)
return {
fields = {
outputBuffer = input.fields.emailContent or ""
}
}
end,
["StartIcon"] = "Icons.Material.Filled.Build"
}
},
{
["Type"] = "BUTTON",
["Props"] = {
["Name"] = "logColor",
["Text"] = "Log color",
["Action"] = function(input)
LogError("ColorPicker value: " .. tostring(input.fields.colorPicker or ""))
return nil
end,
["EndIcon"] = "Icons.Material.Filled.BugReport"
}
}
}
}
SWITCH reference
- Use
Type = "SWITCH"to render a boolean toggle. - Required props:
Name: unique state key used in prompt assembly andBuildPrompt(input.fields).Label: visible label for the switch field.Value: initial boolean state (trueorfalse).
- Optional props:
Disabled: defaults tofalse; disables user interaction while still allowing the value to be included in prompt assembly.UserPrompt: prompt context text for this field.LabelOn: text shown when the switch value istrue.LabelOff: text shown when the switch value isfalse.LabelPlacement: one ofBottom,End,Left,Right,Start,Top; omitted values follow the renderer default.Icon: MudBlazor icon identifier string displayed inside the switch thumb.IconColor: one of the MudBlazorColorenum names such asPrimary,Secondary,Warning; omitted values default toInherit.CheckedColor: color used when the switch state istrue; omitted values default toInherit.UncheckedColor: color used when the switch state isfalse; omitted values default toInherit.Class,Style: forwarded to the rendered component for layout/styling.
Example Switch component
{
["Type"] = "SWITCH",
["Props"] = {
["Name"] = "IncludeSummary",
["Label"] = "Include summary",
["Value"] = true,
["Disabled"] = false,
["UserPrompt"] = "Decide whether the final answer should include a short summary.",
["LabelOn"] = "Summary enabled",
["LabelOff"] = "Summary disabled",
["LabelPlacement"] = "End",
["Icon"] = "Icons.Material.Filled.Summarize",
["IconColor"] = "Primary",
["CheckedColor"] = "Success",
["UncheckedColor"] = "Default",
["Class"] = "mb-6",
}
}
COLOR_PICKER reference
- Use
Type = "COLOR_PICKER"to render a MudBlazor color picker. - Required props:
Name: unique state key used in prompt assembly andBuildPrompt(input.fields).Label: visible field label.
- Optional props:
Placeholder: default color hex string (e.g.#FF10FF) or initial hint text.ShowAlpha: defaults totrue; enables alpha channel editing.ShowToolbar: defaults totrue; shows picker/grid/palette toolbar.ShowModeSwitch: defaults totrue; allows switching between HEX/RGB(A)/HSL modes.PickerVariant: one ofDIALOG,INLINE,STATIC; invalid or omitted values fall back toSTATIC.UserPrompt: prompt context text for the selected color.Class,Style: forwarded to the rendered component for layout/styling.
Example Colorpicker component
{
["Type"] = "COLOR_PICKER",
["Props"] = {
["Name"] = "accentColor",
["Label"] = "Accent color",
["Placeholder"] = "#FFAA00",
["ShowAlpha"] = false,
["ShowToolbar"] = true,
["ShowModeSwitch"] = true,
["PickerVariant"] = "STATIC",
["UserPrompt"] = "Use this as the accent color for the generated design."
}
}
Prompt Assembly - UserPrompt Property
Each component exposes a UserPrompt string. When the assistant runs, AssistantDynamic recursively iterates over the component tree and, for each component that has a prompt, emits:
context:
<UserPrompt>
---
user prompt:
<value extracted from the component>
For switches the “value” is the boolean true/false; for readers it is the fetched/selected content; for color pickers it is the selected color text (for example #FFAA00 or rgba(...), depending on the picker mode). Always provide a meaningful UserPrompt so the final concatenated prompt remains coherent from the LLM’s perspective.
Advanced Prompt Assembly - BuildPrompt()
If you want full control over prompt composition, define ASSISTANT.BuildPrompt as a Lua function. When present, AI Studio calls it and uses its return value as the final user prompt. The default prompt assembly is skipped.
Interface
ASSISTANT.BuildPrompt(LuaTable input) => stringmust return a string, the complete User Prompt.- If the function is missing, returns
nil, or returns a non-string, AI Studio falls back to the default prompt assembly. - Errors in the function are caught and logged, then fall back to the default prompt assembly.
input table shape
The function receives a single input Lua table with:
input.fields: values keyed by componentName- Text area, single-select dropdown, and readers are strings
- Multiselect dropdown is an array-like Lua table of strings
- Switch is a boolean
- Color picker is the selected color as a string
input.meta: per-component metadata keyed by componentNameType(string, e.g.TEXT_AREA,DROPDOWN,SWITCH,COLOR_PICKER)Label(string, when provided)UserPrompt(string, when provided)
input.profile: selected profile dataName,NeedToKnow,Actions,Num- When no profile is selected, values match the built-in "Use no profile" entry
input = {
fields = {
["<Name>"] = "<string|boolean>",
...
},
meta = {
["<Name>"] = {
Type = "<TEXT_AREA|DROPDOWN|SWITCH|WEB_CONTENT_READER|FILE_CONTENT_READER|COLOR_PICKER>",
Label = "<string?>",
UserPrompt = "<string?>"
},
...
},
profile = {
Name = "<string>",
NeedToKnow = "<string>",
Actions = "<string>",
Num = <number>
}
}
-- <Name> is the value you set in the components name property
Using meta inside BuildPrompt
input.meta is useful when you want to dynamically build the prompt based on component type or reuse existing UI text (labels/user prompts).
Example: iterate all fields with labels and include their values
ASSISTANT.BuildPrompt = function(input)
local parts = {}
for name, value in pairs(input.fields) do
local meta = input.meta[name]
if meta and meta.Label and value ~= "" then
table.insert(parts, meta.Label .. ": " .. tostring(value))
end
end
return table.concat(parts, "\n")
end
Example: handle types differently
ASSISTANT.BuildPrompt = function(input)
local parts = {}
for name, meta in pairs(input.meta) do
local value = input.fields[name]
if meta.Type == "SWITCH" then
table.insert(parts, name .. ": " .. tostring(value))
elseif meta.Type == "COLOR_PICKER" and value and value ~= "" then
table.insert(parts, name .. ": " .. value)
elseif value and value ~= "" then
table.insert(parts, name .. ": " .. value)
end
end
return table.concat(parts, "\n")
end
Using profile inside BuildPrompt
Profiles are optional user context (e.g., "NeedToKnow" and "Actions"). You can inject this directly into the user prompt if you want the LLM to always see it.
Example: Add user profile context to the prompt
ASSISTANT.BuildPrompt = function(input)
local parts = {}
if input.profile and input.profile.NeedToKnow ~= "" then
table.insert(parts, "User context:")
table.insert(parts, input.profile.NeedToKnow)
table.insert(parts, "")
end
table.insert(parts, input.fields.Main or "")
return table.concat(parts, "\n")
end
Advanced Layout Options
LAYOUT_GRID reference
A 12-column grid system for organizing content with responsive breakpoints for different screen sizes.
+------------------------------------------------------------+
| 12 |
+------------------------------------------------------------+
+----------------------------+ +----------------------------+
| 6 | | 6 |
+----------------------------+ +----------------------------+
+------------+ +------------+ +-----------+ +-------------+
| 3 | | 3 | | 3 | | 3 |
+------------+ +------------+ +-----------+ +-------------+
- Use
Type = "LAYOUT_GRID"to render a MudBlazor grid container. - Required props:
Name: unique identifier for the layout node.
- Required structure:
Children: array ofLAYOUT_ITEMcomponent tables. Other child component types are ignored.
- Optional props:
Justify: one of the MudBlazorJustifyenum names such asFlexStart,Center,SpaceBetween; omitted values fall back toFlexStart.Spacing: integer spacing between grid items; omitted values fall back to6.Class,Style: forwarded to the renderedMudGridfor layout/styling.
Example: How to define a flexible grid
{
["Type"] = "LAYOUT_GRID",
["Props"] = {
["Name"] = "mainGrid",
["Justify"] = "FlexStart",
["Spacing"] = 2
},
["Children"] = {
{
["Type"] = "LAYOUT_ITEM",
["Props"] = {
["Name"] = "contentColumn",
["Xs"] = 12,
["Lg"] = 8
},
["Children"] = {
["Type"] = "<TEXT_AREA|BUTTON|BUTTON_GROUP|SWITCH|PROVIDER_SELECTION|...>",
["Props"] = {...},
},
},
{
["Type"] = "LAYOUT_ITEM",
["Props"] = {
["Name"] = "contentColumn2",
["Xs"] = 12,
["Lg"] = 8
},
["Children"] = {
["Type"] = "<TEXT_AREA|BUTTON|BUTTON_GROUP|SWITCH|PROVIDER_SELECTION|...>",
["Props"] = {...},
},
},
...
}
}
For a visual example and a full explanation look here
LAYOUT_ITEM reference
LAYOUT_ITEM is used to wrap children components to use them into a grid.
The Breakpoints define how many columns the wrapped components take up in a 12-column grid.
Read more about breakpoint here.
- Use
Type = "LAYOUT_ITEM"to render a MudBlazor grid item. - Required props:
Name: unique identifier for the layout node.
- Intended parent:
- Use this component inside
LAYOUT_GRID.
- Use this component inside
- Optional props:
Xs,Sm,Md,Lg,Xl,Xxl: integer breakpoint widths. Omit a breakpoint to leave it unset.Class,Style: forwarded to the renderedMudItemfor layout/styling.
Childrenmay contain any other assistant components you want to place inside the item.
Example: How to wrap a child component and define its breakpoints
{
["Type"] = "LAYOUT_ITEM",
["Props"] = {
["Name"] = "contentColumn",
["Xs"] = 12,
["Lg"] = 8
},
["Children"] = {
{
["Type"] = "<TEXT_AREA|BUTTON|BUTTON_GROUP|SWITCH|PROVIDER_SELECTION|...>",
["Props"] = {...},
}
}
}
For a full explanation look here
LAYOUT_PAPER reference
- Use
Type = "LAYOUT_PAPER"to render a MudBlazor paper container. - Required props:
Name: unique identifier for the layout node.
- Optional props:
Elevation: integer elevation; omitted values fall back to1.Height,MaxHeight,MinHeight,Width,MaxWidth,MinWidth: CSS size values such as100%,24rem,50vh.IsOutlined: defaults tofalse; toggles outlined mode.IsSquare: defaults tofalse; removes rounded corners.Class,Style: forwarded to the renderedMudPaperfor layout/styling.
Childrenmay contain any other assistant components you want to wrap.
Example: How to define a MudPaper wrapping child components
{
["Type"] = "LAYOUT_PAPER",
["Props"] = {
["Name"] = "contentPaper",
["Elevation"] = 2,
["Width"] = "100%",
["IsOutlined"] = true
},
["Children"] = {
{
["Type"] = "<TEXT_AREA|BUTTON|BUTTON_GROUP|SWITCH|PROVIDER_SELECTION|...>",
["Props"] = {...},
},
...
}
}
For a visual example and a full explanation look here
LAYOUT_STACK reference
- Use
Type = "LAYOUT_STACK"to render a MudBlazor stack layout. - Required props:
Name: unique identifier for the layout node.
- Optional props:
IsRow: defaults tofalse; renders items horizontally.IsReverse: defaults tofalse; reverses the visual order.Breakpoint: one of the MudBlazorBreakpointenum names such asSm,Md,Lg; omitted values fall back toNone.Align: one of the MudBlazorAlignItemsenum names such asStart,Center,Stretch; omitted values fall back toStretch.Justify: one of the MudBlazorJustifyenum names such asFlexStart,Center,SpaceBetween; omitted values fall back toFlexStart.Stretch: one of the MudBlazorStretchItemsenum names such asNone,Start,End,Stretch; omitted values fall back toNone.Wrap: one of the MudBlazorWrapenum names such asWrap,NoWrap,WrapReverse; omitted values fall back toWrap.Spacing: integer spacing between child components; omitted values fall back to3.Class,Style: forwarded to the renderedMudStackfor layout/styling.
Childrenmay contain any other assistant components you want to arrange.
Example: Define a stack of children components
{
["Type"] = "LAYOUT_STACK",
["Props"] = {
["Name"] = "toolbarRow",
["IsRow"] = true,
["Align"] = "Center",
["Justify"] = "SpaceBetween",
["Spacing"] = 2
},
["Children"] = {
{
["Type"] = "<TEXT_AREA|BUTTON|BUTTON_GROUP|SWITCH|PROVIDER_SELECTION|...>",
["Props"] = {...},
},
...
}
}
For a visual example and a full explanation look here
Useful Lua Functions
Included lua libraries
- Basic Functions Library
- Coroutine Manipulation Library
- String Manipulation Library
- Table Manipulation Library
- Mathematical Functions Library
- Bitwise Operations Library
Logging helpers
The assistant runtime exposes basic logging helpers to Lua. Use them to debug custom prompt building.
LogDebug(message)LogInfo(message)LogWarn(message)LogError(message)
Example: Use Logging in lua functions
ASSISTANT.BuildPrompt = function(input)
LogInfo("BuildPrompt called")
return input.fields.Text or ""
end
Date/time helpers (assistant plugins only)
Use these when you need timestamps inside Lua.
DateTime(format)returns a table with date/time parts plus a formatted string.formatis optional; default isyyyy-MM-dd HH:mm:ss(ISO 8601-like).formattedcontains the date in your desired format (e.g.dd.MM.yyyy HH:mm) or the default.- Members:
year,month,day,hour,minute,second,millisecond,formatted.
Timestamp()returns a UTC timestamp in ISO-8601 format (O/ round-trip), e.g.2026-03-02T21:15:30.1234567Z.
Example: Use the datetime functions in lua
local dt = DateTime("yyyy-MM-dd HH:mm:ss")
LogInfo(dt.formatted)
LogInfo(Timestamp())
LogInfo(dt.day .. "." .. dt.month .. "." .. dt.year)
General Tips
- Give every component a unique
Name— it’s used to track state and treated like an Id. - Keep in mind that components and their properties are case-sensitive (e.g. if you write
["Type"] = "heading"instead of["Type"] = "HEADING"the component will not be registered). Always copy-paste the component from theplugin.luamanifest to avoid this. - When you expect default content (e.g., a textarea with instructions), keep
UserPromptbut also setPrefillTextso the user starts with a hint. - If you need extra explanatory text (before or after the interactive controls), use
TEXTorHEADINGcomponents. - Keep
Preselect/PreselectContentCleanerAgentflags inWEB_CONTENT_READERto simplify the initial UI for the user.