@mutmutco/cli 2.46.1 → 2.47.0
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.
- package/README.md +1 -0
- package/dist/main.cjs +10619 -9947
- package/dist/saga.cjs +24 -8
- package/package.json +1 -1
package/dist/saga.cjs
CHANGED
|
@@ -4344,12 +4344,23 @@ function defaultHubUrl() {
|
|
|
4344
4344
|
return process.env.MMI_HUB_URL || DEFAULT_HUB_URL;
|
|
4345
4345
|
}
|
|
4346
4346
|
|
|
4347
|
+
// src/stage-runner.ts
|
|
4348
|
+
var import_node_child_process4 = require("node:child_process");
|
|
4349
|
+
var import_node_util4 = require("node:util");
|
|
4350
|
+
var execFileP2 = (0, import_node_util4.promisify)(import_node_child_process4.execFile);
|
|
4351
|
+
|
|
4352
|
+
// src/wave-status.ts
|
|
4353
|
+
function parseNorthStarSlugFromHead(headText) {
|
|
4354
|
+
const m = /northstar:`([^`]+)`/.exec(headText);
|
|
4355
|
+
return m?.[1];
|
|
4356
|
+
}
|
|
4357
|
+
|
|
4347
4358
|
// src/cli-shared.ts
|
|
4348
4359
|
var import_promises = require("node:fs/promises");
|
|
4349
4360
|
var import_node_fs8 = require("node:fs");
|
|
4350
4361
|
var import_node_crypto2 = require("node:crypto");
|
|
4351
|
-
var
|
|
4352
|
-
var
|
|
4362
|
+
var import_node_child_process5 = require("node:child_process");
|
|
4363
|
+
var import_node_util5 = require("node:util");
|
|
4353
4364
|
|
|
4354
4365
|
// src/saga-session.ts
|
|
4355
4366
|
function resolveSession(d) {
|
|
@@ -4445,9 +4456,9 @@ async function readStdin(opts = {}) {
|
|
|
4445
4456
|
}
|
|
4446
4457
|
|
|
4447
4458
|
// src/cli-shared.ts
|
|
4448
|
-
var rawExecFileP2 = (0,
|
|
4459
|
+
var rawExecFileP2 = (0, import_node_util5.promisify)(import_node_child_process5.execFile);
|
|
4449
4460
|
var DEFAULT_EXEC_TIMEOUT_MS = 1e4;
|
|
4450
|
-
var
|
|
4461
|
+
var execFileP3 = (file, args, options = {}) => (
|
|
4451
4462
|
// encoding 'utf8' guarantees string stdout/stderr at runtime; the cast pins the type because
|
|
4452
4463
|
// promisify(execFile)'s overloads widen to string|Buffer when options is spread in.
|
|
4453
4464
|
rawExecFileP2(file, args, { encoding: "utf8", windowsHide: true, timeout: DEFAULT_EXEC_TIMEOUT_MS, killSignal: "SIGTERM", ...options })
|
|
@@ -4471,7 +4482,7 @@ async function loadConfig() {
|
|
|
4471
4482
|
var SESSION_FILE = ".mmi/.session";
|
|
4472
4483
|
var gitOut = async (args) => {
|
|
4473
4484
|
try {
|
|
4474
|
-
return (await
|
|
4485
|
+
return (await execFileP3("git", [...args])).stdout.trim();
|
|
4475
4486
|
} catch {
|
|
4476
4487
|
return "";
|
|
4477
4488
|
}
|
|
@@ -4537,7 +4548,7 @@ async function postCapture(capture, quiet = false) {
|
|
|
4537
4548
|
}
|
|
4538
4549
|
function spawnSagaFlush() {
|
|
4539
4550
|
try {
|
|
4540
|
-
(0,
|
|
4551
|
+
(0, import_node_child_process5.spawn)(process.execPath, [process.argv[1], "saga", "flush", "--run"], {
|
|
4541
4552
|
detached: true,
|
|
4542
4553
|
stdio: "ignore",
|
|
4543
4554
|
windowsHide: true
|
|
@@ -4551,7 +4562,7 @@ async function maybeSpawnHeadUpdate() {
|
|
|
4551
4562
|
const tsPath = headTsPath(gateKey);
|
|
4552
4563
|
if (!headGateDue(tsPath)) return;
|
|
4553
4564
|
markHeadRun(tsPath);
|
|
4554
|
-
(0,
|
|
4565
|
+
(0, import_node_child_process5.spawn)(process.execPath, [process.argv[1], "saga", "head-update", "--run"], {
|
|
4555
4566
|
detached: true,
|
|
4556
4567
|
stdio: "ignore",
|
|
4557
4568
|
windowsHide: true
|
|
@@ -4617,7 +4628,12 @@ async function runSagaShow(opts, io = consoleIo) {
|
|
|
4617
4628
|
const qs = opts.latestAnywhere ? "scope=anywhere" : new URLSearchParams({ project: key.project, branch: key.branch }).toString();
|
|
4618
4629
|
const res = await fetchWithRetry(fetch, `${cfg.sagaApiUrl}/saga/head?${qs}`, { headers: await hubHeaders() }, { attempts: 2, timeoutMs: 3e3 });
|
|
4619
4630
|
if (res.ok) {
|
|
4620
|
-
|
|
4631
|
+
const text = await res.text();
|
|
4632
|
+
const slug = parseNorthStarSlugFromHead(text);
|
|
4633
|
+
const compass = slug ? `COMPASS: northstar:${slug}` : null;
|
|
4634
|
+
return io.log(compass && !text.includes("COMPASS:") ? `${compass}
|
|
4635
|
+
|
|
4636
|
+
${text}` : text);
|
|
4621
4637
|
}
|
|
4622
4638
|
if (!opts.quiet) io.log(`saga show failed: HTTP ${res.status}`);
|
|
4623
4639
|
} catch (e) {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mutmutco/cli",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.47.0",
|
|
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",
|