@yemi33/minions 0.1.2327 → 0.1.2329

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/engine/cli.js CHANGED
@@ -1488,7 +1488,7 @@ const commands = {
1488
1488
  }
1489
1489
 
1490
1490
  console.log('');
1491
- const metrics = shared.safeJson(path.join(ENGINE_DIR, 'metrics.json')) || {};
1491
+ const metrics = shared.safeJsonObj(path.join(ENGINE_DIR, 'metrics.json'));
1492
1492
  const lifetimeCompleted = Object.entries(metrics).filter(([k]) => !k.startsWith('_')).reduce((sum, [, m]) => sum + (m.tasksCompleted || 0) + (m.tasksErrored || 0), 0);
1493
1493
  console.log(`Dispatch: ${dispatch.pending.length} pending | ${(dispatch.active || []).length} active | ${lifetimeCompleted} completed`);
1494
1494
  const pidSummary = summarizeActiveDispatchPids(dispatch.active || []);
package/engine/meeting.js CHANGED
@@ -881,7 +881,15 @@ function deleteMeeting(id) {
881
881
  _killMeetingDispatches(id);
882
882
  const filePath = path.join(MEETINGS_DIR, id + '.json');
883
883
  if (!fs.existsSync(filePath)) return false;
884
- fs.unlinkSync(filePath);
884
+ try {
885
+ fs.unlinkSync(filePath);
886
+ } catch (e) {
887
+ // TOCTOU: a concurrent delete of the same meeting may win the race
888
+ // between existsSync and unlinkSync. Treat ENOENT as already-deleted
889
+ // (idempotent false) instead of letting it propagate as a 500.
890
+ if (e.code !== 'ENOENT') throw e;
891
+ return false;
892
+ }
885
893
  // mutateMeeting writes a .backup sidecar; safeJson auto-restores from it
886
894
  // when the primary is missing, so deletion must also drop the backup.
887
895
  try { fs.unlinkSync(filePath + '.backup'); } catch { /* sidecar may not exist */ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@yemi33/minions",
3
- "version": "0.1.2327",
3
+ "version": "0.1.2329",
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"