@yemi33/minions 0.1.385 → 0.1.386

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/CHANGELOG.md CHANGED
@@ -1,5 +1,10 @@
1
1
  # Changelog
2
2
 
3
+ ## 0.1.386 (2026-04-06)
4
+
5
+ ### Fixes
6
+ - cache git rev-parse in version check — was spawning every 4s
7
+
3
8
  ## 0.1.385 (2026-04-06)
4
9
 
5
10
  ### Features
package/dashboard.js CHANGED
@@ -202,6 +202,22 @@ function _compareVersions(a, b) {
202
202
  // Kick off first npm check on startup (non-blocking)
203
203
  checkNpmVersion().catch(() => {});
204
204
 
205
+ // Cache disk version + git commit (only changes on deploy/pull, not per-request)
206
+ let _diskVersionCache = null;
207
+ let _diskVersionCacheTs = 0;
208
+ const DISK_VERSION_TTL = 60000; // re-check every 60s
209
+ function getDiskVersion() {
210
+ const now = Date.now();
211
+ if (_diskVersionCache && (now - _diskVersionCacheTs) < DISK_VERSION_TTL) return _diskVersionCache;
212
+ let diskVersion = null;
213
+ try { diskVersion = require('./package.json').version; } catch {}
214
+ let diskCommit = null;
215
+ try { diskCommit = require('child_process').execSync('git rev-parse --short HEAD', { cwd: MINIONS_DIR, encoding: 'utf8', timeout: 5000, windowsHide: true }).trim(); } catch {}
216
+ _diskVersionCache = { diskVersion, diskCommit };
217
+ _diskVersionCacheTs = now;
218
+ return _diskVersionCache;
219
+ }
220
+
205
221
  function getMcpServers() {
206
222
  try {
207
223
  const home = os.homedir();
@@ -291,10 +307,7 @@ function getStatus() {
291
307
  installId: safeRead(path.join(MINIONS_DIR, '.install-id')).trim() || null,
292
308
  version: (() => {
293
309
  const engine = getEngineState();
294
- let diskVersion = null;
295
- try { diskVersion = require('./package.json').version; } catch {}
296
- let diskCommit = null;
297
- try { diskCommit = require('child_process').execSync('git rev-parse --short HEAD', { cwd: MINIONS_DIR, encoding: 'utf8', timeout: 5000, windowsHide: true }).trim(); } catch {}
310
+ const { diskVersion, diskCommit } = getDiskVersion();
298
311
  return {
299
312
  running: engine.codeVersion || null,
300
313
  runningCommit: engine.codeCommit || null,
@@ -3412,15 +3425,17 @@ What would you like to discuss or change? When you're happy, say "approve" and I
3412
3425
  // Routes endpoint (self-describing API)
3413
3426
  { method: 'GET', path: '/api/version', desc: 'Current + latest version info with update check', handler: async (req, res) => {
3414
3427
  const npm = await checkNpmVersion();
3415
- let diskVersion = null;
3416
- try { diskVersion = require('./package.json').version; } catch {}
3428
+ const { diskVersion, diskCommit } = getDiskVersion();
3417
3429
  const engine = getEngineState();
3418
3430
  return jsonReply(res, 200, {
3419
3431
  current: diskVersion,
3432
+ currentCommit: diskCommit,
3420
3433
  running: engine.codeVersion || null,
3434
+ runningCommit: engine.codeCommit || null,
3421
3435
  latest: npm.latest,
3422
3436
  updateAvailable: !!(diskVersion && npm.latest && _compareVersions(npm.latest, diskVersion) > 0),
3423
- stale: !!(engine.codeVersion && diskVersion && engine.codeVersion !== diskVersion),
3437
+ stale: !!(engine.codeVersion && diskVersion && engine.codeVersion !== diskVersion) ||
3438
+ !!(engine.codeCommit && diskCommit && engine.codeCommit !== diskCommit),
3424
3439
  checkedAt: npm.checkedAt,
3425
3440
  });
3426
3441
  }},
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@yemi33/minions",
3
- "version": "0.1.385",
3
+ "version": "0.1.386",
4
4
  "description": "Multi-agent AI dev team that runs from ~/.minions/ — five autonomous agents share a single engine, dashboard, and knowledge base",
5
5
  "bin": {
6
6
  "minions": "bin/minions.js"