Form Type
The Form type stores structured field metadata used by workflows and conversational interfaces. It is usually created through the form block command rather than direct new Form invocation.
Creation Syntax
@currentUser := "Michael"
@favCar form currentUser
modelName : "modelName"
color : "color"
currentUser : $currentUser
end
This shape is validated in tests/chat/formTest.mjs. The block lines are parsed as fieldName : fieldDescriptor pairs and stored inside the resulting Form instance.
Example
Form values are typically passed into a Workflow instance through workflow.configure ... $form .... The workflow reads formData and determines which answers are missing before generating the next question.
@cars form currentUser
carName : "Car name of" $currentUser
color : "Color of car for" $currentUser
end
@workflowAgent new Workflow "Assistant"
workflowAgent.configure "Use " $cars " to collect user preferences"
Step-by-Step Interaction
The interaction begins when the script declares optional form parameters after the form keyword, because those parameters can be referenced inside field descriptors. The script then defines fields line by line using the name : descriptor pattern until end closes the form block. Once runtime creates the form object, the script passes that variable into workflow or chat orchestration objects that can drive field-by-field collection. At execution time, host logic or user interaction supplies answer objects keyed by field names, and orchestration layers validate and merge those answers against the form definition.
Runtime Role Notes
The Form type is a declarative schema container for question/answer workflows. It separates field specification from execution strategy, which is handled by Workflow or chat orchestration layers.