Skip to content

an open-source alternative to the dots, bots and muses of the world, run an office of claude code/codex like agents on your laptop, sandboxes or anywhere, uses your existing subscriptions

fix(ui): show real app version in title bar instead of hardcoded v0.1

Chaitanya Giriecc89b4482c8
diff --git a/electron.vite.config.ts b/electron.vite.config.ts
index b6bb92b0..f6c6bb4f 100644
--- a/electron.vite.config.ts
+++ b/electron.vite.config.ts
@@ -1,10 +1,16 @@
import { defineConfig, externalizeDepsPlugin } from 'electron-vite';
import react from '@vitejs/plugin-react';
import { resolve } from 'node:path';
+import { readFileSync } from 'node:fs';
+
+// Single source of truth for the displayed app version: package.json.
+const pkg = JSON.parse(readFileSync(resolve(__dirname, 'package.json'), 'utf-8'));
+const define = { __APP_VERSION__: JSON.stringify(pkg.version) };
export default defineConfig({
main: {
plugins: [externalizeDepsPlugin()],
+ define,
build: {
rollupOptions: {
input: { index: resolve(__dirname, 'src/main/index.ts') }
@@ -13,6 +19,7 @@ export default defineConfig({
},
preload: {
plugins: [externalizeDepsPlugin()],
+ define,
build: {
rollupOptions: {
input: { index: resolve(__dirname, 'src/preload/index.ts') }
@@ -20,6 +27,7 @@ export default defineConfig({
}
},
renderer: {
+ define,
root: resolve(__dirname, 'src/renderer'),
build: {
rollupOptions: {
diff --git a/src/preload/index.ts b/src/preload/index.ts
index 06039fc7..8d78604b 100644
--- a/src/preload/index.ts
+++ b/src/preload/index.ts
@@ -1,6 +1,9 @@
import { contextBridge, ipcRenderer, type IpcRendererEvent } from 'electron';
import type { AgentProvider } from '../shared/agentProvider';
+// Injected at build time from package.json (see electron.vite.config.ts).
+declare const __APP_VERSION__: string;
+
export interface HiveAgentMeta {
id: string;
name: string;
@@ -271,7 +274,7 @@ export interface CIRun {
}
const api = {
- version: '0.1.0',
+ version: __APP_VERSION__,
// ─── PTY ─────────────────────────────────────────────────────────────────
spawnPty: (opts: SpawnPtyOptions): Promise<{ ok: boolean; error?: string }> =>
diff --git a/src/renderer/src/App.tsx b/src/renderer/src/App.tsx
index 9f7000cf..29da7c3e 100644
--- a/src/renderer/src/App.tsx
+++ b/src/renderer/src/App.tsx
@@ -22,6 +22,9 @@ import { TaskDetailOverlay } from '@/components/TaskDetailOverlay';
import { FullscreenFileEditor } from '@/components/FullscreenFileEditor';
import brandLogo from '@brand/logo.png?url';
+// Injected at build time from package.json (see electron.vite.config.ts).
+declare const __APP_VERSION__: string;
+
export function App() {
const agent = useStore(selectedAgent);
const agents = useStore(s => s.agents);
@@ -155,7 +158,7 @@ export function App() {
fontSize: 14,
color: 'var(--cth-ink-500)'
}}>
- v0.1 · {config.autoMode ? 'auto mode on' : 'auto mode off'}
+ v{__APP_VERSION__} · {config.autoMode ? 'auto mode on' : 'auto mode off'}
</span>
<button
className="cth-titlebar-nodrag cth-settings-btn"