@yemi33/minions 0.1.164 → 0.1.165

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.165 (2026-04-02)
4
+
5
+ ### Engine
6
+ - engine.js
7
+
3
8
  ## 0.1.164 (2026-04-02)
4
9
 
5
10
  ### Engine
package/engine.js CHANGED
@@ -1802,6 +1802,41 @@ function discoverCentralWorkItems(config) {
1802
1802
  assignedProject: projects.length > 0 ? projects[i % projects.length] : null
1803
1803
  }));
1804
1804
 
1805
+ // Inject checkpoint context if agent left a checkpoint.json from a prior run
1806
+ let fanOutCheckpointContext = '';
1807
+ try {
1808
+ const fanFirstProject = projects[0];
1809
+ const fanBranch = item.branch || `work/${item.id}`;
1810
+ const fanWtPath = fanFirstProject?.localPath
1811
+ ? path.resolve(fanFirstProject.localPath, config.engine?.worktreeRoot || '../worktrees', fanBranch)
1812
+ : '';
1813
+ const fanCpPath = fanWtPath ? path.join(fanWtPath, 'checkpoint.json') : '';
1814
+ if (fanCpPath && fs.existsSync(fanCpPath)) {
1815
+ const fanCpData = JSON.parse(fs.readFileSync(fanCpPath, 'utf8'));
1816
+ const fanCpCount = (item._checkpointCount || 0) + 1;
1817
+ if (fanCpCount > 3) {
1818
+ log('warn', `Work item ${item.id} exceeded 3 checkpoint-resumes — marking as needs-human-review`);
1819
+ item.status = 'needs-human-review';
1820
+ item._checkpointCount = fanCpCount;
1821
+ needsWrite = true;
1822
+ continue;
1823
+ }
1824
+ item._checkpointCount = fanCpCount;
1825
+ const fanCpSummary = [
1826
+ `## Checkpoint (Resume #${fanCpCount}/3)`,
1827
+ '',
1828
+ 'A previous agent run timed out but left a checkpoint. Continue from where it left off.',
1829
+ '',
1830
+ Array.isArray(fanCpData.completed) && fanCpData.completed.length > 0 ? `### Completed\n${fanCpData.completed.map(s => '- ' + s).join('\n')}` : '',
1831
+ Array.isArray(fanCpData.remaining) && fanCpData.remaining.length > 0 ? `### Remaining\n${fanCpData.remaining.map(s => '- ' + s).join('\n')}` : '',
1832
+ Array.isArray(fanCpData.blockers) && fanCpData.blockers.length > 0 ? `### Blockers\n${fanCpData.blockers.map(s => '- ' + s).join('\n')}` : '',
1833
+ fanCpData.branch_state ? `### Branch State\n${fanCpData.branch_state}` : '',
1834
+ ].filter(Boolean).join('\n');
1835
+ fanOutCheckpointContext = fanCpSummary;
1836
+ log('info', `Injecting checkpoint context for ${item.id} (resume #${fanCpCount})`);
1837
+ }
1838
+ } catch (e) { log('warn', `checkpoint read for ${item.id}: ${e.message}`); }
1839
+
1805
1840
  for (const { agent, assignedProject } of assignments) {
1806
1841
  const fanKey = `${key}-${agent.id}`;
1807
1842
  if (isAlreadyDispatched(fanKey)) continue;
@@ -1833,6 +1868,10 @@ function discoverCentralWorkItems(config) {
1833
1868
  ? '## Push Branch\n\n**PR creation is skipped for this work item.** Push your branch and report the branch name.\n\n```bash\ngit push -u origin ' + fanBranch + '\n```\n\nInclude the branch name in your completion summary.'
1834
1869
  : '## Create PR (MANDATORY)\n\n**Your task is NOT complete until a pull request exists.** If PR creation fails, retry up to 3 times before reporting the error.\n\n{{pr_create_instructions}}\n- sourceRefName: `refs/heads/' + fanBranch + '`\n- targetRefName: `refs/heads/{{main_branch}}`\n- title: `{{commit_message}}`\n- labels: `["minions:{{agent_id}}"]`\n\nInclude in the PR description:\n- What was built and why\n- Files changed\n- How to build and test, browser URL if applicable\n- Test plan\n\n## Post self-review on PR\n\n{{pr_comment_instructions}}\n- pullRequestId: `<from PR creation>`\n- Re-read your own diff critically before posting\n- Sign: `Built by Minions ({{agent_name}} — {{agent_role}})`';
1835
1870
 
1871
+ // Inject checkpoint context (computed once above the loop)
1872
+ vars.checkpoint_context = fanOutCheckpointContext;
1873
+
1874
+
1836
1875
  if (workType === 'ask') {
1837
1876
  vars.question = item.title + (item.description ? '\n\n' + item.description : '');
1838
1877
  vars.task_id = item.id;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@yemi33/minions",
3
- "version": "0.1.164",
3
+ "version": "0.1.165",
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"