Skip to content

ModuleUi panels

The dashboard generates a form from your input schema, a timeline for the run and a card for each gate. ui lets a module adjust how those are presented, with plain data. No code from your module runs in the browser.

defineModule({
// ...
ui: {
input: { /* form hints */ },
config: { /* form hints, plus secret */ },
runSummary: [ /* panels */ ],
gates: { /* presentation by gate id */ },
},
});

defineModule validates the descriptor and throws a list of problems, so a bad path or an unknown key fails early. Strings in the descriptor are labels, so each is limited to 200 characters. At most 12 panels.

ui.input and ui.config share a shape:

Property Meaning
order Field names in display order. Each must exist in the schema.
fields[name] Hints for one field (below)
groups { id, title } sections. A field joins one with group.
secret ui.config only. Keys masked in the UI and in the API.

A field hint can set:

Property Values
widget text, textarea, select, segmented, switch, checkbox, number, json
placeholder, help Text
showIf { field, equals }: show only when another field has that value
group A group id declared in groups
ui: {
input: {
order: ['from', 'material', 'contentType'],
fields: {
from: { widget: 'segmented' },
material: { widget: 'textarea', help: 'A topic, a link, or the text itself.' },
},
},
}

Panels point into the run with paths:

  • input.<field>
  • outputs.<stage>.<field>
  • gates.<gate>.edits.<field>

[] maps over an array and [0] indexes it, for example outputs.draft.images[]. A path that names a stage or gate that does not exist is rejected.

runSummary is a list of panels shown on the run page.

Kind Shows
keyValue A titled list of { label, path, format? }. format is text, number, datetime, url or code.
list A titled list from an array at path, each item with a title and optional subtitle, href and badge (paths relative to the item)
flags An array of { kind, detail } shown as flags, with an empty message
artifact One artifact by exact name, or a path prefixed with =; view is preview or download
gallery A titled gallery from an array of artifact names at names
runSummary: [
{ kind: 'keyValue', title: 'Piece', fields: [
{ label: 'Format', path: 'input.contentType' },
{ label: 'Headline', path: 'outputs.draft.title' },
] },
{ kind: 'flags', title: 'Review flags', path: 'outputs.review.flags', empty: 'No flags.' },
{ kind: 'artifact', name: 'content.html', view: 'preview' },
]

ui.gates[gateId]:

Property Meaning
optionLayout list, grid or gallery
showArtifacts A path to an array of artifact names to show beside the options
historyItemTitle Where each item’s title lives in the sent-back stage’s earlier outputs

The gate id must be a gate stage of the module.