@mutmutco/codex-plugin 4.6.39 → 4.6.40
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/.codex-plugin/plugin.json +1 -1
- package/cli/dist/main.cjs +267 -41
- package/cli/package.json +1 -1
- package/package.json +1 -1
package/cli/dist/main.cjs
CHANGED
|
@@ -19611,6 +19611,48 @@ function isValidSecretKey(key) {
|
|
|
19611
19611
|
function stripTrailingCRLF(value) {
|
|
19612
19612
|
return value.replace(/\r\n$|\r$|\n$/, "");
|
|
19613
19613
|
}
|
|
19614
|
+
function countCaptureGroups(source) {
|
|
19615
|
+
let count = 0;
|
|
19616
|
+
let inClass = false;
|
|
19617
|
+
for (let i = 0; i < source.length; i += 1) {
|
|
19618
|
+
const ch = source[i];
|
|
19619
|
+
if (ch === "\\") {
|
|
19620
|
+
i += 1;
|
|
19621
|
+
continue;
|
|
19622
|
+
}
|
|
19623
|
+
if (inClass) {
|
|
19624
|
+
if (ch === "]") inClass = false;
|
|
19625
|
+
continue;
|
|
19626
|
+
}
|
|
19627
|
+
if (ch === "[") {
|
|
19628
|
+
inClass = true;
|
|
19629
|
+
continue;
|
|
19630
|
+
}
|
|
19631
|
+
if (ch !== "(") continue;
|
|
19632
|
+
if (source[i + 1] !== "?") {
|
|
19633
|
+
count += 1;
|
|
19634
|
+
continue;
|
|
19635
|
+
}
|
|
19636
|
+
if (source[i + 2] === "<" && source[i + 3] !== "=" && source[i + 3] !== "!") count += 1;
|
|
19637
|
+
}
|
|
19638
|
+
return count;
|
|
19639
|
+
}
|
|
19640
|
+
function compileExtractRegex(source) {
|
|
19641
|
+
let re;
|
|
19642
|
+
try {
|
|
19643
|
+
re = new RegExp(source);
|
|
19644
|
+
} catch {
|
|
19645
|
+
return { ok: false, reason: "syntax" };
|
|
19646
|
+
}
|
|
19647
|
+
if (countCaptureGroups(source) !== 1) return { ok: false, reason: "capture-groups" };
|
|
19648
|
+
return { ok: true, re };
|
|
19649
|
+
}
|
|
19650
|
+
function extractSingleMatch(text, re) {
|
|
19651
|
+
const flags = re.flags.includes("g") ? re.flags : `${re.flags}g`;
|
|
19652
|
+
const all = [...text.matchAll(new RegExp(re.source, flags))];
|
|
19653
|
+
if (all.length !== 1) return { ok: false, count: all.length };
|
|
19654
|
+
return { ok: true, value: all[0][1] ?? "" };
|
|
19655
|
+
}
|
|
19614
19656
|
var ORG_WIDE_SLUGS = /* @__PURE__ */ new Set([ORG_INFRA_SLUG, "shared", "cloudflare", "docs", "mmi-hub"]);
|
|
19615
19657
|
function classifyTier(slug, _key) {
|
|
19616
19658
|
return ORG_WIDE_SLUGS.has(slug) ? "org" : "project";
|
|
@@ -21231,6 +21273,64 @@ async function secretsSet(deps, key, opts) {
|
|
|
21231
21273
|
}
|
|
21232
21274
|
return putSecret(deps, key, value, opts);
|
|
21233
21275
|
}
|
|
21276
|
+
async function secretsSetFromClipboard(deps, key, opts) {
|
|
21277
|
+
let value;
|
|
21278
|
+
try {
|
|
21279
|
+
if (!isValidSecretKey(key)) {
|
|
21280
|
+
deps.err(`invalid secret key ${JSON.stringify(key)}`);
|
|
21281
|
+
return false;
|
|
21282
|
+
}
|
|
21283
|
+
let re;
|
|
21284
|
+
if (opts.extract !== void 0) {
|
|
21285
|
+
const compiled = compileExtractRegex(opts.extract);
|
|
21286
|
+
if (!compiled.ok) {
|
|
21287
|
+
deps.err(
|
|
21288
|
+
compiled.reason === "syntax" ? "secrets set: --extract is not a valid regular expression \u2014 aborted (nothing written)" : "secrets set: --extract must contain exactly one capture group, e.g. '--token\\s+(\\S+)' \u2014 aborted (nothing written)"
|
|
21289
|
+
);
|
|
21290
|
+
return false;
|
|
21291
|
+
}
|
|
21292
|
+
re = compiled.re;
|
|
21293
|
+
}
|
|
21294
|
+
if (!deps.readClipboard) {
|
|
21295
|
+
deps.err("secrets set: --from-clipboard is not available in this build \u2014 aborted (nothing written)");
|
|
21296
|
+
return false;
|
|
21297
|
+
}
|
|
21298
|
+
let text;
|
|
21299
|
+
try {
|
|
21300
|
+
text = await deps.readClipboard();
|
|
21301
|
+
} catch (e) {
|
|
21302
|
+
deps.err(`secrets set: --from-clipboard: ${e.message}`);
|
|
21303
|
+
return false;
|
|
21304
|
+
}
|
|
21305
|
+
if (re) {
|
|
21306
|
+
const matched = extractSingleMatch(text, re);
|
|
21307
|
+
if (!matched.ok) {
|
|
21308
|
+
deps.err(
|
|
21309
|
+
matched.count === 0 ? "secrets set: --from-clipboard: --extract found no match (0 matches) \u2014 aborted (nothing written)" : `secrets set: --from-clipboard: --extract matched ${matched.count} times \u2014 need exactly one; aborted (nothing written)`
|
|
21310
|
+
);
|
|
21311
|
+
return false;
|
|
21312
|
+
}
|
|
21313
|
+
value = stripTrailingCRLF(matched.value);
|
|
21314
|
+
} else {
|
|
21315
|
+
value = stripTrailingCRLF(text);
|
|
21316
|
+
}
|
|
21317
|
+
if (!value) {
|
|
21318
|
+
deps.err(`secrets set: --from-clipboard: empty value for ${key} \u2014 aborted (nothing written)`);
|
|
21319
|
+
return false;
|
|
21320
|
+
}
|
|
21321
|
+
const ok = await putSecret(deps, key, value, opts);
|
|
21322
|
+
if (ok) deps.log(`set ${key} (${value.length} chars)`);
|
|
21323
|
+
return ok;
|
|
21324
|
+
} finally {
|
|
21325
|
+
if (deps.writeClipboard) {
|
|
21326
|
+
try {
|
|
21327
|
+
await deps.writeClipboard("");
|
|
21328
|
+
} catch (e) {
|
|
21329
|
+
deps.err(`secrets set: warning: could not clear the clipboard \u2014 ${e.message}`);
|
|
21330
|
+
}
|
|
21331
|
+
}
|
|
21332
|
+
}
|
|
21333
|
+
}
|
|
21234
21334
|
var DECLARE_KEY_RE = /^[A-Za-z][A-Za-z0-9_]*$/;
|
|
21235
21335
|
var DECLARE_STAGES = /* @__PURE__ */ new Set(["dev", "rc", "main"]);
|
|
21236
21336
|
var DECLARE_CONSUMERS = /* @__PURE__ */ new Set(["runtime", "build", "lambda", "actions", "agent", "box"]);
|
|
@@ -28405,10 +28505,10 @@ var rollout_plan_default = {
|
|
|
28405
28505
|
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)."
|
|
28406
28506
|
},
|
|
28407
28507
|
baseline: {
|
|
28408
|
-
version: "4.6.
|
|
28409
|
-
tag: "v4.6.
|
|
28410
|
-
commit: "
|
|
28411
|
-
npm: "@mutmutco/cli@4.6.
|
|
28508
|
+
version: "4.6.40",
|
|
28509
|
+
tag: "v4.6.40",
|
|
28510
|
+
commit: "0c850872865f",
|
|
28511
|
+
npm: "@mutmutco/cli@4.6.40"
|
|
28412
28512
|
},
|
|
28413
28513
|
exitCriterion: "fleet-n-of-n",
|
|
28414
28514
|
hubOnlyShortcut: "forbidden",
|
|
@@ -28425,14 +28525,14 @@ var rollout_plan_default = {
|
|
|
28425
28525
|
repo: "mutmutco/mmi-hub",
|
|
28426
28526
|
role: "canary",
|
|
28427
28527
|
schedule: "train",
|
|
28428
|
-
v3Target: "v4.6.
|
|
28528
|
+
v3Target: "v4.6.40"
|
|
28429
28529
|
}
|
|
28430
28530
|
],
|
|
28431
28531
|
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.",
|
|
28432
28532
|
rollback: {
|
|
28433
28533
|
independent: true,
|
|
28434
|
-
mechanism: "npm dist-tag latest -> 4.6.
|
|
28435
|
-
v3Target: "v4.6.
|
|
28534
|
+
mechanism: "npm dist-tag latest -> 4.6.40 and redeploy the Hub Lambda from tag v4.6.40 (0c850872865f); installed clients repair via `mmi-cli doctor`. No other cohort is touched.",
|
|
28535
|
+
v3Target: "v4.6.40 (@mutmutco/cli@4.6.40, tag commit 0c850872865f \u2014 last known-good release carrying the repo-index v4-only contract)"
|
|
28436
28536
|
}
|
|
28437
28537
|
},
|
|
28438
28538
|
{
|
|
@@ -47190,7 +47290,7 @@ async function assignPersistedPortRange(repo, slug, reg, opts) {
|
|
|
47190
47290
|
|
|
47191
47291
|
// src/box-commands.ts
|
|
47192
47292
|
var import_node_fs39 = require("node:fs");
|
|
47193
|
-
var
|
|
47293
|
+
var import_node_child_process13 = require("node:child_process");
|
|
47194
47294
|
var import_node_os20 = require("node:os");
|
|
47195
47295
|
var import_node_path36 = require("node:path");
|
|
47196
47296
|
|
|
@@ -47418,6 +47518,7 @@ init_cli_shared();
|
|
|
47418
47518
|
|
|
47419
47519
|
// src/secrets-commands.ts
|
|
47420
47520
|
var import_node_fs37 = require("node:fs");
|
|
47521
|
+
var import_node_child_process12 = require("node:child_process");
|
|
47421
47522
|
var import_node_path34 = require("node:path");
|
|
47422
47523
|
var import_node_os19 = require("node:os");
|
|
47423
47524
|
init_cli_shared();
|
|
@@ -48684,9 +48785,122 @@ function makeSecretsDeps(cfg) {
|
|
|
48684
48785
|
slug: async () => (await repoProject(cfg)).toLowerCase(),
|
|
48685
48786
|
readSecretValue: () => readSecretStdin(),
|
|
48686
48787
|
log: (m) => console.log(m),
|
|
48687
|
-
err: (m) => console.error(m)
|
|
48788
|
+
err: (m) => console.error(m),
|
|
48789
|
+
// #10056: the sanctioned clipboard handoff — read/write the OS clipboard directly, never through a
|
|
48790
|
+
// shell, so a pasted value cannot be re-parsed by cmd.exe/PowerShell.
|
|
48791
|
+
readClipboard: () => readClipboardText(),
|
|
48792
|
+
writeClipboard: (value) => clearClipboard(value)
|
|
48688
48793
|
};
|
|
48689
48794
|
}
|
|
48795
|
+
var CLIPBOARD_TIMEOUT_MS = 1e4;
|
|
48796
|
+
function clipboardReadCommands(platform2) {
|
|
48797
|
+
if (platform2 === "win32") return [{ cmd: "powershell", args: ["-NoProfile", "-Command", "Get-Clipboard -Raw"] }];
|
|
48798
|
+
if (platform2 === "darwin") return [{ cmd: "pbpaste", args: [] }];
|
|
48799
|
+
return [
|
|
48800
|
+
{ cmd: "wl-paste", args: ["-n"] },
|
|
48801
|
+
{ cmd: "xclip", args: ["-selection", "clipboard", "-o"] }
|
|
48802
|
+
];
|
|
48803
|
+
}
|
|
48804
|
+
function clipboardClearCommands(platform2) {
|
|
48805
|
+
if (platform2 === "win32") return [{ cmd: "powershell", args: ["-NoProfile", "-Command", "Set-Clipboard -Value ' '"] }];
|
|
48806
|
+
if (platform2 === "darwin") return [{ cmd: "pbcopy", args: [], input: "" }];
|
|
48807
|
+
return [
|
|
48808
|
+
{ cmd: "wl-copy", args: ["--clear"] },
|
|
48809
|
+
{ cmd: "xclip", args: ["-selection", "clipboard"], input: "" }
|
|
48810
|
+
];
|
|
48811
|
+
}
|
|
48812
|
+
function clipboardFailure(command, error) {
|
|
48813
|
+
const code = error.code;
|
|
48814
|
+
if (code === "ENOENT") return `${command.cmd}: not found`;
|
|
48815
|
+
if (typeof code === "number") return `${command.cmd}: exit ${code}`;
|
|
48816
|
+
return `${command.cmd}: could not run`;
|
|
48817
|
+
}
|
|
48818
|
+
function runClipboardCommand(command) {
|
|
48819
|
+
return new Promise((resolveRun, rejectRun) => {
|
|
48820
|
+
const child2 = (0, import_node_child_process12.spawn)(command.cmd, command.args, {
|
|
48821
|
+
shell: false,
|
|
48822
|
+
windowsHide: true,
|
|
48823
|
+
stdio: ["pipe", "pipe", "pipe"]
|
|
48824
|
+
});
|
|
48825
|
+
const out = [];
|
|
48826
|
+
let settled2 = false;
|
|
48827
|
+
const settle = (error, value) => {
|
|
48828
|
+
if (settled2) return;
|
|
48829
|
+
settled2 = true;
|
|
48830
|
+
clearTimeout(timer);
|
|
48831
|
+
if (error) rejectRun(error);
|
|
48832
|
+
else resolveRun(value ?? "");
|
|
48833
|
+
};
|
|
48834
|
+
const timer = setTimeout(() => {
|
|
48835
|
+
child2.kill();
|
|
48836
|
+
settle(new Error(`${command.cmd}: timed out`));
|
|
48837
|
+
}, CLIPBOARD_TIMEOUT_MS);
|
|
48838
|
+
timer.unref?.();
|
|
48839
|
+
child2.stdout?.on("data", (chunk) => out.push(chunk));
|
|
48840
|
+
child2.stderr?.on("data", () => {
|
|
48841
|
+
});
|
|
48842
|
+
child2.on("error", (e) => settle(e instanceof Error ? e : new Error(String(e))));
|
|
48843
|
+
child2.on("close", (code) => {
|
|
48844
|
+
if (code === 0) settle(void 0, Buffer.concat(out).toString("utf8"));
|
|
48845
|
+
else settle(Object.assign(new Error(`${command.cmd}: exit ${code}`), { code }));
|
|
48846
|
+
});
|
|
48847
|
+
child2.stdin?.on("error", () => {
|
|
48848
|
+
});
|
|
48849
|
+
child2.stdin?.end(command.input ?? "");
|
|
48850
|
+
});
|
|
48851
|
+
}
|
|
48852
|
+
async function readClipboardText(platform2 = process.platform) {
|
|
48853
|
+
const failures = [];
|
|
48854
|
+
for (const command of clipboardReadCommands(platform2)) {
|
|
48855
|
+
try {
|
|
48856
|
+
return await runClipboardCommand(command);
|
|
48857
|
+
} catch (e) {
|
|
48858
|
+
failures.push(clipboardFailure(command, e));
|
|
48859
|
+
}
|
|
48860
|
+
}
|
|
48861
|
+
throw new Error(`could not read the clipboard (${failures.join(", ")})`);
|
|
48862
|
+
}
|
|
48863
|
+
async function clearClipboard(value, platform2 = process.platform) {
|
|
48864
|
+
const failures = [];
|
|
48865
|
+
for (const command of clipboardClearCommands(platform2)) {
|
|
48866
|
+
try {
|
|
48867
|
+
await runClipboardCommand({ ...command, ...command.input !== void 0 ? { input: value } : {} });
|
|
48868
|
+
return;
|
|
48869
|
+
} catch (e) {
|
|
48870
|
+
failures.push(clipboardFailure(command, e));
|
|
48871
|
+
}
|
|
48872
|
+
}
|
|
48873
|
+
throw new Error(`${failures.join(", ")}`);
|
|
48874
|
+
}
|
|
48875
|
+
function clipboardSourceRefusal(fromClipboard, stdinHasData) {
|
|
48876
|
+
if (!fromClipboard || !stdinHasData) return null;
|
|
48877
|
+
return "secrets set: --from-clipboard conflicts with piped stdin \u2014 remove the pipe (the value comes from the clipboard), or drop --from-clipboard and pipe it";
|
|
48878
|
+
}
|
|
48879
|
+
async function stdinCarriesData(timeoutMs = 50) {
|
|
48880
|
+
const stdin = process.stdin;
|
|
48881
|
+
if (stdin.isTTY) return false;
|
|
48882
|
+
if (stdin.readableLength > 0) return true;
|
|
48883
|
+
return new Promise((resolveProbe) => {
|
|
48884
|
+
let settled2 = false;
|
|
48885
|
+
const finish = (value) => {
|
|
48886
|
+
if (settled2) return;
|
|
48887
|
+
settled2 = true;
|
|
48888
|
+
clearTimeout(timer);
|
|
48889
|
+
stdin.off("readable", onReadable);
|
|
48890
|
+
stdin.off("end", onEnd);
|
|
48891
|
+
resolveProbe(value);
|
|
48892
|
+
};
|
|
48893
|
+
const onReadable = () => {
|
|
48894
|
+
if (stdin.readableLength > 0) finish(true);
|
|
48895
|
+
};
|
|
48896
|
+
const onEnd = () => finish(false);
|
|
48897
|
+
const timer = setTimeout(() => finish(stdin.readableLength > 0), timeoutMs);
|
|
48898
|
+
timer.unref?.();
|
|
48899
|
+
stdin.once("readable", onReadable);
|
|
48900
|
+
stdin.once("end", onEnd);
|
|
48901
|
+
stdin.once("error", () => finish(false));
|
|
48902
|
+
});
|
|
48903
|
+
}
|
|
48690
48904
|
async function withSecrets(run) {
|
|
48691
48905
|
const cfg = await loadConfig();
|
|
48692
48906
|
if (!cfg.sagaApiUrl) {
|
|
@@ -48833,10 +49047,22 @@ function registerSecretsCommands(program3) {
|
|
|
48833
49047
|
if (!ok) process.exitCode = 1;
|
|
48834
49048
|
}));
|
|
48835
49049
|
const setHandler = (key, o) => withSecrets(async (d) => {
|
|
49050
|
+
if (o.fromClipboard) {
|
|
49051
|
+
const refusal = clipboardSourceRefusal(true, await stdinCarriesData());
|
|
49052
|
+
if (refusal) return fail(refusal);
|
|
49053
|
+
const ok2 = await secretsSetFromClipboard(d, key, {
|
|
49054
|
+
...o.repo !== void 0 ? { repo: o.repo } : {},
|
|
49055
|
+
...o.slug !== void 0 ? { slug: o.slug } : {},
|
|
49056
|
+
...o.extract !== void 0 ? { extract: o.extract } : {}
|
|
49057
|
+
});
|
|
49058
|
+
if (!ok2) process.exitCode = 1;
|
|
49059
|
+
return;
|
|
49060
|
+
}
|
|
49061
|
+
if (o.extract !== void 0) return fail("secrets set: --extract needs --from-clipboard (it isolates the value inside copied text)");
|
|
48836
49062
|
const ok = await secretsSet(d, key, o);
|
|
48837
49063
|
if (!ok) process.exitCode = 1;
|
|
48838
49064
|
});
|
|
48839
|
-
secrets.command("set <key>").description("write/rotate a secret; value from stdin (never an argument). DECLARE-FIRST (#2528): the key must be a declared catalog coordinate \u2014 bare <KEY> = the stageless canonical, <stage>/<KEY> = a declared per-stage override; undeclared writes are rejected with the fix. --slug _org writes an org-infra <provider>/<KEY> coordinate (#3298) \u2014 master or an exact grant, declare-first enforced server-side").option("--repo <owner/repo>", "target repo (defaults to the current repo)").option("--slug <slug>", "org-infra namespace (e.g. _org) for the value write \u2014 master or an exact grant (#3298)").action(setHandler);
|
|
49065
|
+
secrets.command("set <key>").description("write/rotate a secret; value from stdin (never an argument). DECLARE-FIRST (#2528): the key must be a declared catalog coordinate \u2014 bare <KEY> = the stageless canonical, <stage>/<KEY> = a declared per-stage override; undeclared writes are rejected with the fix. --slug _org writes an org-infra <provider>/<KEY> coordinate (#3298) \u2014 master or an exact grant, declare-first enforced server-side. --from-clipboard takes the value from the OS clipboard instead of stdin, extracts it with --extract, and CLEARS the clipboard afterwards \u2014 the sanctioned handoff for a secret embedded in copied text (#10056)").option("--repo <owner/repo>", "target repo (defaults to the current repo)").option("--slug <slug>", "org-infra namespace (e.g. _org) for the value write \u2014 master or an exact grant (#3298)").option("--from-clipboard", "read the value from the OS clipboard instead of stdin: powershell Get-Clipboard / pbpaste / wl-paste (xclip fallback). The clipboard is overwritten on EVERY path (success, no match, failed write). Conflicts with piped stdin").option("--extract <regex>", "with --from-clipboard: a regex with EXACTLY ONE capture group whose single match inside the copied text is the value, e.g. --extract '--token\\s+(\\S+)'. Zero or 2+ matches are refused (the count is reported, the text never is). Without --extract the whole clipboard, minus one trailing newline, is the value").action(setHandler);
|
|
48840
49066
|
secrets.command("copy").description("copy provider keys between stages in your own project vault (audit-logged; encryption keys blocked)").requiredOption("--from <stage>", "source tier: dev, rc, or main").requiredOption("--to <stage>", "destination tier: dev, rc, or main").requiredOption("--keys <names>", "comma-separated secret names (encryption keys blocked)").option("--dry-run", "report copies without writing").option("--repo <owner/repo>", "target repo (defaults to the current repo)").action((o) => withSecrets(async (d) => {
|
|
48841
49067
|
const stages = ["dev", "rc", "main"];
|
|
48842
49068
|
if (!stages.includes(o.from) || !stages.includes(o.to)) {
|
|
@@ -49662,7 +49888,7 @@ var UsageError = class extends Error {
|
|
|
49662
49888
|
var UnreadableError = class extends Error {
|
|
49663
49889
|
};
|
|
49664
49890
|
function hubGitShow(ref) {
|
|
49665
|
-
const git3 = (args) => (0,
|
|
49891
|
+
const git3 = (args) => (0, import_node_child_process13.execFileSync)("git", args, { maxBuffer: 64 * 1024 * 1024, stdio: ["ignore", "pipe", "pipe"], windowsHide: true });
|
|
49666
49892
|
try {
|
|
49667
49893
|
git3(["cat-file", "-e", `HEAD:${MANIFEST_PATH}`]);
|
|
49668
49894
|
} catch {
|
|
@@ -49676,7 +49902,7 @@ function runOnBox(found, script) {
|
|
|
49676
49902
|
try {
|
|
49677
49903
|
const recipe = (0, import_node_path36.join)(dir, "recipe.sh");
|
|
49678
49904
|
(0, import_node_fs39.writeFileSync)(recipe, sshRecipeScript(found, "sh -s"), "utf8");
|
|
49679
|
-
const r = (0,
|
|
49905
|
+
const r = (0, import_node_child_process13.spawnSync)("bash", [recipe], { input: script, encoding: "utf8", maxBuffer: 16 * 1024 * 1024, timeout: 18e4, windowsHide: true });
|
|
49680
49906
|
if (r.status !== 0) {
|
|
49681
49907
|
throw new UnreadableError(`box control: the ssh session to ${found.name} failed (exit ${r.status ?? r.signal}): ${(r.stderr || "").trim().split("\n").slice(-3).join(" | ")}`);
|
|
49682
49908
|
}
|
|
@@ -54433,7 +54659,7 @@ async function runRcDataSwitch(deps, opts) {
|
|
|
54433
54659
|
}
|
|
54434
54660
|
|
|
54435
54661
|
// src/suite-train-io.ts
|
|
54436
|
-
var
|
|
54662
|
+
var import_node_child_process20 = require("node:child_process");
|
|
54437
54663
|
var import_node_path52 = require("node:path");
|
|
54438
54664
|
var import_node_fs55 = require("node:fs");
|
|
54439
54665
|
var import_node_path53 = require("node:path");
|
|
@@ -56022,13 +56248,13 @@ async function findInFlightHotfixVersion(deps, ctx, latestMainTag, workflows = H
|
|
|
56022
56248
|
}
|
|
56023
56249
|
|
|
56024
56250
|
// src/hotfix-coverage.ts
|
|
56025
|
-
var
|
|
56251
|
+
var import_node_child_process14 = require("node:child_process");
|
|
56026
56252
|
var CHERRY_TRAILER = /\(cherry picked from commit ([0-9a-f]{7,40})\)/g;
|
|
56027
56253
|
var GIT_MAX_BUFFER = 512 * 1024 * 1024;
|
|
56028
56254
|
function checkHotfixCoverage(options = {}) {
|
|
56029
56255
|
const { cwd = process.cwd(), mainRef = "origin/main", rcRef = "origin/rc", manifestPaths = [] } = options;
|
|
56030
56256
|
const ack = (options.ack ?? []).filter(Boolean);
|
|
56031
|
-
const git3 = options.git ?? ((args, opts) => (0,
|
|
56257
|
+
const git3 = options.git ?? ((args, opts) => (0, import_node_child_process14.execFileSync)("git", args, { cwd, encoding: "utf8", input: opts?.input, stdio: ["pipe", "pipe", "pipe"], maxBuffer: GIT_MAX_BUFFER }));
|
|
56032
56258
|
const revList = (range) => {
|
|
56033
56259
|
const out = git3(["rev-list", "--no-merges", range]).trim();
|
|
56034
56260
|
return out ? out.split("\n") : [];
|
|
@@ -56096,7 +56322,7 @@ function checkHotfixCoverage(options = {}) {
|
|
|
56096
56322
|
}
|
|
56097
56323
|
function checkHotfixCarries(options) {
|
|
56098
56324
|
const { cwd = process.cwd(), branch, baseRef, targets } = options;
|
|
56099
|
-
const git3 = options.git ?? ((args, opts) => (0,
|
|
56325
|
+
const git3 = options.git ?? ((args, opts) => (0, import_node_child_process14.execFileSync)("git", args, { cwd, encoding: "utf8", input: opts?.input, stdio: ["pipe", "pipe", "pipe"], maxBuffer: GIT_MAX_BUFFER }));
|
|
56100
56326
|
const isAncestor = (sha, ref) => {
|
|
56101
56327
|
try {
|
|
56102
56328
|
git3(["merge-base", "--is-ancestor", sha, ref]);
|
|
@@ -57983,7 +58209,7 @@ function prTitleRefusal(title) {
|
|
|
57983
58209
|
}
|
|
57984
58210
|
|
|
57985
58211
|
// src/command-register-collaboration.ts
|
|
57986
|
-
var
|
|
58212
|
+
var import_node_child_process19 = require("node:child_process");
|
|
57987
58213
|
var import_node_fs54 = require("node:fs");
|
|
57988
58214
|
var import_promises9 = require("node:fs/promises");
|
|
57989
58215
|
init_clean_exit();
|
|
@@ -59521,7 +59747,7 @@ async function readAppApi(path2, runner = apiReadRunner) {
|
|
|
59521
59747
|
return log ? Buffer.from(body, "latin1").toString("utf8") : out;
|
|
59522
59748
|
}
|
|
59523
59749
|
function registerApiReadCommands(program3, overrides) {
|
|
59524
|
-
const
|
|
59750
|
+
const spawn8 = overrides?.runner ?? apiReadRunner;
|
|
59525
59751
|
const jqRun = overrides?.jqRunner ?? systemJqRunner;
|
|
59526
59752
|
let bindings = [];
|
|
59527
59753
|
const runGet = async (req, o) => {
|
|
@@ -59541,7 +59767,7 @@ function registerApiReadCommands(program3, overrides) {
|
|
|
59541
59767
|
let body;
|
|
59542
59768
|
try {
|
|
59543
59769
|
body = await runApiGet(
|
|
59544
|
-
async (args, timeoutMs) => zip ?
|
|
59770
|
+
async (args, timeoutMs) => zip ? spawn8(args, ZIP_TIMEOUT_MS, env, true) : spawn8(args, timeoutMs, env),
|
|
59545
59771
|
req.path,
|
|
59546
59772
|
o.accept
|
|
59547
59773
|
);
|
|
@@ -59787,7 +60013,7 @@ function registerRunLogRead(run, runner) {
|
|
|
59787
60013
|
|
|
59788
60014
|
// src/app-read-broker.ts
|
|
59789
60015
|
init_cli_shared();
|
|
59790
|
-
var
|
|
60016
|
+
var import_node_child_process15 = require("node:child_process");
|
|
59791
60017
|
var OWNER_REPO_RE = /^[A-Za-z0-9_.-]+\/[A-Za-z0-9_.-]+$/;
|
|
59792
60018
|
var JSON_FIELD_RE = /^[A-Za-z0-9_,]+$/;
|
|
59793
60019
|
var ID_RE = /^\d+$/;
|
|
@@ -59873,7 +60099,7 @@ function formatJqFailureMessage(code, stderr) {
|
|
|
59873
60099
|
return `${base} \u2014 the expression is handed to jq verbatim (mmi-cli never re-quotes it), so if a shell or seat layer collapsed a backslash, use an escape-free form such as \`test("bundle[.]css")\` or \`contains("bundle.css")\`, or drop --jq and filter the JSON locally`;
|
|
59874
60100
|
}
|
|
59875
60101
|
var systemJqRunner = (expr, input, env, bindings) => new Promise((resolveOut, reject2) => {
|
|
59876
|
-
const child2 = (0,
|
|
60102
|
+
const child2 = (0, import_node_child_process15.spawn)("jq", [...process.platform === "win32" ? ["--binary"] : [], "-r", "-c", ...(bindings ?? []).flatMap((b) => [b.kind, b.name, b.value]), expr], { env, stdio: ["pipe", "pipe", "pipe"], windowsHide: true });
|
|
59877
60103
|
let stdout = "";
|
|
59878
60104
|
let stderr = "";
|
|
59879
60105
|
child2.stdout.setEncoding("utf8").on("data", (chunk) => {
|
|
@@ -61088,7 +61314,7 @@ function registerPrLifecycleCommands(program3) {
|
|
|
61088
61314
|
}
|
|
61089
61315
|
|
|
61090
61316
|
// src/review-verdict.ts
|
|
61091
|
-
var
|
|
61317
|
+
var import_node_child_process16 = require("node:child_process");
|
|
61092
61318
|
var import_node_fs49 = require("node:fs");
|
|
61093
61319
|
var import_node_os25 = require("node:os");
|
|
61094
61320
|
var import_node_path46 = require("node:path");
|
|
@@ -61188,8 +61414,8 @@ async function checkPrReview(number, repo, head, deps = {
|
|
|
61188
61414
|
}
|
|
61189
61415
|
function computePrPatchId(number, repo) {
|
|
61190
61416
|
return new Promise((resolve8, reject2) => {
|
|
61191
|
-
const gh2 = (0,
|
|
61192
|
-
const git3 = (0,
|
|
61417
|
+
const gh2 = (0, import_node_child_process16.spawn)("gh", ["pr", "diff", number, "--repo", repo], { windowsHide: true, stdio: ["ignore", "pipe", "pipe"] });
|
|
61418
|
+
const git3 = (0, import_node_child_process16.spawn)("git", ["patch-id", "--stable"], { windowsHide: true, stdio: ["pipe", "pipe", "pipe"] });
|
|
61193
61419
|
let out = "";
|
|
61194
61420
|
let ghErr = "";
|
|
61195
61421
|
let gitErr = "";
|
|
@@ -61414,7 +61640,7 @@ async function observePrCreateClaims(body, repoOption, deps = {}) {
|
|
|
61414
61640
|
}
|
|
61415
61641
|
|
|
61416
61642
|
// src/pr-create-docs-check.ts
|
|
61417
|
-
var
|
|
61643
|
+
var import_node_child_process17 = require("node:child_process");
|
|
61418
61644
|
init_cli_shared();
|
|
61419
61645
|
var GIT_TIMEOUT_MS2 = 15e3;
|
|
61420
61646
|
function catFileBatch(root, ref, paths) {
|
|
@@ -61422,7 +61648,7 @@ function catFileBatch(root, ref, paths) {
|
|
|
61422
61648
|
return new Promise((resolve8) => {
|
|
61423
61649
|
const chunks = [];
|
|
61424
61650
|
let settled2 = false;
|
|
61425
|
-
const child2 = (0,
|
|
61651
|
+
const child2 = (0, import_node_child_process17.spawn)("git", ["-C", root, "cat-file", "--batch", "--buffer"], { windowsHide: true });
|
|
61426
61652
|
const finish = (ok = false) => {
|
|
61427
61653
|
if (settled2) return;
|
|
61428
61654
|
settled2 = true;
|
|
@@ -61761,7 +61987,7 @@ var import_node_path49 = require("node:path");
|
|
|
61761
61987
|
init_cli_shared();
|
|
61762
61988
|
|
|
61763
61989
|
// src/stage-runner.ts
|
|
61764
|
-
var
|
|
61990
|
+
var import_node_child_process18 = require("node:child_process");
|
|
61765
61991
|
var import_node_fs51 = require("node:fs");
|
|
61766
61992
|
var import_node_path48 = require("node:path");
|
|
61767
61993
|
var import_node_net = require("node:net");
|
|
@@ -61932,7 +62158,7 @@ function stageComposeFileEnv(files) {
|
|
|
61932
62158
|
}
|
|
61933
62159
|
|
|
61934
62160
|
// src/stage-runner.ts
|
|
61935
|
-
var execFileP3 = (0, import_node_util5.promisify)(
|
|
62161
|
+
var execFileP3 = (0, import_node_util5.promisify)(import_node_child_process18.execFile);
|
|
61936
62162
|
var DOCKER_TIMEOUT_MS = 15e3;
|
|
61937
62163
|
function stageBash() {
|
|
61938
62164
|
if (process.platform !== "win32") return "bash";
|
|
@@ -62576,7 +62802,7 @@ async function startStage(config = {}, opts = {}) {
|
|
|
62576
62802
|
let up = sub(config.up.trim());
|
|
62577
62803
|
if (opts.forceRecreate) up = appendForceRecreate(up);
|
|
62578
62804
|
const identity = await resolveStageIdentity(cwd);
|
|
62579
|
-
const child2 = (0,
|
|
62805
|
+
const child2 = (0, import_node_child_process18.spawn)(bash, ["-c", up], {
|
|
62580
62806
|
cwd,
|
|
62581
62807
|
// POSIX-only: the process group exists for the group-kill in stopStage. On win32 teardown is
|
|
62582
62808
|
// `taskkill /T /F` (no group needed), and detached+shell defeats windowsHide — every spawn would
|
|
@@ -63709,7 +63935,7 @@ function scheduleRelatedDiscovery(o) {
|
|
|
63709
63935
|
try {
|
|
63710
63936
|
const args = ["issue", "discover-related", "--number", String(o.number), "--title", o.title, "--body", o.body, "--fail-soft"];
|
|
63711
63937
|
if (o.repo) args.push("--repo", o.repo);
|
|
63712
|
-
spawnDetachedSelf(args, { spawn:
|
|
63938
|
+
spawnDetachedSelf(args, { spawn: import_node_child_process19.spawn, execPath: process.execPath, scriptPath: process.argv[1] }, { cwd: process.cwd() });
|
|
63713
63939
|
} catch {
|
|
63714
63940
|
}
|
|
63715
63941
|
}
|
|
@@ -66693,7 +66919,7 @@ function suiteTrainIo(root, summaryFile, memberSummaryFiles = {}, summaryFileTr,
|
|
|
66693
66919
|
if (repo === SUITE_REPO) return inTrain(repo, (deps) => rcandInCheckout(repo, deps, previousRc, rcWasAbsent));
|
|
66694
66920
|
const target = await checkout(repo);
|
|
66695
66921
|
return new Promise((resolveResult, reject2) => {
|
|
66696
|
-
const child2 = (0,
|
|
66922
|
+
const child2 = (0, import_node_child_process20.fork)((0, import_node_path52.resolve)(process.argv[1]), ["devops", "suite", "member-rcand-internal", repo, previousRc ?? "", ...rcWasAbsent ? ["--rc-was-absent"] : []], {
|
|
66697
66923
|
cwd: target,
|
|
66698
66924
|
stdio: ["ignore", "inherit", "inherit", "ipc"],
|
|
66699
66925
|
execArgv: []
|
|
@@ -67314,7 +67540,7 @@ function registerJevCommands(program3) {
|
|
|
67314
67540
|
}
|
|
67315
67541
|
|
|
67316
67542
|
// src/packages-adopt-export.ts
|
|
67317
|
-
var
|
|
67543
|
+
var import_node_child_process21 = require("node:child_process");
|
|
67318
67544
|
var import_node_fs57 = require("node:fs");
|
|
67319
67545
|
var import_node_os26 = require("node:os");
|
|
67320
67546
|
var import_node_path54 = require("node:path");
|
|
@@ -67971,7 +68197,7 @@ async function adoptExport(opts, deps) {
|
|
|
67971
68197
|
(0, import_node_fs57.rmSync)(work, { recursive: true, force: true });
|
|
67972
68198
|
}
|
|
67973
68199
|
}
|
|
67974
|
-
var execFileBuffer = (0, import_node_util6.promisify)(
|
|
68200
|
+
var execFileBuffer = (0, import_node_util6.promisify)(import_node_child_process21.execFile);
|
|
67975
68201
|
var MAX_OUTPUT = 200 * 1024 * 1024;
|
|
67976
68202
|
async function findPython() {
|
|
67977
68203
|
for (const bin of ["python3", "python"]) {
|
|
@@ -72537,7 +72763,7 @@ async function resolveWhoami(deps) {
|
|
|
72537
72763
|
var import_node_path64 = require("node:path");
|
|
72538
72764
|
|
|
72539
72765
|
// src/doc-refs-command-source.ts
|
|
72540
|
-
var
|
|
72766
|
+
var import_node_child_process22 = require("node:child_process");
|
|
72541
72767
|
var import_node_fs62 = require("node:fs");
|
|
72542
72768
|
var import_node_path58 = require("node:path");
|
|
72543
72769
|
var IN_PROCESS_SOURCE = "in-process";
|
|
@@ -72558,7 +72784,7 @@ function inventoryFromManifest(manifest, source) {
|
|
|
72558
72784
|
collect(body?.tree);
|
|
72559
72785
|
return { commandPaths, commandOptions, source };
|
|
72560
72786
|
}
|
|
72561
|
-
function readBundleManifest(bundle, exec3 =
|
|
72787
|
+
function readBundleManifest(bundle, exec3 = import_node_child_process22.execFileSync) {
|
|
72562
72788
|
try {
|
|
72563
72789
|
const text = exec3(process.execPath, [bundle, "commands", "--all", "--json"], {
|
|
72564
72790
|
cwd: (0, import_node_path58.dirname)(bundle),
|
|
@@ -72727,7 +72953,7 @@ async function executeWaveLand(plan, deps) {
|
|
|
72727
72953
|
}
|
|
72728
72954
|
|
|
72729
72955
|
// src/dist-drift.ts
|
|
72730
|
-
var
|
|
72956
|
+
var import_node_child_process23 = require("node:child_process");
|
|
72731
72957
|
var import_node_crypto26 = require("node:crypto");
|
|
72732
72958
|
var import_node_fs64 = require("node:fs");
|
|
72733
72959
|
var import_node_os28 = require("node:os");
|
|
@@ -72873,7 +73099,7 @@ function bomPathFor(root) {
|
|
|
72873
73099
|
}
|
|
72874
73100
|
}
|
|
72875
73101
|
function rebuildTo(packageRoot, outDir) {
|
|
72876
|
-
(0,
|
|
73102
|
+
(0, import_node_child_process23.execFileSync)(process.execPath, ["build.mjs"], {
|
|
72877
73103
|
cwd: packageRoot,
|
|
72878
73104
|
env: { ...process.env, MMI_DIST_OUTDIR: outDir },
|
|
72879
73105
|
windowsHide: true,
|
|
@@ -72997,9 +73223,9 @@ async function runLiveDocRefs(root, deps, live) {
|
|
|
72997
73223
|
}
|
|
72998
73224
|
|
|
72999
73225
|
// src/doc-refs-live-io.ts
|
|
73000
|
-
var
|
|
73226
|
+
var import_node_child_process24 = require("node:child_process");
|
|
73001
73227
|
var import_node_util7 = require("node:util");
|
|
73002
|
-
var exec2 = (0, import_node_util7.promisify)(
|
|
73228
|
+
var exec2 = (0, import_node_util7.promisify)(import_node_child_process24.execFile);
|
|
73003
73229
|
function createRunbookLiveDeps(cliBin) {
|
|
73004
73230
|
const json = async (args) => {
|
|
73005
73231
|
const { stdout } = await exec2(process.execPath, [cliBin, ...args, "--json"], { windowsHide: true, timeout: 3e4, maxBuffer: 4 * 1024 * 1024 });
|
|
@@ -73310,7 +73536,7 @@ function registerSchedulesLiftCommand(program3, deps = {}) {
|
|
|
73310
73536
|
}
|
|
73311
73537
|
|
|
73312
73538
|
// src/spawn-policy-core.ts
|
|
73313
|
-
var
|
|
73539
|
+
var import_node_child_process25 = require("node:child_process");
|
|
73314
73540
|
var import_node_fs65 = require("node:fs");
|
|
73315
73541
|
var import_node_path63 = require("node:path");
|
|
73316
73542
|
var SPAWNERS = ["spawn", "spawnSync", "exec", "execSync", "execFile", "execFileSync"];
|
|
@@ -73381,7 +73607,7 @@ function findViolationsInSource(raw) {
|
|
|
73381
73607
|
return found;
|
|
73382
73608
|
}
|
|
73383
73609
|
function policedFiles(root) {
|
|
73384
|
-
const r = (0,
|
|
73610
|
+
const r = (0, import_node_child_process25.spawnSync)("git", ["ls-files", "-z", "--cached", "--others", "--exclude-standard"], {
|
|
73385
73611
|
cwd: root,
|
|
73386
73612
|
encoding: "utf8",
|
|
73387
73613
|
windowsHide: true,
|
package/cli/package.json
CHANGED