@yemi33/minions 0.1.385 → 0.1.387
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 +10 -0
- package/dashboard.js +30 -10
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,15 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## 0.1.387 (2026-04-06)
|
|
4
|
+
|
|
5
|
+
### Fixes
|
|
6
|
+
- version check — bust require cache, check HTTP status from npm
|
|
7
|
+
|
|
8
|
+
## 0.1.386 (2026-04-06)
|
|
9
|
+
|
|
10
|
+
### Fixes
|
|
11
|
+
- cache git rev-parse in version check — was spawning every 4s
|
|
12
|
+
|
|
3
13
|
## 0.1.385 (2026-04-06)
|
|
4
14
|
|
|
5
15
|
### Features
|
package/dashboard.js
CHANGED
|
@@ -173,10 +173,11 @@ async function checkNpmVersion() {
|
|
|
173
173
|
try {
|
|
174
174
|
const https = require('https');
|
|
175
175
|
const data = await new Promise((resolve, reject) => {
|
|
176
|
-
const req = https.get(`https://registry.npmjs.org/${PKG_NAME}/latest`, { timeout: 5000 }, (
|
|
176
|
+
const req = https.get(`https://registry.npmjs.org/${PKG_NAME}/latest`, { timeout: 5000 }, (resp) => {
|
|
177
|
+
if (resp.statusCode !== 200) { reject(new Error('npm registry ' + resp.statusCode)); resp.resume(); return; }
|
|
177
178
|
let body = '';
|
|
178
|
-
|
|
179
|
-
|
|
179
|
+
resp.on('data', c => body += c);
|
|
180
|
+
resp.on('end', () => { try { resolve(JSON.parse(body)); } catch { reject(new Error('bad json')); } });
|
|
180
181
|
});
|
|
181
182
|
req.on('error', reject);
|
|
182
183
|
req.on('timeout', () => { req.destroy(); reject(new Error('timeout')); });
|
|
@@ -202,6 +203,26 @@ function _compareVersions(a, b) {
|
|
|
202
203
|
// Kick off first npm check on startup (non-blocking)
|
|
203
204
|
checkNpmVersion().catch(() => {});
|
|
204
205
|
|
|
206
|
+
// Cache disk version + git commit (only changes on deploy/pull, not per-request)
|
|
207
|
+
let _diskVersionCache = null;
|
|
208
|
+
let _diskVersionCacheTs = 0;
|
|
209
|
+
const DISK_VERSION_TTL = 60000; // re-check every 60s
|
|
210
|
+
function getDiskVersion() {
|
|
211
|
+
const now = Date.now();
|
|
212
|
+
if (_diskVersionCache && (now - _diskVersionCacheTs) < DISK_VERSION_TTL) return _diskVersionCache;
|
|
213
|
+
let diskVersion = null;
|
|
214
|
+
try {
|
|
215
|
+
const pkgPath = require.resolve('./package.json');
|
|
216
|
+
delete require.cache[pkgPath]; // bust Node's require cache so npm updates are detected
|
|
217
|
+
diskVersion = require('./package.json').version;
|
|
218
|
+
} catch {}
|
|
219
|
+
let diskCommit = null;
|
|
220
|
+
try { diskCommit = require('child_process').execSync('git rev-parse --short HEAD', { cwd: MINIONS_DIR, encoding: 'utf8', timeout: 5000, windowsHide: true }).trim(); } catch {}
|
|
221
|
+
_diskVersionCache = { diskVersion, diskCommit };
|
|
222
|
+
_diskVersionCacheTs = now;
|
|
223
|
+
return _diskVersionCache;
|
|
224
|
+
}
|
|
225
|
+
|
|
205
226
|
function getMcpServers() {
|
|
206
227
|
try {
|
|
207
228
|
const home = os.homedir();
|
|
@@ -291,10 +312,7 @@ function getStatus() {
|
|
|
291
312
|
installId: safeRead(path.join(MINIONS_DIR, '.install-id')).trim() || null,
|
|
292
313
|
version: (() => {
|
|
293
314
|
const engine = getEngineState();
|
|
294
|
-
|
|
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 {}
|
|
315
|
+
const { diskVersion, diskCommit } = getDiskVersion();
|
|
298
316
|
return {
|
|
299
317
|
running: engine.codeVersion || null,
|
|
300
318
|
runningCommit: engine.codeCommit || null,
|
|
@@ -3412,15 +3430,17 @@ What would you like to discuss or change? When you're happy, say "approve" and I
|
|
|
3412
3430
|
// Routes endpoint (self-describing API)
|
|
3413
3431
|
{ method: 'GET', path: '/api/version', desc: 'Current + latest version info with update check', handler: async (req, res) => {
|
|
3414
3432
|
const npm = await checkNpmVersion();
|
|
3415
|
-
|
|
3416
|
-
try { diskVersion = require('./package.json').version; } catch {}
|
|
3433
|
+
const { diskVersion, diskCommit } = getDiskVersion();
|
|
3417
3434
|
const engine = getEngineState();
|
|
3418
3435
|
return jsonReply(res, 200, {
|
|
3419
3436
|
current: diskVersion,
|
|
3437
|
+
currentCommit: diskCommit,
|
|
3420
3438
|
running: engine.codeVersion || null,
|
|
3439
|
+
runningCommit: engine.codeCommit || null,
|
|
3421
3440
|
latest: npm.latest,
|
|
3422
3441
|
updateAvailable: !!(diskVersion && npm.latest && _compareVersions(npm.latest, diskVersion) > 0),
|
|
3423
|
-
stale: !!(engine.codeVersion && diskVersion && engine.codeVersion !== diskVersion)
|
|
3442
|
+
stale: !!(engine.codeVersion && diskVersion && engine.codeVersion !== diskVersion) ||
|
|
3443
|
+
!!(engine.codeCommit && diskCommit && engine.codeCommit !== diskCommit),
|
|
3424
3444
|
checkedAt: npm.checkedAt,
|
|
3425
3445
|
});
|
|
3426
3446
|
}},
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@yemi33/minions",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.387",
|
|
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"
|