@yemi33/minions 0.1.539 → 0.1.540

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.540 (2026-04-07)
4
+
5
+ ### Features
6
+ - pipeline modal live-polls every 4s while active run is open
7
+
3
8
  ## 0.1.539 (2026-04-07)
4
9
 
5
10
  ### 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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@yemi33/minions",
3
- "version": "0.1.539",
3
+ "version": "0.1.540",
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"