@yemi33/minions 0.1.539 → 0.1.541

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.541 (2026-04-07)
4
+
5
+ ### Fixes
6
+ - plan edits flag PRD stale instead of auto-regenerating
7
+
8
+ ## 0.1.540 (2026-04-07)
9
+
10
+ ### Features
11
+ - pipeline modal live-polls every 4s while active run is open
12
+
3
13
  ## 0.1.539 (2026-04-07)
4
14
 
5
15
  ### Features
@@ -1,6 +1,9 @@
1
1
  // render-pipelines.js — Pipeline list, run detail, and create modal
2
2
 
3
3
  let _pipelinesData = [];
4
+ let _pipelinePollId = null;
5
+ let _pipelinePollInterval = null;
6
+ function _stopPipelinePoll() { if (_pipelinePollInterval) { clearInterval(_pipelinePollInterval); _pipelinePollInterval = null; } _pipelinePollId = null; }
4
7
 
5
8
  /**
6
9
  * Render clickable artifact links for a pipeline stage.
@@ -167,6 +170,7 @@ function renderPipelines(pipelines) {
167
170
  }
168
171
 
169
172
  function openPipelineDetail(id) {
173
+ _stopPipelinePoll();
170
174
  var p = _pipelinesData.find(function(x) { return x.id === id; });
171
175
  if (!p) { alert('Pipeline not found'); return; }
172
176
 
@@ -238,7 +242,31 @@ function openPipelineDetail(id) {
238
242
  document.getElementById('modal-title').textContent = 'Pipeline: ' + p.title;
239
243
  document.getElementById('modal-body').innerHTML = html;
240
244
  document.getElementById('modal').classList.add('open');
245
+
246
+ // Live-poll while modal is open and pipeline has an active run
247
+ if (activeRun) {
248
+ _pipelinePollId = id;
249
+ _pipelinePollInterval = setInterval(function() {
250
+ if (!document.getElementById('modal')?.classList?.contains('open') || _pipelinePollId !== id) {
251
+ _stopPipelinePoll(); return;
252
+ }
253
+ fetch('/api/pipelines').then(function(r) { return r.json(); }).then(function(d) {
254
+ if (_pipelinePollId !== id) return;
255
+ var fresh = (d.pipelines || []).find(function(x) { return x.id === id; });
256
+ if (fresh) {
257
+ // Only re-render if data changed
258
+ var newHash = JSON.stringify(fresh.runs || []);
259
+ if (newHash !== _pipelinePollHash) {
260
+ _pipelinePollHash = newHash;
261
+ _pipelinesData = _pipelinesData.map(function(x) { return x.id === id ? fresh : x; });
262
+ openPipelineDetail(id);
263
+ }
264
+ }
265
+ }).catch(function() {});
266
+ }, 4000);
267
+ }
241
268
  }
269
+ var _pipelinePollHash = '';
242
270
 
243
271
  async function _triggerPipeline(id, btn) {
244
272
  if (btn) { btn.textContent = 'Starting...'; btn.style.pointerEvents = 'none'; btn.style.opacity = '0.6'; }
@@ -294,16 +322,7 @@ async function _continuePipeline(id, stageId, btn) {
294
322
  if (res.ok) {
295
323
  showToast('cmd-toast', 'Stage continued — dispatching next tick', true);
296
324
  if (btn) { btn.textContent = '\u2713 Continued'; btn.style.color = 'var(--green)'; btn.style.borderColor = 'var(--green)'; btn.style.opacity = '1'; }
297
- // Auto-refresh the modal to show pipeline progressing
298
325
  setTimeout(function() { openPipelineDetail(id); }, 2000);
299
- var pollCount = 0;
300
- var pollTimer = setInterval(function() {
301
- pollCount++;
302
- if (pollCount > 15 || !document.getElementById('modal')?.classList?.contains('open')) {
303
- clearInterval(pollTimer); return;
304
- }
305
- openPipelineDetail(id);
306
- }, 4000);
307
326
  } else {
308
327
  var d = await res.json().catch(function() { return {}; }); alert('Failed: ' + (d.error || 'unknown'));
309
328
  if (btn) { btn.textContent = 'Continue'; btn.style.pointerEvents = ''; btn.style.opacity = ''; }
package/engine.js CHANGED
@@ -1098,11 +1098,19 @@ function materializePlansAsWorkItems(config) {
1098
1098
  plan.sourcePlanModifiedAt = new Date(sourceMtime).toISOString();
1099
1099
  plan.lastSyncedFromPlan = ts();
1100
1100
 
1101
- // Handle PRD based on current status — auto-regenerate for any state
1101
+ // Handle PRD based on current status
1102
1102
  const prdStatus = plan.status || (plan.requires_approval ? 'awaiting-approval' : null);
1103
1103
 
1104
- if (prdStatus) {
1105
- log('info', `PRD ${file} invalidated (was ${prdStatus}) queuing regeneration from revised plan`);
1104
+ // Approved/paused/completed PRDs: flag stale — user must click Re-execute to regenerate
1105
+ if (prdStatus && prdStatus !== 'awaiting-approval') {
1106
+ plan.planStale = true;
1107
+ safeWrite(path.join(PRD_DIR, file), plan);
1108
+ log('info', `PRD ${file} flagged as stale (plan revised while ${prdStatus}) — user can re-execute from dashboard`);
1109
+ }
1110
+
1111
+ // Awaiting-approval PRDs: auto-regenerate (no work started yet, safe to replace)
1112
+ if (prdStatus === 'awaiting-approval') {
1113
+ log('info', `PRD ${file} invalidated (was awaiting-approval) — queuing regeneration from revised plan`);
1106
1114
 
1107
1115
  // Collect completed items to carry over to new PRD
1108
1116
  const completedStatuses = new Set(['done', 'in-pr', 'implemented']); // in-pr kept for backward compat
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@yemi33/minions",
3
- "version": "0.1.539",
3
+ "version": "0.1.541",
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"