@@ -74,44 +74,44 @@ export default defineCommand({
7474 // downstream tooling can drive `bl deploy create --template-id <…>` without
7575 // a second round-trip. For text: keep the compact one-line summary.
7676 if ( format === "json" ) {
77- const items = models . map ( ( m ) => {
77+ const items = models . map ( ( model ) => {
7878 const out : Record < string , unknown > = {
79- model_name : m . model_name ?? "" ,
79+ model_name : model . model_name ?? "" ,
8080 } ;
81- if ( m . base_model ) out . base_model = m . base_model ;
82- if ( m . model_source ) out . model_source = m . model_source ;
83- if ( m . supported_plans && m . supported_plans . length > 0 ) {
84- out . supported_plans = m . supported_plans ;
81+ if ( model . base_model ) out . base_model = model . base_model ;
82+ if ( model . model_source ) out . model_source = model . model_source ;
83+ if ( model . supported_plans && model . supported_plans . length > 0 ) {
84+ out . supported_plans = model . supported_plans ;
8585 }
86- if ( m . plans && m . plans . length > 0 ) {
87- out . plans = m . plans . map ( ( p ) => {
88- const planEntry : Record < string , unknown > = { plan : p . plan ?? "" } ;
89- if ( p . cu_specs && p . cu_specs . length > 0 ) {
90- planEntry . cu_specs = p . cu_specs ;
86+ if ( model . plans && model . plans . length > 0 ) {
87+ out . plans = model . plans . map ( ( plan ) => {
88+ const planEntry : Record < string , unknown > = { plan : plan . plan ?? "" } ;
89+ if ( plan . cu_specs && plan . cu_specs . length > 0 ) {
90+ planEntry . cu_specs = plan . cu_specs ;
9191 }
92- if ( p . templates && p . templates . length > 0 ) {
92+ if ( plan . templates && plan . templates . length > 0 ) {
9393 // Pull the top 6 fields most useful for `bl deploy create`.
9494 // Drop noisy/redundant: template_source, template_type,
9595 // template_version, deploy_spec (typically == template_id).
96- planEntry . templates = p . templates . map ( ( t ) => {
96+ planEntry . templates = plan . templates . map ( ( template ) => {
9797 const tpl : Record < string , unknown > = { } ;
98- if ( t . template_id ) tpl . template_id = t . template_id ;
99- if ( t . template_name ) tpl . template_name = t . template_name ;
100- if ( t . charge_type ) tpl . charge_type = t . charge_type ;
98+ if ( template . template_id ) tpl . template_id = template . template_id ;
99+ if ( template . template_name ) tpl . template_name = template . template_name ;
100+ if ( template . charge_type ) tpl . charge_type = template . charge_type ;
101101 // Flatten roles.unified for the common COUPLED case.
102- const unified = t . roles ?. unified ;
102+ const unified = template . roles ?. unified ;
103103 if ( unified ?. model_unit_spec ) tpl . model_unit_spec = unified . model_unit_spec ;
104104 if ( unified ?. capacity_unit_per_instance !== undefined )
105105 tpl . capacity_unit_per_instance = unified . capacity_unit_per_instance ;
106106 // Preserve split-role configs (SEPERATED) as-is so callers
107107 // can still drive prefill/decode sizing.
108- if ( t . roles ?. prefill || t . roles ?. decode ) {
108+ if ( template . roles ?. prefill || template . roles ?. decode ) {
109109 tpl . roles = {
110- prefill : t . roles ?. prefill ,
111- decode : t . roles ?. decode ,
110+ prefill : template . roles ?. prefill ,
111+ decode : template . roles ?. decode ,
112112 } ;
113113 }
114- if ( t . template_desc ) tpl . template_desc = t . template_desc ;
114+ if ( template . template_desc ) tpl . template_desc = template . template_desc ;
115115 return tpl ;
116116 } ) ;
117117 }
@@ -125,19 +125,19 @@ export default defineCommand({
125125 }
126126
127127 // text / quiet — keep the compact single-line summary table.
128- const textItems = models . map ( ( m ) => {
128+ const textItems = models . map ( ( model ) => {
129129 let plansSummary = "" ;
130- if ( m . supported_plans && m . supported_plans . length > 0 ) {
131- plansSummary = m . supported_plans . join ( "," ) ;
132- } else if ( m . plans && m . plans . length > 0 ) {
133- plansSummary = m . plans
134- . map ( ( p ) => {
135- const planName = p . plan ?? "?" ;
136- if ( p . templates && p . templates . length > 0 ) {
137- return `${ planName } (${ p . templates . length } t)` ;
130+ if ( model . supported_plans && model . supported_plans . length > 0 ) {
131+ plansSummary = model . supported_plans . join ( "," ) ;
132+ } else if ( model . plans && model . plans . length > 0 ) {
133+ plansSummary = model . plans
134+ . map ( ( plan ) => {
135+ const planName = plan . plan ?? "?" ;
136+ if ( plan . templates && plan . templates . length > 0 ) {
137+ return `${ planName } (${ plan . templates . length } t)` ;
138138 }
139- if ( p . cu_specs && p . cu_specs . length > 0 ) {
140- return `${ planName } (${ p . cu_specs . join ( "/" ) } )` ;
139+ if ( plan . cu_specs && plan . cu_specs . length > 0 ) {
140+ return `${ planName } (${ plan . cu_specs . join ( "/" ) } )` ;
141141 }
142142 return planName ;
143143 } )
@@ -146,9 +146,9 @@ export default defineCommand({
146146 plansSummary = "-" ;
147147 }
148148 return {
149- model_name : m . model_name ?? "" ,
150- base_model : m . base_model ?? "" ,
151- source : m . model_source ?? "" ,
149+ model_name : model . model_name ?? "" ,
150+ base_model : model . base_model ?? "" ,
151+ source : model . model_source ?? "" ,
152152 plans : plansSummary ,
153153 } ;
154154 } ) ;
@@ -158,7 +158,12 @@ export default defineCommand({
158158 return ;
159159 }
160160 const headers = [ "MODEL_NAME" , "BASE_MODEL" , "SOURCE" , "PLANS" ] ;
161- const rows = textItems . map ( ( i ) => [ i . model_name , i . base_model , i . source , i . plans ] ) ;
161+ const rows = textItems . map ( ( item ) => [
162+ item . model_name ,
163+ item . base_model ,
164+ item . source ,
165+ item . plans ,
166+ ] ) ;
162167 for ( const line of formatTable ( headers , rows ) ) emitBare ( line ) ;
163168 if ( total !== undefined ) emitBare ( `\nTotal: ${ total } ` ) ;
164169 } ,
0 commit comments