{#if arg != undefined && !hidden}
{#if isStaticTemplate(inputCat)}
{'${...}'}
{/if}
{#if !noDynamicToggle}
{#if enableAi} (suggestion = e.detail || undefined)} on:setExpr={(e) => { arg = { type: 'javascript', expr: e.detail } propertyType = 'javascript' monaco?.setCode('') monaco?.insertAtCursor(e.detail) }} {pickableProperties} {argName} btnClass={twMerge( 'h-6 min-w-8 px-2', 'group-hover:opacity-100 transition-opacity', !connecting ? 'opacity-0' : '' )} /> {/if} {#if propPickerWrapperContext} { if ( $propPickerConfig?.propName == argName && $propPickerConfig?.insertionMode == 'connect' ) { clearFocus() } else { focusProp?.(argName, 'connect', (path) => { connectProperty(path) dispatch('change', { argName }) return true }) } }} /> {/if}
{ if (e.detail == propertyType || suggestion) return const staticTemplate = isStaticTemplate(inputCat) if (e.detail === 'ai') { // Switch to AI mode: static with no value if (arg) { arg.type = 'ai' arg.value = undefined arg.expr = undefined } propertyType = 'ai' } else if (e.detail === 'javascript') { if (arg.expr == undefined) { arg.expr = getDefaultExpr( argName, previousModuleId, staticTemplate ? `\`${arg?.value?.toString().replaceAll('`', '\\`') ?? ''}\`` : arg.value ? '(' + JSON.stringify(arg?.value, null, 4) + ')' : '' ) } if (arg) { arg.value = undefined arg.type = 'javascript' } propertyType = 'javascript' } else { if (staticTemplate) { if (arg) { arg.value = codeToStaticTemplate(arg.expr) arg.expr = undefined } setPropertyType(arg?.value) } else if (inputCat == 'list' || inputCat == 'object') { if (arg) { try { let newExpr = arg.expr if (newExpr.startsWith('(') && newExpr.endsWith(')')) { newExpr = newExpr.slice(1, -1) } arg.value = JSON.parse(newExpr) } catch (e) { arg.value = undefined } arg.expr = undefined arg.type = 'static' } } else { if (arg) { arg.type = 'static' arg.value = undefined arg.expr = undefined } } propertyType = 'static' } }} > {#snippet children({ item })} {#if isAgentTool} {/if} {#if isStaticTemplate(inputCat)} {:else} {/if} {#if codeInjectionDetected && propertyType == 'static'} {:else} {/if} {/snippet}
{/if}
{#if suggestion}
{/if}
{ if (e.key === 'Tab' && suggestion) { e.preventDefault() } }} > {@render innerInput()}
{#snippet innerInput()} {#if propertyType === 'ai'}
This field will be filled by the AI agent dynamically
{#if argName && schema?.properties?.[argName]?.description}
										{schema.properties[argName].description}
									
{/if} {:else if isStaticTemplate(inputCat) && propertyType == 'static' && !noDynamicToggle}
{#if argName && schema?.properties?.[argName]?.description}
										{schema.properties[argName].description}
										
{/if} {#if arg} { focused = false }} bind:code={arg.value} fontSize={12} on:change={() => { dispatch('change', { argName, arg }) }} loadAsync class="bg-surface-input" /> {/if}
{:else if (propertyType === undefined || propertyType == 'static') && schema?.properties?.[argName]} { focused = false }} shouldDispatchChanges on:change={() => { dispatch('change', { argName, arg }) }} label={argName} bind:editor={monaco} bind:description={schema.properties[argName].description} bind:value={arg.value} type={schema.properties[argName].type} oneOf={schema.properties[argName].oneOf} required={schema.required?.includes(argName)} bind:pattern={schema.properties[argName].pattern} bind:valid={inputCheck} defaultValue={schema.properties[argName].default} bind:enum_={schema.properties[argName].enum} bind:format={schema.properties[argName].format} contentEncoding={schema.properties[argName].contentEncoding} bind:itemsType={schema.properties[argName].items} properties={schema.properties[argName].properties} nestedRequired={schema.properties[argName].required} displayHeader={false} extra={argExtra} {variableEditor} {itemPicker} bind:pickForField showSchemaExplorer nullable={schema.properties[argName].nullable} bind:title={schema.properties[argName].title} bind:placeholder={schema.properties[argName].placeholder} {helperScript} otherArgs={Object.fromEntries( Object.entries(otherArgs).map(([key, transform]) => [ key, transform?.type === 'static' ? transform.value : transform?.expr ]) )} > {#snippet innerBottomSnippet()} {#if shouldShowS3ArrayHelper} switchToJsAndConnect((path) => appendPathToArrayExpr(arg.expr, path))} /> {/if} {/snippet} {:else if arg.expr != undefined}
(focused = true)} on:blur={() => (focused = false)} on:change={() => { dispatch('change', { argName, arg }) }} autoHeight loadAsync />
{#if shouldShowS3ArrayHelper} focusProp?.(argName, 'connect', (path) => { appendPathToArrayExpr(arg.expr, path) return true })} /> {/if} {#if argName && schema?.properties?.[argName]?.description}
{schema.properties[argName].description}
{/if} {#if !hideHelpButton} {/if}
{:else} Not recognized input type {argName} ({arg.expr}, {propertyType})
{/if} {/snippet}
{/if}