pyre-cli 9.5.2 → 10.1.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 +73 -16
- package/dist/alertChannels-TPSQIJ7S.js +8 -0
- package/dist/{blender-7UT5J7IP.js → blender-FGH3ASEQ.js} +2 -2
- package/dist/brewHealth-P2GW5Y5C.js +176 -0
- package/dist/buildCmd-CDPZ2ZFA.js +38 -0
- package/dist/{checkCmd-T7O4KXXA.js → checkCmd-RKW6QGDR.js} +9 -11
- package/dist/{chunk-CXL4GYGQ.js → chunk-53O2RGSL.js} +44 -17
- package/dist/{chunk-3TE7MJLS.js → chunk-6UHZP4QP.js} +36 -10
- package/dist/chunk-GHRDW646.js +2506 -0
- package/dist/{prometheus-LFYHF6VO.js → chunk-HT4VQ4OH.js} +1 -0
- package/dist/chunk-M73HCQD2.js +95 -0
- package/dist/chunk-MZO5QKUR.js +32 -0
- package/dist/{chunk-25I533OF.js → chunk-VIACN2RU.js} +1 -1
- package/dist/chunk-Z2YV5HKV.js +87 -0
- package/dist/chunk-ZLVIVFSO.js +110 -0
- package/dist/{collectors-JB4OGUEF.js → collectors-H43PN4PS.js} +6 -3
- package/dist/{completions-VQMHQCXE.js → completions-JKYEJNGR.js} +34 -1
- package/dist/{config-KS5ZZ3VN.js → config-GYGJXU2Q.js} +9 -1
- package/dist/doctor-GYHFTNZQ.js +387 -0
- package/dist/explainCmd-MF6PIMLW.js +222 -0
- package/dist/extensions-XJGHG7X3.js +134 -0
- package/dist/index.js +460 -88
- package/dist/ioreport.py +72 -0
- package/dist/netUsageCmd-WKBTW2YG.js +90 -0
- package/dist/{pipeCmd-TYLJHQ5B.js → pipeCmd-7REDBLBU.js} +4 -3
- package/dist/profileProcCmd-N4H6MCBT.js +107 -0
- package/dist/prometheus-5BL5PVLC.js +6 -0
- package/dist/prometheusCmd-PL64BLN5.js +93 -0
- package/dist/replayCmd-Z3PYXY7V.js +164 -0
- package/dist/run-HOGQDDTA.js +8 -0
- package/dist/serveCmd-2H5VLF3P.js +153 -0
- package/dist/service-Q74BBILO.js +181 -0
- package/dist/smartCmd-ODWKSFNG.js +166 -0
- package/dist/syncCmd-A2W3QB3S.js +126 -0
- package/dist/topoCmd-DU2HHZNH.js +148 -0
- package/dist/watchdogCmd-UF53JPZB.js +161 -0
- package/dist/{wizard-Z3RGA3VB.js → wizard-TD7BGX6O.js} +1 -1
- package/install.ps1 +29 -0
- package/install.sh +10 -9
- package/package.json +7 -3
- package/src/ai/models.ts +138 -0
- package/src/alertChannels.ts +119 -0
- package/src/brewHealth.ts +157 -40
- package/src/buildCmd.ts +48 -0
- package/src/checkCmd.ts +5 -5
- package/src/completions.ts +35 -0
- package/src/doctor.ts +235 -7
- package/src/easy_features.test.ts +40 -0
- package/src/explainCmd.ts +261 -0
- package/src/extensions.ts +71 -7
- package/src/formatters/render.ts +34 -10
- package/src/formatters/types.ts +2 -0
- package/src/index.ts +251 -36
- package/src/live/input.ts +60 -0
- package/src/live/render.ts +67 -0
- package/src/live/state.ts +5 -0
- package/src/live/types.ts +1 -1
- package/src/monitors/batteryPredictor.ts +143 -0
- package/src/monitors/buildTracker.ts +121 -0
- package/src/monitors/collectors.ts +342 -178
- package/src/monitors/ioreport.py +72 -0
- package/src/monitors/platform/linux.ts +756 -0
- package/src/monitors/platform/windows.ts +519 -0
- package/src/monitors/run.ts +27 -3
- package/src/monitors/smc.ts +21 -1
- package/src/monitors/types.ts +15 -0
- package/src/netUsageCmd.ts +121 -0
- package/src/platform.test.ts +99 -0
- package/src/plugins/index.ts +143 -0
- package/src/profileProcCmd.ts +133 -0
- package/src/prometheusCmd.ts +107 -0
- package/src/replayCmd.ts +186 -0
- package/src/serveCmd.ts +180 -0
- package/src/service.ts +125 -7
- package/src/smartCmd.ts +205 -0
- package/src/state/config.ts +58 -17
- package/src/syncCmd.ts +166 -0
- package/src/topoCmd.ts +176 -0
- package/src/watchdogCmd.ts +198 -0
- package/src/xbar.ts +22 -11
- package/dist/brewHealth-F2BXF5M6.js +0 -74
- package/dist/chunk-FH5WDJBF.js +0 -15
- package/dist/chunk-N4WJVF5M.js +0 -1184
- package/dist/doctor-UV7TWIHX.js +0 -184
- package/dist/extensions-DVA5YLGH.js +0 -74
- package/dist/service-WTS3NBQU.js +0 -73
package/dist/doctor-UV7TWIHX.js
DELETED
|
@@ -1,184 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
CONFIG_FILE,
|
|
3
|
-
readConfig
|
|
4
|
-
} from "./chunk-CXL4GYGQ.js";
|
|
5
|
-
import {
|
|
6
|
-
run
|
|
7
|
-
} from "./chunk-FH5WDJBF.js";
|
|
8
|
-
|
|
9
|
-
// src/doctor.ts
|
|
10
|
-
import chalk from "chalk";
|
|
11
|
-
async function runDoctor() {
|
|
12
|
-
const checks = [];
|
|
13
|
-
try {
|
|
14
|
-
const pmResult = await run("sudo -n powermetrics --samplers cpu_power -n 1 2>&1", "");
|
|
15
|
-
if (pmResult.includes("Password:") || pmResult.includes("Permission denied") || pmResult.includes("sudo: a password is required")) {
|
|
16
|
-
checks.push({
|
|
17
|
-
name: "Sudo / Powermetrics",
|
|
18
|
-
status: "warn",
|
|
19
|
-
message: "Passwordless sudo for powermetrics is not configured.",
|
|
20
|
-
details: "Powermetrics allows high-precision GPU & CPU power sampling. Run with sudo or configure passwordless sudo in /etc/sudoers."
|
|
21
|
-
});
|
|
22
|
-
} else {
|
|
23
|
-
checks.push({
|
|
24
|
-
name: "Sudo / Powermetrics",
|
|
25
|
-
status: "ok",
|
|
26
|
-
message: "Powermetrics access available."
|
|
27
|
-
});
|
|
28
|
-
}
|
|
29
|
-
} catch {
|
|
30
|
-
checks.push({
|
|
31
|
-
name: "Sudo / Powermetrics",
|
|
32
|
-
status: "warn",
|
|
33
|
-
message: "Powermetrics check failed."
|
|
34
|
-
});
|
|
35
|
-
}
|
|
36
|
-
try {
|
|
37
|
-
const psCheck = await run("ps -ax -o pid,user,command", "");
|
|
38
|
-
if (psCheck.length > 0) {
|
|
39
|
-
checks.push({
|
|
40
|
-
name: "TCC / Process Visibility",
|
|
41
|
-
status: "ok",
|
|
42
|
-
message: "Process listing access available."
|
|
43
|
-
});
|
|
44
|
-
} else {
|
|
45
|
-
checks.push({
|
|
46
|
-
name: "TCC / Process Visibility",
|
|
47
|
-
status: "warn",
|
|
48
|
-
message: "Restricted process visibility.",
|
|
49
|
-
details: "Grant Full Disk Access or Terminal permissions in System Settings -> Privacy & Security."
|
|
50
|
-
});
|
|
51
|
-
}
|
|
52
|
-
} catch {
|
|
53
|
-
checks.push({
|
|
54
|
-
name: "TCC / Process Visibility",
|
|
55
|
-
status: "error",
|
|
56
|
-
message: "Unable to list system processes."
|
|
57
|
-
});
|
|
58
|
-
}
|
|
59
|
-
try {
|
|
60
|
-
const netCheck = await run("netstat -rn", "");
|
|
61
|
-
if (netCheck.includes("default") || netCheck.includes("gateway")) {
|
|
62
|
-
checks.push({
|
|
63
|
-
name: "Network Reachability",
|
|
64
|
-
status: "ok",
|
|
65
|
-
message: "Network interface active with default gateway."
|
|
66
|
-
});
|
|
67
|
-
} else {
|
|
68
|
-
checks.push({
|
|
69
|
-
name: "Network Reachability",
|
|
70
|
-
status: "warn",
|
|
71
|
-
message: "No active network route detected for P2P mode."
|
|
72
|
-
});
|
|
73
|
-
}
|
|
74
|
-
} catch {
|
|
75
|
-
checks.push({
|
|
76
|
-
name: "Network Reachability",
|
|
77
|
-
status: "warn",
|
|
78
|
-
message: "Could not verify network routes."
|
|
79
|
-
});
|
|
80
|
-
}
|
|
81
|
-
try {
|
|
82
|
-
const spctlOut = await run("spctl --status 2>&1", "");
|
|
83
|
-
if (spctlOut.includes("assessments enabled")) {
|
|
84
|
-
checks.push({
|
|
85
|
-
name: "Gatekeeper",
|
|
86
|
-
status: "ok",
|
|
87
|
-
message: "Gatekeeper enforcement is enabled."
|
|
88
|
-
});
|
|
89
|
-
} else {
|
|
90
|
-
checks.push({
|
|
91
|
-
name: "Gatekeeper",
|
|
92
|
-
status: "warn",
|
|
93
|
-
message: "Gatekeeper is disabled or status check unconfirmed.",
|
|
94
|
-
details: 'Re-enable Gatekeeper using "sudo spctl --master-enable" to protect against untrusted software.'
|
|
95
|
-
});
|
|
96
|
-
}
|
|
97
|
-
} catch {
|
|
98
|
-
checks.push({
|
|
99
|
-
name: "Gatekeeper",
|
|
100
|
-
status: "warn",
|
|
101
|
-
message: "Could not query Gatekeeper status."
|
|
102
|
-
});
|
|
103
|
-
}
|
|
104
|
-
try {
|
|
105
|
-
const sipOut = await run("csrutil status 2>&1", "");
|
|
106
|
-
if (sipOut.includes("enabled")) {
|
|
107
|
-
checks.push({
|
|
108
|
-
name: "System Integrity Protection",
|
|
109
|
-
status: "ok",
|
|
110
|
-
message: "SIP is enabled."
|
|
111
|
-
});
|
|
112
|
-
} else {
|
|
113
|
-
checks.push({
|
|
114
|
-
name: "System Integrity Protection",
|
|
115
|
-
status: "warn",
|
|
116
|
-
message: "SIP is disabled or restricted.",
|
|
117
|
-
details: "System Integrity Protection protects core system files. Enable it from macOS Recovery."
|
|
118
|
-
});
|
|
119
|
-
}
|
|
120
|
-
} catch {
|
|
121
|
-
checks.push({
|
|
122
|
-
name: "System Integrity Protection",
|
|
123
|
-
status: "warn",
|
|
124
|
-
message: "Could not query SIP status."
|
|
125
|
-
});
|
|
126
|
-
}
|
|
127
|
-
try {
|
|
128
|
-
const xprotectOut = await run("system_profiler SPInstallHistoryDataType 2>&1", "");
|
|
129
|
-
const xpMatches = Array.from(xprotectOut.matchAll(/XProtect(?:Remediator)?ConfigData.*?\n.*?Install Date:\s*(.+)/gi));
|
|
130
|
-
if (xpMatches.length > 0) {
|
|
131
|
-
const latestDateStr = xpMatches[xpMatches.length - 1][1];
|
|
132
|
-
checks.push({
|
|
133
|
-
name: "XProtect Definitions",
|
|
134
|
-
status: "ok",
|
|
135
|
-
message: `XProtect active (last updated ${latestDateStr.trim()}).`
|
|
136
|
-
});
|
|
137
|
-
} else {
|
|
138
|
-
checks.push({
|
|
139
|
-
name: "XProtect Definitions",
|
|
140
|
-
status: "ok",
|
|
141
|
-
message: "XProtect definitions installed."
|
|
142
|
-
});
|
|
143
|
-
}
|
|
144
|
-
} catch {
|
|
145
|
-
checks.push({
|
|
146
|
-
name: "XProtect Definitions",
|
|
147
|
-
status: "warn",
|
|
148
|
-
message: "Could not determine XProtect update history."
|
|
149
|
-
});
|
|
150
|
-
}
|
|
151
|
-
try {
|
|
152
|
-
const cfg = readConfig();
|
|
153
|
-
checks.push({
|
|
154
|
-
name: "Configuration File",
|
|
155
|
-
status: "ok",
|
|
156
|
-
message: `Config file valid (${CONFIG_FILE}).`
|
|
157
|
-
});
|
|
158
|
-
} catch (err) {
|
|
159
|
-
checks.push({
|
|
160
|
-
name: "Configuration File",
|
|
161
|
-
status: "error",
|
|
162
|
-
message: "Failed to parse config file.",
|
|
163
|
-
details: err.message
|
|
164
|
-
});
|
|
165
|
-
}
|
|
166
|
-
return checks;
|
|
167
|
-
}
|
|
168
|
-
function printDoctorReport(checks) {
|
|
169
|
-
console.log(chalk.bold("\n pyre doctor \u2014 System Diagnostics\n"));
|
|
170
|
-
for (const check of checks) {
|
|
171
|
-
let icon = chalk.green("\u2714");
|
|
172
|
-
if (check.status === "warn") icon = chalk.yellow("\u26A0");
|
|
173
|
-
if (check.status === "error") icon = chalk.red("\u2716");
|
|
174
|
-
console.log(` ${icon} ${chalk.bold(check.name.padEnd(26))} ${check.message}`);
|
|
175
|
-
if (check.details) {
|
|
176
|
-
console.log(chalk.dim(` \u21B3 ${check.details}`));
|
|
177
|
-
}
|
|
178
|
-
}
|
|
179
|
-
console.log();
|
|
180
|
-
}
|
|
181
|
-
export {
|
|
182
|
-
printDoctorReport,
|
|
183
|
-
runDoctor
|
|
184
|
-
};
|
|
@@ -1,74 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
run
|
|
3
|
-
} from "./chunk-FH5WDJBF.js";
|
|
4
|
-
|
|
5
|
-
// src/extensions.ts
|
|
6
|
-
import chalk from "chalk";
|
|
7
|
-
async function getSystemExtensions() {
|
|
8
|
-
try {
|
|
9
|
-
const raw = await run("systemextensionsctl list 2>&1", "");
|
|
10
|
-
return parseSystemExtensionsOutput(raw);
|
|
11
|
-
} catch (err) {
|
|
12
|
-
return [];
|
|
13
|
-
}
|
|
14
|
-
}
|
|
15
|
-
function parseSystemExtensionsOutput(output) {
|
|
16
|
-
const result = [];
|
|
17
|
-
let currentCategory = "Other Extensions";
|
|
18
|
-
let currentList = [];
|
|
19
|
-
const lines = output.split("\n");
|
|
20
|
-
for (const line of lines) {
|
|
21
|
-
const trimmed = line.trim();
|
|
22
|
-
if (!trimmed) continue;
|
|
23
|
-
if (trimmed.startsWith("--- category") || trimmed.startsWith("--- ")) {
|
|
24
|
-
if (currentList.length > 0 || result.length > 0) {
|
|
25
|
-
result.push({ category: currentCategory, extensions: currentList });
|
|
26
|
-
currentList = [];
|
|
27
|
-
}
|
|
28
|
-
const catMatch = trimmed.match(/category\s+([\w\.-]+)/i);
|
|
29
|
-
currentCategory = catMatch ? catMatch[1] : trimmed.replace(/^-+\s*/, "").replace(/\s*-+$/, "");
|
|
30
|
-
continue;
|
|
31
|
-
}
|
|
32
|
-
const extMatch = trimmed.match(/^(?:\*\s*)*([A-Z0-9]{10}|\?\?\?\?\?\?\?\?\?\?)\s+([\w\.-]+)\s+\(([^)]+)\)\s+\[([^\]]+)\]/i);
|
|
33
|
-
if (extMatch) {
|
|
34
|
-
currentList.push({
|
|
35
|
-
teamId: extMatch[1],
|
|
36
|
-
bundleId: extMatch[2],
|
|
37
|
-
version: extMatch[3],
|
|
38
|
-
state: extMatch[4],
|
|
39
|
-
category: currentCategory
|
|
40
|
-
});
|
|
41
|
-
}
|
|
42
|
-
}
|
|
43
|
-
if (currentList.length > 0 || result.length === 0) {
|
|
44
|
-
result.push({ category: currentCategory, extensions: currentList });
|
|
45
|
-
}
|
|
46
|
-
return result.filter((group) => group.extensions.length > 0 || result.length === 1);
|
|
47
|
-
}
|
|
48
|
-
async function printExtensionsReport() {
|
|
49
|
-
console.log(chalk.bold("\n pyre extensions \u2014 System Extensions Inspector\n"));
|
|
50
|
-
const categories = await getSystemExtensions();
|
|
51
|
-
let totalCount = 0;
|
|
52
|
-
for (const cat of categories) {
|
|
53
|
-
totalCount += cat.extensions.length;
|
|
54
|
-
console.log(chalk.cyan.bold(` \u{1F4C2} ${cat.category}`));
|
|
55
|
-
if (cat.extensions.length === 0) {
|
|
56
|
-
console.log(chalk.dim(" (No extensions registered in this category)"));
|
|
57
|
-
continue;
|
|
58
|
-
}
|
|
59
|
-
for (const ext of cat.extensions) {
|
|
60
|
-
const stateColor = ext.state.includes("activated") || ext.state.includes("enabled") ? chalk.green : chalk.yellow;
|
|
61
|
-
console.log(` \u2022 ${chalk.bold(ext.bundleId)} (${ext.version})`);
|
|
62
|
-
console.log(chalk.dim(` Team: ${ext.teamId} | State: `) + stateColor(ext.state));
|
|
63
|
-
}
|
|
64
|
-
console.log();
|
|
65
|
-
}
|
|
66
|
-
if (totalCount === 0) {
|
|
67
|
-
console.log(chalk.dim(" No active system extensions detected on this system.\n"));
|
|
68
|
-
}
|
|
69
|
-
}
|
|
70
|
-
export {
|
|
71
|
-
getSystemExtensions,
|
|
72
|
-
parseSystemExtensionsOutput,
|
|
73
|
-
printExtensionsReport
|
|
74
|
-
};
|
package/dist/service-WTS3NBQU.js
DELETED
|
@@ -1,73 +0,0 @@
|
|
|
1
|
-
// src/service.ts
|
|
2
|
-
import fs from "fs";
|
|
3
|
-
import os from "os";
|
|
4
|
-
import path from "path";
|
|
5
|
-
import { execSync } from "child_process";
|
|
6
|
-
import chalk from "chalk";
|
|
7
|
-
var PLIST_LABEL = "com.pyre.web";
|
|
8
|
-
var PLIST_PATH = path.join(os.homedir(), "Library", "LaunchAgents", `${PLIST_LABEL}.plist`);
|
|
9
|
-
function installLaunchdAgent(port = 3e3) {
|
|
10
|
-
const nodePath = process.execPath;
|
|
11
|
-
const scriptPath = path.resolve(process.argv[1]);
|
|
12
|
-
const plistContent = `<?xml version="1.0" encoding="UTF-8"?>
|
|
13
|
-
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
|
14
|
-
<plist version="1.0">
|
|
15
|
-
<dict>
|
|
16
|
-
<key>Label</key>
|
|
17
|
-
<string>${PLIST_LABEL}</string>
|
|
18
|
-
<key>ProgramArguments</key>
|
|
19
|
-
<array>
|
|
20
|
-
<string>${nodePath}</string>
|
|
21
|
-
<string>${scriptPath}</string>
|
|
22
|
-
<string>web</string>
|
|
23
|
-
<string>--port</string>
|
|
24
|
-
<string>${port}</string>
|
|
25
|
-
</array>
|
|
26
|
-
<key>RunAtLoad</key>
|
|
27
|
-
<true/>
|
|
28
|
-
<key>KeepAlive</key>
|
|
29
|
-
<true/>
|
|
30
|
-
<key>StandardOutPath</key>
|
|
31
|
-
<string>${path.join(os.homedir(), ".config", "pyre", "web.log")}</string>
|
|
32
|
-
<key>StandardErrorPath</key>
|
|
33
|
-
<string>${path.join(os.homedir(), ".config", "pyre", "web.err")}</string>
|
|
34
|
-
</dict>
|
|
35
|
-
</plist>
|
|
36
|
-
`;
|
|
37
|
-
try {
|
|
38
|
-
const launchAgentsDir = path.dirname(PLIST_PATH);
|
|
39
|
-
if (!fs.existsSync(launchAgentsDir)) {
|
|
40
|
-
fs.mkdirSync(launchAgentsDir, { recursive: true });
|
|
41
|
-
}
|
|
42
|
-
fs.writeFileSync(PLIST_PATH, plistContent);
|
|
43
|
-
try {
|
|
44
|
-
execSync(`launchctl unload ${PLIST_PATH} 2>/dev/null`);
|
|
45
|
-
} catch {
|
|
46
|
-
}
|
|
47
|
-
execSync(`launchctl load ${PLIST_PATH}`);
|
|
48
|
-
console.log(chalk.green(`\u2714 Installed and started launchd agent at ${PLIST_PATH}`));
|
|
49
|
-
console.log(chalk.dim(` Service label: ${PLIST_LABEL}`));
|
|
50
|
-
} catch (err) {
|
|
51
|
-
console.log(chalk.red(`\u2716 Failed to install launchd agent: ${err.message}`));
|
|
52
|
-
}
|
|
53
|
-
}
|
|
54
|
-
function uninstallLaunchdAgent() {
|
|
55
|
-
try {
|
|
56
|
-
if (fs.existsSync(PLIST_PATH)) {
|
|
57
|
-
try {
|
|
58
|
-
execSync(`launchctl unload ${PLIST_PATH} 2>/dev/null`);
|
|
59
|
-
} catch {
|
|
60
|
-
}
|
|
61
|
-
fs.unlinkSync(PLIST_PATH);
|
|
62
|
-
console.log(chalk.green(`\u2714 Uninstalled launchd agent ${PLIST_PATH}`));
|
|
63
|
-
} else {
|
|
64
|
-
console.log(chalk.yellow(` No launchd agent found at ${PLIST_PATH}`));
|
|
65
|
-
}
|
|
66
|
-
} catch (err) {
|
|
67
|
-
console.log(chalk.red(`\u2716 Failed to uninstall launchd agent: ${err.message}`));
|
|
68
|
-
}
|
|
69
|
-
}
|
|
70
|
-
export {
|
|
71
|
-
installLaunchdAgent,
|
|
72
|
-
uninstallLaunchdAgent
|
|
73
|
-
};
|