@mutmutco/cli 2.32.3 → 2.32.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.
Files changed (2) hide show
  1. package/dist/main.cjs +31 -17
  2. package/package.json +1 -1
package/dist/main.cjs CHANGED
@@ -3423,7 +3423,7 @@ function resolveRulesBase(orgRulesSource, defaultBase) {
3423
3423
  }
3424
3424
 
3425
3425
  // src/index.ts
3426
- var import_node_child_process9 = require("node:child_process");
3426
+ var import_node_child_process10 = require("node:child_process");
3427
3427
 
3428
3428
  // src/cli-shared.ts
3429
3429
  var import_promises = require("node:fs/promises");
@@ -8248,15 +8248,24 @@ function decideStage(inputs) {
8248
8248
  }
8249
8249
 
8250
8250
  // src/cursor-plugin-seed.ts
8251
+ var import_node_child_process7 = require("node:child_process");
8251
8252
  var import_node_fs11 = require("node:fs");
8252
8253
  var import_node_os4 = require("node:os");
8253
8254
  var import_node_path11 = require("node:path");
8255
+ var import_node_util6 = require("node:util");
8254
8256
  function isSemverVersion(v) {
8255
8257
  return typeof v === "string" && /^v?\d+\.\d+\.\d+/.test(v.trim());
8256
8258
  }
8257
8259
  var MMI_HUB_REPO = "mutmutco/MMI-Hub";
8258
8260
  var CURSOR_THIRD_PARTY_STATE_KEY = "cursor/thirdPartyExtensibilityEnabled";
8259
8261
  var PLUGIN_JSON_REL = ".cursor-plugin/plugin.json";
8262
+ var execFileBuffer = (0, import_node_util6.promisify)(import_node_child_process7.execFile);
8263
+ function gitFetchReleaseTagArgs(hubCheckout, tag) {
8264
+ return ["-C", hubCheckout, "fetch", "origin", "tag", tag, "--quiet"];
8265
+ }
8266
+ function ghReleaseTarballApiArgs(tag) {
8267
+ return ["api", `repos/${MMI_HUB_REPO}/tarball/refs/tags/${tag}`];
8268
+ }
8260
8269
  function cursorUserGlobalStatePath() {
8261
8270
  if (process.platform === "win32") {
8262
8271
  const base2 = process.env.APPDATA || (0, import_node_path11.join)((0, import_node_os4.homedir)(), "AppData", "Roaming");
@@ -8295,7 +8304,7 @@ function releaseTag(releasedVersion) {
8295
8304
  async function extractPluginMmiFromHubCheckout(hubCheckout, tag, tmpRoot, execFileP5) {
8296
8305
  const tarFile = (0, import_node_path11.join)(tmpRoot, "archive.tar");
8297
8306
  try {
8298
- await execFileP5("git", ["-C", hubCheckout, "fetch", "origin", `tag ${tag}`, "--quiet"], { timeout: 6e4 });
8307
+ await execFileP5("git", gitFetchReleaseTagArgs(hubCheckout, tag), { timeout: 6e4 });
8299
8308
  await execFileP5("git", ["-C", hubCheckout, "archive", "--format=tar", `--output=${tarFile}`, tag, "plugins/mmi"], {
8300
8309
  timeout: 6e4
8301
8310
  });
@@ -8306,13 +8315,18 @@ async function extractPluginMmiFromHubCheckout(hubCheckout, tag, tmpRoot, execFi
8306
8315
  return void 0;
8307
8316
  }
8308
8317
  }
8309
- async function downloadPluginMmiViaGh(tag, tmpRoot, execFileP5) {
8318
+ async function downloadPluginMmiViaGh(tag, tmpRoot) {
8310
8319
  const tarPath = (0, import_node_path11.join)(tmpRoot, "repo.tgz");
8311
8320
  try {
8312
- await execFileP5("gh", ["api", `repos/${MMI_HUB_REPO}/tarball/refs/tags/${tag}`, "--output", tarPath], {
8313
- timeout: 12e4
8321
+ (0, import_node_fs11.mkdirSync)(tmpRoot, { recursive: true });
8322
+ const { stdout } = await execFileBuffer("gh", ghReleaseTarballApiArgs(tag), {
8323
+ timeout: 12e4,
8324
+ maxBuffer: 100 * 1024 * 1024,
8325
+ encoding: "buffer",
8326
+ windowsHide: true
8314
8327
  });
8315
- await execFileP5("tar", ["-xzf", tarPath, "-C", tmpRoot], { timeout: 12e4 });
8328
+ (0, import_node_fs11.writeFileSync)(tarPath, stdout);
8329
+ await execFileBuffer("tar", ["-xzf", tarPath, "-C", tmpRoot], { timeout: 12e4, windowsHide: true });
8316
8330
  const top = (0, import_node_fs11.readdirSync)(tmpRoot).find((entry) => entry !== "repo.tgz");
8317
8331
  if (!top) return void 0;
8318
8332
  const pluginMmi = (0, import_node_path11.join)(tmpRoot, top, "plugins", "mmi");
@@ -8328,7 +8342,7 @@ async function resolvePluginMmiSource(releasedVersion, hubCheckout, tmpRoot, exe
8328
8342
  const fromHub = await extractPluginMmiFromHubCheckout(hubCheckout, tag, tmpRoot, execFileP5);
8329
8343
  if (fromHub) return fromHub;
8330
8344
  }
8331
- return downloadPluginMmiViaGh(tag, (0, import_node_path11.join)(tmpRoot, "gh"), execFileP5);
8345
+ return downloadPluginMmiViaGh(tag, (0, import_node_path11.join)(tmpRoot, "gh"));
8332
8346
  }
8333
8347
  function cursorPluginPinsNeedingSeed(pins, releasedVersion) {
8334
8348
  if (!isSemverVersion(releasedVersion)) return pins.filter((pin) => !pin.hasPluginJson || !pin.hasHooksJson || pin.isEmpty);
@@ -9054,12 +9068,12 @@ async function runStageLiveDown(deps, t) {
9054
9068
  }
9055
9069
 
9056
9070
  // src/stage-runner.ts
9057
- var import_node_child_process7 = require("node:child_process");
9071
+ var import_node_child_process8 = require("node:child_process");
9058
9072
  var import_node_fs12 = require("node:fs");
9059
9073
  var import_node_path12 = require("node:path");
9060
9074
  var import_node_net2 = require("node:net");
9061
- var import_node_util6 = require("node:util");
9062
- var execFileP4 = (0, import_node_util6.promisify)(import_node_child_process7.execFile);
9075
+ var import_node_util7 = require("node:util");
9076
+ var execFileP4 = (0, import_node_util7.promisify)(import_node_child_process8.execFile);
9063
9077
  var EARLY_EXIT_GRACE_MS = 2e3;
9064
9078
  function waitForProcessStability(child, graceMs = EARLY_EXIT_GRACE_MS) {
9065
9079
  return new Promise((resolve, reject) => {
@@ -9255,7 +9269,7 @@ async function startStage(config = {}, opts = {}) {
9255
9269
  const extraEnv = {};
9256
9270
  for (const [k, v] of Object.entries(config.env ?? {})) extraEnv[k] = sub(v) ?? v;
9257
9271
  const up = sub(config.up.trim());
9258
- const child = (0, import_node_child_process7.spawn)(up, {
9272
+ const child = (0, import_node_child_process8.spawn)(up, {
9259
9273
  cwd,
9260
9274
  shell: true,
9261
9275
  // POSIX-only: the process group exists for the group-kill in stopStage. On win32 teardown is
@@ -10346,12 +10360,12 @@ async function runTenantRedeploy(deps, options) {
10346
10360
  }
10347
10361
 
10348
10362
  // src/hotfix-coverage.ts
10349
- var import_node_child_process8 = require("node:child_process");
10363
+ var import_node_child_process9 = require("node:child_process");
10350
10364
  var CHERRY_TRAILER = /\(cherry picked from commit ([0-9a-f]{7,40})\)/g;
10351
10365
  function checkHotfixCoverage(options = {}) {
10352
10366
  const { cwd = process.cwd(), mainRef = "origin/main", rcRef = "origin/rc", manifestPaths = [] } = options;
10353
10367
  const ack = (options.ack ?? []).filter(Boolean);
10354
- const git = options.git ?? ((args, opts) => (0, import_node_child_process8.execFileSync)("git", args, { cwd, encoding: "utf8", input: opts?.input, stdio: ["pipe", "pipe", "pipe"] }));
10368
+ const git = options.git ?? ((args, opts) => (0, import_node_child_process9.execFileSync)("git", args, { cwd, encoding: "utf8", input: opts?.input, stdio: ["pipe", "pipe", "pipe"] }));
10355
10369
  const revList = (range) => {
10356
10370
  const out = git(["rev-list", "--no-merges", range]).trim();
10357
10371
  return out ? out.split("\n") : [];
@@ -13866,7 +13880,7 @@ function scheduleRelatedDiscovery(o) {
13866
13880
  try {
13867
13881
  const args = ["issue", "discover-related", "--number", String(o.number), "--title", o.title, "--body", o.body];
13868
13882
  if (o.repo) args.push("--repo", o.repo);
13869
- (0, import_node_child_process9.spawn)(process.execPath, [process.argv[1], ...args], {
13883
+ (0, import_node_child_process10.spawn)(process.execPath, [process.argv[1], ...args], {
13870
13884
  detached: true,
13871
13885
  stdio: "ignore",
13872
13886
  windowsHide: true,
@@ -13880,7 +13894,7 @@ function detachPlanSync() {
13880
13894
  if (planSyncDetached) return;
13881
13895
  planSyncDetached = true;
13882
13896
  try {
13883
- (0, import_node_child_process9.spawn)(process.execPath, [process.argv[1], "northstar", "sync", "--quiet"], {
13897
+ (0, import_node_child_process10.spawn)(process.execPath, [process.argv[1], "northstar", "sync", "--quiet"], {
13884
13898
  detached: true,
13885
13899
  stdio: "ignore",
13886
13900
  windowsHide: true,
@@ -13959,7 +13973,7 @@ function openInEditor(path2) {
13959
13973
  return;
13960
13974
  }
13961
13975
  try {
13962
- (0, import_node_child_process9.spawn)(editor, [path2], { stdio: "inherit" });
13976
+ (0, import_node_child_process10.spawn)(editor, [path2], { stdio: "inherit" });
13963
13977
  } catch {
13964
13978
  console.log(`open ${path2} manually`);
13965
13979
  }
@@ -16166,7 +16180,7 @@ program2.command("session-start").description("run the SessionStart verbs (rules
16166
16180
  } catch (e) {
16167
16181
  console.error(`[mmi-hook] saga session failed: ${e.message}`);
16168
16182
  }
16169
- spawnDetachedSelf(["docs", "sync", "--quiet"], { spawn: import_node_child_process9.spawn, execPath: process.execPath, scriptPath: process.argv[1] });
16183
+ spawnDetachedSelf(["docs", "sync", "--quiet"], { spawn: import_node_child_process10.spawn, execPath: process.execPath, scriptPath: process.argv[1] });
16170
16184
  let northstarInjected = false;
16171
16185
  const { parallel, sequential } = buildSessionStartPlan({
16172
16186
  rulesSync: (io) => runRulesSync({ quiet: true }, io),
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mutmutco/cli",
3
- "version": "2.32.3",
3
+ "version": "2.32.4",
4
4
  "description": "MMI Future CLI — delivers the org rules (whole-file), plus saga and KB access. The cross-IDE engine the plugin's SessionStart hook drives.",
5
5
  "type": "module",
6
6
  "license": "UNLICENSED",