@@ -102,6 +102,26 @@ export function truncateActorReadme(readme: string, limit = ACTOR_README_MAX_LEN
102102 const prunedReadme = lines . filter ( ( line ) => line . startsWith ( '#' ) ) ;
103103 return `${ readmeFirst } \n\nREADME was truncated because it was too long. Remaining headers:\n${ prunedReadme . join ( ', ' ) } ` ;
104104}
105+ /**
106+ * Helps determine the type of items in an array schema property.
107+ * Priority order: explicit type in items > prefill type > default value type > editor type.
108+ */
109+ export function inferArrayItemType ( property : SchemaProperties ) : string | null {
110+ return property . items ?. type
111+ || ( property . prefill && typeof property . prefill )
112+ || ( property . default && typeof property . default )
113+ || ( property . editor && getEditorItemType ( property . editor ) )
114+ || null ;
115+
116+ function getEditorItemType ( editor : string ) : string | null {
117+ const editorTypeMap : Record < string , string > = {
118+ requestListSources : 'object' ,
119+ stringList : 'string' ,
120+ } ;
121+ return editorTypeMap [ editor ] || null ;
122+ }
123+ }
124+
105125/**
106126 * Filters schema properties to include only the necessary fields.
107127 * @param properties
@@ -111,6 +131,12 @@ export function filterSchemaProperties(properties: { [key: string]: SchemaProper
111131 for ( const [ key , property ] of Object . entries ( properties ) ) {
112132 const { title, description, enum : enumValues , type, default : defaultValue , prefill } = property ;
113133 filteredProperties [ key ] = { title, description, enum : enumValues , type, default : defaultValue , prefill } ;
134+ if ( type === 'array' ) {
135+ const itemsType = inferArrayItemType ( property ) ;
136+ if ( itemsType ) {
137+ filteredProperties [ key ] . items = { type : itemsType } ;
138+ }
139+ }
114140 }
115141 return filteredProperties ;
116142}
0 commit comments