@mutmutco/hub 4.4.14 → 4.4.16
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/index.cjs +73 -43
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -84,7 +84,7 @@ __export(index_exports, {
|
|
|
84
84
|
writePending: () => writePending
|
|
85
85
|
});
|
|
86
86
|
module.exports = __toCommonJS(index_exports);
|
|
87
|
-
var
|
|
87
|
+
var import_node_child_process10 = require("node:child_process");
|
|
88
88
|
var import_node_fs22 = require("node:fs");
|
|
89
89
|
var import_node_path13 = require("node:path");
|
|
90
90
|
|
|
@@ -210,15 +210,24 @@ function createFace({ product, color = false, columns, env = process.env, operat
|
|
|
210
210
|
const record = { v: PROGRESS_PROTOCOL, step: stripColor(title), state: kind };
|
|
211
211
|
if (typeof measure === "number") record.ms = Math.max(0, Math.round(measure * 1e3));
|
|
212
212
|
if (kind === "running" && typeof measure === "string") record.measure = measure;
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
213
|
+
const line = `${JSON.stringify(record)}
|
|
214
|
+
`;
|
|
215
|
+
if (progressFd !== null) {
|
|
216
|
+
try {
|
|
217
|
+
(0, import_node_fs.writeSync)(progressFd, line);
|
|
218
|
+
return true;
|
|
219
|
+
} catch {
|
|
220
|
+
}
|
|
221
221
|
}
|
|
222
|
+
if (progressFile) {
|
|
223
|
+
try {
|
|
224
|
+
(0, import_node_fs.appendFileSync)(progressFile, line);
|
|
225
|
+
return true;
|
|
226
|
+
} catch {
|
|
227
|
+
return false;
|
|
228
|
+
}
|
|
229
|
+
}
|
|
230
|
+
return false;
|
|
222
231
|
};
|
|
223
232
|
const welcome = () => continuesFace || nested ? [] : [
|
|
224
233
|
`${paint(identity.accent, GLYPH.diamond)} ${paint(identity.accent, identity.name)} \u2014 Mutatis Mutandis`,
|
|
@@ -232,7 +241,7 @@ function createFace({ product, color = false, columns, env = process.env, operat
|
|
|
232
241
|
};
|
|
233
242
|
const step = (title, measure = null, kind = "ok") => {
|
|
234
243
|
if (emitMilestone(title, measure, kind)) return "";
|
|
235
|
-
const glyph = title === "Armed hourly updates" && kind === "ok" ? GLYPH.clock : kind === "fail" ? paint(identity.accent, GLYPH.cross) : kind === "note" ? paint(PALETTE.muted, GLYPH.dot) : paint(
|
|
244
|
+
const glyph = title === "Armed hourly updates" && kind === "ok" ? GLYPH.clock : kind === "fail" ? paint(identity.accent, GLYPH.cross) : kind === "note" ? paint(PALETTE.muted, GLYPH.dot) : paint(identity.accent, GLYPH.check);
|
|
236
245
|
const measured = measure === null || measure === void 0 ? "" : paint(PALETTE.muted, typeof measure === "number" ? `${Math.max(0, Math.round(measure))}s` : String(measure).trim());
|
|
237
246
|
const time = measured;
|
|
238
247
|
const column = Math.min(44, Math.max(0, width - 8));
|
|
@@ -253,7 +262,7 @@ function createFace({ product, color = false, columns, env = process.env, operat
|
|
|
253
262
|
const content = Math.min(width - 6, Math.max(...body.map(visibleWidth)));
|
|
254
263
|
const rule = paint(identity.accent, GLYPH.rule.repeat(content + 4));
|
|
255
264
|
const frame = (left, right) => `${paint(identity.accent, left)}${rule}${paint(identity.accent, right)}`;
|
|
256
|
-
const bodyRow = (line) => line.startsWith(GLYPH.check) ? `${paint(
|
|
265
|
+
const bodyRow = (line) => line.startsWith(GLYPH.check) ? `${paint(identity.accent, GLYPH.check)}${line.slice(1)}` : line;
|
|
257
266
|
return [
|
|
258
267
|
frame(GLYPH.boxTop, GLYPH.boxTopEnd),
|
|
259
268
|
...body.map((line) => `${paint(identity.accent, GLYPH.bar)} ${bodyRow(line)}${" ".repeat(Math.max(0, content - visibleWidth(line)))} ${paint(identity.accent, GLYPH.bar)}`),
|
|
@@ -284,16 +293,31 @@ var import_node_fs2 = require("node:fs");
|
|
|
284
293
|
var import_node_worker_threads = require("node:worker_threads");
|
|
285
294
|
|
|
286
295
|
// ../installer/face/src/encoding.ts
|
|
296
|
+
var import_node_child_process = require("node:child_process");
|
|
287
297
|
var UNICODE_SPINNER_FRAMES = Object.freeze(["\u25D2", "\u25D0", "\u25D3", "\u25D1"]);
|
|
288
298
|
var ASCII_SPINNER_FRAMES = Object.freeze(["-", "\\", "|", "/"]);
|
|
289
|
-
|
|
299
|
+
var cachedCodePage;
|
|
300
|
+
function consoleOutputCodePage() {
|
|
301
|
+
if (cachedCodePage !== void 0) return cachedCodePage;
|
|
302
|
+
cachedCodePage = null;
|
|
303
|
+
try {
|
|
304
|
+
const out = (0, import_node_child_process.execFileSync)("chcp.com", { windowsHide: true, encoding: "utf8", timeout: 5e3 });
|
|
305
|
+
const pages = [...String(out).matchAll(/(\d{3,5})/gu)].map((m) => Number(m[1]));
|
|
306
|
+
cachedCodePage = pages.length ? pages[pages.length - 1] : null;
|
|
307
|
+
} catch {
|
|
308
|
+
cachedCodePage = null;
|
|
309
|
+
}
|
|
310
|
+
return cachedCodePage;
|
|
311
|
+
}
|
|
312
|
+
function consoleRendersUnicode(env = process.env, platform = process.platform, codePage = platform === "win32" ? consoleOutputCodePage() : null) {
|
|
290
313
|
if (env.MM_FACE_ASCII === "1" || env.NO_UNICODE === "1") return false;
|
|
291
314
|
const locale = env.LC_ALL || env.LC_CTYPE || env.LANG || "";
|
|
292
315
|
if (locale === "C" || locale === "POSIX" || /^C\./u.test(locale) || /^POSIX\./u.test(locale)) return false;
|
|
293
316
|
if (/cp437|ibm437|\b437\b/iu.test(locale)) return false;
|
|
294
317
|
if (/utf-?8/iu.test(locale)) return true;
|
|
295
318
|
if (platform === "win32") {
|
|
296
|
-
|
|
319
|
+
if (env.WT_SESSION || env.ConEmuANSI === "ON") return true;
|
|
320
|
+
return codePage === 65001;
|
|
297
321
|
}
|
|
298
322
|
return true;
|
|
299
323
|
}
|
|
@@ -710,6 +734,7 @@ function createInstallerRun(value, options = {}) {
|
|
|
710
734
|
let chunkColumn = 0;
|
|
711
735
|
const trailingCR = /* @__PURE__ */ new Set();
|
|
712
736
|
let deferredActivity;
|
|
737
|
+
const drawnPhaseCompletions = /* @__PURE__ */ new Set();
|
|
713
738
|
const closeChunk = () => {
|
|
714
739
|
if (chunkOpen) emit("\n", chunkChannel);
|
|
715
740
|
chunkOpen = false;
|
|
@@ -768,7 +793,10 @@ function createInstallerRun(value, options = {}) {
|
|
|
768
793
|
if (facts.detail) run.relay(facts.detail);
|
|
769
794
|
return;
|
|
770
795
|
}
|
|
771
|
-
if (!face.continues(id, state))
|
|
796
|
+
if (!face.continues(id, state)) {
|
|
797
|
+
durable(title, facts.seconds ?? facts.measure ?? null, state);
|
|
798
|
+
if (state === "ok") drawnPhaseCompletions.add(title);
|
|
799
|
+
}
|
|
772
800
|
if (facts.detail) run.relay(facts.detail);
|
|
773
801
|
},
|
|
774
802
|
surface(facts) {
|
|
@@ -799,7 +827,9 @@ function createInstallerRun(value, options = {}) {
|
|
|
799
827
|
}
|
|
800
828
|
return;
|
|
801
829
|
}
|
|
830
|
+
if (state !== "fail" && drawnPhaseCompletions.has(step)) return;
|
|
802
831
|
durable(step, ms === void 0 ? null : ms / 1e3, state);
|
|
832
|
+
if (state === "ok") drawnPhaseCompletions.add(step);
|
|
803
833
|
},
|
|
804
834
|
signIn({ url, code }) {
|
|
805
835
|
start();
|
|
@@ -1260,7 +1290,7 @@ function fileExists(path) {
|
|
|
1260
1290
|
var import_node_perf_hooks2 = require("node:perf_hooks");
|
|
1261
1291
|
|
|
1262
1292
|
// src/npm.ts
|
|
1263
|
-
var
|
|
1293
|
+
var import_node_child_process2 = require("node:child_process");
|
|
1264
1294
|
var import_node_fs6 = require("node:fs");
|
|
1265
1295
|
var import_node_path2 = require("node:path");
|
|
1266
1296
|
var cachedNpm = null;
|
|
@@ -1268,7 +1298,7 @@ function resolveNpm(env = process.env) {
|
|
|
1268
1298
|
if (env.MMI_UPDATER_NPM) return { kind: "command", command: env.MMI_UPDATER_NPM };
|
|
1269
1299
|
if (cachedNpm) return cachedNpm;
|
|
1270
1300
|
if (process.platform === "win32") {
|
|
1271
|
-
const where = (0,
|
|
1301
|
+
const where = (0, import_node_child_process2.spawnSync)("where.exe", ["npm.cmd"], { encoding: "utf8", windowsHide: true });
|
|
1272
1302
|
const first = where.stdout.split("\n").map((l) => l.trim()).find(Boolean);
|
|
1273
1303
|
if (where.status === 0 && first) {
|
|
1274
1304
|
const script = (0, import_node_path2.join)((0, import_node_path2.dirname)(first), "node_modules", "npm", "bin", "npm-cli.js");
|
|
@@ -1285,7 +1315,7 @@ function resolveNpm(env = process.env) {
|
|
|
1285
1315
|
cachedNpm = { kind: "node-script", script: bundled };
|
|
1286
1316
|
return cachedNpm;
|
|
1287
1317
|
}
|
|
1288
|
-
const located = (0,
|
|
1318
|
+
const located = (0, import_node_child_process2.spawnSync)("/bin/sh", ["-lc", "command -v npm"], { encoding: "utf8", windowsHide: true });
|
|
1289
1319
|
const resolved = (located.stdout ?? "").trim().split("\n").map((line) => line.trim()).find(Boolean);
|
|
1290
1320
|
if (located.status === 0 && resolved && (0, import_node_fs6.existsSync)(resolved)) {
|
|
1291
1321
|
cachedNpm = { kind: "command", command: resolved };
|
|
@@ -1296,7 +1326,7 @@ function resolveNpm(env = process.env) {
|
|
|
1296
1326
|
}
|
|
1297
1327
|
function runNpm(args, env = process.env, options = {}) {
|
|
1298
1328
|
const npm = resolveNpm(env);
|
|
1299
|
-
const result = npm.kind === "node-script" ? (0,
|
|
1329
|
+
const result = npm.kind === "node-script" ? (0, import_node_child_process2.spawnSync)(process.execPath, [npm.script, ...args], { encoding: "utf8", env, cwd: options.cwd, windowsHide: true }) : (0, import_node_child_process2.spawnSync)(npm.command, args, { encoding: "utf8", env, cwd: options.cwd, shell: process.platform === "win32", windowsHide: true });
|
|
1300
1330
|
return { status: result.status, stdout: result.stdout ?? "", stderr: result.stderr ?? "" };
|
|
1301
1331
|
}
|
|
1302
1332
|
function runNpmAsync(args, env = process.env, options = {}) {
|
|
@@ -1307,7 +1337,7 @@ function runNpmAsync(args, env = process.env, options = {}) {
|
|
|
1307
1337
|
let stderr = "";
|
|
1308
1338
|
let child;
|
|
1309
1339
|
try {
|
|
1310
|
-
child = (0,
|
|
1340
|
+
child = (0, import_node_child_process2.spawn)(file, argv, { env, cwd: options.cwd, windowsHide: true, shell });
|
|
1311
1341
|
} catch (error) {
|
|
1312
1342
|
resolve({ status: null, stdout, stderr: String(error?.message ?? error) });
|
|
1313
1343
|
return;
|
|
@@ -1368,7 +1398,7 @@ function npmVersions(packageName, env = process.env) {
|
|
|
1368
1398
|
}
|
|
1369
1399
|
|
|
1370
1400
|
// src/gate.ts
|
|
1371
|
-
var
|
|
1401
|
+
var import_node_child_process3 = require("node:child_process");
|
|
1372
1402
|
var import_node_fs7 = require("node:fs");
|
|
1373
1403
|
function parseBom(text) {
|
|
1374
1404
|
const bom = JSON.parse(text);
|
|
@@ -1383,16 +1413,16 @@ function npmPackRows(bom) {
|
|
|
1383
1413
|
var GateEnvError = class extends Error {
|
|
1384
1414
|
};
|
|
1385
1415
|
function git(cachePath, args) {
|
|
1386
|
-
const result = (0,
|
|
1416
|
+
const result = (0, import_node_child_process3.spawnSync)("git", ["-C", cachePath, ...args], { encoding: "utf8", windowsHide: true });
|
|
1387
1417
|
return { status: result.status, stdout: (result.stdout ?? "").trim(), stderr: result.stderr ?? "" };
|
|
1388
1418
|
}
|
|
1389
1419
|
function ensureBareCache(cachePath, repoUrl) {
|
|
1390
|
-
const probe = (0,
|
|
1420
|
+
const probe = (0, import_node_child_process3.spawnSync)("git", ["--version"], { encoding: "utf8", windowsHide: true });
|
|
1391
1421
|
if (probe.status !== 0) {
|
|
1392
1422
|
throw new GateEnvError("git is not available \u2014 the release gate needs a git client");
|
|
1393
1423
|
}
|
|
1394
1424
|
if (!(0, import_node_fs7.existsSync)(cachePath)) {
|
|
1395
|
-
const init = (0,
|
|
1425
|
+
const init = (0, import_node_child_process3.spawnSync)("git", ["init", "--bare", cachePath], { encoding: "utf8", windowsHide: true });
|
|
1396
1426
|
if (init.status !== 0) throw new GateEnvError(`cannot create bare cache at ${cachePath}: ${init.stderr}`);
|
|
1397
1427
|
}
|
|
1398
1428
|
}
|
|
@@ -1503,18 +1533,18 @@ var import_node_os3 = require("node:os");
|
|
|
1503
1533
|
var import_node_path7 = require("node:path");
|
|
1504
1534
|
|
|
1505
1535
|
// src/arm-host-plugins.ts
|
|
1506
|
-
var
|
|
1536
|
+
var import_node_child_process6 = require("node:child_process");
|
|
1507
1537
|
var import_node_fs11 = require("node:fs");
|
|
1508
1538
|
var import_node_os2 = require("node:os");
|
|
1509
1539
|
var import_node_path6 = require("node:path");
|
|
1510
1540
|
|
|
1511
1541
|
// src/arm-npm-global.ts
|
|
1512
1542
|
var import_node_fs9 = require("node:fs");
|
|
1513
|
-
var
|
|
1543
|
+
var import_node_child_process5 = require("node:child_process");
|
|
1514
1544
|
var import_node_path4 = require("node:path");
|
|
1515
1545
|
|
|
1516
1546
|
// src/pending.ts
|
|
1517
|
-
var
|
|
1547
|
+
var import_node_child_process4 = require("node:child_process");
|
|
1518
1548
|
var import_node_fs8 = require("node:fs");
|
|
1519
1549
|
var import_node_path3 = require("node:path");
|
|
1520
1550
|
function hubDistPath(env) {
|
|
@@ -1595,7 +1625,7 @@ function buildWatcherCommand(opts) {
|
|
|
1595
1625
|
return { file: "sh", args: ["-c", `${testBusy}; ${wait}; ${lock}; ${run}`] };
|
|
1596
1626
|
}
|
|
1597
1627
|
function defaultDetachSpawn(file, args) {
|
|
1598
|
-
const child = (0,
|
|
1628
|
+
const child = (0, import_node_child_process4.spawn)(file, [...args], {
|
|
1599
1629
|
detached: process.platform !== "win32",
|
|
1600
1630
|
stdio: "ignore",
|
|
1601
1631
|
windowsHide: true,
|
|
@@ -1662,7 +1692,7 @@ function globalDist(env, packageName, distRel) {
|
|
|
1662
1692
|
}
|
|
1663
1693
|
function probeVersion(distPath) {
|
|
1664
1694
|
if (!fileExists(distPath)) return null;
|
|
1665
|
-
const probe = (0,
|
|
1695
|
+
const probe = (0, import_node_child_process5.spawnSync)(process.execPath, [distPath, "--version"], { encoding: "utf8", windowsHide: true });
|
|
1666
1696
|
const version = (probe.stdout || "").trim();
|
|
1667
1697
|
return probe.status === 0 && /^\d+\.\d+\.\d+/.test(version) ? version : null;
|
|
1668
1698
|
}
|
|
@@ -1808,13 +1838,13 @@ function cmdArg(value) {
|
|
|
1808
1838
|
return /^[A-Za-z0-9_@./:\\=+-]+$/.test(value) ? value : `"${value.replaceAll('"', '""')}"`;
|
|
1809
1839
|
}
|
|
1810
1840
|
var runHostCommand = (command, args, env) => {
|
|
1811
|
-
const result = process.platform === "win32" ? (0,
|
|
1841
|
+
const result = process.platform === "win32" ? (0, import_node_child_process6.spawnSync)("cmd.exe", ["/d", "/s", "/c", [command, ...args].map(cmdArg).join(" ")], {
|
|
1812
1842
|
encoding: "utf8",
|
|
1813
1843
|
env,
|
|
1814
1844
|
input: "",
|
|
1815
1845
|
timeout: 12e4,
|
|
1816
1846
|
windowsHide: true
|
|
1817
|
-
}) : (0,
|
|
1847
|
+
}) : (0, import_node_child_process6.spawnSync)(command, args, {
|
|
1818
1848
|
encoding: "utf8",
|
|
1819
1849
|
env,
|
|
1820
1850
|
input: "",
|
|
@@ -1900,7 +1930,7 @@ function claudeProcessToken(line) {
|
|
|
1900
1930
|
return null;
|
|
1901
1931
|
}
|
|
1902
1932
|
function realClaudeProcessListing() {
|
|
1903
|
-
const result = process.platform === "win32" ? (0,
|
|
1933
|
+
const result = process.platform === "win32" ? (0, import_node_child_process6.spawnSync)("powershell.exe", ["-NoProfile", "-Command", "Get-CimInstance Win32_Process | ForEach-Object { $_.Name + ' ' + $_.CommandLine }"], { encoding: "utf8", windowsHide: true, timeout: 15e3 }) : (0, import_node_child_process6.spawnSync)("ps", ["-eo", "args="], { encoding: "utf8", windowsHide: true, timeout: 15e3 });
|
|
1904
1934
|
return result.status === 0 ? result.stdout ?? "" : null;
|
|
1905
1935
|
}
|
|
1906
1936
|
function claudeHostEvidence(env, processListProvider) {
|
|
@@ -2165,7 +2195,7 @@ function enumerateSurfaces(env = process.env) {
|
|
|
2165
2195
|
|
|
2166
2196
|
// src/arm-cursor.ts
|
|
2167
2197
|
var import_node_fs15 = require("node:fs");
|
|
2168
|
-
var
|
|
2198
|
+
var import_node_child_process7 = require("node:child_process");
|
|
2169
2199
|
var import_node_os5 = require("node:os");
|
|
2170
2200
|
var import_node_path8 = require("node:path");
|
|
2171
2201
|
|
|
@@ -2348,7 +2378,7 @@ function cursorHostEvidence(env) {
|
|
|
2348
2378
|
if (env[marker]?.trim()) return `env marker ${marker}`;
|
|
2349
2379
|
}
|
|
2350
2380
|
if (env.CURSOR_AGENT === "1") return "env marker CURSOR_AGENT=1";
|
|
2351
|
-
const result = process.platform === "win32" ? (0,
|
|
2381
|
+
const result = process.platform === "win32" ? (0, import_node_child_process7.spawnSync)("powershell.exe", ["-NoProfile", "-Command", "Get-CimInstance Win32_Process | ForEach-Object { $_.CommandLine }"], { encoding: "utf8", windowsHide: true, timeout: 15e3 }) : (0, import_node_child_process7.spawnSync)("ps", ["-eo", "args="], { encoding: "utf8", windowsHide: true, timeout: 15e3 });
|
|
2352
2382
|
if (result.status !== 0 || !(result.stdout ?? "").trim()) return "the process table is unreadable (unsafe to write)";
|
|
2353
2383
|
for (const line of result.stdout.split(/\r?\n/)) {
|
|
2354
2384
|
const executable = cursorExecutable(line);
|
|
@@ -2745,7 +2775,7 @@ function jervcodeArm(options) {
|
|
|
2745
2775
|
|
|
2746
2776
|
// src/arm-hermes.ts
|
|
2747
2777
|
var import_node_fs17 = require("node:fs");
|
|
2748
|
-
var
|
|
2778
|
+
var import_node_child_process8 = require("node:child_process");
|
|
2749
2779
|
var import_node_path10 = require("node:path");
|
|
2750
2780
|
var PACKAGE2 = "@mutmutco/hermes-plugin";
|
|
2751
2781
|
var MANIFEST2 = "plugin.yaml";
|
|
@@ -2831,7 +2861,7 @@ function hermesProcessToken(line, home) {
|
|
|
2831
2861
|
return hermesToken(tokens) ?? (home && normalized.toLowerCase().includes(home.toLowerCase()) ? home : null);
|
|
2832
2862
|
}
|
|
2833
2863
|
function realProcessListing() {
|
|
2834
|
-
const result = process.platform === "win32" ? (0,
|
|
2864
|
+
const result = process.platform === "win32" ? (0, import_node_child_process8.spawnSync)("powershell.exe", ["-NoProfile", "-Command", "Get-CimInstance Win32_Process | ForEach-Object { $_.Name + ' ' + $_.CommandLine }"], { encoding: "utf8", windowsHide: true, timeout: 15e3 }) : (0, import_node_child_process8.spawnSync)("ps", ["-eo", "args="], { encoding: "utf8", windowsHide: true, timeout: 15e3 });
|
|
2835
2865
|
return result.status === 0 ? result.stdout ?? "" : null;
|
|
2836
2866
|
}
|
|
2837
2867
|
function hermesHostEvidence(env, home, processListProvider) {
|
|
@@ -3346,7 +3376,7 @@ async function reconcile(options) {
|
|
|
3346
3376
|
}
|
|
3347
3377
|
|
|
3348
3378
|
// src/scheduler.ts
|
|
3349
|
-
var
|
|
3379
|
+
var import_node_child_process9 = require("node:child_process");
|
|
3350
3380
|
var import_node_fs19 = require("node:fs");
|
|
3351
3381
|
var import_node_os6 = require("node:os");
|
|
3352
3382
|
var import_node_path12 = require("node:path");
|
|
@@ -3365,15 +3395,15 @@ var SYSTEMD_UNIT = "mmi-hub-updater";
|
|
|
3365
3395
|
var SYSTEMD_SERVICE_NAME = `${SYSTEMD_UNIT}.service`;
|
|
3366
3396
|
var SYSTEMD_TIMER_NAME = `${SYSTEMD_UNIT}.timer`;
|
|
3367
3397
|
function schtasks(args) {
|
|
3368
|
-
const result = (0,
|
|
3398
|
+
const result = (0, import_node_child_process9.spawnSync)("schtasks.exe", args, { encoding: "utf8", windowsHide: true });
|
|
3369
3399
|
return { status: result.status, stdout: result.stdout ?? "", stderr: result.stderr ?? "" };
|
|
3370
3400
|
}
|
|
3371
3401
|
function launchctl(args) {
|
|
3372
|
-
const result = (0,
|
|
3402
|
+
const result = (0, import_node_child_process9.spawnSync)("launchctl", args, { encoding: "utf8", windowsHide: true });
|
|
3373
3403
|
return { status: result.status, stdout: result.stdout ?? "", stderr: result.stderr ?? "" };
|
|
3374
3404
|
}
|
|
3375
3405
|
function systemctlUser(args) {
|
|
3376
|
-
const result = (0,
|
|
3406
|
+
const result = (0, import_node_child_process9.spawnSync)("systemctl", ["--user", ...args], { encoding: "utf8", windowsHide: true });
|
|
3377
3407
|
return { status: result.status, stdout: result.stdout ?? "", stderr: result.stderr ?? "" };
|
|
3378
3408
|
}
|
|
3379
3409
|
function uid() {
|
|
@@ -3398,7 +3428,7 @@ WScript.Quit code
|
|
|
3398
3428
|
`;
|
|
3399
3429
|
}
|
|
3400
3430
|
function loginPath(fallback = process.env.PATH ?? "") {
|
|
3401
|
-
const probe = (0,
|
|
3431
|
+
const probe = (0, import_node_child_process9.spawnSync)("/bin/sh", ["-lc", 'printf %s "$PATH"'], { encoding: "utf8", windowsHide: true, timeout: 1e4 });
|
|
3402
3432
|
const captured = (probe.status === 0 ? probe.stdout ?? "" : "").trim();
|
|
3403
3433
|
const source = captured || fallback;
|
|
3404
3434
|
const durable = source.split(":").filter((entry) => entry && !/^\/(?:private\/)?(?:tmp|var\/folders)\//.test(entry));
|
|
@@ -3519,7 +3549,7 @@ function elevatedRelaunch(mode, env) {
|
|
|
3519
3549
|
if (env.MMI_UPDATER_ELEVATED_RETRY === "1") return false;
|
|
3520
3550
|
const self = process.argv[1];
|
|
3521
3551
|
const command = self ? `"${process.execPath}" "${self}" autoupdate ${mode}` : `mmi-hub autoupdate ${mode}`;
|
|
3522
|
-
const relaunch = (0,
|
|
3552
|
+
const relaunch = (0, import_node_child_process9.spawnSync)(
|
|
3523
3553
|
"powershell.exe",
|
|
3524
3554
|
["-NoProfile", "-Command", `Start-Process -Verb RunAs -Wait -WindowStyle Hidden -FilePath 'cmd.exe' -ArgumentList '/c',${psQuote(`set MMI_UPDATER_ELEVATED_RETRY=1&& ${command}`)}`],
|
|
3525
3555
|
{ encoding: "utf8", windowsHide: true }
|
|
@@ -3530,7 +3560,7 @@ var NEVER_RUN_RESULT = 267011;
|
|
|
3530
3560
|
var NEVER_RUN_YEAR = 1999;
|
|
3531
3561
|
var EMPTY_RUN_INFO = { lastRunTime: null, lastTaskResult: null, nextRunTime: null };
|
|
3532
3562
|
function taskRunInfo() {
|
|
3533
|
-
const result = (0,
|
|
3563
|
+
const result = (0, import_node_child_process9.spawnSync)(
|
|
3534
3564
|
"powershell.exe",
|
|
3535
3565
|
["-NoProfile", "-Command", `$stamp = { param($t) if ($t) { $t.ToString('yyyy-MM-dd HH:mm:ss') } }; Get-ScheduledTaskInfo -TaskName '${TASK_NAME}' | Select-Object @{n='LastRunTime';e={& $stamp $_.LastRunTime}},LastTaskResult,@{n='NextRunTime';e={& $stamp $_.NextRunTime}} | ConvertTo-Json -Compress`],
|
|
3536
3566
|
{ encoding: "utf8", windowsHide: true, timeout: 3e4 }
|
|
@@ -4051,7 +4081,7 @@ State remains under $MMI_UPDATER_HOME (default ~/.mmi/updater), and the Windows
|
|
|
4051
4081
|
"MMI Fleet Updater", so existing installations continue in place.
|
|
4052
4082
|
Status performs no npm install, host repair, scheduler write, state mkdir, or repository cleanup.`;
|
|
4053
4083
|
function handOff(reexec, args, env) {
|
|
4054
|
-
const child = (0,
|
|
4084
|
+
const child = (0, import_node_child_process10.spawnSync)(process.execPath, [reexec.dist, ...args], {
|
|
4055
4085
|
stdio: "inherit",
|
|
4056
4086
|
windowsHide: true,
|
|
4057
4087
|
env: { ...env, MMI_UPDATER_REEXEC: "1" }
|
package/package.json
CHANGED