@@ -136,16 +136,27 @@ export function loadManifestModelCatalog(params: {
136136 const plan = planManifestModelCatalogRows ( {
137137 registry : { plugins : eligiblePlugins } ,
138138 } ) ;
139- return plan . rows . map ( ( row ) => ( {
140- id : row . id ,
141- name : row . name ,
142- provider : row . provider ,
143- ...( row . contextWindow ? { contextWindow : row . contextWindow } : { } ) ,
144- ...( row . contextTokens && ! row . contextWindow ? { contextWindow : row . contextTokens } : { } ) ,
145- ...( typeof row . reasoning === "boolean" ? { reasoning : row . reasoning } : { } ) ,
146- ...( row . input ?. length ? { input : [ ...row . input ] } : { } ) ,
147- ...( row . compat ? { compat : row . compat } : { } ) ,
148- } ) ) ;
139+ return plan . rows . map ( ( row ) => {
140+ const entry : ModelCatalogEntry = {
141+ id : row . id ,
142+ name : row . name ,
143+ provider : row . provider ,
144+ } ;
145+ const contextWindow = row . contextWindow ?? row . contextTokens ;
146+ if ( contextWindow ) {
147+ entry . contextWindow = contextWindow ;
148+ }
149+ if ( typeof row . reasoning === "boolean" ) {
150+ entry . reasoning = row . reasoning ;
151+ }
152+ if ( row . input ?. length ) {
153+ entry . input = [ ...row . input ] ;
154+ }
155+ if ( row . compat ) {
156+ entry . compat = row . compat ;
157+ }
158+ return entry ;
159+ } ) ;
149160}
150161
151162export async function loadModelCatalog ( params ?: {
0 commit comments