@yemi33/minions 0.1.655 → 0.1.656

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,11 @@
1
1
  # Changelog
2
2
 
3
+ ## 0.1.656 (2026-04-09)
4
+
5
+ ### Fixes
6
+ - bust require cache for package.json in engine start
7
+ - PRD discovery loop, github.js duplicate const, transcript null guards
8
+
3
9
  ## 0.1.655 (2026-04-09)
4
10
 
5
11
  ### Fixes
@@ -197,7 +197,7 @@ function _renderMeetingDetail(m) {
197
197
 
198
198
  // Wire up doc-chat Q&A panel for the meeting transcript
199
199
  const transcript = (m.transcript || []).map(t =>
200
- '### ' + t.agent + ' (' + t.type + ', Round ' + t.round + ')\n\n' + (t.content || '')
200
+ '### ' + (t.agent || 'agent') + ' (' + (t.type || '') + ', Round ' + (t.round || '?') + ')\n\n' + (t.content || '')
201
201
  ).join('\n\n---\n\n');
202
202
  const meetingDoc = '# Meeting: ' + m.title + '\n\n**Agenda:** ' + m.agenda + '\n\n' + transcript;
203
203
  _modalDocContext = { title: 'Meeting: ' + m.title, content: meetingDoc, selection: '' };
@@ -418,7 +418,7 @@ async function _createPlanFromMeeting(id, btn) {
418
418
 
419
419
  // Use doc-chat to generate a structured plan from the meeting
420
420
  const transcript = (m.transcript || []).map(function(t) {
421
- return '### ' + t.agent + ' (' + t.type + ', Round ' + t.round + ')\n\n' + (t.content || '');
421
+ return '### ' + (t.agent || 'agent') + ' (' + (t.type || '') + ', Round ' + (t.round || '?') + ')\n\n' + (t.content || '');
422
422
  }).join('\n\n---\n\n');
423
423
  const meetingDoc = '# Meeting: ' + m.title + '\n\n**Agenda:** ' + m.agenda + '\n\n' + transcript;
424
424
 
package/engine/cli.js CHANGED
@@ -85,9 +85,20 @@ const commands = {
85
85
  }
86
86
 
87
87
  // Record version + git commit so dashboard can detect stale engine code
88
+ // Bust require cache so npm updates are detected after minions restart
88
89
  let codeVersion = null;
89
- try { codeVersion = require('../package.json').version; } catch {}
90
- if (!codeVersion) { try { codeVersion = require('@yemi33/minions/package.json').version; } catch {} }
90
+ try {
91
+ const pkgPath = require.resolve('../package.json');
92
+ delete require.cache[pkgPath];
93
+ codeVersion = require('../package.json').version;
94
+ } catch {}
95
+ if (!codeVersion) {
96
+ try {
97
+ const pkgPath = require.resolve('@yemi33/minions/package.json');
98
+ delete require.cache[pkgPath];
99
+ codeVersion = require('@yemi33/minions/package.json').version;
100
+ } catch {}
101
+ }
91
102
  let codeCommit = null;
92
103
  try { codeCommit = require('child_process').execSync('git rev-parse --short HEAD', { cwd: path.resolve(__dirname, '..'), encoding: 'utf8', timeout: 5000, windowsHide: true }).trim(); } catch {}
93
104
  safeWrite(CONTROL_PATH, { state: 'running', pid: process.pid, started_at: e.ts(), codeVersion, codeCommit });
package/engine/github.js CHANGED
@@ -537,8 +537,8 @@ async function reconcilePrs(config) {
537
537
  if (ghPrs.length === 0) continue;
538
538
 
539
539
  const prPath = projectPrPath(project);
540
- const existingPrs = safeJson(prPath) || [];
541
- const existingIds = new Set(existingPrs.map(p => p.id));
540
+ const currentPrs = safeJson(prPath) || [];
541
+ const existingIds = new Set(currentPrs.map(p => p.id));
542
542
  let projectAdded = 0;
543
543
 
544
544
  // Load work items to match branches
@@ -559,7 +559,7 @@ async function reconcilePrs(config) {
559
559
  if (existingIds.has(prId)) {
560
560
  if (confirmedItemId) {
561
561
  addPrLink(prId, confirmedItemId);
562
- const existing = existingPrs.find(p => p.id === prId);
562
+ const existing = currentPrs.find(p => p.id === prId);
563
563
  if (existing && !(existing.prdItems || []).includes(confirmedItemId)) {
564
564
  existing.prdItems = Array.isArray(existing.prdItems) ? existing.prdItems : [];
565
565
  existing.prdItems.push(confirmedItemId);
@@ -573,7 +573,7 @@ async function reconcilePrs(config) {
573
573
 
574
574
  const prUrl = project.prUrlBase ? project.prUrlBase + ghPr.number : ghPr.html_url || '';
575
575
 
576
- existingPrs.push({
576
+ currentPrs.push({
577
577
  id: prId,
578
578
  title: (ghPr.title || `PR #${ghPr.number}`).slice(0, 120),
579
579
  agent: (linkedItem?.dispatched_to || ghPr.user?.login || 'unknown').toLowerCase(),
@@ -594,7 +594,7 @@ async function reconcilePrs(config) {
594
594
  // Backfill prdItems from pr-links for any PR with empty array
595
595
  const prLinks = getPrLinks();
596
596
  let backfilled = 0;
597
- for (const pr of existingPrs) {
597
+ for (const pr of currentPrs) {
598
598
  const linked = prLinks[pr.id];
599
599
  if (linked && !(pr.prdItems || []).includes(linked)) {
600
600
  pr.prdItems = Array.isArray(pr.prdItems) ? pr.prdItems : [];
@@ -604,13 +604,13 @@ async function reconcilePrs(config) {
604
604
  }
605
605
 
606
606
  if (projectAdded > 0 || backfilled > 0) {
607
- mutateJsonFileLocked(prPath, (currentPrs) => {
608
- for (const pr of existingPrs) {
609
- const idx = currentPrs.findIndex(p => p.id === pr.id);
610
- if (idx >= 0) currentPrs[idx] = pr;
611
- else currentPrs.push(pr);
607
+ mutateJsonFileLocked(prPath, (lockedPrs) => {
608
+ for (const pr of currentPrs) {
609
+ const idx = lockedPrs.findIndex(p => p.id === pr.id);
610
+ if (idx >= 0) lockedPrs[idx] = pr;
611
+ else lockedPrs.push(pr);
612
612
  }
613
- return currentPrs;
613
+ return lockedPrs;
614
614
  }, { defaultValue: [] });
615
615
  totalAdded += projectAdded;
616
616
  }
@@ -603,21 +603,21 @@ function isStageComplete(stage, stageState, run, config) {
603
603
  const plans = artifacts.plans || [];
604
604
  const discoveredPrds = [];
605
605
  const discoveredWiIds = [];
606
+ const prdFiles = fs.existsSync(prdDir) ? safeReadDir(prdDir).filter(f => f.endsWith('.json')) : [];
606
607
  for (const planFile of plans) {
607
- const prdFiles = fs.existsSync(prdDir) ? safeReadDir(prdDir).filter(f => f.endsWith('.json')) : [];
608
608
  for (const pf of prdFiles) {
609
609
  const prd = safeJson(path.join(prdDir, pf));
610
610
  if (prd?.source_plan === planFile && !(artifacts.prds || []).includes(pf) && !discoveredPrds.includes(pf)) {
611
611
  discoveredPrds.push(pf);
612
612
  }
613
613
  }
614
- const allPrds = [...(artifacts.prds || []), ...discoveredPrds];
615
- for (const prdFile of allPrds) {
616
- const prdItems = all.filter(w => w.sourcePlan === prdFile && w.type !== WORK_TYPE.PLAN_TO_PRD);
617
- for (const wi of prdItems) {
618
- if (!(artifacts.workItems || []).includes(wi.id) && !discoveredWiIds.includes(wi.id)) {
619
- discoveredWiIds.push(wi.id);
620
- }
614
+ }
615
+ const allPrds = [...(artifacts.prds || []), ...discoveredPrds];
616
+ for (const prdFile of allPrds) {
617
+ const prdItems = all.filter(w => w.sourcePlan === prdFile && w.type !== WORK_TYPE.PLAN_TO_PRD);
618
+ for (const wi of prdItems) {
619
+ if (!(artifacts.workItems || []).includes(wi.id) && !discoveredWiIds.includes(wi.id)) {
620
+ discoveredWiIds.push(wi.id);
621
621
  }
622
622
  }
623
623
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@yemi33/minions",
3
- "version": "0.1.655",
3
+ "version": "0.1.656",
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"