@yemi33/minions 0.1.2091 → 0.1.2092

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.
@@ -222,25 +222,39 @@ function _isCachedBinUsable(cached) {
222
222
  }
223
223
 
224
224
  /**
225
- * Probe `gh extension list` for the gh-copilot extension. Returns the absolute
226
- * path of the `gh` binary when found, null otherwise.
225
+ * Probe `gh` for Copilot support. Returns the absolute path of the `gh`
226
+ * binary when `gh copilot` is invokable, null otherwise.
227
227
  *
228
- * `gh extension list` exits 0 with a list of extensions on stdout. We grep for
229
- * `gh-copilot`, the extension's repository slug. If `gh` isn't on PATH the
230
- * outer try-catch swallows the ENOENT.
228
+ * Two install paths produce a working `gh copilot` subcommand and we accept
229
+ * both:
230
+ * 1. gh ≥ ~2.90 ships Copilot as a built-in preview command. `gh extension
231
+ * list` does NOT list it (it's not an extension) — and attempting to
232
+ * install the legacy `github/gh-copilot` extension is rejected because
233
+ * gh already provides the command. Detecting via the extension list
234
+ * would falsely report "copilot not installed" on every recent gh.
235
+ * 2. gh < ~2.90 with the legacy `gh-copilot` extension installed. The
236
+ * extension also responds to `gh copilot --help` with exit 0.
237
+ *
238
+ * `gh copilot --help` exits 0 in both cases and non-zero ("unknown command")
239
+ * when neither path is available, so it's a clean unified signal. The probe
240
+ * runs with --no-update-notifier (silences gh's update banner so a slow
241
+ * network doesn't drag the probe over the timeout). If `gh` isn't on PATH
242
+ * the outer try-catch swallows the ENOENT.
231
243
  */
232
- function _findGhCopilotExtension(env) {
244
+ function _findGhCopilotExtension(env, { execSyncCapture = _execSyncCapture } = {}) {
233
245
  let ghPath = null;
234
246
  try {
235
247
  const cmd = isWin ? 'where gh 2>NUL' : 'which gh 2>/dev/null';
236
- const which = _execSyncCapture(cmd, env).trim().split('\n')[0].trim();
248
+ const which = execSyncCapture(cmd, env).trim().split('\n')[0].trim();
237
249
  if (!which) return null;
238
250
  ghPath = which;
239
251
  } catch { return null; }
240
252
  try {
241
- const out = _execSyncCapture('gh extension list', env);
242
- if (/gh-copilot/i.test(out)) return ghPath;
243
- } catch { /* `gh` may have no extensions or be misconfigured */ }
253
+ // execSync throws on non-zero exit; reaching the return means `gh copilot`
254
+ // is a valid subcommand on this gh version (builtin or legacy extension).
255
+ execSyncCapture('gh copilot --help', env, 5000);
256
+ return ghPath;
257
+ } catch { /* gh present but no copilot subcommand */ }
244
258
  return null;
245
259
  }
246
260
 
@@ -1205,11 +1219,12 @@ const capabilities = {
1205
1219
 
1206
1220
  // Install hint surfaced when `resolveBinary()` returns null. Covers all
1207
1221
  // supported install paths so users on any platform see one actionable line.
1208
- // Standalone Copilot CLI (preferred path) is available via:
1209
- // - WinGet: winget install --id GitHub.cli && gh extension install github/gh-copilot
1210
- // - Homebrew: brew install gh && gh extension install github/gh-copilot
1211
- // - Direct: download from https://github.com/github/copilot-cli/releases
1212
- const INSTALL_HINT = 'install via WinGet (winget install --id GitHub.cli && gh extension install github/gh-copilot), Homebrew (brew install gh && gh extension install github/gh-copilot), or download standalone copilot from https://github.com/github/copilot-cli/releases';
1222
+ //
1223
+ // gh ~2.90 ships `gh copilot` as a built-in preview command, so the legacy
1224
+ // `gh extension install github/gh-copilot` flow is no longer required (and is
1225
+ // in fact rejected by recent gh, since the command is already provided). The
1226
+ // hint reflects that: get a modern gh, OR install the standalone Copilot CLI.
1227
+ const INSTALL_HINT = 'install GitHub CLI 2.90+ which ships `gh copilot` built in (WinGet: `winget install --id GitHub.cli`, Homebrew: `brew install gh`, or download from https://cli.github.com), or install the standalone Copilot CLI via `npm i -g @github/copilot`';
1213
1228
 
1214
1229
  function getUserAssetDirs({ homeDir = os.homedir() } = {}) {
1215
1230
  return [
@@ -1286,6 +1301,7 @@ module.exports = {
1286
1301
  _pickStandaloneCopilotFromOutput,
1287
1302
  _resolveNpmCopilotJsEntry,
1288
1303
  _isCachedBinUsable,
1304
+ _findGhCopilotExtension,
1289
1305
  // W-mpmwxni2000c25c7-a — invalid-model error-path helpers. `_warmModelCache`
1290
1306
  // populates the in-memory model catalog so parseError can enrich its
1291
1307
  // "Model X not available" message without a per-error HTTP round trip.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@yemi33/minions",
3
- "version": "0.1.2091",
3
+ "version": "0.1.2092",
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"