agentfit 0.1.7 → 0.1.9
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.github/workflows/release.yml +6 -2
- package/electron/main.mjs +39 -0
- package/package.json +2 -1
|
@@ -43,12 +43,14 @@ jobs:
|
|
|
43
43
|
APPLE_TEAM_ID: ${{ secrets.APPLE_TEAM_ID }}
|
|
44
44
|
run: npm run electron:build:mac
|
|
45
45
|
|
|
46
|
-
- name: Upload DMGs
|
|
46
|
+
- name: Upload DMGs + updater metadata
|
|
47
47
|
uses: actions/upload-artifact@v7
|
|
48
48
|
with:
|
|
49
49
|
name: mac-dmgs
|
|
50
50
|
path: |
|
|
51
51
|
dist-electron/*.dmg
|
|
52
|
+
dist-electron/*.dmg.blockmap
|
|
53
|
+
dist-electron/latest-mac*.yml
|
|
52
54
|
|
|
53
55
|
build-win:
|
|
54
56
|
runs-on: windows-latest
|
|
@@ -66,12 +68,14 @@ jobs:
|
|
|
66
68
|
- name: Build Windows installer
|
|
67
69
|
run: npm run electron:build:win
|
|
68
70
|
|
|
69
|
-
- name: Upload exe
|
|
71
|
+
- name: Upload exe + updater metadata
|
|
70
72
|
uses: actions/upload-artifact@v7
|
|
71
73
|
with:
|
|
72
74
|
name: win-exe
|
|
73
75
|
path: |
|
|
74
76
|
dist-electron/*.exe
|
|
77
|
+
dist-electron/*.exe.blockmap
|
|
78
|
+
dist-electron/latest*.yml
|
|
75
79
|
|
|
76
80
|
publish-npm:
|
|
77
81
|
runs-on: ubuntu-latest
|
package/electron/main.mjs
CHANGED
|
@@ -4,6 +4,8 @@ import { existsSync, readFileSync } from 'fs'
|
|
|
4
4
|
import { createRequire } from 'module'
|
|
5
5
|
import path from 'path'
|
|
6
6
|
import http from 'http'
|
|
7
|
+
import electronUpdaterPkg from 'electron-updater'
|
|
8
|
+
const { autoUpdater } = electronUpdaterPkg
|
|
7
9
|
|
|
8
10
|
const isPacked = app.isPackaged
|
|
9
11
|
|
|
@@ -147,12 +149,16 @@ function createWindow() {
|
|
|
147
149
|
minWidth: 900,
|
|
148
150
|
minHeight: 600,
|
|
149
151
|
title: 'AgentFit',
|
|
152
|
+
show: false, // wait until maximized so the user doesn't see the resize jump
|
|
150
153
|
webPreferences: {
|
|
151
154
|
nodeIntegration: false,
|
|
152
155
|
contextIsolation: true,
|
|
153
156
|
},
|
|
154
157
|
})
|
|
155
158
|
|
|
159
|
+
mainWindow.maximize()
|
|
160
|
+
mainWindow.show()
|
|
161
|
+
|
|
156
162
|
mainWindow.loadURL(`http://127.0.0.1:${activePort}`)
|
|
157
163
|
|
|
158
164
|
mainWindow.webContents.setWindowOpenHandler(({ url }) => {
|
|
@@ -165,6 +171,38 @@ function createWindow() {
|
|
|
165
171
|
})
|
|
166
172
|
}
|
|
167
173
|
|
|
174
|
+
function setupAutoUpdate() {
|
|
175
|
+
if (!app.isPackaged) return // skip in dev — there's no signed build to update
|
|
176
|
+
|
|
177
|
+
autoUpdater.autoDownload = true
|
|
178
|
+
autoUpdater.autoInstallOnAppQuit = true
|
|
179
|
+
autoUpdater.logger = { info: log, warn: log, error: log, debug: () => {} }
|
|
180
|
+
|
|
181
|
+
autoUpdater.on('error', (err) => log(`Updater error: ${err?.message || err}`))
|
|
182
|
+
autoUpdater.on('update-available', (info) => log(`Update available: ${info?.version}`))
|
|
183
|
+
autoUpdater.on('update-not-available', () => log('No update available'))
|
|
184
|
+
autoUpdater.on('update-downloaded', async (info) => {
|
|
185
|
+
log(`Update downloaded: ${info?.version}`)
|
|
186
|
+
const { response } = await dialog.showMessageBox(mainWindow ?? undefined, {
|
|
187
|
+
type: 'info',
|
|
188
|
+
buttons: ['Restart now', 'Later'],
|
|
189
|
+
defaultId: 0,
|
|
190
|
+
cancelId: 1,
|
|
191
|
+
title: 'Update ready',
|
|
192
|
+
message: `AgentFit ${info?.version} is ready to install.`,
|
|
193
|
+
detail: 'Restart the app to finish updating.',
|
|
194
|
+
})
|
|
195
|
+
if (response === 0) {
|
|
196
|
+
autoUpdater.quitAndInstall()
|
|
197
|
+
}
|
|
198
|
+
})
|
|
199
|
+
|
|
200
|
+
// Don't block startup; check shortly after the window is ready.
|
|
201
|
+
setTimeout(() => {
|
|
202
|
+
autoUpdater.checkForUpdates().catch((err) => log(`Update check failed: ${err?.message || err}`))
|
|
203
|
+
}, 5_000)
|
|
204
|
+
}
|
|
205
|
+
|
|
168
206
|
function showSplash() {
|
|
169
207
|
const splash = new BrowserWindow({
|
|
170
208
|
width: 400,
|
|
@@ -197,6 +235,7 @@ app.whenReady().then(async () => {
|
|
|
197
235
|
await startServer()
|
|
198
236
|
splash.close()
|
|
199
237
|
createWindow()
|
|
238
|
+
setupAutoUpdate()
|
|
200
239
|
} catch (err) {
|
|
201
240
|
splash.close()
|
|
202
241
|
log(`Startup error: ${err.message}`)
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "agentfit",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.9",
|
|
4
4
|
"description": "Fitness tracker dashboard for AI coding agents (Claude Code, Codex). Visualize usage, cost, tokens, and productivity from local conversation logs.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"bin": {
|
|
@@ -51,6 +51,7 @@
|
|
|
51
51
|
"clsx": "^2.1.1",
|
|
52
52
|
"dagre": "^0.8.5",
|
|
53
53
|
"date-fns": "^4.1.0",
|
|
54
|
+
"electron-updater": "^6.8.3",
|
|
54
55
|
"embla-carousel-react": "^8.6.0",
|
|
55
56
|
"lucide-react": "^1.7.0",
|
|
56
57
|
"next": "16.1.7",
|