@@ -3417,39 +3417,44 @@ async function testTool(toolId) {
3417
3417
fieldDiv . appendChild ( arrayContainer ) ;
3418
3418
fieldDiv . appendChild ( addBtn ) ;
3419
3419
} else {
3420
- // Input field with validation
3421
- const input = document . createElement ( "input" ) ;
3422
- input . name = keyValidation . value ;
3423
- input . required =
3424
- schema . required && schema . required . includes ( key ) ;
3425
- input . className =
3426
- "mt-1 block w-full rounded-md border border-gray-300 shadow-sm focus:border-indigo-500 focus:ring-indigo-500 dark:bg-gray-900 text-gray-700 dark:text-gray-300 dark:border-gray-700 dark:focus:border-indigo-400 dark:focus:ring-indigo-400" ;
3427
- // Add validation based on type
3428
- if ( prop . type === "text" ) {
3429
- input . type = "text" ;
3430
- } else if (
3431
- prop . type === "number" ||
3432
- prop . type === "integer"
3433
- ) {
3434
- input . type = "number" ;
3435
- } else if ( prop . type === "boolean" ) {
3436
- input . type = "checkbox" ;
3437
- input . className =
3438
- "mt-1 h-4 w-4 text-indigo-600 dark:text-indigo-200 border border-gray-300 rounded" ;
3420
+ // Input field with validation (with multiline support)
3421
+ let fieldInput ;
3422
+ const isTextType = prop . type === "text" ;
3423
+ if ( isTextType ) {
3424
+ fieldInput = document . createElement ( "textarea" ) ;
3425
+ fieldInput . rows = 4 ;
3439
3426
} else {
3440
- input . type = "text" ;
3427
+ fieldInput = document . createElement ( "input" ) ;
3428
+ if ( prop . type === "number" || prop . type === "integer" ) {
3429
+ fieldInput . type = "number" ;
3430
+ } else if ( prop . type === "boolean" ) {
3431
+ fieldInput . type = "checkbox" ;
3432
+ } else {
3433
+ fieldInput = document . createElement ( "textarea" ) ;
3434
+ fieldInput . rows = 1 ;
3435
+ }
3441
3436
}
3442
3437
3438
+ fieldInput . name = keyValidation . value ;
3439
+ fieldInput . required =
3440
+ schema . required && schema . required . includes ( key ) ;
3441
+ fieldInput . className =
3442
+ prop . type === "boolean"
3443
+ ? "mt-1 h-4 w-4 text-indigo-600 dark:text-indigo-200 border border-gray-300 rounded"
3444
+ : "mt-1 block w-full rounded-md border border-gray-300 shadow-sm focus:border-indigo-500 focus:ring-indigo-500 dark:bg-gray-900 text-gray-700 dark:text-gray-300 dark:border-gray-700 dark:focus:border-indigo-400 dark:focus:ring-indigo-400" ;
3445
+
3443
3446
// Set default values here
3444
3447
if ( prop . default !== undefined ) {
3445
- if ( input . type === "checkbox" ) {
3446
- input . checked = prop . default === true ;
3448
+ if ( fieldInput . type === "checkbox" ) {
3449
+ fieldInput . checked = prop . default === true ;
3450
+ } else if ( isTextType ) {
3451
+ fieldInput . value = prop . default ;
3447
3452
} else {
3448
- input . value = prop . default ;
3453
+ fieldInput . value = prop . default ;
3449
3454
}
3450
3455
}
3451
3456
3452
- fieldDiv . appendChild ( input ) ;
3457
+ fieldDiv . appendChild ( fieldInput ) ;
3453
3458
}
3454
3459
3455
3460
container . appendChild ( fieldDiv ) ;
0 commit comments