@yemi33/minions 0.1.1805 → 0.1.1806

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.1806 (2026-05-08)
4
+
5
+ ### Fixes
6
+ - preserve active agents across restart
7
+
3
8
  ## 0.1.1805 (2026-05-08)
4
9
 
5
10
  ### Fixes
package/bin/minions.js CHANGED
@@ -131,7 +131,7 @@ function killMinionsProcesses(patterns) {
131
131
  if (patterns.some(p => line.includes(p))) {
132
132
  const pidMatch = line.match(/(\d{2,})/);
133
133
  const pid = pidMatch ? pidMatch[1] : null;
134
- if (pid && pid !== String(process.pid)) try { execSync(`taskkill /F /T /PID ${pid}`, { stdio: 'ignore', timeout: 5000, windowsHide: true }); } catch {}
134
+ if (pid && pid !== String(process.pid)) killPidOnly(pid);
135
135
  }
136
136
  }
137
137
  } else {
@@ -1,5 +1,5 @@
1
1
  {
2
2
  "runtime": "copilot",
3
3
  "models": null,
4
- "cachedAt": "2026-05-08T18:14:57.011Z"
4
+ "cachedAt": "2026-05-08T18:43:02.635Z"
5
5
  }
@@ -209,6 +209,41 @@ async function writeProcessExitSentinel({
209
209
  return { sentinel, stdoutFlushed, outputPathWritten };
210
210
  }
211
211
 
212
+ function _appendOutputFallback(outputPath, chunk, prefix = '') {
213
+ if (!outputPath) return false;
214
+ try {
215
+ fs.appendFileSync(outputPath, prefix + chunk.toString());
216
+ return true;
217
+ } catch {
218
+ return false;
219
+ }
220
+ }
221
+
222
+ function createParentPipeForwarder(stream, outputPath, prefix = '') {
223
+ let pipeBroken = false;
224
+ if (stream && typeof stream.on === 'function') {
225
+ stream.on('error', () => {
226
+ pipeBroken = true;
227
+ });
228
+ }
229
+ return (chunk) => {
230
+ if (pipeBroken || !stream || typeof stream.write !== 'function') {
231
+ _appendOutputFallback(outputPath, chunk, prefix);
232
+ return;
233
+ }
234
+ try {
235
+ stream.write(chunk, (err) => {
236
+ if (!err) return;
237
+ pipeBroken = true;
238
+ _appendOutputFallback(outputPath, chunk, prefix);
239
+ });
240
+ } catch {
241
+ pipeBroken = true;
242
+ _appendOutputFallback(outputPath, chunk, prefix);
243
+ }
244
+ };
245
+ }
246
+
212
247
  /**
213
248
  * Build the `--add-dir` list passed to the runtime CLI. Pure: takes
214
249
  * `{ runtime, minionsDir, homeDir, exists }` and returns an ordered, deduped
@@ -371,15 +406,18 @@ function main() {
371
406
  process.on('exit', _cleanupSpawnTempFiles);
372
407
  process.on('SIGTERM', () => { _cleanupSpawnTempFiles(); process.exit(143); });
373
408
 
409
+ const forwardStdout = createParentPipeForwarder(process.stdout, process.env.MINIONS_LIVE_OUTPUT_PATH);
410
+ const forwardStderr = createParentPipeForwarder(process.stderr, process.env.MINIONS_LIVE_OUTPUT_PATH, '[stderr] ');
411
+
374
412
  // Capture stderr separately for debugging
375
413
  let stderrBuf = '';
376
414
  proc.stderr.on('data', (chunk) => {
377
415
  stderrBuf += chunk.toString();
378
- process.stderr.write(chunk);
416
+ forwardStderr(chunk);
379
417
  });
380
418
 
381
- // Pipe stdout to parent
382
- proc.stdout.pipe(process.stdout);
419
+ // Forward output without depending on the parent engine pipe staying alive.
420
+ proc.stdout.on('data', forwardStdout);
383
421
 
384
422
  // MCP startup timeout: kill if no stdout within 3 minutes
385
423
  const MCP_STARTUP_TIMEOUT = 180000; // 3 minutes
@@ -411,6 +449,6 @@ function main() {
411
449
  });
412
450
  }
413
451
 
414
- module.exports = { parseSpawnArgs, buildSpawnInvocation, normalizeRuntimeExit, shouldInjectAdoTokenEnv, injectAdoTokenEnv, injectAdoTokenEnvForRepoHost, writeProcessExitSentinel, computeAddDirs };
452
+ module.exports = { parseSpawnArgs, buildSpawnInvocation, normalizeRuntimeExit, shouldInjectAdoTokenEnv, injectAdoTokenEnv, injectAdoTokenEnvForRepoHost, writeProcessExitSentinel, computeAddDirs, createParentPipeForwarder };
415
453
 
416
454
  if (require.main === module) main();
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@yemi33/minions",
3
- "version": "0.1.1805",
3
+ "version": "0.1.1806",
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"