Support registering custom action steps
Maintainers usually reply within 1 day
Nobody has claimed this yet.
Assessment
- Difficulty
- 5/5
- Estimated time
- Over a week
- Newbie friendliness
- 35/100
- Issue type
- Feature
- Clarity
- Mostly clear
- Activity status
- Quiet
- Tech stack
- typescript
- Domain
- api
Research direction
Start by tracing how built-in action steps are parsed and evaluated, how they appear in generated system prompts, and how the Renderer exposes the onAction callback. The issue names no files or tests, so first locate those entry points and check how Action([...]) is handled. Done means registered steps work inside Action, dispatch typed params to the host, appear in prompts, and unknown steps fail clearly.
Written by the indexing model from the issue text.
Description
Is your feature request related to a problem? Please describe.
We need app-specific click behavior that does not map cleanly to the built-in action steps (@ToAssistant, @OpenUrl, @Run, @Set, @Reset). In our case, we want the model to say what happens when tapping a card: open a menu, post a message, reset the conversation etc.
Today, unknown @ calls are not evaluated as action steps. We work around this by preprocessing OpenUI Lang before render, rewriting syntax like:
Action([@OpenMenu(["option 1", "option 2"])])
into a plain object literal that our component reads from an action prop. That works, but it is brittle (regex/string rewriting), duplicates knowledge already in the system prompt, and is easy to get wrong while streaming.
Describe the solution you'd like
A public API to register custom action handlers, e.g.:
registerActionStep({
name: "OpenMenu",
description: "Opens a menu with the given options",
props: z.object({
options: z.array(z.string()),
}),
evaluate: (props) => ({
openMenu(props.options);
}),
});
Requirements:
- Registered steps appear in generated system prompts (like built-ins).
- They can be used inside
Action([...]). - They dispatch to the host app via
onAction(or a similar callback), with a typedparamspayload. - Unknown
@steps fail clearly at parse/eval time instead of being silently dropped.
Describe alternatives you've considered
- Object literals in props — e.g.
{ intent: "product_select", name, variantId }onaction: z.any(). Works, but is less ergonomic for the LLM and not documented as a first-class action pattern. - Component-only handling — custom card components with explicit props instead of
Action([...]). More verbose in generated Lang. - String preprocessing — rewrite Lang before
Renderer. Current approach; fragile and hard to maintain. - Always use
@ToAssistant— sends a message immediately; cannot support intermediate UI like a product menu.
- Dominant language
- TypeScript
- Stars
- 10k
- Forks
- 698
- Avg merge
- 1d 3h
- Merged PRs (30d)
- 133
Getting set up
This project ships no dev container, Dockerfile or contributing guide, so setting up is up to you: start from its README, and see our first-contribution guide for the general steps.
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from thesysdev/openui
-
Difficulty 2/5 1-3 hours Newbie friendliness 62/100
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 70/100
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
thesysdev/openui#1445 · 2 comments ·
Maintainers usually reply within 1 day
-
Add dataInvention flag to PromptOptions to disable the 'generate realistic/plausible data' ruleOpen
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
thesysdev/openui#959 · 1 comment ·
Maintainers usually reply within 1 day
-
Difficulty 1/5 Under an hour Newbie friendliness 18/100
thesysdev/openui#1528 · 1 reaction ·
Maintainers usually reply within 1 day
All issues in thesysdev/openui
Similar issues
-
Difficulty 1/5 Under an hour Newbie friendliness 88/100
-
bug needs triage
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
DSpace/dspace-angular#6511 ·
Maintainers usually reply within 1 day
-
area: frontend area:byok bug severity:low
Difficulty 2/5 1-3 hours Newbie friendliness 65/100
Maintainers usually reply within 1 day
-
Phone app shows Unknown for a remote machine whose key changedPossibly taken @janicduplessis claimed this today. Openarea: mobile priority: P3 type: bug
Difficulty 1/5 Under an hour Newbie friendliness 78/100
appandflow/stim#5006 · 1 comment ·
Maintainers usually reply within 1 day
-
Area - Local to Cloud Bug
Difficulty 2/5 1-3 hours Newbie friendliness 66/100
microsoft/vscode-mssql#23209 ·
Maintainers usually reply within 1 day