pyre-cli 10.4.0 → 10.6.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/dist/{blender-6ZX5SPYC.js → blender-OXH3PVYM.js} +3 -3
- package/dist/{brewHealth-VFW33QB3.js → brewHealth-JE4EZ63L.js} +1 -1
- package/dist/{buildCmd-E7KUCFYG.js → buildCmd-R6RY3XZR.js} +3 -3
- package/dist/{checkCmd-QLYTP77Y.js → checkCmd-KF6G77SC.js} +5 -5
- package/dist/{chunk-RKPGPVTO.js → chunk-2SUFLPIH.js} +5 -5
- package/dist/chunk-735X2GPS.js +88 -0
- package/dist/{chunk-QEH4LR6P.js → chunk-D3HWHU3X.js} +4 -4
- package/dist/{chunk-FYCBGUTW.js → chunk-GPSU54LZ.js} +2 -2
- package/dist/{chunk-NMGQVRCA.js → chunk-KLANOKZF.js} +2 -2
- package/dist/{chunk-OCL7P7N7.js → chunk-YXZ4XREM.js} +195 -111
- package/dist/{collectors-V7SCIIDH.js → collectors-DQEVTONN.js} +5 -5
- package/dist/{doctor-O4DIAMHK.js → doctor-SCHRYF6D.js} +2 -2
- package/dist/{extensions-QQEV7U3D.js → extensions-BWXMZVMN.js} +1 -1
- package/dist/{flightRecorder-GJIAQOXC.js → flightRecorder-J4TESP5M.js} +5 -5
- package/dist/index.js +55 -28
- package/dist/monitors/platform/windows-ui.ps1 +14 -4
- package/dist/{netUsageCmd-JP6YKBPF.js → netUsageCmd-2QVRC6FX.js} +5 -5
- package/dist/{optimizeCmd-WZKLFYZU.js → optimizeCmd-ZF7U3DXR.js} +2 -2
- package/dist/{pipeCmd-CPK6FVKB.js → pipeCmd-XBWAYRRU.js} +5 -5
- package/dist/{profileProcCmd-5Y3733E7.js → profileProcCmd-33YB4RXZ.js} +1 -1
- package/dist/{prometheusCmd-G2CSEZRQ.js → prometheusCmd-6PXZG73L.js} +5 -5
- package/dist/{run-UJQYT2TO.js → run-744KZ7CE.js} +1 -1
- package/dist/{serveCmd-KDPWLVQI.js → serveCmd-R2Y7O3XC.js} +5 -5
- package/dist/{smartCmd-2BJJ37GV.js → smartCmd-C33WRXA2.js} +1 -1
- package/dist/{statuslineCmd-EUKYRR2G.js → statuslineCmd-QPBGXC2G.js} +5 -5
- package/dist/{topoCmd-RTXQJ6XA.js → topoCmd-RVWFSPHE.js} +5 -5
- package/dist/{watchdogCmd-XM6OPTKM.js → watchdogCmd-346TXWWH.js} +6 -6
- package/package.json +1 -1
- package/src/index.ts +31 -2
- package/src/monitors/platform/windows-ui.ps1 +14 -4
- package/src/monitors/platform/windows.ts +225 -102
- package/src/monitors/run.ts +83 -7
- package/src/platform.test.ts +24 -0
- package/dist/chunk-MZO5QKUR.js +0 -32
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import {
|
|
2
2
|
collectBlenderRenders
|
|
3
|
-
} from "./chunk-
|
|
4
|
-
import "./chunk-
|
|
5
|
-
import "./chunk-
|
|
3
|
+
} from "./chunk-GPSU54LZ.js";
|
|
4
|
+
import "./chunk-YXZ4XREM.js";
|
|
5
|
+
import "./chunk-735X2GPS.js";
|
|
6
6
|
import "./chunk-3RG5ZIWI.js";
|
|
7
7
|
export {
|
|
8
8
|
collectBlenderRenders
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import {
|
|
2
2
|
collectBuilds
|
|
3
|
-
} from "./chunk-
|
|
4
|
-
import "./chunk-
|
|
5
|
-
import "./chunk-
|
|
3
|
+
} from "./chunk-KLANOKZF.js";
|
|
4
|
+
import "./chunk-YXZ4XREM.js";
|
|
5
|
+
import "./chunk-735X2GPS.js";
|
|
6
6
|
import "./chunk-3RG5ZIWI.js";
|
|
7
7
|
|
|
8
8
|
// src/buildCmd.ts
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import "./chunk-IM3IQMMT.js";
|
|
2
2
|
import {
|
|
3
3
|
collectAll
|
|
4
|
-
} from "./chunk-
|
|
5
|
-
import "./chunk-
|
|
6
|
-
import "./chunk-
|
|
7
|
-
import "./chunk-
|
|
8
|
-
import "./chunk-
|
|
4
|
+
} from "./chunk-D3HWHU3X.js";
|
|
5
|
+
import "./chunk-KLANOKZF.js";
|
|
6
|
+
import "./chunk-GPSU54LZ.js";
|
|
7
|
+
import "./chunk-YXZ4XREM.js";
|
|
8
|
+
import "./chunk-735X2GPS.js";
|
|
9
9
|
import "./chunk-3RG5ZIWI.js";
|
|
10
10
|
|
|
11
11
|
// src/checkCmd.ts
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import {
|
|
2
2
|
run
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-735X2GPS.js";
|
|
4
4
|
import {
|
|
5
5
|
CONFIG_FILE,
|
|
6
6
|
readConfig
|
|
@@ -301,7 +301,7 @@ async function runWindowsDoctor() {
|
|
|
301
301
|
});
|
|
302
302
|
}
|
|
303
303
|
try {
|
|
304
|
-
const { runPowerShell } = await import("./run-
|
|
304
|
+
const { runPowerShell } = await import("./run-744KZ7CE.js");
|
|
305
305
|
const wmiCheck = await runPowerShell("(Get-CimInstance Win32_OperatingSystem -ErrorAction SilentlyContinue).Caption", "");
|
|
306
306
|
if (wmiCheck.toLowerCase().includes("windows")) {
|
|
307
307
|
checks.push({
|
|
@@ -325,7 +325,7 @@ async function runWindowsDoctor() {
|
|
|
325
325
|
});
|
|
326
326
|
}
|
|
327
327
|
try {
|
|
328
|
-
const { runPowerShell } = await import("./run-
|
|
328
|
+
const { runPowerShell } = await import("./run-744KZ7CE.js");
|
|
329
329
|
const avRaw = await runPowerShell(
|
|
330
330
|
`$av = Get-CimInstance -Namespace root/SecurityCenter2 -ClassName AntiVirusProduct -ErrorAction SilentlyContinue; if ($av) { ($av | Select-Object -ExpandProperty displayName) -join ', ' } else { '' }`,
|
|
331
331
|
""
|
|
@@ -351,7 +351,7 @@ async function runWindowsDoctor() {
|
|
|
351
351
|
});
|
|
352
352
|
}
|
|
353
353
|
try {
|
|
354
|
-
const { runPowerShell } = await import("./run-
|
|
354
|
+
const { runPowerShell } = await import("./run-744KZ7CE.js");
|
|
355
355
|
const uacRaw = await runPowerShell(
|
|
356
356
|
`(Get-ItemProperty -Path 'HKLM:\\SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Policies\\System' -Name EnableLUA -ErrorAction SilentlyContinue).EnableLUA`,
|
|
357
357
|
""
|
|
@@ -378,7 +378,7 @@ async function runWindowsDoctor() {
|
|
|
378
378
|
});
|
|
379
379
|
}
|
|
380
380
|
try {
|
|
381
|
-
const { runPowerShell } = await import("./run-
|
|
381
|
+
const { runPowerShell } = await import("./run-744KZ7CE.js");
|
|
382
382
|
const cpuName = await runPowerShell("(Get-CimInstance Win32_Processor -ErrorAction SilentlyContinue | Select-Object -First 1 -ExpandProperty Name)", "");
|
|
383
383
|
const gpuName = await runPowerShell("(Get-CimInstance Win32_VideoController -ErrorAction SilentlyContinue | Select-Object -First 1 -ExpandProperty Name)", "");
|
|
384
384
|
const cpuVendor = cpuName.toLowerCase().includes("amd") ? "AMD" : cpuName.toLowerCase().includes("intel") ? "Intel" : "x86/x64";
|
|
@@ -0,0 +1,88 @@
|
|
|
1
|
+
// src/monitors/run.ts
|
|
2
|
+
import { exec } from "child_process";
|
|
3
|
+
import { promisify } from "util";
|
|
4
|
+
var execAsync = promisify(exec);
|
|
5
|
+
var isWindows = process.platform === "win32";
|
|
6
|
+
async function run(cmd, fallback = "", timeout = 3e3) {
|
|
7
|
+
try {
|
|
8
|
+
let sanitizedCmd = cmd;
|
|
9
|
+
if (isWindows) {
|
|
10
|
+
sanitizedCmd = sanitizedCmd.replace(/2>\s*\/dev\/null/g, "2>nul");
|
|
11
|
+
sanitizedCmd = sanitizedCmd.replace(/\/dev\/null/g, "nul");
|
|
12
|
+
}
|
|
13
|
+
return (await execAsync(sanitizedCmd, { encoding: "utf8", timeout, windowsHide: true })).stdout.trim();
|
|
14
|
+
} catch {
|
|
15
|
+
return fallback;
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
var MAX_CONCURRENT_PS = 3;
|
|
19
|
+
var activePs = 0;
|
|
20
|
+
var psWaiters = [];
|
|
21
|
+
async function acquirePsSlot() {
|
|
22
|
+
if (activePs < MAX_CONCURRENT_PS) {
|
|
23
|
+
activePs++;
|
|
24
|
+
return;
|
|
25
|
+
}
|
|
26
|
+
await new Promise((resolve) => psWaiters.push(resolve));
|
|
27
|
+
}
|
|
28
|
+
function releasePsSlot() {
|
|
29
|
+
const next = psWaiters.shift();
|
|
30
|
+
if (next) next();
|
|
31
|
+
else activePs--;
|
|
32
|
+
}
|
|
33
|
+
var psCache = /* @__PURE__ */ new Map();
|
|
34
|
+
var psInflight = /* @__PURE__ */ new Map();
|
|
35
|
+
async function execPowerShell(script, timeout) {
|
|
36
|
+
const existing = psInflight.get(script);
|
|
37
|
+
if (existing) return existing;
|
|
38
|
+
const p = (async () => {
|
|
39
|
+
await acquirePsSlot();
|
|
40
|
+
try {
|
|
41
|
+
const encoded = Buffer.from(script, "utf16le").toString("base64");
|
|
42
|
+
const cmd = `powershell.exe -NoLogo -NoProfile -NonInteractive -ExecutionPolicy Bypass -EncodedCommand ${encoded}`;
|
|
43
|
+
return (await execAsync(cmd, { encoding: "utf8", timeout, windowsHide: true, maxBuffer: 16 * 1024 * 1024 })).stdout.trim();
|
|
44
|
+
} catch {
|
|
45
|
+
return null;
|
|
46
|
+
} finally {
|
|
47
|
+
releasePsSlot();
|
|
48
|
+
}
|
|
49
|
+
})();
|
|
50
|
+
psInflight.set(script, p);
|
|
51
|
+
p.finally(() => psInflight.delete(script)).catch(() => {
|
|
52
|
+
});
|
|
53
|
+
return p;
|
|
54
|
+
}
|
|
55
|
+
async function runPowerShell(script, fallback = "", timeout = 1e4, cacheTtlMs = 0) {
|
|
56
|
+
if (!isWindows) return fallback;
|
|
57
|
+
if (cacheTtlMs > 0) {
|
|
58
|
+
const now = Date.now();
|
|
59
|
+
const entry = psCache.get(script);
|
|
60
|
+
if (entry) {
|
|
61
|
+
if (now - entry.ts >= cacheTtlMs && !entry.inflight) {
|
|
62
|
+
entry.inflight = execPowerShell(script, timeout).then((v) => {
|
|
63
|
+
if (v !== null) {
|
|
64
|
+
entry.value = v;
|
|
65
|
+
entry.ts = Date.now();
|
|
66
|
+
}
|
|
67
|
+
return v;
|
|
68
|
+
}).finally(() => {
|
|
69
|
+
entry.inflight = void 0;
|
|
70
|
+
});
|
|
71
|
+
entry.inflight.catch(() => {
|
|
72
|
+
});
|
|
73
|
+
}
|
|
74
|
+
return entry.value;
|
|
75
|
+
}
|
|
76
|
+
const value2 = await execPowerShell(script, timeout);
|
|
77
|
+
if (value2 === null) return fallback;
|
|
78
|
+
psCache.set(script, { value: value2, ts: Date.now() });
|
|
79
|
+
return value2;
|
|
80
|
+
}
|
|
81
|
+
const value = await execPowerShell(script, timeout);
|
|
82
|
+
return value === null ? fallback : value;
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
export {
|
|
86
|
+
run,
|
|
87
|
+
runPowerShell
|
|
88
|
+
};
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import {
|
|
2
2
|
collectBuilds
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-KLANOKZF.js";
|
|
4
4
|
import {
|
|
5
5
|
collectBlenderRenders
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-GPSU54LZ.js";
|
|
7
7
|
import {
|
|
8
8
|
collectWindowsBattery,
|
|
9
9
|
collectWindowsCpu,
|
|
@@ -18,10 +18,10 @@ import {
|
|
|
18
18
|
collectWindowsTasks,
|
|
19
19
|
collectWindowsThermal,
|
|
20
20
|
getWindowsDisplayInfo
|
|
21
|
-
} from "./chunk-
|
|
21
|
+
} from "./chunk-YXZ4XREM.js";
|
|
22
22
|
import {
|
|
23
23
|
run
|
|
24
|
-
} from "./chunk-
|
|
24
|
+
} from "./chunk-735X2GPS.js";
|
|
25
25
|
|
|
26
26
|
// src/monitors/collectors.ts
|
|
27
27
|
import chalk from "chalk";
|