@yemi33/minions 0.1.704 → 0.1.705

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.705 (2026-04-09)
4
+
5
+ ### Fixes
6
+ - modal buttons now derive status from linked PRD when plan not in status
7
+
3
8
  ## 0.1.704 (2026-04-09)
4
9
 
5
10
  ### Other
@@ -453,35 +453,53 @@ function _renderPlanModal(normalizedFile, raw, lastMod) {
453
453
  const canExecute = isMdPlan && !hasActiveWork && !prdCompleted;
454
454
  const modalExecuteBtn = canExecute && !hasPrd ? '<button class="pr-pager-btn" style="font-size:10px;padding:2px 10px;color:var(--green);font-weight:600" ' +
455
455
  'onclick="planExecute(\'' + escHtml(normalizedFile) + '\',\'\',this)">Execute</button>' : '';
456
- const modalReExecuteBtn = canExecute && linkedPrdAwaiting ? '<button class="pr-pager-btn" style="font-size:10px;padding:2px 10px;color:var(--green);font-weight:600" ' +
457
- 'onclick="planExecute(\'' + escHtml(normalizedFile) + '\',\'\',this)">Re-execute</button>' : '';
458
- const modalCompletedLabel = prdCompleted && !hasActiveWork ? '<span style="font-size:10px;color:var(--green);font-weight:600">Completed</span>' : '';
459
- const modalAwaitingLabel = linkedPrdAwaiting && !hasActiveWork && !prdCompleted ? '<span style="font-size:10px;color:var(--yellow);font-weight:600">Awaiting Approval</span>' : '';
460
- const modalInProgressLabel = hasActiveWork ? '<span style="font-size:10px;color:var(--blue)">In Progress</span>' : '';
461
- const isModalCompleted = planStatus === 'completed';
462
- const modalPauseBtn = isActive && !isMdPlan && !isModalCompleted ? '<button class="pr-pager-btn" style="font-size:10px;padding:2px 10px;color:var(--yellow)" ' +
463
- 'onclick="planPause(\'' + escHtml(normalizedFile) + '\',this)">Pause</button>' : '';
464
- const modalApproveTarget = linkedPrdAwaiting ? linkedPrd.file : normalizedFile;
465
- const isActuallyPaused = planStatus === 'paused' || linkedPrd?.status === 'paused';
466
- const modalApproveLabel = isActuallyPaused ? 'Resume' : 'Approve';
467
- const showRejectInModal = linkedPrdAwaiting || planStatus === 'awaiting-approval';
468
- const modalApproveBtn = modalShowResume ? '<button class="pr-pager-btn" style="font-size:10px;padding:2px 10px;color:var(--green)" ' +
469
- 'onclick="planApprove(\'' + escHtml(modalApproveTarget) + '\',this)">' + modalApproveLabel + '</button>' : '';
470
- const modalRejectBtn = showRejectInModal ? '<button class="pr-pager-btn" style="font-size:10px;padding:2px 10px;color:var(--red)" ' +
471
- 'onclick="planReject(\'' + escHtml(modalApproveTarget) + '\')">Reject</button>' : '';
472
- const modalVerifyWi = (window._lastWorkItems || []).find(w => w.itemType === 'verify' && w.sourcePlan === normalizedFile);
473
- const modalVerifyBtn = isModalCompleted && !modalVerifyWi ? '<button class="pr-pager-btn" style="font-size:10px;padding:2px 10px;color:var(--green)" ' +
474
- 'onclick="triggerVerify(\'' + escHtml(normalizedFile) + '\',this)">Verify</button>' : '';
475
- const modalVerifyInfo = modalVerifyWi ? _renderVerifyBadge(modalVerifyWi) : '';
476
- const modalArchiveBtn = '<button class="pr-pager-btn" style="font-size:10px;padding:2px 10px;color:var(--muted)" ' +
477
- 'onclick="planArchive(\'' + escHtml(normalizedFile) + '\')">Archive</button>';
456
+ // Modal buttons mirror card logic derive effectiveStatus the same way
457
+ const allPlans = window._lastStatus?.plans || [];
458
+ const cardPlan = allPlans.find(p => p.file === normalizedFile || p.sourcePlan === normalizedFile || (p.file?.endsWith('.json') && p.file === normalizedFile));
459
+ // Also check for linked PRD by searching all plans for a PRD whose source_plan matches this file
460
+ const linkedPrd = allPlans.find(p => p.sourcePlan === normalizedFile && p.format === 'prd');
461
+ const effectiveStatus = cardPlan ? derivePlanStatus(cardPlan) : (linkedPrd ? derivePlanStatus(linkedPrd) : (planStatus || 'active'));
462
+ const prdFile = cardPlan?.file?.endsWith('.json') ? cardPlan.file : (linkedPrd?.file || '');
463
+ const isArchived = !!(cardPlan?.archived || linkedPrd?.archived);
464
+ const isDraft = isMdPlan && !prdFile;
465
+ const isNeedsAction = (effectiveStatus === 'awaiting-approval' || effectiveStatus === 'paused') && !isArchived;
466
+
467
+ const bs = 'font-size:10px;padding:2px 10px'; // button style
468
+ let modalActions = '';
469
+
470
+ // Approve/Reject for awaiting-approval or paused
471
+ if (isNeedsAction) {
472
+ const target = prdFile || normalizedFile;
473
+ const label = effectiveStatus === 'paused' ? 'Resume' : 'Approve';
474
+ modalActions += '<button class="pr-pager-btn" style="' + bs + ';color:var(--green)" onclick="planApprove(\'' + escHtml(target) + '\',this)">' + label + '</button> ';
475
+ // Re-execute: re-generate PRD from updated plan (only for .md drafts with existing PRD)
476
+ if (effectiveStatus === 'awaiting-approval' && isMdPlan && prdFile && canExecute) {
477
+ modalActions += '<button class="pr-pager-btn" style="' + bs + ';color:var(--green);opacity:0.7" onclick="planExecute(\'' + escHtml(normalizedFile) + '\',\'\',this)">Re-execute</button> ';
478
+ }
479
+ modalActions += '<button class="pr-pager-btn" style="' + bs + ';color:var(--red)" onclick="planReject(\'' + escHtml(target) + '\')">Reject</button> ';
480
+ }
481
+ // Execute (draft .md without PRD)
482
+ if (isDraft && (effectiveStatus === 'active' || effectiveStatus === 'draft') && !isArchived) {
483
+ modalActions += '<button class="pr-pager-btn" style="' + bs + ';color:var(--green);font-weight:600" onclick="planExecute(\'' + escHtml(normalizedFile) + '\',\'\',this)">Execute</button> ';
484
+ }
485
+ // Pause (active PRD, not completed)
486
+ if (effectiveStatus === 'dispatched' && prdFile && !isArchived) {
487
+ modalActions += '<button class="pr-pager-btn" style="' + bs + ';color:var(--yellow)" onclick="planPause(\'' + escHtml(prdFile) + '\',this)">Pause</button> ';
488
+ }
489
+ // Verify / Verified badge
490
+ const modalVerifyWi = (window._lastWorkItems || []).find(w => w.itemType === 'verify' && w.sourcePlan === (prdFile || normalizedFile));
491
+ if (effectiveStatus === 'completed' && prdFile && !isArchived && !modalVerifyWi) {
492
+ modalActions += '<button class="pr-pager-btn" style="' + bs + ';color:var(--green)" onclick="triggerVerify(\'' + escHtml(prdFile) + '\',this)">Verify</button> ';
493
+ }
494
+ if (modalVerifyWi) modalActions += _renderVerifyBadge(modalVerifyWi);
495
+ // Archive + Delete (always, unless archived)
496
+ if (!isArchived) {
497
+ modalActions += '<button class="pr-pager-btn" style="' + bs + ';color:var(--muted)" onclick="planArchive(\'' + escHtml(prdFile || normalizedFile) + '\')">Archive</button> ';
498
+ modalActions += '<button class="pr-pager-btn" style="' + bs + ';color:var(--red)" onclick="planDelete(\'' + escHtml(normalizedFile) + '\')">Delete</button>';
499
+ }
500
+
478
501
  const lastModLabel = lastMod ? '<div style="font-size:10px;color:var(--muted);font-weight:400;margin-top:2px">Last updated: ' + new Date(lastMod).toLocaleString() + '</div>' : '';
479
- const actionBtns = '<div style="display:flex;gap:4px;flex-wrap:wrap;margin-top:4px">' +
480
- (modalCompletedLabel || '') + (modalAwaitingLabel || '') + (modalInProgressLabel || '') + (modalApproveBtn || '') + (modalReExecuteBtn || '') + (modalExecuteBtn || '') + (modalPauseBtn || '') + (modalRejectBtn || '') + (modalVerifyBtn || '') + (modalVerifyInfo || '') +
481
- ' ' + modalArchiveBtn +
482
- ' <button class="pr-pager-btn" style="font-size:10px;padding:2px 10px;color:var(--red)" ' +
483
- 'onclick="planDelete(\'' + escHtml(normalizedFile) + '\')">Delete</button>' +
484
- '</div>';
502
+ const actionBtns = '<div style="display:flex;gap:4px;flex-wrap:wrap;margin-top:4px">' + modalActions + '</div>';
485
503
 
486
504
  document.getElementById('modal-title').innerHTML = escHtml(title) + (versionLabel ? ' <span style="font-size:11px;font-weight:700;padding:1px 6px;border-radius:3px;background:rgba(56,139,253,0.15);color:var(--blue)">' + escHtml(versionLabel) + '</span>' : '') + lastModLabel + actionBtns;
487
505
  const modalBody = document.getElementById('modal-body');
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@yemi33/minions",
3
- "version": "0.1.704",
3
+ "version": "0.1.705",
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"