2025-07-21 12:38:08 +00:00
require ( " icon " )
2026-02-23 16:18:14 +00:00
--[[
This sample assistant shows how plugin authors map Lua tables into UI components .
Each component declares a ` UserPrompt ` which is prepended as a ` context ` block , followed
by the actual component value in ` user prompt ` . See
` app / MindWork AI Studio / Plugins / assistants / README.md ` for the full data - model reference .
] ]
2025-09-29 18:58:01 +00:00
2025-07-21 12:38:08 +00:00
-- The ID for this plugin:
2025-09-29 18:58:01 +00:00
ID = " 00000000-0000-0000-0000-000000000000 "
2025-07-21 12:38:08 +00:00
-- The icon for the plugin:
ICON_SVG = SVG
-- The name of the plugin:
2025-09-29 18:58:01 +00:00
NAME = " <Company Name> - Configuration for <Department Name> "
2025-07-21 12:38:08 +00:00
-- The description of the plugin:
2025-09-29 18:58:01 +00:00
DESCRIPTION = " This is a pre-defined configuration of <Company Name> "
2025-07-21 12:38:08 +00:00
-- The version of the plugin:
VERSION = " 1.0.0 "
-- The type of the plugin:
2025-09-29 18:58:01 +00:00
TYPE = " ASSISTANT "
2025-07-21 12:38:08 +00:00
-- The authors of the plugin:
2025-09-29 18:58:01 +00:00
AUTHORS = { " <Company Name> " }
2025-07-21 12:38:08 +00:00
-- The support contact for the plugin:
2025-09-29 18:58:01 +00:00
SUPPORT_CONTACT = " <IT Department of Company Name> "
2025-07-21 12:38:08 +00:00
-- The source URL for the plugin:
2025-09-29 18:58:01 +00:00
SOURCE_URL = " <Any internal Git repository> "
2025-07-21 12:38:08 +00:00
-- The categories for the plugin:
2025-09-29 18:58:01 +00:00
CATEGORIES = { " CORE " }
2025-07-21 12:38:08 +00:00
-- The target groups for the plugin:
TARGET_GROUPS = { " EVERYONE " }
-- The flag for whether the plugin is maintained:
IS_MAINTAINED = true
-- When the plugin is deprecated, this message will be shown to users:
DEPRECATION_MESSAGE = " "
2025-09-29 18:58:01 +00:00
ASSISTANT = {
[ " Title " ] = " <Title of your assistant> " ,
[ " Description " ] = " <Description presented to the users, explaining your assistant> " ,
[ " UI " ] = {
[ " Type " ] = " FORM " ,
[ " Children " ] = { }
} ,
}
2025-11-11 19:01:22 +00:00
-- usage example with the full feature set:
2025-07-21 12:38:08 +00:00
ASSISTANT = {
2025-11-11 19:01:22 +00:00
[ " Title " ] = " <main title of assistant> " , -- required
2026-02-23 14:01:00 +00:00
[ " Description " ] = " <assistant description> " , -- required
[ " SystemPrompt " ] = " <prompt that fundamentally changes behaviour, personality and task focus of your assistant. Invisible to the user> " , -- required
2025-11-11 19:01:22 +00:00
[ " SubmitText " ] = " <label for submit button> " , -- required
[ " AllowProfiles " ] = true , -- if true, allows AiStudios profiles; required
2025-07-22 18:15:36 +00:00
[ " UI " ] = {
[ " Type " ] = " FORM " ,
[ " Children " ] = {
2025-07-21 12:38:08 +00:00
{
2025-11-11 19:01:22 +00:00
[ " Type " ] = " TEXT_AREA " , -- required
2025-07-22 18:15:36 +00:00
[ " Props " ] = {
2025-11-11 19:01:22 +00:00
[ " Name " ] = " <unique identifier of this component> " , -- required
[ " Label " ] = " <heading of your component> " , -- required
2026-03-13 00:14:03 +00:00
[ " Adornment " ] = " <Start|End|None> " , -- location of the `AdornmentIcon` OR `AdornmentText`; CASE SENSITIVE
2026-03-09 17:56:38 +00:00
[ " AdornmentIcon " ] = " Icons.Material.Filled.AppSettingsAlt " , -- The Mudblazor icon displayed for the adornment
[ " AdornmentText " ] = " " , -- The text displayed for the adornment
[ " AdornmentColor " ] = " <Dark|Error|Info|Inherit|Primary|Secondary|Success|Surface|Tertiary|Transparent|Warning> " , -- the color of AdornmentText or AdornmentIcon; CASE SENSITIVE
[ " Counter " ] = 0 , -- shows a character counter. When 0, the current character count is displayed. When 1 or greater, the character count and this count are displayed. Defaults to `null`
[ " MaxLength " ] = 100 , -- max number of characters allowed, prevents more input characters; use together with the character counter. Defaults to 524,288
[ " HelperText " ] = " <a helping text rendered under the text area to give hints to users> " ,
[ " IsImmediate " ] = false , -- changes the value as soon as input is received. Defaults to false but will be true if counter or maxlength is set to reflect changes
[ " HelperTextOnFocus " ] = true , -- if true, shows the helping text only when the user focuses on the text area
2025-11-11 19:01:22 +00:00
[ " UserPrompt " ] = " <direct input of instructions, questions, or tasks by a user> " ,
[ " PrefillText " ] = " <text to show in the field initially> " ,
[ " IsSingleLine " ] = false , -- if true, shows a text field instead of an area
2026-03-09 17:56:38 +00:00
[ " ReadOnly " ] = false , -- if true, deactivates user input (make sure to provide a PrefillText)
2026-03-10 12:12:46 +00:00
[ " Class " ] = " <optional MudBlazor or css classes> " ,
[ " Style " ] = " <optional css styles> " ,
2025-07-21 12:38:08 +00:00
}
} ,
{
2025-11-11 19:01:22 +00:00
[ " Type " ] = " DROPDOWN " , -- required
2025-07-22 18:15:36 +00:00
[ " Props " ] = {
2026-03-13 00:14:03 +00:00
[ " Name " ] = " <unique identifier of component> " , -- required
[ " Label " ] = " <heading of component> " , -- required
2025-11-11 19:01:22 +00:00
[ " UserPrompt " ] = " <direct input of instructions, questions, or tasks by a user> " ,
2026-03-13 00:14:03 +00:00
[ " IsMultiselect " ] = false ,
[ " HasSelectAll " ] = false ,
[ " SelectAllText " ] = " <label for 'SelectAll'-Button " ,
[ " HelperText " ] = " <helping text rendered under the component> " ,
[ " OpenIcon " ] = " Icons.Material.Filled.ArrowDropDown " ,
[ " OpenClose " ] = " Icons.Material.Filled.ArrowDropUp " ,
[ " IconColor " ] = " <Dark|Error|Info|Inherit|Primary|Secondary|Success|Surface|Tertiary|Transparent|Warning> " ,
[ " IconPositon " ] = " <Start|End> " ,
[ " Variant " ] = " <Text|Filled|Outlined> " ,
[ " ValueType " ] = " <string|int|bool> " , -- required
2025-11-11 19:01:22 +00:00
[ " Default " ] = { [ " Value " ] = " <internal data> " , [ " Display " ] = " <user readable representation> " } , -- required
[ " Items " ] = {
{ [ " Value " ] = " <internal data> " , [ " Display " ] = " <user readable representation> " } ,
{ [ " Value " ] = " <internal data> " , [ " Display " ] = " <user readable representation> " } ,
} -- required
2025-07-21 12:38:08 +00:00
}
} ,
{
2025-11-11 19:01:22 +00:00
[ " Type " ] = " SWITCH " ,
2025-07-22 18:15:36 +00:00
[ " Props " ] = {
2025-11-11 19:01:22 +00:00
[ " Name " ] = " <unique identifier of this component> " , -- required
[ " Label " ] = " <heading of your component> " , -- required
2026-02-23 14:01:00 +00:00
[ " Value " ] = true , -- initial switch state
2026-03-16 13:15:29 +00:00
[ " OnChanged " ] = function ( input ) -- optional; same input and return contract as BUTTON.Action(input)
return nil
end ,
2026-03-10 10:45:15 +00:00
[ " Disabled " ] = false , -- if true, disables user interaction but the value can still be used in the user prompt (use for presentation purposes)
2025-11-11 19:01:22 +00:00
[ " UserPrompt " ] = " <direct input of instructions, questions, or tasks by a user> " ,
2026-03-10 10:45:15 +00:00
[ " LabelOn " ] = " <text if state is true> " ,
[ " LabelOff " ] = " <text if state is false> " ,
[ " LabelPlacement " ] = " <Bottom|End|Left|Right|Start|Top> " , -- Defaults to End (right of the switch)
[ " Icon " ] = " Icons.Material.Filled.Bolt " , -- places a thumb icon inside the switch
[ " IconColor " ] = " <Dark|Error|Info|Inherit|Primary|Secondary|Success|Surface|Tertiary|Transparent|Warning> " , -- color of the thumb icon. Defaults to `Inherit`
[ " CheckedColor " ] = " <Dark|Error|Info|Inherit|Primary|Secondary|Success|Surface|Tertiary|Transparent|Warning> " , -- color of the switch if state is true. Defaults to `Inherit`
[ " UncheckedColor " ] = " <Dark|Error|Info|Inherit|Primary|Secondary|Success|Surface|Tertiary|Transparent|Warning> " , -- color of the switch if state is false. Defaults to `Inherit`
2026-03-10 12:12:46 +00:00
[ " Class " ] = " <optional MudBlazor or css classes> " ,
[ " Style " ] = " <optional css styles> " ,
2026-03-10 14:43:40 +00:00
}
} ,
{
[ " Type " ] = " BUTTON " ,
[ " Props " ] = {
[ " Name " ] = " buildEmailOutput " ,
2026-03-16 13:15:29 +00:00
[ " Text " ] = " Build email output " , -- keep this even for icon-only buttons so the manifest stays readable
[ " IsIconButton " ] = false , -- when true, renders an icon-only action button using StartIcon
2026-03-10 14:43:40 +00:00
[ " Size " ] = " <Small|Medium|Large> " , -- size of the button. Defaults to Medium
[ " Variant " ] = " <Filled|Outlined|Text> " , -- display variation to use. Defaults to Text
[ " Color " ] = " <Dark|Error|Info|Inherit|Primary|Secondary|Success|Surface|Tertiary|Transparent|Warning> " , -- color of the button. Defaults to Default
[ " IsFullWidth " ] = false , -- ignores sizing and renders a long full width button. Defaults to false
2026-03-16 13:15:29 +00:00
[ " StartIcon " ] = " Icons.Material.Filled.ArrowRight " , -- icon displayed before the text, or the main icon for icon-only buttons. Defaults to null
2026-03-10 14:43:40 +00:00
[ " EndIcon " ] = " Icons.Material.Filled.ArrowLeft " , -- icon displayed after the text. Defaults to null
2026-03-16 13:15:29 +00:00
[ " IconColor " ] = " <Dark|Error|Info|Inherit|Primary|Secondary|Success|Surface|Tertiary|Transparent|Warning> " , -- color of start and end icons on text buttons. Defaults to Inherit
2026-03-10 14:43:40 +00:00
[ " IconSize " ] = " <Small|Medium|Large> " , -- size of icons. Defaults to null. When null, the value of ["Size"] is used
[ " 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 \n Translate this email. "
end
return {
fields = {
outputBuffer = output
}
}
end ,
[ " Class " ] = " <optional MudBlazor or css classes> " ,
[ " Style " ] = " <optional css styles> " ,
2025-07-21 12:38:08 +00:00
}
} ,
2026-03-10 15:12:00 +00:00
{
[ " Type " ] = " BUTTON_GROUP " ,
[ " Props " ] = {
[ " Variant " ] = " <Filled|Outlined|Text> " , -- display variation of the group. Defaults to Filled
[ " Color " ] = " <Dark|Error|Info|Inherit|Primary|Secondary|Success|Surface|Tertiary|Transparent|Warning> " , -- color of the group. Defaults to Default
[ " Size " ] = " <Small|Medium|Large> " , -- size of the group. Defaults to Medium
[ " OverrideStyles " ] = false , -- allows MudBlazor group style overrides. Defaults to false
[ " Vertical " ] = false , -- renders buttons vertically instead of horizontally. Defaults to false
[ " DropShadow " ] = true , -- applies a group shadow. Defaults to true
[ " Class " ] = " <optional MudBlazor or css classes> " ,
[ " Style " ] = " <optional css styles> " ,
} ,
[ " Children " ] = {
-- BUTTON_ELEMENTS
}
} ,
2026-03-10 17:57:48 +00:00
{
[ " Type " ] = " LAYOUT_STACK " ,
[ " Props " ] = {
[ " Name " ] = " exampleStack " ,
[ " IsRow " ] = true ,
[ " Align " ] = " Center " ,
[ " Justify " ] = " SpaceBetween " ,
[ " Wrap " ] = " Wrap " ,
[ " Spacing " ] = 2 ,
[ " Class " ] = " <optional MudBlazor or css classes> " ,
2026-03-13 22:47:41 +00:00
[ " Style " ] = " <optional css styles> " ,
} ,
[ " Children " ] = {
-- CHILDREN
}
} ,
{
[ " Type " ] = " LAYOUT_ACCORDION " ,
[ " Props " ] = {
[ " Name " ] = " exampleAccordion " ,
[ " AllowMultiSelection " ] = false , -- if true, multiple sections can stay open at the same time
[ " IsDense " ] = false , -- denser layout with less spacing
[ " HasOutline " ] = false , -- outlined accordion panels
[ " IsSquare " ] = false , -- removes rounded corners
[ " Elevation " ] = 0 , -- shadow depth of the accordion container
[ " HasSectionPaddings " ] = true , -- controls section gutters / inner frame paddings
[ " Class " ] = " <optional MudBlazor or css classes> " ,
[ " Style " ] = " <optional css styles> " ,
} ,
[ " Children " ] = {
-- LAYOUT_ACCORDION_SECTION elements
}
} ,
{
[ " Type " ] = " LAYOUT_ACCORDION_SECTION " ,
[ " Props " ] = {
[ " Name " ] = " exampleAccordionSection " , -- required
[ " HeaderText " ] = " <section title shown in the accordion header> " , -- required
[ " IsDisabled " ] = false , -- disables expanding/collapsing and interaction
[ " IsExpanded " ] = false , -- initial expansion state
[ " IsDense " ] = false , -- denser panel layout
[ " HasInnerPadding " ] = true , -- controls padding around the section content
[ " HideIcon " ] = false , -- hides the expand/collapse icon
[ " HeaderIcon " ] = " Icons.Material.Filled.ExpandMore " , -- icon shown before the header text
[ " HeaderColor " ] = " <Dark|Error|Info|Inherit|Primary|Secondary|Success|Surface|Tertiary|Transparent|Warning> " ,
[ " HeaderTypo " ] = " <body1|subtitle1|h6|...> " , -- MudBlazor typo value used for the header
[ " HeaderAlign " ] = " <Start|Center|End|Justify> " , -- header text alignment
[ " MaxHeight " ] = 320 , -- nullable integer pixel height for the expanded content area
[ " ExpandIcon " ] = " Icons.Material.Filled.ExpandMore " , -- override the expand/collapse icon
[ " Class " ] = " <optional MudBlazor or css classes> " ,
2026-03-10 17:57:48 +00:00
[ " Style " ] = " <optional css styles> " ,
} ,
[ " Children " ] = {
-- CHILDREN
}
} ,
{
[ " Type " ] = " LAYOUT_PAPER " ,
[ " Props " ] = {
[ " Name " ] = " examplePaper " ,
[ " Elevation " ] = 2 ,
[ " Width " ] = " 100% " ,
[ " Class " ] = " pa-4 mb-3 " ,
[ " Style " ] = " <optional css styles> " ,
} ,
[ " Children " ] = {
-- CHILDREN
}
} ,
{
[ " Type " ] = " LAYOUT_GRID " ,
[ " Props " ] = {
[ " Name " ] = " exampleGrid " ,
[ " Justify " ] = " FlexStart " ,
[ " Spacing " ] = 2 ,
[ " Class " ] = " <optional MudBlazor or css classes> " ,
[ " Style " ] = " <optional css styles> " ,
} ,
[ " Children " ] = {
-- CHILDREN
}
} ,
2025-07-21 12:38:08 +00:00
{
2025-11-11 19:01:22 +00:00
[ " Type " ] = " PROVIDER_SELECTION " , -- required
2025-07-22 18:15:36 +00:00
[ " Props " ] = {
2026-02-23 14:01:00 +00:00
[ " Name " ] = " Provider " ,
[ " Label " ] = " Choose LLM "
}
} ,
-- If you add a PROFILE_SELECTION component, AI Studio will hide the footer selection and use this block instead:
{
[ " Type " ] = " PROFILE_SELECTION " ,
[ " Props " ] = {
[ " ValidationMessage " ] = " <warning message that is shown when the user has not picked a profile> "
2025-07-21 12:38:08 +00:00
}
} ,
2026-02-10 15:12:59 +00:00
{
[ " Type " ] = " HEADING " , -- descriptive component for headings
[ " Props " ] = {
2026-02-10 16:06:45 +00:00
[ " Text " ] = " <heading content> " , -- required
2026-02-10 15:12:59 +00:00
[ " Level " ] = 2 -- Heading level, 1 - 3
}
} ,
{
[ " Type " ] = " TEXT " , -- descriptive component for normal text
[ " Props " ] = {
2026-02-10 16:06:45 +00:00
[ " Content " ] = " <text content> "
}
} ,
{
[ " Type " ] = " LIST " , -- descriptive list component
[ " Props " ] = {
[ " Items " ] = {
{
[ " Type " ] = " LINK " , -- required
[ " Text " ] = " <user readable link text> " ,
[ " Href " ] = " <link> " -- required
} ,
{
[ " Type " ] = " TEXT " , -- required
[ " Text " ] = " <user readable text> "
}
}
2026-02-10 15:12:59 +00:00
}
} ,
2026-02-24 10:31:16 +00:00
{
[ " Type " ] = " IMAGE " ,
[ " Props " ] = {
[ " Src " ] = " plugin://assets/example.png " ,
[ " Alt " ] = " SVG-inspired placeholder " ,
[ " Caption " ] = " Static illustration via the IMAGE component. "
}
} ,
2026-02-23 15:13:28 +00:00
{
[ " Type " ] = " WEB_CONTENT_READER " , -- allows the user to fetch a URL and clean it
[ " Props " ] = {
[ " Name " ] = " <unique identifier of this component> " , -- required
[ " UserPrompt " ] = " <help text that explains the purpose of this reader> " ,
[ " Preselect " ] = false , -- automatically show the reader when the assistant opens
[ " PreselectContentCleanerAgent " ] = true -- run the content cleaner by default
}
} ,
2026-02-23 15:33:24 +00:00
{
[ " Type " ] = " FILE_CONTENT_READER " , -- allows the user to load local files
[ " Props " ] = {
[ " Name " ] = " <unique identifier of this component> " , -- required
[ " UserPrompt " ] = " <help text reminding the user what kind of file they should load> "
}
} ,
2026-03-09 12:23:35 +00:00
{
[ " Type " ] = " COLOR_PICKER " ,
[ " Props " ] = {
[ " Name " ] = " <unique identifier of this component> " , -- required
[ " Label " ] = " <heading of your component> " , -- required
[ " Placeholder " ] = " <use this as a default color property with HEX code (e.g '#FFFF12') or just show hints to the user> " ,
[ " ShowAlpha " ] = true , -- weather alpha channels are shown
[ " ShowToolbar " ] = true , -- weather the toolbar to toggle between picker, grid or palette is shown
[ " ShowModeSwitch " ] = true , -- weather switch to toggle between RGB(A), HEX or HSL color mode is shown
2026-03-09 17:56:38 +00:00
[ " PickerVariant " ] = " <Dialog|Inline|Static> " , -- different rendering modes: `Dialog` opens the picker in a modal type screen, `Inline` shows the picker next to the input field and `Static` renders the picker widget directly (default); Case sensitiv
2026-03-09 12:23:35 +00:00
[ " UserPrompt " ] = " <help text reminding the user what kind of file they should load> " ,
}
} ,
2026-03-16 19:06:50 +00:00
{
[ " Type " ] = " DATE_PICKER " ,
[ " Props " ] = {
[ " Name " ] = " <unique identifier of this component> " , -- required
[ " Label " ] = " <heading of your component> " , -- required
[ " Value " ] = " 2026-03-16 " , -- optional initial value
[ " Placeholder " ] = " YYYY-MM-DD " ,
[ " HelperText " ] = " <optional help text rendered under the picker> " ,
[ " DateFormat " ] = " yyyy-MM-dd " ,
[ " PickerVariant " ] = " <Dialog|Inline|Static> " ,
[ " UserPrompt " ] = " <prompt context for the selected date> " ,
[ " Class " ] = " <optional MudBlazor or css classes> " ,
[ " Style " ] = " <optional css styles> " ,
}
} ,
{
[ " Type " ] = " DATE_RANGE_PICKER " ,
[ " Props " ] = {
[ " Name " ] = " <unique identifier of this component> " , -- required
[ " Label " ] = " <heading of your component> " , -- required
[ " Value " ] = " 2026-03-16 - 2026-03-20 " , -- optional initial range
[ " PlaceholderStart " ] = " Start date " ,
[ " PlaceholderEnd " ] = " End date " ,
[ " HelperText " ] = " <optional help text rendered under the picker> " ,
[ " DateFormat " ] = " yyyy-MM-dd " ,
[ " PickerVariant " ] = " <Dialog|Inline|Static> " ,
[ " UserPrompt " ] = " <prompt context for the selected date range> " ,
[ " Class " ] = " <optional MudBlazor or css classes> " ,
[ " Style " ] = " <optional css styles> " ,
}
} ,
{
[ " Type " ] = " TIME_PICKER " ,
[ " Props " ] = {
[ " Name " ] = " <unique identifier of this component> " , -- required
[ " Label " ] = " <heading of your component> " , -- required
[ " Value " ] = " 14:30 " , -- optional initial time
[ " Placeholder " ] = " HH:mm " ,
[ " HelperText " ] = " <optional help text rendered under the picker> " ,
[ " TimeFormat " ] = " HH:mm " ,
[ " AmPm " ] = false ,
[ " PickerVariant " ] = " <Dialog|Inline|Static> " ,
[ " UserPrompt " ] = " <prompt context for the selected time> " ,
[ " Class " ] = " <optional MudBlazor or css classes> " ,
[ " Style " ] = " <optional css styles> " ,
}
} ,
2025-07-21 12:38:08 +00:00
}
} ,
2026-02-23 14:01:00 +00:00
}