@yemi33/minions 0.1.51 → 0.1.53
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 +10 -0
- package/dashboard/js/render-plans.js +29 -12
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -191,10 +191,12 @@ function renderPlans(plans) {
|
|
|
191
191
|
|
|
192
192
|
let actions = '';
|
|
193
193
|
if (needsAction) {
|
|
194
|
+
// Approve/Reject target the PRD .json file (not the .md plan) since the API parses it as JSON
|
|
195
|
+
const actionTarget = prdFile || p.file;
|
|
194
196
|
actions = '<div class="plan-card-actions" onclick="event.stopPropagation()">' +
|
|
195
|
-
'<button class="plan-btn approve" onclick="planApprove(\'' + escHtml(
|
|
197
|
+
'<button class="plan-btn approve" onclick="planApprove(\'' + escHtml(actionTarget) + '\')">Approve</button>' +
|
|
196
198
|
'<button class="plan-btn" style="color:var(--blue);border-color:var(--blue)" onclick="planDiscuss(\'' + escHtml(p.file) + '\')">Discuss & Revise</button>' +
|
|
197
|
-
'<button class="plan-btn reject" onclick="planReject(\'' + escHtml(
|
|
199
|
+
'<button class="plan-btn reject" onclick="planReject(\'' + escHtml(actionTarget) + '\')">Reject</button>' +
|
|
198
200
|
'</div>' +
|
|
199
201
|
'<div id="revise-input-' + escHtml(p.file).replace(/\./g, '-') + '" style="display:none">' +
|
|
200
202
|
'<textarea class="plan-feedback-input" placeholder="What should be changed? Be specific..." id="revise-feedback-' + escHtml(p.file).replace(/\./g, '-') + '"></textarea>' +
|
|
@@ -469,9 +471,14 @@ async function planView(file) {
|
|
|
469
471
|
|
|
470
472
|
async function planApprove(file) {
|
|
471
473
|
try {
|
|
472
|
-
await fetch('/api/plans/approve', { method: 'POST', headers: { 'Content-Type': 'application/json' }, body: JSON.stringify({ file }) });
|
|
473
|
-
|
|
474
|
-
|
|
474
|
+
const res = await fetch('/api/plans/approve', { method: 'POST', headers: { 'Content-Type': 'application/json' }, body: JSON.stringify({ file }) });
|
|
475
|
+
if (res.ok) {
|
|
476
|
+
showToast('cmd-toast', 'Plan approved — work will begin on next engine tick', true);
|
|
477
|
+
refreshPlans();
|
|
478
|
+
} else {
|
|
479
|
+
const d = await res.json().catch(() => ({}));
|
|
480
|
+
alert('Approve failed: ' + (d.error || 'unknown'));
|
|
481
|
+
}
|
|
475
482
|
} catch (e) { showToast('cmd-toast', 'Error: ' + e.message, false); }
|
|
476
483
|
}
|
|
477
484
|
|
|
@@ -496,10 +503,15 @@ async function planDelete(file) {
|
|
|
496
503
|
|
|
497
504
|
async function planPause(file) {
|
|
498
505
|
try {
|
|
499
|
-
await fetch('/api/plans/pause', { method: 'POST', headers: { 'Content-Type': 'application/json' }, body: JSON.stringify({ file }) });
|
|
500
|
-
|
|
501
|
-
|
|
502
|
-
|
|
506
|
+
const res = await fetch('/api/plans/pause', { method: 'POST', headers: { 'Content-Type': 'application/json' }, body: JSON.stringify({ file }) });
|
|
507
|
+
if (res.ok) {
|
|
508
|
+
showToast('cmd-toast', 'Plan paused — no new items will be dispatched', true);
|
|
509
|
+
refreshPlans();
|
|
510
|
+
refresh();
|
|
511
|
+
} else {
|
|
512
|
+
const d = await res.json().catch(() => ({}));
|
|
513
|
+
alert('Pause failed: ' + (d.error || 'unknown'));
|
|
514
|
+
}
|
|
503
515
|
} catch (e) { showToast('cmd-toast', 'Error: ' + e.message, false); }
|
|
504
516
|
}
|
|
505
517
|
|
|
@@ -507,9 +519,14 @@ async function planReject(file) {
|
|
|
507
519
|
if (!confirm('Reject this plan? It will not be executed.')) return;
|
|
508
520
|
const reason = prompt('Reason for rejection (optional):') || '';
|
|
509
521
|
try {
|
|
510
|
-
await fetch('/api/plans/reject', { method: 'POST', headers: { 'Content-Type': 'application/json' }, body: JSON.stringify({ file, reason }) });
|
|
511
|
-
|
|
512
|
-
|
|
522
|
+
const res = await fetch('/api/plans/reject', { method: 'POST', headers: { 'Content-Type': 'application/json' }, body: JSON.stringify({ file, reason }) });
|
|
523
|
+
if (res.ok) {
|
|
524
|
+
showToast('cmd-toast', 'Plan rejected', true);
|
|
525
|
+
refreshPlans();
|
|
526
|
+
} else {
|
|
527
|
+
const d = await res.json().catch(() => ({}));
|
|
528
|
+
alert('Reject failed: ' + (d.error || 'unknown'));
|
|
529
|
+
}
|
|
513
530
|
} catch (e) { showToast('cmd-toast', 'Error: ' + e.message, false); }
|
|
514
531
|
}
|
|
515
532
|
|
package/package.json
CHANGED