@@ -34,14 +34,19 @@ interface IProviderConfig {
3434
3535interface CommitData {
3636 commit : string ;
37+ version ?: string ;
3738}
3839
40+ const connitJson : CommitData = commit ;
41+
3942const LOCAL_PROVIDERS = [ 'Ollama' , 'LMStudio' , 'OpenAILike' ] ;
40- const versionHash = commit . commit ;
43+ const versionHash = connitJson . commit ;
44+ const versionTag = connitJson . version ;
4145const GITHUB_URLS = {
4246 original : 'https://api.github.com/repos/stackblitz-labs/bolt.diy/commits/main' ,
4347 fork : 'https://api.github.com/repos/Stijnus/bolt.new-any-llm/commits/main' ,
44- commitJson : ( branch : string ) => `https://raw.githubusercontent.com/stackblitz-labs/bolt.diy/${ branch } /app/commit.json` ,
48+ commitJson : ( branch : string ) =>
49+ `https://raw.githubusercontent.com/stackblitz-labs/bolt.diy/${ branch } /app/commit.json` ,
4550} ;
4651
4752function getSystemInfo ( ) : SystemInfo {
@@ -206,7 +211,7 @@ const checkProviderStatus = async (url: string | null, providerName: string): Pr
206211} ;
207212
208213export default function DebugTab ( ) {
209- const { providers, useLatestBranch } = useSettings ( ) ;
214+ const { providers, latestBranch } = useSettings ( ) ;
210215 const [ activeProviders , setActiveProviders ] = useState < ProviderStatus [ ] > ( [ ] ) ;
211216 const [ updateMessage , setUpdateMessage ] = useState < string > ( '' ) ;
212217 const [ systemInfo ] = useState < SystemInfo > ( getSystemInfo ( ) ) ;
@@ -227,19 +232,20 @@ export default function DebugTab() {
227232 provider . name . toLowerCase ( ) === 'ollama'
228233 ? 'OLLAMA_API_BASE_URL'
229234 : provider . name . toLowerCase ( ) === 'lmstudio'
230- ? 'LMSTUDIO_API_BASE_URL'
231- : `REACT_APP_${ provider . name . toUpperCase ( ) } _URL` ;
235+ ? 'LMSTUDIO_API_BASE_URL'
236+ : `REACT_APP_${ provider . name . toUpperCase ( ) } _URL` ;
232237
233238 // Access environment variables through import.meta.env
234239 const url = import . meta. env [ envVarName ] || provider . settings . baseUrl || null ; // Ensure baseUrl is used
235240 console . log ( `[Debug] Using URL for ${ provider . name } :` , url , `(from ${ envVarName } )` ) ;
236241
237242 const status = await checkProviderStatus ( url , provider . name ) ;
243+
238244 return {
239245 ...status ,
240246 enabled : provider . settings . enabled ?? false ,
241247 } ;
242- } )
248+ } ) ,
243249 ) ;
244250
245251 setActiveProviders ( statuses ) ;
@@ -265,23 +271,24 @@ export default function DebugTab() {
265271 setIsCheckingUpdate ( true ) ;
266272 setUpdateMessage ( 'Checking for updates...' ) ;
267273
268- const branchToCheck = useLatestBranch ? 'main' : 'stable' ;
274+ const branchToCheck = latestBranch ? 'main' : 'stable' ;
269275 console . log ( `[Debug] Checking for updates against ${ branchToCheck } branch` ) ;
270276
271277 const localCommitResponse = await fetch ( GITHUB_URLS . commitJson ( branchToCheck ) ) ;
278+
272279 if ( ! localCommitResponse . ok ) {
273280 throw new Error ( 'Failed to fetch local commit info' ) ;
274281 }
275282
276- const localCommitData = await localCommitResponse . json ( ) as CommitData ;
283+ const localCommitData = ( await localCommitResponse . json ( ) ) as CommitData ;
277284 const remoteCommitHash = localCommitData . commit ;
278285 const currentCommitHash = versionHash ;
279286
280287 if ( remoteCommitHash !== currentCommitHash ) {
281288 setUpdateMessage (
282289 `Update available from ${ branchToCheck } branch!\n` +
283- `Current: ${ currentCommitHash . slice ( 0 , 7 ) } \n` +
284- `Latest: ${ remoteCommitHash . slice ( 0 , 7 ) } `
290+ `Current: ${ currentCommitHash . slice ( 0 , 7 ) } \n` +
291+ `Latest: ${ remoteCommitHash . slice ( 0 , 7 ) } ` ,
285292 ) ;
286293 } else {
287294 setUpdateMessage ( `You are on the latest version from the ${ branchToCheck } branch` ) ;
@@ -292,7 +299,7 @@ export default function DebugTab() {
292299 } finally {
293300 setIsCheckingUpdate ( false ) ;
294301 }
295- } , [ isCheckingUpdate , useLatestBranch ] ) ;
302+ } , [ isCheckingUpdate , latestBranch ] ) ;
296303
297304 const handleCopyToClipboard = useCallback ( ( ) => {
298305 const debugInfo = {
@@ -309,15 +316,15 @@ export default function DebugTab() {
309316 } ) ) ,
310317 Version : {
311318 hash : versionHash . slice ( 0 , 7 ) ,
312- branch : useLatestBranch ? 'main' : 'stable'
319+ branch : latestBranch ? 'main' : 'stable' ,
313320 } ,
314321 Timestamp : new Date ( ) . toISOString ( ) ,
315322 } ;
316323
317324 navigator . clipboard . writeText ( JSON . stringify ( debugInfo , null , 2 ) ) . then ( ( ) => {
318325 toast . success ( 'Debug information copied to clipboard!' ) ;
319326 } ) ;
320- } , [ activeProviders , systemInfo , useLatestBranch ] ) ;
327+ } , [ activeProviders , systemInfo , latestBranch ] ) ;
321328
322329 return (
323330 < div className = "p-4 space-y-6" >
@@ -403,7 +410,7 @@ export default function DebugTab() {
403410 < p className = "text-sm font-medium text-bolt-elements-textPrimary font-mono" >
404411 { versionHash . slice ( 0 , 7 ) }
405412 < span className = "ml-2 text-xs text-bolt-elements-textSecondary" >
406- ({ new Date ( ) . toLocaleDateString ( ) } )
413+ (v { versionTag || '0.0.1' } ) - { latestBranch ? 'nightly' : 'stable' }
407414 </ span >
408415 </ p >
409416 </ div >
0 commit comments