@mutmutco/cli 4.5.190 → 4.5.192

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 +33 -9
  2. package/package.json +1 -1
package/dist/main.cjs CHANGED
@@ -19193,10 +19193,10 @@ var rollout_plan_default = {
19193
19193
  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)."
19194
19194
  },
19195
19195
  baseline: {
19196
- version: "4.5.190",
19197
- tag: "v4.5.190",
19198
- commit: "cc6f26a519fa",
19199
- npm: "@mutmutco/cli@4.5.190"
19196
+ version: "4.5.192",
19197
+ tag: "v4.5.192",
19198
+ commit: "f1f8ae295dcd",
19199
+ npm: "@mutmutco/cli@4.5.192"
19200
19200
  },
19201
19201
  exitCriterion: "fleet-n-of-n",
19202
19202
  hubOnlyShortcut: "forbidden",
@@ -19213,14 +19213,14 @@ var rollout_plan_default = {
19213
19213
  repo: "mutmutco/mmi-hub",
19214
19214
  role: "canary",
19215
19215
  schedule: "train",
19216
- v3Target: "v4.5.190"
19216
+ v3Target: "v4.5.192"
19217
19217
  }
19218
19218
  ],
19219
19219
  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.",
19220
19220
  rollback: {
19221
19221
  independent: true,
19222
- mechanism: "npm dist-tag latest -> 4.5.190 and redeploy the Hub Lambda from tag v4.5.190 (cc6f26a519fa); installed clients repair via `mmi-cli doctor`. No other cohort is touched.",
19223
- v3Target: "v4.5.190 (@mutmutco/cli@4.5.190, tag commit cc6f26a519fa \u2014 last known-good release carrying the repo-index v4-only contract)"
19222
+ mechanism: "npm dist-tag latest -> 4.5.192 and redeploy the Hub Lambda from tag v4.5.192 (f1f8ae295dcd); installed clients repair via `mmi-cli doctor`. No other cohort is touched.",
19223
+ v3Target: "v4.5.192 (@mutmutco/cli@4.5.192, tag commit f1f8ae295dcd \u2014 last known-good release carrying the repo-index v4-only contract)"
19224
19224
  }
19225
19225
  },
19226
19226
  {
@@ -33363,6 +33363,7 @@ function planRemoteScript(dests) {
33363
33363
  lines2.push(`if [ -f '${d}' ]; then printf '%s %s %s\\n' "$(md5sum < '${d}' | cut -d' ' -f1)" "$(stat -c %a '${d}')" '${d}'; else printf 'MISSING - %s\\n' '${d}'; fi`);
33364
33364
  }
33365
33365
  lines2.push(`for f in ${ALERT_DIR}/*; do [ -f "$f" ] && printf 'ALERT %s %s\\n' "$(basename "$f")" "$(head -c 300 "$f" | tr '\\n' ' ')"; done; true`);
33366
+ lines2.push(`if command -v needrestart >/dev/null 2>&1 && nr_out=$(needrestart -b -r l 2>/dev/null); then printf 'PENDING_RESTART_STATUS ok\\n'; printf '%s\\n' "$nr_out" | sed -n 's/^NEEDRESTART-SVC:[[:space:]]*/PENDING_RESTART /p'; else printf 'PENDING_RESTART_STATUS unavailable\\n'; fi; true`);
33366
33367
  return `${lines2.join("\n")}
33367
33368
  `;
33368
33369
  }
@@ -33375,6 +33376,21 @@ function parseAlerts(output) {
33375
33376
  }
33376
33377
  return out;
33377
33378
  }
33379
+ function parsePendingRestartStatus(output) {
33380
+ for (const line of output.split("\n")) {
33381
+ if (line.trim() === "PENDING_RESTART_STATUS ok") return "ok";
33382
+ if (line.trim() === "PENDING_RESTART_STATUS unavailable") return "unavailable";
33383
+ }
33384
+ return "unavailable";
33385
+ }
33386
+ function parsePendingRestarts(output) {
33387
+ const out = [];
33388
+ for (const line of output.split("\n")) {
33389
+ const m = /^PENDING_RESTART ([A-Za-z0-9@_.:-]+)$/.exec(line.trim());
33390
+ if (m && !out.includes(m[1])) out.push(m[1]);
33391
+ }
33392
+ return out;
33393
+ }
33378
33394
  function parsePlanOutput(output, rows) {
33379
33395
  const seen = /* @__PURE__ */ new Map();
33380
33396
  for (const line of output.split("\n")) {
@@ -35240,9 +35256,17 @@ ${SSH_RECIPE_AGENT_NOTE}`);
35240
35256
  const drift = results.filter((r) => r.status !== "in-sync").length;
35241
35257
  const unread = results.some((r) => r.status === "unread");
35242
35258
  const alerts = parseAlerts(output);
35243
- const payload = { box: found.box.name, ref: o.ref, mode: o.apply ? "apply" : "plan", files: results, drift, alerts, ok: drift === 0 && alerts.length === 0 };
35259
+ const pendingRestartsStatus = parsePendingRestartStatus(output);
35260
+ const pendingRestarts = parsePendingRestarts(output);
35261
+ const payload = { box: found.box.name, ref: o.ref, mode: o.apply ? "apply" : "plan", files: results, drift, alerts, pendingRestartsStatus, pendingRestarts, ok: drift === 0 && alerts.length === 0 };
35244
35262
  if (o.json) console.log(JSON.stringify(payload, null, 2));
35245
- else console.log([formatControl(payload.mode, found.box.name, results), ...alerts.map((a) => `ALERT ${a.name}: ${a.message}`)].join("\n"));
35263
+ else {
35264
+ console.log([
35265
+ formatControl(payload.mode, found.box.name, results),
35266
+ ...alerts.map((a) => `ALERT ${a.name}: ${a.message}`),
35267
+ ...pendingRestartsStatus === "unavailable" ? ["PENDING_RESTART: unavailable (needrestart probe missing or failed)"] : pendingRestarts.length ? [`PENDING_RESTART: ${pendingRestarts.join(", ")}`] : []
35268
+ ].join("\n"));
35269
+ }
35246
35270
  process.exitCode = unread ? 2 : drift || alerts.length ? 1 : 0;
35247
35271
  } catch (e) {
35248
35272
  if (o.json) console.log(JSON.stringify({ box: name, ref: o.ref, ok: false, error: e.message }, null, 2));
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mutmutco/cli",
3
- "version": "4.5.190",
3
+ "version": "4.5.192",
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",