@mutmutco/cli 4.2.1 → 4.2.2
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/dist/main.cjs +73 -18
- package/package.json +1 -1
package/dist/main.cjs
CHANGED
|
@@ -4522,10 +4522,29 @@ function targetFlagValueFromArgv(flag, argv) {
|
|
|
4522
4522
|
if (!next || next.startsWith("-")) return void 0;
|
|
4523
4523
|
return next;
|
|
4524
4524
|
}
|
|
4525
|
+
function survivingFlagArgs(argv, rejectedFlag, ownFlags) {
|
|
4526
|
+
const out = [];
|
|
4527
|
+
for (let i = 0; i < argv.length; i += 1) {
|
|
4528
|
+
const token = argv[i];
|
|
4529
|
+
if (!token.startsWith("--")) continue;
|
|
4530
|
+
const [name, inlineValue] = token.includes("=") ? [token.slice(0, token.indexOf("=")), token.slice(token.indexOf("=") + 1)] : [token, void 0];
|
|
4531
|
+
const values = [];
|
|
4532
|
+
if (inlineValue === void 0) {
|
|
4533
|
+
while (argv[i + 1] !== void 0 && !argv[i + 1].startsWith("-")) {
|
|
4534
|
+
values.push(argv[i + 1]);
|
|
4535
|
+
i += 1;
|
|
4536
|
+
}
|
|
4537
|
+
}
|
|
4538
|
+
if (name === rejectedFlag || !ownFlags.includes(name)) continue;
|
|
4539
|
+
out.push(inlineValue !== void 0 ? token : name, ...values);
|
|
4540
|
+
}
|
|
4541
|
+
return out;
|
|
4542
|
+
}
|
|
4525
4543
|
function formatPositionalTarget(commandPath3, argName, opts = {}) {
|
|
4526
4544
|
const concrete = opts.flag && opts.argv ? targetFlagValueFromArgv(opts.flag, opts.argv) : void 0;
|
|
4527
|
-
|
|
4528
|
-
|
|
4545
|
+
const target = concrete ?? `<${argName}>`;
|
|
4546
|
+
const kept = opts.flag && opts.argv && opts.ownFlags ? survivingFlagArgs(opts.argv, opts.flag, opts.ownFlags) : [];
|
|
4547
|
+
return [`mmi-cli ${commandPath3}`, target, ...kept].join(" ");
|
|
4529
4548
|
}
|
|
4530
4549
|
var FLAG_SYNONYMS = /* @__PURE__ */ new Map([["--outcome", "--reason"]]);
|
|
4531
4550
|
function synonymFlagFor(flag, ownFlags) {
|
|
@@ -4545,6 +4564,27 @@ var GUIDES = /* @__PURE__ */ new Map([
|
|
|
4545
4564
|
expected: ["learning report", "oracle issue create", "oracle issue list"],
|
|
4546
4565
|
did_you_mean: "learning report"
|
|
4547
4566
|
}
|
|
4567
|
+
],
|
|
4568
|
+
// #5821: `list` is the verb `oracle issue list` and `devops pr list` teach, so callers reach for
|
|
4569
|
+
// `oracle board list` next. Distance ranks the OTHER houses' `list` leaves above the board's own
|
|
4570
|
+
// reader, so the receipt pointed at `devops pr list` — a different house, for a board query.
|
|
4571
|
+
[
|
|
4572
|
+
"oracle board:list",
|
|
4573
|
+
{
|
|
4574
|
+
hint: "no `oracle board list` \u2014 the bounded board query is `oracle board read` (add `--json` for the machine-readable partition)",
|
|
4575
|
+
expected: ["oracle board read"],
|
|
4576
|
+
did_you_mean: "oracle board read"
|
|
4577
|
+
}
|
|
4578
|
+
],
|
|
4579
|
+
// #5823: `label` names a capability, not a command. The mutation door is `oracle issue edit`
|
|
4580
|
+
// (`--add-label` / `--remove-label`); distance cannot bridge noun→verb, so name it here.
|
|
4581
|
+
[
|
|
4582
|
+
"oracle issue:label",
|
|
4583
|
+
{
|
|
4584
|
+
hint: "no `oracle issue label` \u2014 labels are edited through `oracle issue edit --add-label <name>` / `--remove-label <name>`",
|
|
4585
|
+
expected: ["oracle issue edit"],
|
|
4586
|
+
did_you_mean: "oracle issue edit"
|
|
4587
|
+
}
|
|
4548
4588
|
]
|
|
4549
4589
|
]);
|
|
4550
4590
|
function unknownCommandDomainGuide(parentPath, token) {
|
|
@@ -11762,10 +11802,10 @@ var rollout_plan_default = {
|
|
|
11762
11802
|
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)."
|
|
11763
11803
|
},
|
|
11764
11804
|
baseline: {
|
|
11765
|
-
version: "4.2.
|
|
11766
|
-
tag: "v4.2.
|
|
11767
|
-
commit: "
|
|
11768
|
-
npm: "@mutmutco/cli@4.2.
|
|
11805
|
+
version: "4.2.2",
|
|
11806
|
+
tag: "v4.2.2",
|
|
11807
|
+
commit: "c347a86b94cc",
|
|
11808
|
+
npm: "@mutmutco/cli@4.2.2"
|
|
11769
11809
|
},
|
|
11770
11810
|
exitCriterion: "fleet-n-of-n",
|
|
11771
11811
|
hubOnlyShortcut: "forbidden",
|
|
@@ -11782,14 +11822,14 @@ var rollout_plan_default = {
|
|
|
11782
11822
|
repo: "mutmutco/mmi-hub",
|
|
11783
11823
|
role: "canary",
|
|
11784
11824
|
schedule: "train",
|
|
11785
|
-
v3Target: "v4.2.
|
|
11825
|
+
v3Target: "v4.2.2"
|
|
11786
11826
|
}
|
|
11787
11827
|
],
|
|
11788
11828
|
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.",
|
|
11789
11829
|
rollback: {
|
|
11790
11830
|
independent: true,
|
|
11791
|
-
mechanism: "npm dist-tag latest -> 4.2.
|
|
11792
|
-
v3Target: "v4.2.
|
|
11831
|
+
mechanism: "npm dist-tag latest -> 4.2.2 and redeploy the Hub Lambda from tag v4.2.2 (c347a86b94cc); installed clients repair via `mmi-cli doctor`. No other cohort is touched.",
|
|
11832
|
+
v3Target: "v4.2.2 (@mutmutco/cli@4.2.2, tag commit c347a86b94cc \u2014 last known-good release carrying the repo-index v4-only contract)"
|
|
11793
11833
|
}
|
|
11794
11834
|
},
|
|
11795
11835
|
{
|
|
@@ -23508,8 +23548,11 @@ var defaultDeps = {
|
|
|
23508
23548
|
},
|
|
23509
23549
|
// Re-exec the SAME command line in the fresh CLI with inherited stdio (spawn, not execFile, so
|
|
23510
23550
|
// output streams live) and hand its exit code back — the stale parent exits with it (#5762).
|
|
23511
|
-
|
|
23512
|
-
|
|
23551
|
+
// #5813: the caller supplies that command line. `process.argv` is NOT it — the house shim splices
|
|
23552
|
+
// the house root out in place, so re-reading it here re-ran the removed flat alias (`release …`
|
|
23553
|
+
// instead of `devops release …`) and the converged child refused with exit 2.
|
|
23554
|
+
reexec: (argv) => new Promise((resolve6) => {
|
|
23555
|
+
const args = [...argv];
|
|
23513
23556
|
const child2 = isWin2 ? (0, import_node_child_process10.spawn)("cmd.exe", ["/c", "mmi-cli", ...args], { stdio: "inherit", windowsHide: true }) : (0, import_node_child_process10.spawn)("mmi-cli", args, { stdio: "inherit", windowsHide: true });
|
|
23514
23557
|
child2.on("exit", (code) => resolve6(code ?? 1));
|
|
23515
23558
|
child2.on("error", () => resolve6(1));
|
|
@@ -23531,7 +23574,7 @@ async function selfConvergeTrainCli(input) {
|
|
|
23531
23574
|
error: `self-converge did not take effect: mmi-cli on PATH still resolves to ${installed ?? "unknown"}, expected >= ${input.releasedVersion}`
|
|
23532
23575
|
};
|
|
23533
23576
|
}
|
|
23534
|
-
const reexecCode = await deps.reexec();
|
|
23577
|
+
const reexecCode = await deps.reexec(input.argv);
|
|
23535
23578
|
return { kind: "converged", reexecCode };
|
|
23536
23579
|
} catch (e) {
|
|
23537
23580
|
return { kind: "failed", error: e instanceof Error ? e.message : String(e) };
|
|
@@ -33907,12 +33950,18 @@ function catalogCommandPaths(manifest) {
|
|
|
33907
33950
|
function nearestExplainTargets(query, paths, limit = 5) {
|
|
33908
33951
|
const parentPath = query.includes(" ") ? query.slice(0, query.lastIndexOf(" ")) : void 0;
|
|
33909
33952
|
const leaf = query.includes(" ") ? query.slice(query.lastIndexOf(" ") + 1) : query;
|
|
33910
|
-
const guide = unknownCommandDomainGuide(parentPath, leaf);
|
|
33911
|
-
if (guide) return guide.expected.slice(0, limit);
|
|
33912
33953
|
const all = [...paths];
|
|
33913
33954
|
const leafOf = (p) => p.slice(p.lastIndexOf(" ") + 1);
|
|
33955
|
+
const siblings = parentPath ? all.filter((p) => p !== query && p.startsWith(`${parentPath} `) && !p.slice(parentPath.length + 1).includes(" ")).sort() : [];
|
|
33956
|
+
const withSiblings = (primary) => {
|
|
33957
|
+
const out2 = [...primary];
|
|
33958
|
+
for (const sibling of siblings) if (!out2.includes(sibling)) out2.push(sibling);
|
|
33959
|
+
return out2.slice(0, limit);
|
|
33960
|
+
};
|
|
33961
|
+
const guide = unknownCommandDomainGuide(parentPath, leaf);
|
|
33962
|
+
if (guide) return withSiblings(guide.expected);
|
|
33914
33963
|
const exactLeaf = all.filter((p) => p !== query && leafOf(p) === leaf).sort();
|
|
33915
|
-
if (exactLeaf.length) return exactLeaf
|
|
33964
|
+
if (exactLeaf.length) return withSiblings(exactLeaf);
|
|
33916
33965
|
const out = [];
|
|
33917
33966
|
const nearPath = didYouMean(query, all);
|
|
33918
33967
|
if (nearPath) out.push(nearPath);
|
|
@@ -33923,7 +33972,7 @@ function nearestExplainTargets(query, paths, limit = 5) {
|
|
|
33923
33972
|
if (out.length >= limit) break;
|
|
33924
33973
|
}
|
|
33925
33974
|
}
|
|
33926
|
-
return out
|
|
33975
|
+
return withSiblings(out);
|
|
33927
33976
|
}
|
|
33928
33977
|
function explainCommandManifest(manifest, command, opts = {}) {
|
|
33929
33978
|
const base = {
|
|
@@ -38280,7 +38329,9 @@ async function requireFreshTrainCli(commandName) {
|
|
|
38280
38329
|
const converge = await selfConvergeTrainCli({
|
|
38281
38330
|
currentVersion: resolveClientVersion(),
|
|
38282
38331
|
releasedVersion: report.releasedVersion,
|
|
38283
|
-
commandName
|
|
38332
|
+
commandName,
|
|
38333
|
+
// The typed, house-prefixed argv — never the spliced process.argv (#5813).
|
|
38334
|
+
argv: INVOKED_ARGV
|
|
38284
38335
|
});
|
|
38285
38336
|
if (converge.kind === "failed") {
|
|
38286
38337
|
throw new Error(`${commandName}: ${converge.error}. ${staleTrainCliMessage(report, commandName)}`);
|
|
@@ -38375,7 +38426,10 @@ function positionalTargetForm(cmd, opts = {}) {
|
|
|
38375
38426
|
const args = cmd.registeredArguments ?? [];
|
|
38376
38427
|
const first = args[0];
|
|
38377
38428
|
if (!first) return void 0;
|
|
38378
|
-
return formatPositionalTarget(canonicalPathFor(commandPath2(cmd)) ?? commandPath2(cmd), first.name(),
|
|
38429
|
+
return formatPositionalTarget(canonicalPathFor(commandPath2(cmd)) ?? commandPath2(cmd), first.name(), {
|
|
38430
|
+
...opts,
|
|
38431
|
+
ownFlags: commandOwnLongFlags(cmd)
|
|
38432
|
+
});
|
|
38379
38433
|
}
|
|
38380
38434
|
function unknownCommandCandidates(parent, allPaths) {
|
|
38381
38435
|
if (!parent) return [...allPaths];
|
|
@@ -38470,6 +38524,7 @@ function envelopeAwareWriteErr(str) {
|
|
|
38470
38524
|
if (unknownFlagJsonHandled && argvWantsJson2()) return;
|
|
38471
38525
|
process.stderr.write(str);
|
|
38472
38526
|
}
|
|
38527
|
+
var INVOKED_ARGV = process.argv.slice(2);
|
|
38473
38528
|
var program2 = new Command();
|
|
38474
38529
|
program2.name("mmi-cli").description("MMI Future Hub CLI \u2014 the org control plane for agentic coding.").version(resolveClientVersion()).configureOutput({ writeErr: envelopeAwareWriteErr }).showHelpAfterError(PARSE_HINT_SENTINEL);
|
|
38475
38530
|
program2.addHelpText(
|
package/package.json
CHANGED