@yemi33/minions 0.1.1715 → 0.1.1717

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,12 @@
1
1
  # Changelog
2
2
 
3
+ ## 0.1.1717 (2026-05-04)
4
+
5
+ ### Features
6
+ - Harden update init timeout (#2059)
7
+ - harden claude auth classifier (#2058)
8
+ - add CC post-dispatch stop rule (#2057)
9
+
3
10
  ## 0.1.1715 (2026-05-04)
4
11
 
5
12
  ### Features
package/bin/minions.js CHANGED
@@ -25,7 +25,7 @@
25
25
  const fs = require('fs');
26
26
  const path = require('path');
27
27
  const os = require('os');
28
- const { spawn, execSync } = require('child_process');
28
+ const { spawn, spawnSync, execSync } = require('child_process');
29
29
 
30
30
  const PKG_ROOT = path.resolve(__dirname, '..');
31
31
 
@@ -205,6 +205,8 @@ let force = rest.includes('--force');
205
205
  const skipScan = rest.includes('--skip-scan');
206
206
  const skipStart = rest.includes('--skip-start') || rest.includes('--no-start');
207
207
  const MINIONS_HOME = resolveMinionsHome(cmd === 'init');
208
+ const POST_UPDATE_INIT_TIMEOUT_MS = 120000;
209
+ const POST_UPDATE_RESTART_TIMEOUT_MS = 60000;
208
210
 
209
211
  function isSubpath(parent, child) {
210
212
  const rel = path.relative(path.resolve(parent), path.resolve(child));
@@ -432,6 +434,70 @@ function showChangelog(fromVersion) {
432
434
  console.log(` cat ${changelogPath}\n`);
433
435
  }
434
436
 
437
+ function writeCommandOutput(stream, output) {
438
+ if (!output) return;
439
+ stream.write(Buffer.isBuffer(output) ? output.toString('utf8') : String(output));
440
+ }
441
+
442
+ function formatPackageCliCommand(args) {
443
+ const initScript = path.join(PKG_ROOT, 'bin', 'minions.js');
444
+ return `node "${initScript}" ${args.join(' ')}`;
445
+ }
446
+
447
+ function runPackageCli(args, timeout) {
448
+ const initScript = path.join(PKG_ROOT, 'bin', 'minions.js');
449
+ const result = spawnSync(process.execPath, [initScript, ...args], {
450
+ cwd: process.cwd(),
451
+ env: { ...process.env, MINIONS_HOME },
452
+ encoding: 'utf8',
453
+ timeout,
454
+ windowsHide: true,
455
+ });
456
+
457
+ writeCommandOutput(process.stdout, result.stdout);
458
+ writeCommandOutput(process.stderr, result.stderr);
459
+ return result;
460
+ }
461
+
462
+ function runPostUpdateInit() {
463
+ const args = ['init', '--force', '--skip-start'];
464
+ const result = runPackageCli(args, POST_UPDATE_INIT_TIMEOUT_MS);
465
+
466
+ if (!result.error && result.status === 0) return;
467
+
468
+ const timedOut = result.error && result.error.code === 'ETIMEDOUT';
469
+ if (timedOut) {
470
+ console.error(`\n ERROR: Post-update initialization timed out after ${POST_UPDATE_INIT_TIMEOUT_MS / 1000}s.`);
471
+ } else {
472
+ const detail = result.error ? result.error.message : `exit code ${result.status}`;
473
+ console.error(`\n ERROR: Post-update initialization failed (${detail}).`);
474
+ }
475
+ console.error(' The npm package update completed, but runtime files were not fully synchronized.');
476
+ console.error(' After npm finishes settling, run:');
477
+ console.error(` ${formatPackageCliCommand(args)}`);
478
+ console.error(` ${formatPackageCliCommand(['restart'])}\n`);
479
+ process.exit(1);
480
+ }
481
+
482
+ function runPostUpdateRestart() {
483
+ const args = ['restart'];
484
+ const result = runPackageCli(args, POST_UPDATE_RESTART_TIMEOUT_MS);
485
+
486
+ if (!result.error && result.status === 0) return;
487
+
488
+ const timedOut = result.error && result.error.code === 'ETIMEDOUT';
489
+ if (timedOut) {
490
+ console.error(`\n ERROR: Post-update restart timed out after ${POST_UPDATE_RESTART_TIMEOUT_MS / 1000}s.`);
491
+ } else {
492
+ const detail = result.error ? result.error.message : `exit code ${result.status}`;
493
+ console.error(`\n ERROR: Post-update restart failed (${detail}).`);
494
+ }
495
+ console.error(' Runtime files were synchronized, but the engine/dashboard were not restarted.');
496
+ console.error(' Run this command to finish the update without using the Windows command shim:');
497
+ console.error(` ${formatPackageCliCommand(args)}\n`);
498
+ process.exit(1);
499
+ }
500
+
435
501
  // ─── Version command ────────────────────────────────────────────────────────
436
502
 
437
503
  function showVersion() {
@@ -544,11 +610,13 @@ if (!cmd || cmd === 'help' || cmd === '--help' || cmd === '-h') {
544
610
  console.error(' npm update failed:', e.message);
545
611
  process.exit(1);
546
612
  }
547
- execSync('minions init --force --skip-start', { stdio: 'inherit', timeout: 120000 });
613
+ // Equivalent to `minions init --force --skip-start`, but avoids recursing through
614
+ // the global shim while npm is still settling the updated install.
615
+ runPostUpdateInit();
548
616
  }
549
617
  // Restart engine + dashboard so they pick up the new code
550
618
  console.log('\n Restarting engine and dashboard...\n');
551
- execSync('minions restart', { stdio: 'inherit', timeout: 60000 });
619
+ runPostUpdateRestart();
552
620
  } else if (cmd === 'version' || cmd === '--version' || cmd === '-v') {
553
621
  showVersion();
554
622
  } else if (cmd === 'add' || cmd === 'remove' || cmd === 'list' || cmd === 'scan') {
@@ -1,5 +1,5 @@
1
1
  {
2
2
  "runtime": "copilot",
3
3
  "models": null,
4
- "cachedAt": "2026-05-04T18:47:12.870Z"
4
+ "cachedAt": "2026-05-04T22:25:10.942Z"
5
5
  }
@@ -456,7 +456,9 @@ function parseError(rawOutput) {
456
456
  if (!text) return { message: '', code: null, retriable: true };
457
457
  const lower = text.toLowerCase();
458
458
 
459
- if (/invalid api key|api key.*invalid|authentication.*fail|unauthorized|401|403 forbidden|please.*log.*in|claude\.ai\/login/i.test(text)) {
459
+ const hasExplicitAuthFailure = /invalid api key|api key.*invalid|authentication.*fail|\bunauthorized\b|please.*log.*in|claude\.ai\/login/i.test(text);
460
+ const hasAuthStatusCode = /\b(?:http(?:\/\d(?:\.\d)?)?|status(?:\s+code)?|statuscode|response(?:\s+status)?|api(?:\s+(?:error|response|status))?)\s*[:=]?\s*(?:401|403)\b|\b(?:401\s+unauthorized|403\s+forbidden)\b/i.test(text);
461
+ if (hasExplicitAuthFailure || hasAuthStatusCode) {
460
462
  return { message: 'Claude authentication failed', code: 'auth-failure', retriable: false };
461
463
  }
462
464
  if (/prompt is too long|context window|context.*length.*exceeded|token limit|conversation.*too long/i.test(text)) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@yemi33/minions",
3
- "version": "0.1.1715",
3
+ "version": "0.1.1717",
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"
@@ -90,6 +90,7 @@ Core action types:
90
90
  workTypes: `explore` (research/report only, NO PR), `ask` (answer/report, NO PR), `implement` (new code, PR REQUIRED), `fix` (standalone bug fix creates a PR; include `pr` when fixing review comments/build failures on an existing PR), `review` (code review, NO PR), `test` (tests, PR if new), `verify` (merge/build/maintenance, NO PR)
91
91
  If the user wants a design/architecture artifact committed through a PR, dispatch `implement` or `docs` rather than `explore`.
92
92
  When the user names a specific agent ("assign this to lambert"), put exactly that one name in `agents` (e.g. `"agents": ["lambert"]`). A single-agent assignment is hard-pinned by the server — it will queue for that agent only and skip the routing table. If the user explicitly asks for fan-out/all agents, set `scope: "fan-out"`.
93
+ After emitting a dispatch, fix, or implement action, return immediately; do not poll, monitor, watch, wait, or check until completion, and do not add follow-up status actions. Only create a watch, monitor, poll, or periodically check when the human explicitly asks for monitoring, watching, periodic checks, or notification on completion.
93
94
  - **build-and-test**: pr, project (optional), agent (optional) — Run the build-and-test playbook against a PR. The agent will checkout the PR branch, run the project's build/test commands, and report results. Use when the user asks to "run tests on PR X" or "build PR X" or after a fix to verify nothing regressed.
94
95
  Example: user says "run build and test on PR 1834" → `{"type":"build-and-test","pr":"1834"}`
95
96
  - **note**: title, content — save to inbox