mirror of
https://github.com/MindWorkAI/AI-Studio.git
synced 2026-10-18 12:58:00 +00:00
Added direct-chat launchers for assistant plugins and a dialog to reconfigure them (#935)
Co-authored-by: Thorsten Sommer <SommerEngineering@users.noreply.github.com>
This commit is contained in:
1 parent
f03c2d1c88
commit
a4c35fc2f2
44 files changed
+2615
-219
No files matched your search
@@ -80,12 +80,11 @@ Each assistant plugin lives in its own directory under the assistants plugin roo
|
||||
```
|
||||
|
||||
## Structure
|
||||
- `ASSISTANT` is the root table. It must contain `Title`, `Description`, `SystemPrompt`, `SubmitText`, `AllowProfiles`, and the nested `UI` definition.
|
||||
- `ASSISTANT` is the root table. Every assistant requires `Title` and `Description`.
|
||||
- Form assistants additionally require `SystemPrompt`, `SubmitText`, `AllowProfiles`, and a nested `UI` definition.
|
||||
- Direct chat launchers instead require `LaunchBehavior = "OPEN_WORKSPACE_CHAT_BY_NAME"` and `WorkspaceName`. AI Studio stops reading the form-only fields as soon as a launch behavior is active, so older launchers that still carry them keep working.
|
||||
- `DEPLOYED_USING_CONFIG_SERVER` identifies who manages the assistant plugin. Set it to `false` for locally managed plugins. A missing field is also treated as local for compatibility with existing plugins. Enterprise-distributed plugins must set it to `true` and cannot be revised with AI in AI Studio.
|
||||
- `AI_STUDIO_ASSISTANT_BUILDER = {Generated = true, SchemaVersion = 1}` is reserved for plugins generated by the AI Studio Assistant Builder. It enables Builder-specific actions such as safe deletion and must not be added to manually authored or enterprise-distributed assistants. Newly generated Builder assistants always set `DEPLOYED_USING_CONFIG_SERVER = false` explicitly.
|
||||
- `ASSISTANT` may optionally define direct-launch metadata for assistant tiles:
|
||||
- `LaunchBehavior = "OPEN_WORKSPACE_CHAT_BY_NAME"`
|
||||
- `WorkspaceName = "<target workspace name>"`
|
||||
- `UI.Type` is always `"FORM"` and `UI.Children` is a list of component tables.
|
||||
- Each component table declares `Type`, an optional `Children` array, and a `Props` table that feeds the component’s parameters.
|
||||
|
||||
@@ -99,8 +98,6 @@ ASSISTANT = {
|
||||
["SystemPrompt"] = "",
|
||||
["SubmitText"] = "",
|
||||
["AllowProfiles"] = true,
|
||||
["LaunchBehavior"] = "OPEN_WORKSPACE_CHAT_BY_NAME",
|
||||
["WorkspaceName"] = "",
|
||||
["UI"] = {
|
||||
["Type"] = "FORM",
|
||||
["Children"] = {
|
||||
@@ -117,21 +114,38 @@ Assistant plugins can optionally skip the normal assistant page and open a chat
|
||||
ASSISTANT = {
|
||||
["Title"] = "Open Chat",
|
||||
["Description"] = "Open a new chat in the XXX workspace.",
|
||||
["SystemPrompt"] = "",
|
||||
["SubmitText"] = "Start",
|
||||
["AllowProfiles"] = true,
|
||||
["LaunchBehavior"] = "OPEN_WORKSPACE_CHAT_BY_NAME",
|
||||
["WorkspaceName"] = "XXX",
|
||||
["UI"] = {
|
||||
["Type"] = "FORM",
|
||||
["Children"] = {}
|
||||
}
|
||||
["ProviderId"] = "11111111-1111-1111-1111-111111111111", -- optional
|
||||
["ProfileId"] = "22222222-2222-2222-2222-222222222222", -- optional
|
||||
["ChatTemplateId"] = "33333333-3333-3333-3333-333333333333", -- optional
|
||||
["DataSourceIds"] = { -- optional; when present, at least one unique data source is required
|
||||
"44444444-4444-4444-4444-444444444444",
|
||||
"55555555-5555-5555-5555-555555555555",
|
||||
},
|
||||
}
|
||||
```
|
||||
|
||||
- `WorkspaceName` is resolved case-insensitively after trimming.
|
||||
- If the workspace does not exist yet, AI Studio creates it automatically.
|
||||
- The opened chat uses the normal default chat settings of AI Studio.
|
||||
- Omitted optional IDs use the chat defaults active when the tile is opened. An explicit empty GUID selects no profile or no chat template; an empty provider or data-source GUID is invalid.
|
||||
- `ProviderId` overrides both the chat-specific and app-wide default provider. It must name a provider that is permitted for chats at the required confidence level.
|
||||
- Explicit data sources are enabled and manually preselected, automatic source selection is disabled, and the normal automatic-validation setting is retained. Every referenced source must currently be available and permitted for the effective provider.
|
||||
- Invalid or unavailable references stop the launch with an error before a workspace or chat is created.
|
||||
- A selected chat template supplies the chat system prompt, profile allowance, predefined user prompt, attachments, and cloned example conversation. A launcher `SystemPrompt`, if retained in an older plugin, is ignored, so there is never a second competing system prompt.
|
||||
- When the selected chat template does not allow profiles, the template wins: the launcher `ProfileId` is dropped and the chat starts without a profile. This matches the disabled profile selection such a template produces in the chat.
|
||||
- The predefined user prompt and the attachments of the selected chat template are placed into the chat input, unless the user already has an unsent draft there.
|
||||
|
||||
### Editing a launcher in AI Studio
|
||||
Users can change a launcher without touching Lua and without asking a model: the tile on the assistants page and the plugins page both offer a settings dialog for the name, the title, the description, and every chat selection above. Changing a launcher is picking from drop-downs, so there is nothing to prompt about, and locally managed launchers therefore get this dialog instead of the AI revision.
|
||||
|
||||
Saving rewrites the whole `plugin.lua` in a canonical shape. Comments, formatting, and anything beyond the metadata and the `ASSISTANT` table would be lost that way, so AI Studio offers the dialog only for launchers that are:
|
||||
|
||||
- locally managed, meaning not internal and not deployed by a configuration server,
|
||||
- made of a single `plugin.lua` without companion Lua files, and
|
||||
- free of `ICON_SVG` and any `require(...)`.
|
||||
|
||||
Launchers with an own icon or extra Lua code keep the plugin code editor and the AI revision, so nothing an author wrote gets dropped. `AI_STUDIO_ASSISTANT_BUILDER` is carried over unchanged: the dialog never adds it to a manually authored plugin.
|
||||
|
||||
|
||||
#### Supported types (matching the Blazor UI components):
|
||||
|
||||
@@ -57,6 +57,9 @@ DEPLOYED_USING_CONFIG_SERVER = false
|
||||
ASSISTANT = {
|
||||
["Title"] = "<Title of your assistant>",
|
||||
["Description"] = "<Description presented to the users, explaining your assistant>",
|
||||
["SystemPrompt"] = "<System prompt for the assistant>",
|
||||
["SubmitText"] = "<label for submit button>",
|
||||
["AllowProfiles"] = true,
|
||||
["UI"] = {
|
||||
["Type"] = "FORM",
|
||||
["Children"] = {}
|
||||
@@ -70,8 +73,6 @@ ASSISTANT = {
|
||||
["SystemPrompt"] = "<prompt that fundamentally changes behaviour, personality and task focus of your assistant. Invisible to the user>", -- required
|
||||
["SubmitText"] = "<label for submit button>", -- required
|
||||
["AllowProfiles"] = true, -- if true, allows AiStudios profiles; required
|
||||
["LaunchBehavior"] = "<NONE|OPEN_WORKSPACE_CHAT_BY_NAME>", -- optional; when set to OPEN_WORKSPACE_CHAT_BY_NAME the tile opens a chat directly
|
||||
["WorkspaceName"] = "<name of the workspace to open or create>", -- optional; required for OPEN_WORKSPACE_CHAT_BY_NAME
|
||||
["UI"] = {
|
||||
["Type"] = "FORM",
|
||||
["Children"] = {
|
||||
@@ -429,3 +430,17 @@ ASSISTANT = {
|
||||
}
|
||||
},
|
||||
}
|
||||
|
||||
-- direct chat launcher example; form-only fields and UI are not used in this mode:
|
||||
ASSISTANT = {
|
||||
["Title"] = "<main title of chat launcher>",
|
||||
["Description"] = "<description of the chat that will be opened>",
|
||||
["LaunchBehavior"] = "OPEN_WORKSPACE_CHAT_BY_NAME",
|
||||
["WorkspaceName"] = "<name of the workspace to open or create>",
|
||||
["ProviderId"] = "<optional provider GUID; omit to use the chat default>",
|
||||
["ProfileId"] = "<optional profile GUID; use the empty GUID for no profile>",
|
||||
["ChatTemplateId"] = "<optional chat template GUID; use the empty GUID for no template>",
|
||||
["DataSourceIds"] = {
|
||||
"<optional data source GUID>",
|
||||
},
|
||||
}
|
||||
Reference in new issue
Block a user