File tree Expand file tree Collapse file tree 5 files changed +20
-4
lines changed
Expand file tree Collapse file tree 5 files changed +20
-4
lines changed Original file line number Diff line number Diff line change @@ -33,7 +33,7 @@ import {
3333 binPath ,
3434} from './toolhive-manager'
3535import log from './logger'
36- import { getAppVersion , pollWindowReady } from './util'
36+ import { getAppVersion , isOfficialReleaseBuild , pollWindowReady } from './util'
3737import { delay } from '../../utils/delay'
3838
3939import Store from 'electron-store'
@@ -541,6 +541,10 @@ ipcMain.handle('install-update-and-restart', async () => {
541541 return { success : true }
542542} )
543543
544+ ipcMain . handle ( 'is-release-build' , ( ) => {
545+ return isOfficialReleaseBuild ( )
546+ } )
547+
544548// Shutdown store IPC handlers
545549ipcMain . handle ( 'shutdown-store:get-last-servers' , ( ) => {
546550 return getLastShutdownServers ( )
Original file line number Diff line number Diff line change @@ -9,7 +9,6 @@ function getVersionFromGit(): string {
99 encoding : 'utf8' ,
1010 stdio : 'pipe' ,
1111 } ) . trim ( )
12-
1312 return exactTag . replace ( / ^ v / , '' )
1413 } catch {
1514 try {
@@ -30,7 +29,6 @@ export function getAppVersion(): string {
3029 if ( process . env . SENTRY_RELEASE ) {
3130 return process . env . SENTRY_RELEASE
3231 }
33-
3432 return getVersionFromGit ( )
3533}
3634
@@ -44,3 +42,13 @@ export async function pollWindowReady(window: BrowserWindow): Promise<void> {
4442 await delay ( 100 )
4543 return pollWindowReady ( window )
4644}
45+
46+ export function isOfficialReleaseBuild ( ) : boolean {
47+ try {
48+ const version = getAppVersion ( )
49+ return / ^ \d + \. \d + \. \d + $ / . test ( version )
50+ } catch {
51+ log . error ( 'Failed to get app version' )
52+ return false
53+ }
54+ }
Original file line number Diff line number Diff line change 11{
22 "name" : " toolhive-studio" ,
33 "productName" : " ToolHive" ,
4- "version" : " 0.0.5 " ,
4+ "version" : " 0.0.0-dev " ,
55 "description" : " ToolHive is an application that allows you to install, manage and run MCP servers and connect them to AI agents and clients" ,
66 "main" : " .vite/build/main.js" ,
77 "repository" : " https://github.com/stacklok/toolhive-studio" ,
Original file line number Diff line number Diff line change @@ -18,6 +18,7 @@ contextBridge.exposeInMainWorld('electronAPI', {
1818
1919 // App version
2020 getAppVersion : ( ) => ipcRenderer . invoke ( 'get-app-version' ) ,
21+ isReleaseBuild : ( ) => ipcRenderer . invoke ( 'is-release-build' ) ,
2122
2223 // ToolHive port
2324 getToolhivePort : ( ) => ipcRenderer . invoke ( 'get-toolhive-port' ) ,
@@ -98,6 +99,7 @@ contextBridge.exposeInMainWorld('electronAPI', {
9899
99100export interface ElectronAPI {
100101 getAppVersion : ( ) => Promise < string >
102+ isReleaseBuild : ( ) => Promise < boolean >
101103 getAutoLaunchStatus : ( ) => Promise < boolean >
102104 setAutoLaunch : ( enabled : boolean ) => Promise < boolean >
103105 showApp : ( ) => Promise < void >
Original file line number Diff line number Diff line change @@ -78,6 +78,7 @@ if (!window.electronAPI || !window.electronAPI.getToolhivePort) {
7878 try {
7979 const port = await window . electronAPI . getToolhivePort ( )
8080 const appVersion = await window . electronAPI . getAppVersion ( )
81+ const isReleaseBuild = await window . electronAPI . isReleaseBuild ( )
8182 const baseUrl = `http://localhost:${ port } `
8283
8384 client . setConfig ( {
@@ -86,6 +87,7 @@ if (!window.electronAPI || !window.electronAPI.getToolhivePort) {
8687 'X-Client-Type' : 'toolhive-studio' ,
8788 'X-Client-Version' : appVersion ,
8889 'X-Client-Platform' : window . electronAPI . platform ,
90+ 'X-Client-Release-Build' : isReleaseBuild ,
8991 } ,
9092 } )
9193 } catch ( e ) {
You can’t perform that action at this time.
0 commit comments