@yemi33/minions 0.1.1804 → 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 +10 -0
- package/bin/minions.js +4 -2
- package/engine/copilot-models.json +1 -1
- package/engine/spawn-agent.js +42 -4
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
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))
|
|
134
|
+
if (pid && pid !== String(process.pid)) killPidOnly(pid);
|
|
135
135
|
}
|
|
136
136
|
}
|
|
137
137
|
} else {
|
|
@@ -145,7 +145,9 @@ function killMinionsProcesses(patterns) {
|
|
|
145
145
|
/** Spawn a detached dashboard. When `suppressOpen` is true, the new dashboard
|
|
146
146
|
* skips its auto-open of the browser — the existing tab will reconnect. */
|
|
147
147
|
function spawnDashboard(suppressOpen) {
|
|
148
|
-
const env =
|
|
148
|
+
const env = { ...process.env };
|
|
149
|
+
if (suppressOpen) env.MINIONS_NO_AUTO_OPEN = '1';
|
|
150
|
+
else delete env.MINIONS_NO_AUTO_OPEN;
|
|
149
151
|
const proc = spawn(process.execPath, [path.join(MINIONS_HOME, 'dashboard.js')], {
|
|
150
152
|
cwd: MINIONS_HOME, stdio: 'ignore', detached: true, windowsHide: true, env
|
|
151
153
|
});
|
package/engine/spawn-agent.js
CHANGED
|
@@ -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
|
-
|
|
416
|
+
forwardStderr(chunk);
|
|
379
417
|
});
|
|
380
418
|
|
|
381
|
-
//
|
|
382
|
-
proc.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.
|
|
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"
|