@yemi33/minions 0.1.704 → 0.1.706

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,15 @@
1
1
  # Changelog
2
2
 
3
+ ## 0.1.706 (2026-04-09)
4
+
5
+ ### Other
6
+ - simplify: remove dead modal button variables, fix canExecute reference
7
+
8
+ ## 0.1.705 (2026-04-09)
9
+
10
+ ### Fixes
11
+ - modal buttons now derive status from linked PRD when plan not in status
12
+
3
13
  ## 0.1.704 (2026-04-09)
4
14
 
5
15
  ### Other
@@ -437,51 +437,53 @@ function _renderPlanModal(normalizedFile, raw, lastMod) {
437
437
  const isActive = planStatus === 'approved' || planStatus === 'active';
438
438
  const isPaused = planStatus === 'awaiting-approval' || planStatus === 'paused';
439
439
  const wi = window._lastWorkItems || [];
440
- const linkedPrdFile = isMdPlan ? (window._lastStatus?.plans || []).find(p => p.sourcePlan === normalizedFile && p.format === 'prd')?.file : null;
441
- const hasActiveWork = wi.some(w =>
442
- (w.status === 'pending' || w.status === 'dispatched') &&
443
- (w.planFile === normalizedFile || w.sourcePlan === normalizedFile ||
444
- (linkedPrdFile && w.sourcePlan === linkedPrdFile))
445
- );
446
- const prdConversion = wi.find(w => w.type === 'plan-to-prd' && w.status === 'done' && w.planFile === normalizedFile);
447
- const linkedPrd = (window._lastStatus?.plans || []).find(p => p.sourcePlan === normalizedFile && p.format === 'prd');
448
- const hasPrd = !!linkedPrd;
449
- // Plan-to-prd conversion done is not "completed" the PRD still needs approval and execution
450
- const prdCompleted = prdConversion && linkedPrd && linkedPrd.status === 'completed';
451
- const linkedPrdAwaiting = linkedPrd && (linkedPrd.status === 'awaiting-approval' || linkedPrd.status === 'paused');
452
- const modalShowResume = isPaused || linkedPrdAwaiting;
453
- const canExecute = isMdPlan && !hasActiveWork && !prdCompleted;
454
- const modalExecuteBtn = canExecute && !hasPrd ? '<button class="pr-pager-btn" style="font-size:10px;padding:2px 10px;color:var(--green);font-weight:600" ' +
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>';
440
+ // Modal buttons mirror card logic derive effectiveStatus the same way
441
+ const allPlans = window._lastStatus?.plans || [];
442
+ const cardPlan = allPlans.find(p => p.file === normalizedFile || p.sourcePlan === normalizedFile || (p.file?.endsWith('.json') && p.file === normalizedFile));
443
+ // Also check for linked PRD by searching all plans for a PRD whose source_plan matches this file
444
+ const linkedPrd = allPlans.find(p => p.sourcePlan === normalizedFile && p.format === 'prd');
445
+ const effectiveStatus = cardPlan ? derivePlanStatus(cardPlan) : (linkedPrd ? derivePlanStatus(linkedPrd) : (planStatus || 'active'));
446
+ const prdFile = cardPlan?.file?.endsWith('.json') ? cardPlan.file : (linkedPrd?.file || '');
447
+ const isArchived = !!(cardPlan?.archived || linkedPrd?.archived);
448
+ const isDraft = isMdPlan && !prdFile;
449
+ const isNeedsAction = (effectiveStatus === 'awaiting-approval' || effectiveStatus === 'paused') && !isArchived;
450
+
451
+ const bs = 'font-size:10px;padding:2px 10px'; // button style
452
+ let modalActions = '';
453
+
454
+ // Approve/Reject for awaiting-approval or paused
455
+ if (isNeedsAction) {
456
+ const target = prdFile || normalizedFile;
457
+ const label = effectiveStatus === 'paused' ? 'Resume' : 'Approve';
458
+ modalActions += '<button class="pr-pager-btn" style="' + bs + ';color:var(--green)" onclick="planApprove(\'' + escHtml(target) + '\',this)">' + label + '</button> ';
459
+ // Re-execute: re-generate PRD from updated plan (only for .md plans with existing awaiting PRD)
460
+ if (effectiveStatus === 'awaiting-approval' && isMdPlan && prdFile) {
461
+ modalActions += '<button class="pr-pager-btn" style="' + bs + ';color:var(--green);opacity:0.7" onclick="planExecute(\'' + escHtml(normalizedFile) + '\',\'\',this)">Re-execute</button> ';
462
+ }
463
+ modalActions += '<button class="pr-pager-btn" style="' + bs + ';color:var(--red)" onclick="planReject(\'' + escHtml(target) + '\')">Reject</button> ';
464
+ }
465
+ // Execute (draft .md without PRD)
466
+ if (isDraft && (effectiveStatus === 'active' || effectiveStatus === 'draft') && !isArchived) {
467
+ modalActions += '<button class="pr-pager-btn" style="' + bs + ';color:var(--green);font-weight:600" onclick="planExecute(\'' + escHtml(normalizedFile) + '\',\'\',this)">Execute</button> ';
468
+ }
469
+ // Pause (active PRD, not completed)
470
+ if (effectiveStatus === 'dispatched' && prdFile && !isArchived) {
471
+ modalActions += '<button class="pr-pager-btn" style="' + bs + ';color:var(--yellow)" onclick="planPause(\'' + escHtml(prdFile) + '\',this)">Pause</button> ';
472
+ }
473
+ // Verify / Verified badge
474
+ const modalVerifyWi = (window._lastWorkItems || []).find(w => w.itemType === 'verify' && w.sourcePlan === (prdFile || normalizedFile));
475
+ if (effectiveStatus === 'completed' && prdFile && !isArchived && !modalVerifyWi) {
476
+ modalActions += '<button class="pr-pager-btn" style="' + bs + ';color:var(--green)" onclick="triggerVerify(\'' + escHtml(prdFile) + '\',this)">Verify</button> ';
477
+ }
478
+ if (modalVerifyWi) modalActions += _renderVerifyBadge(modalVerifyWi);
479
+ // Archive + Delete (always, unless archived)
480
+ if (!isArchived) {
481
+ modalActions += '<button class="pr-pager-btn" style="' + bs + ';color:var(--muted)" onclick="planArchive(\'' + escHtml(prdFile || normalizedFile) + '\')">Archive</button> ';
482
+ modalActions += '<button class="pr-pager-btn" style="' + bs + ';color:var(--red)" onclick="planDelete(\'' + escHtml(normalizedFile) + '\')">Delete</button>';
483
+ }
484
+
478
485
  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>';
486
+ const actionBtns = '<div style="display:flex;gap:4px;flex-wrap:wrap;margin-top:4px">' + modalActions + '</div>';
485
487
 
486
488
  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
489
  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.706",
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"