@yemi33/minions 0.1.52 → 0.1.54
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 +4 -2
- package/engine.js +19 -7
- 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>' +
|
package/engine.js
CHANGED
|
@@ -2361,7 +2361,8 @@ function materializePlansAsWorkItems(config) {
|
|
|
2361
2361
|
const defaultProjectName = plan.project || file.replace(/-\d{4}-\d{2}-\d{2}\.json$/, '');
|
|
2362
2362
|
const allProjects = getProjects(config);
|
|
2363
2363
|
const defaultProject = allProjects.find(p => p.name?.toLowerCase() === defaultProjectName.toLowerCase());
|
|
2364
|
-
|
|
2364
|
+
// No project found — use central work-items.json (engine works without projects)
|
|
2365
|
+
const useCentral = !defaultProject;
|
|
2365
2366
|
|
|
2366
2367
|
const statusFilter = ['missing', 'planned'];
|
|
2367
2368
|
// Also materialize in-pr/done items that never got a work item (race with PR status sync)
|
|
@@ -2371,20 +2372,31 @@ function materializePlansAsWorkItems(config) {
|
|
|
2371
2372
|
if (w.id) allExistingWiIds.add(w.id);
|
|
2372
2373
|
}
|
|
2373
2374
|
}
|
|
2375
|
+
// Also check central work-items.json
|
|
2376
|
+
for (const w of (safeJson(path.join(MINIONS_DIR, 'work-items.json')) || [])) {
|
|
2377
|
+
if (w.id) allExistingWiIds.add(w.id);
|
|
2378
|
+
}
|
|
2374
2379
|
const items = plan.missing_features.filter(f =>
|
|
2375
2380
|
statusFilter.includes(f.status) ||
|
|
2376
2381
|
((f.status === 'in-pr' || f.status === 'done') && f.id && !allExistingWiIds.has(f.id))
|
|
2377
2382
|
);
|
|
2378
2383
|
|
|
2379
2384
|
// Group items by target project (per-item project field overrides plan-level project)
|
|
2385
|
+
// When no projects are configured, all items go to central work-items.json
|
|
2380
2386
|
const itemsByProject = new Map(); // projectName -> { project, items: [] }
|
|
2381
2387
|
for (const item of items) {
|
|
2382
|
-
|
|
2383
|
-
|
|
2384
|
-
|
|
2385
|
-
|
|
2388
|
+
if (useCentral) {
|
|
2389
|
+
if (!itemsByProject.has('_central')) itemsByProject.set('_central', { project: null, items: [] });
|
|
2390
|
+
itemsByProject.get('_central').items.push(item);
|
|
2391
|
+
} else {
|
|
2392
|
+
const itemProjectName = item.project || defaultProjectName;
|
|
2393
|
+
const itemProject = allProjects.find(p => p.name?.toLowerCase() === itemProjectName.toLowerCase()) || defaultProject;
|
|
2394
|
+
if (!itemProject) continue;
|
|
2395
|
+
if (!itemsByProject.has(itemProject.name)) {
|
|
2396
|
+
itemsByProject.set(itemProject.name, { project: itemProject, items: [] });
|
|
2397
|
+
}
|
|
2398
|
+
itemsByProject.get(itemProject.name).items.push(item);
|
|
2386
2399
|
}
|
|
2387
|
-
itemsByProject.get(itemProject.name).items.push(item);
|
|
2388
2400
|
}
|
|
2389
2401
|
|
|
2390
2402
|
// Cycle detection BEFORE materialization — skip cyclic items
|
|
@@ -2406,7 +2418,7 @@ function materializePlansAsWorkItems(config) {
|
|
|
2406
2418
|
|
|
2407
2419
|
let totalCreated = 0;
|
|
2408
2420
|
for (const [projName, { project, items: projItems }] of itemsByProject) {
|
|
2409
|
-
const wiPath = projectWorkItemsPath(project);
|
|
2421
|
+
const wiPath = project ? projectWorkItemsPath(project) : path.join(MINIONS_DIR, 'work-items.json');
|
|
2410
2422
|
const existingItems = safeJson(wiPath) || [];
|
|
2411
2423
|
let created = 0;
|
|
2412
2424
|
const newlyCreatedIds = new Set(); // tracks IDs created in this pass for reconciliation scoping
|
package/package.json
CHANGED