@mutmutco/cli 4.6.2 → 4.6.4

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.
@@ -228,7 +228,7 @@ function isFilingWriteApi(rest) {
228
228
  }
229
229
  }
230
230
  if (method === "POST" && path2 && /^repos\/[^/]+\/[^/]+\/(issues|pulls)$/.test(path2)) return true;
231
- if (method === "PUT" && path2 && /^repos\/[^/]+\/[^/]+\/pulls\/\d+\/merge$/.test(path2)) return true;
231
+ if (method === "PUT" && path2 && /^repos\/[^/]+\/[^/]+\/pulls\/\d+\/merge(-async)?$/.test(path2)) return true;
232
232
  return false;
233
233
  }
234
234
  function isViewerFreeGhRead(args) {
@@ -440,16 +440,26 @@ var init_cli_shared = __esm({
440
440
  rawExecFileP(file, args, { encoding: "utf8", windowsHide: true, timeout: DEFAULT_EXEC_TIMEOUT_MS, killSignal: "SIGTERM", ...options, ...env ? { env } : {} })
441
441
  );
442
442
  const appEnv = options.env ? void 0 : await ghReadAppEnv(file, args) ?? await ghFilingAppEnv(file, args);
443
+ const reportsCredential = !options.env && /(^|[\\/])gh(\.exe)?$/i.test(file) && isAppFilingWrite(args);
444
+ const tag = async (call, credential) => {
445
+ if (!reportsCredential) return call;
446
+ try {
447
+ return { ...await call, credential };
448
+ } catch (e) {
449
+ if (e && typeof e === "object") e.credential = credential;
450
+ throw e;
451
+ }
452
+ };
443
453
  if (/(^|[\\/])gh(\.exe)?$/i.test(file) && args[0] !== "auth") {
444
454
  const callerEnv = options.env;
445
455
  const pool = appEnv ? "app" : !callerEnv ? ambientPool() : !callerEnv.GH_TOKEN ? "personal" : callerEnv.MMI_GH_POOL === "app" ? "app" : callerEnv.GH_TOKEN === process.env.GH_TOKEN ? ambientPool() : "caller";
446
456
  recordGhUsage("gh", pool, args.filter((a) => !a.startsWith("-")).slice(0, 2).join(" "));
447
457
  }
448
- if (!appEnv) return run();
458
+ if (!appEnv) return tag(run(), "user");
449
459
  try {
450
- return await run(appEnv);
460
+ return await tag(run(appEnv), "app_installation");
451
461
  } catch (e) {
452
- if (shouldRetryIntegrationRefusalOnAmbient(e)) return run();
462
+ if (shouldRetryIntegrationRefusalOnAmbient(e)) return tag(run(), "user");
453
463
  throw e;
454
464
  }
455
465
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mutmutco/cli",
3
- "version": "4.6.2",
3
+ "version": "4.6.4",
4
4
  "description": "MMI Future CLI — the org dev toolbox and shared cross-IDE engine for every registry-declared MMI coding surface.",
5
5
  "type": "module",
6
6
  "license": "UNLICENSED",