204
case 'number':
205
case 'integer':
207
>
...base,
208
>
kind: field.type === 'integer' ? ChatInputQuestionKind.Integer : ChatInputQuestionKind.Number,
209
>
min: field.minimum,
210
>
max: field.maximum,
211
>
defaultValue: typeof field.default === 'number' ? field.default : undefined,
212
>
};
213
case 'array':
215
>
...base,
216
>
kind: ChatInputQuestionKind.MultiSelect,
217
>
// MCP enum arrays are strict — only the declared options are valid —
218
>
// but the workbench defaults an omitted `allowFreeformInput` to true.
219
>
allowFreeformInput: false,
220
>
options: field.items?.anyOf
221
? field.items.anyOf.map((o): ChatInputOption => ({ id: o.const, label: o.title || o.const }))
222
: (field.items?.enum ?? []).map((v): ChatInputOption => ({ id: v, label: v })),
224
>
max: field.maxItems,
225
>
};
226
case 'string':
227
default: