@@ -26,6 +26,15 @@ const DEFAULT_PAGE_SIZE = 10;
2626
2727type OperationType = "create_devbox" | "delete" | null ;
2828
29+ // Local interface for blueprint data used in this component
30+ interface BlueprintListItem {
31+ id : string ;
32+ name ?: string ;
33+ status ?: string ;
34+ create_time_ms ?: number ;
35+ [ key : string ] : unknown ;
36+ }
37+
2938const ListBlueprintsUI = ( {
3039 onBack,
3140 onExit,
@@ -76,34 +85,29 @@ const ListBlueprintsUI = ({
7685 const fetchPage = React . useCallback (
7786 async ( params : { limit : number ; startingAt ?: string } ) => {
7887 const client = getClient ( ) ;
79- // eslint-disable-next-line @typescript-eslint/no-explicit-any
80- const pageBlueprints : any [ ] = [ ] ;
88+ const pageBlueprints : BlueprintListItem [ ] = [ ] ;
8189
8290 // Build query params
83- // eslint-disable-next-line @typescript-eslint/no-explicit-any
84- const queryParams : any = {
91+ const queryParams : Record < string , unknown > = {
8592 limit : params . limit ,
8693 } ;
8794 if ( params . startingAt ) {
8895 queryParams . starting_after = params . startingAt ;
8996 }
9097
9198 // Fetch ONE page only
92- let page = ( await client . blueprints . list (
99+ const page = ( await client . blueprints . list (
93100 queryParams ,
94- ) ) as BlueprintsCursorIDPage < { id : string } > ;
101+ ) ) as unknown as BlueprintsCursorIDPage < BlueprintListItem > ;
95102
96103 // Extract data and create defensive copies
97104 if ( page . blueprints && Array . isArray ( page . blueprints ) ) {
98- page . blueprints . forEach ( ( b : any ) => {
105+ page . blueprints . forEach ( ( b : BlueprintListItem ) => {
99106 pageBlueprints . push ( {
100107 id : b . id ,
101108 name : b . name ,
102109 status : b . status ,
103110 create_time_ms : b . create_time_ms ,
104- dockerfile_setup : b . dockerfile_setup
105- ? { ...b . dockerfile_setup }
106- : undefined ,
107111 } ) ;
108112 } ) ;
109113 }
@@ -114,9 +118,6 @@ const ListBlueprintsUI = ({
114118 totalCount : page . total_count || pageBlueprints . length ,
115119 } ;
116120
117- // Help GC
118- page = null as any ;
119-
120121 return result ;
121122 } ,
122123 [ ] ,
@@ -137,7 +138,7 @@ const ListBlueprintsUI = ({
137138 } = useCursorPagination ( {
138139 fetchPage,
139140 pageSize : PAGE_SIZE ,
140- getItemId : ( blueprint : any ) => blueprint . id ,
141+ getItemId : ( blueprint : BlueprintListItem ) => blueprint . id ,
141142 pollInterval : 2000 ,
142143 pollingEnabled : ! showPopup && ! showCreateDevbox && ! executingOperation ,
143144 deps : [ PAGE_SIZE ] ,
@@ -150,8 +151,12 @@ const ListBlueprintsUI = ({
150151 key : "statusIcon" ,
151152 label : "" ,
152153 width : statusIconWidth ,
153- render : ( blueprint : any , index : number , isSelected : boolean ) => {
154- const statusDisplay = getStatusDisplay ( blueprint . status ) ;
154+ render : (
155+ blueprint : BlueprintListItem ,
156+ _index : number ,
157+ isSelected : boolean ,
158+ ) => {
159+ const statusDisplay = getStatusDisplay ( blueprint . status || "" ) ;
155160 const statusColor =
156161 statusDisplay . color === colors . textDim
157162 ? colors . info
@@ -173,7 +178,11 @@ const ListBlueprintsUI = ({
173178 key : "id" ,
174179 label : "ID" ,
175180 width : idWidth + 1 ,
176- render : ( blueprint : any , index : number , isSelected : boolean ) => {
181+ render : (
182+ blueprint : BlueprintListItem ,
183+ _index : number ,
184+ isSelected : boolean ,
185+ ) => {
177186 const value = blueprint . id ;
178187 const width = Math . max ( 1 , idWidth + 1 ) ;
179188 const truncated = value . slice ( 0 , Math . max ( 1 , width - 1 ) ) ;
@@ -195,8 +204,12 @@ const ListBlueprintsUI = ({
195204 key : "statusText" ,
196205 label : "Status" ,
197206 width : statusTextWidth ,
198- render : ( blueprint : any , index : number , isSelected : boolean ) => {
199- const statusDisplay = getStatusDisplay ( blueprint . status ) ;
207+ render : (
208+ blueprint : BlueprintListItem ,
209+ _index : number ,
210+ isSelected : boolean ,
211+ ) => {
212+ const statusDisplay = getStatusDisplay ( blueprint . status || "" ) ;
200213 const statusColor =
201214 statusDisplay . color === colors . textDim
202215 ? colors . info
@@ -220,27 +233,16 @@ const ListBlueprintsUI = ({
220233 createTextColumn (
221234 "name" ,
222235 "Name" ,
223- ( blueprint : any ) => blueprint . name || "(unnamed)" ,
236+ ( blueprint : BlueprintListItem ) => blueprint . name || "(unnamed)" ,
224237 {
225238 width : nameWidth ,
226239 } ,
227240 ) ,
228- createTextColumn (
229- "description" ,
230- "Description" ,
231- ( blueprint : any ) => blueprint . dockerfile_setup ?. description || "" ,
232- {
233- width : descriptionWidth ,
234- color : colors . textDim ,
235- dimColor : false ,
236- bold : false ,
237- visible : showDescription ,
238- } ,
239- ) ,
241+ // Description column removed - not available in API
240242 createTextColumn (
241243 "created" ,
242244 "Created" ,
243- ( blueprint : any ) =>
245+ ( blueprint : BlueprintListItem ) =>
244246 blueprint . create_time_ms
245247 ? formatTimeAgo ( blueprint . create_time_ms )
246248 : "" ,
@@ -264,7 +266,9 @@ const ListBlueprintsUI = ({
264266 ) ;
265267
266268 // Helper function to generate operations based on selected blueprint
267- const getOperationsForBlueprint = ( blueprint : any ) : Operation [ ] => {
269+ const getOperationsForBlueprint = (
270+ blueprint : BlueprintListItem ,
271+ ) : Operation [ ] => {
268272 const operations : Operation [ ] = [ ] ;
269273
270274 if (
@@ -653,7 +657,7 @@ const ListBlueprintsUI = ({
653657 { ! showPopup && (
654658 < Table
655659 data = { blueprints }
656- keyExtractor = { ( blueprint : any ) => blueprint . id }
660+ keyExtractor = { ( blueprint : BlueprintListItem ) => blueprint . id }
657661 selectedIndex = { selectedIndex }
658662 title = { `blueprints[${ totalCount } ]` }
659663 columns = { blueprintColumns }
0 commit comments