multi-agents-cli 1.1.24 → 1.1.25

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.
@@ -354,7 +354,23 @@ const runMissingGate = async (params) => {
354
354
  const coexistence = coexistenceCheck(branch, ROOT);
355
355
 
356
356
  // Display coexistence results
357
- if (!coexistence.remoteExists) {
357
+ if (!coexistence.remoteExists && coexistence.divergenceCount === 0) {
358
+ console.log(` ${dim('Remote')} : ${red('not found - branch was deleted remotely')}`);
359
+ console.log(` ${dim('Divergence')}: ${green('none - branch is up to date with main')}`);
360
+ console.log(`\n ${dim('No data loss detected - auto-resetting and continuing...\n')}`);
361
+
362
+ // Auto-reset: remove worktree, delete local branch, clear tracking
363
+ if (slot.worktreePath) {
364
+ const absoluteWorktreePath = path.isAbsolute(slot.worktreePath) ? slot.worktreePath : path.resolve(ROOT, slot.worktreePath);
365
+ try { execSync(`git worktree remove "${absoluteWorktreePath}" --force`, { cwd: ROOT, stdio: 'pipe' }); } catch {}
366
+ }
367
+ try { execSync(`git branch -D ${branch}`, { cwd: ROOT, stdio: 'pipe' }); } catch {}
368
+ tracking[scope][agent] = emptySlot();
369
+ const trackingPath = path.join(ROOT, '.scaffold', '.tracking.json');
370
+ fs.writeFileSync(trackingPath, JSON.stringify(tracking, null, 2), 'utf8');
371
+ console.log(` ${green('✓')} Auto-reset complete - launching fresh ${agent} task.\n`);
372
+ return { action: 'reset' };
373
+ } else if (!coexistence.remoteExists) {
358
374
  console.log(` ${dim('Remote')} : ${red('not found - branch was deleted remotely')}`);
359
375
  } else {
360
376
  console.log(` ${dim('Remote')} : ${green('exists')} - ${coexistence.unmergedCommits} unmerged commit(s)`);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "multi-agents-cli",
3
- "version": "1.1.24",
3
+ "version": "1.1.25",
4
4
  "description": "Multi-agent workflow orchestration for Claude Code — isolated git worktrees, structured state tracking, autonomous task chaining",
5
5
  "keywords": [
6
6
  "claude-code",