@mutmutco/cli 4.5.25 → 4.5.26

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.
Files changed (2) hide show
  1. package/dist/main.cjs +31 -15
  2. package/package.json +1 -1
package/dist/main.cjs CHANGED
@@ -1045,9 +1045,21 @@ function mutating(cmd, planFn) {
1045
1045
  return cmd;
1046
1046
  }
1047
1047
  function installProcessBackstop() {
1048
+ installBrokenPipeGuard(process.stdout);
1049
+ installBrokenPipeGuard(process.stderr);
1048
1050
  process.on("unhandledRejection", (reason) => void failGraceful(reason instanceof Error ? reason.message : String(reason)));
1049
1051
  process.on("uncaughtException", (err) => void failGraceful(err instanceof Error ? err.message : String(err)));
1050
1052
  }
1053
+ function installBrokenPipeGuard(stream) {
1054
+ stream.on("error", (err) => {
1055
+ if (err?.code !== "EPIPE") throw err;
1056
+ stream.write = (_chunk, enc, cb) => {
1057
+ const done = typeof enc === "function" ? enc : cb;
1058
+ if (typeof done === "function") queueMicrotask(() => done());
1059
+ return true;
1060
+ };
1061
+ });
1062
+ }
1051
1063
  function rawFlag(flag) {
1052
1064
  return process.argv.some((arg) => arg === flag || arg.startsWith(`${flag}=`));
1053
1065
  }
@@ -16804,10 +16816,10 @@ var rollout_plan_default = {
16804
16816
  note: "The v4.0.0 stamp happens at cut time (D6e #4463); until then the candidate is the origin/development head artifacts (built cli/dist + npm pack), identity proven by dist content hash (D6a)."
16805
16817
  },
16806
16818
  baseline: {
16807
- version: "4.5.25",
16808
- tag: "v4.5.25",
16809
- commit: "d7c572c38021",
16810
- npm: "@mutmutco/cli@4.5.25"
16819
+ version: "4.5.26",
16820
+ tag: "v4.5.26",
16821
+ commit: "f5ca4e782979",
16822
+ npm: "@mutmutco/cli@4.5.26"
16811
16823
  },
16812
16824
  exitCriterion: "fleet-n-of-n",
16813
16825
  hubOnlyShortcut: "forbidden",
@@ -16824,14 +16836,14 @@ var rollout_plan_default = {
16824
16836
  repo: "mutmutco/mmi-hub",
16825
16837
  role: "canary",
16826
16838
  schedule: "train",
16827
- v3Target: "v4.5.25"
16839
+ v3Target: "v4.5.26"
16828
16840
  }
16829
16841
  ],
16830
16842
  rollbackTrigger: "Any red inside the post-contract soak window: `devops train gate` FAIL attributable to the v4 doors, Hub endpoint health probe failure, a pre-v4 client admitted instead of receiving actionable HTTP 426, or npm consumer install/doctor failure on the v4-only dist.",
16831
16843
  rollback: {
16832
16844
  independent: true,
16833
- mechanism: "npm dist-tag latest -> 4.5.25 and redeploy the Hub Lambda from tag v4.5.25 (d7c572c38021); installed clients repair via `mmi-cli doctor`. No other cohort is touched.",
16834
- v3Target: "v4.5.25 (@mutmutco/cli@4.5.25, tag commit d7c572c38021 \u2014 last known-good release carrying the repo-index v4-only contract)"
16845
+ mechanism: "npm dist-tag latest -> 4.5.26 and redeploy the Hub Lambda from tag v4.5.26 (f5ca4e782979); installed clients repair via `mmi-cli doctor`. No other cohort is touched.",
16846
+ v3Target: "v4.5.26 (@mutmutco/cli@4.5.26, tag commit f5ca4e782979 \u2014 last known-good release carrying the repo-index v4-only contract)"
16835
16847
  }
16836
16848
  },
16837
16849
  {
@@ -17195,11 +17207,11 @@ var QueryReadError = class extends Error {
17195
17207
  this.code = code;
17196
17208
  }
17197
17209
  };
17198
- function clampLimit(n, dflt) {
17210
+ function clampLimit(n, dflt, max = MAX_LIMIT) {
17199
17211
  if (n === void 0 || !Number.isFinite(n)) return dflt;
17200
17212
  const v = Math.floor(n);
17201
17213
  if (v < 1) return 1;
17202
- if (v > MAX_LIMIT) return MAX_LIMIT;
17214
+ if (v > max) return max;
17203
17215
  return v;
17204
17216
  }
17205
17217
  function isGhNotFound(e) {
@@ -17226,10 +17238,12 @@ function loginsOf(v) {
17226
17238
  function namesOf(v) {
17227
17239
  return Array.isArray(v) ? v.map((a) => String(a?.name ?? "")).filter(Boolean) : [];
17228
17240
  }
17241
+ var ISSUE_LIST_MAX_LIMIT = 1e3;
17229
17242
  function buildIssueListArgs(opts, repo) {
17230
- const limit = clampLimit(opts.limit, DEFAULT_LIMIT);
17243
+ const limit = clampLimit(opts.limit, DEFAULT_LIMIT, ISSUE_LIST_MAX_LIMIT);
17231
17244
  const state = opts.state ?? "open";
17232
- const args = ["issue", "list", "--repo", repo, "--state", state, "--limit", String(limit), "--json", ISSUE_LIST_FIELDS];
17245
+ const fields = opts.withBody ? `${ISSUE_LIST_FIELDS},body` : ISSUE_LIST_FIELDS;
17246
+ const args = ["issue", "list", "--repo", repo, "--state", state, "--limit", String(limit), "--json", fields];
17233
17247
  if (opts.label) args.push("--label", opts.label);
17234
17248
  if (opts.assignee) args.push("--assignee", opts.assignee);
17235
17249
  if (opts.search) args.push("--search", opts.search);
@@ -17245,7 +17259,8 @@ function shapeIssueList(rows) {
17245
17259
  state: String(row.state ?? ""),
17246
17260
  url: String(row.url ?? ""),
17247
17261
  assignees: loginsOf(row.assignees),
17248
- labels: namesOf(row.labels)
17262
+ labels: namesOf(row.labels),
17263
+ ...typeof row.body === "string" ? { body: row.body } : {}
17249
17264
  };
17250
17265
  });
17251
17266
  }
@@ -17254,7 +17269,8 @@ async function runIssueList(deps, opts) {
17254
17269
  if (!repo) {
17255
17270
  throw new QueryReadError("BAD_INPUT", `could not resolve repo (pass --repo <owner/repo>)`);
17256
17271
  }
17257
- const rows = await deps.ghJson(buildIssueListArgs(opts, repo), GH_LIST_TIMEOUT_MS);
17272
+ const timeout = (opts.limit ?? 0) > MAX_LIMIT ? GH_LIST_TIMEOUT_MS * 4 : GH_LIST_TIMEOUT_MS;
17273
+ const rows = await deps.ghJson(buildIssueListArgs(opts, repo), timeout);
17258
17274
  return shapeIssueList(rows);
17259
17275
  }
17260
17276
  function childrenGraphqlArgs(owner, name, number) {
@@ -17862,10 +17878,10 @@ function registerQueryCommands(program3) {
17862
17878
  const project2 = program3.commands.find((c) => c.name() === "project");
17863
17879
  if (!issue || !pr) return;
17864
17880
  const deps = queryDeps();
17865
- issue.command("list").description("bounded issue read \u2014 filter by text, label, state, or assignee; always prints JSON").option("--label <label>", "filter by label").option("--search <query>", "free-text issue search").addOption(caseInsensitiveChoices(new Option("--state <state>", "open | closed | all").default("open"), ISSUE_STATES)).option("--assignee <login>", "filter by assignee login").option("--limit <n>", "max issues to return (capped at 100)", (v) => Number(v), DEFAULT_LIMIT).option("--repo <owner/repo>", "target repo (defaults to the current repo)").option("--json", "machine-readable output (already the default \u2014 accepted for contract uniformity)").action(async (o) => {
17881
+ issue.command("list").description("bounded issue read \u2014 filter by text, label, state, or assignee; always prints JSON").option("--label <label>", "filter by label").option("--search <query>", "free-text issue search").addOption(caseInsensitiveChoices(new Option("--state <state>", "open | closed | all").default("open"), ISSUE_STATES)).option("--assignee <login>", "filter by assignee login").option("--limit <n>", "max issues to return (capped at 1000; gh pages past 100)", (v) => Number(v), DEFAULT_LIMIT).option("--with-body", "include each issue's markdown body").option("--repo <owner/repo>", "target repo (defaults to the current repo)").option("--json", "machine-readable output (already the default \u2014 accepted for contract uniformity)").action(async (o) => {
17866
17882
  try {
17867
17883
  const state = validateEnum("--state", ISSUE_STATES, o.state, "issue list");
17868
- const rows = await runIssueList(deps, { label: o.label, search: o.search, state, assignee: o.assignee, limit: o.limit, repo: o.repo });
17884
+ const rows = await runIssueList(deps, { label: o.label, search: o.search, state, assignee: o.assignee, limit: o.limit, repo: o.repo, withBody: o.withBody });
17869
17885
  console.log(JSON.stringify(rows));
17870
17886
  } catch (e) {
17871
17887
  queryFail("issue list", e);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mutmutco/cli",
3
- "version": "4.5.25",
3
+ "version": "4.5.26",
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",