@yemi33/minions 0.1.306 → 0.1.307

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,8 +1,9 @@
1
1
  # Changelog
2
2
 
3
- ## 0.1.306 (2026-04-03)
3
+ ## 0.1.307 (2026-04-03)
4
4
 
5
5
  ### Features
6
+ - guard projects[0] fallbacks in lifecycle.js
6
7
  - Add null guards to dashboard.js request handlers
7
8
 
8
9
  ### Fixes
@@ -154,7 +154,11 @@ function checkPlanCompletion(meta, config) {
154
154
  // Resolve the primary project for writing new work items (PR, verify)
155
155
  const projectName = plan.project;
156
156
  const primaryProject = projectName
157
- ? projects.find(p => p.name?.toLowerCase() === projectName?.toLowerCase()) : projects[0];
157
+ ? projects.find(p => p.name?.toLowerCase() === projectName?.toLowerCase()) : (projects[0] || null);
158
+ if (!primaryProject) {
159
+ log('warn', `checkPlanCompletion: no project available (projects array ${projects.length === 0 ? 'empty' : 'no match for ' + projectName}) — skipping PR/verify creation for ${planFile}`);
160
+ return;
161
+ }
158
162
  const wiPath = primaryProject ? shared.projectWorkItemsPath(primaryProject) : null;
159
163
  const workItems = wiPath ? (safeJson(wiPath) || []) : [];
160
164
 
@@ -424,6 +428,10 @@ function chainPlanToPrd(dispatchItem, meta, config) {
424
428
 
425
429
  const projectName = meta?.item?.project || meta?.project?.name;
426
430
  const projects = shared.getProjects(config);
431
+ if (projects.length === 0) {
432
+ log('error', 'Plan chaining: no projects configured — cannot chain plan to PRD');
433
+ return;
434
+ }
427
435
  const targetProject = projectName
428
436
  ? projects.find(p => p.name === projectName) || projects[0]
429
437
  : projects[0];
@@ -584,7 +592,11 @@ function syncPrsFromOutput(output, agentId, meta, config) {
584
592
  if (prMatches.size === 0) return 0;
585
593
 
586
594
  const projects = shared.getProjects(config);
587
- const defaultProject = (meta?.project?.name && projects.find(p => p.name === meta.project.name)) || projects[0];
595
+ if (projects.length === 0 && !meta?.project?.name) {
596
+ log('warn', `syncPrsFromOutput: no projects configured and no project in meta — cannot sync PRs`);
597
+ return 0;
598
+ }
599
+ const defaultProject = (meta?.project?.name && projects.find(p => p.name === meta.project.name)) || (projects[0] || null);
588
600
  const useCentral = !defaultProject;
589
601
 
590
602
  // Match each PR to its correct project by finding which repo URL appears near the PR number in output
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@yemi33/minions",
3
- "version": "0.1.306",
3
+ "version": "0.1.307",
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"