pyre-cli 9.5.0 → 9.5.1

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.
@@ -4,7 +4,7 @@ import {
4
4
  import "./chunk-SG26Y3WF.js";
5
5
  import {
6
6
  collectAll
7
- } from "./chunk-PV4MXTAJ.js";
7
+ } from "./chunk-HGRBBPYX.js";
8
8
  import "./chunk-FH5WDJBF.js";
9
9
 
10
10
  // src/checkCmd.ts
@@ -58,6 +58,25 @@ async function getSmcMetrics() {
58
58
  } catch {
59
59
  }
60
60
  }
61
+ if (result.temps["cpu_die"] === void 0) {
62
+ try {
63
+ const battRaw = await run("ioreg -r -n AppleSmartBattery 2>/dev/null", "");
64
+ if (battRaw) {
65
+ const virtMatch = battRaw.match(/"VirtualTemperature"\s*=\s*(\d+)/);
66
+ const cellMatch = battRaw.match(/"Temperature"\s*=\s*(\d+)/);
67
+ const rawVirt = virtMatch ? parseFloat(virtMatch[1]) : void 0;
68
+ const rawCell = cellMatch ? parseFloat(cellMatch[1]) : void 0;
69
+ const virtC = rawVirt !== void 0 ? Math.round(rawVirt / 10) / 10 : void 0;
70
+ const cellC = rawCell !== void 0 ? Math.round(rawCell / 10) / 10 : void 0;
71
+ if (virtC !== void 0 && virtC >= 15 && virtC <= 115) {
72
+ result.temps["cpu_die"] = virtC;
73
+ } else if (cellC !== void 0 && cellC >= 15 && cellC <= 115) {
74
+ result.temps["cpu_die"] = cellC;
75
+ }
76
+ }
77
+ } catch {
78
+ }
79
+ }
61
80
  if (result.temps["cpu_die"] === void 0) {
62
81
  try {
63
82
  const tz0 = (await run("cat /sys/class/thermal/thermal_zone0/temp 2>/dev/null", "")).trim();
@@ -13,7 +13,7 @@ import {
13
13
  collectThermal,
14
14
  getDisplayInfo,
15
15
  getTimeMachineStatus
16
- } from "./chunk-PV4MXTAJ.js";
16
+ } from "./chunk-HGRBBPYX.js";
17
17
  import "./chunk-FH5WDJBF.js";
18
18
  export {
19
19
  collectAll,
package/dist/index.js CHANGED
@@ -19,7 +19,7 @@ import {
19
19
  import "./chunk-SG26Y3WF.js";
20
20
  import {
21
21
  collectAll
22
- } from "./chunk-PV4MXTAJ.js";
22
+ } from "./chunk-HGRBBPYX.js";
23
23
  import "./chunk-FH5WDJBF.js";
24
24
 
25
25
  // src/index.ts
@@ -4223,7 +4223,7 @@ async function main() {
4223
4223
  await runSetupWizardIfNeeded(!opts.wizard);
4224
4224
  const cmd = program.args[0];
4225
4225
  if (cmd === "check") {
4226
- const { runCheckCommand } = await import("./checkCmd-ULNENOPZ.js");
4226
+ const { runCheckCommand } = await import("./checkCmd-EWFNLBWE.js");
4227
4227
  await runCheckCommand({
4228
4228
  exitCode: !!opts.exitCode,
4229
4229
  cpuAlertPct: config2.cpuAlertPct,
@@ -4233,7 +4233,7 @@ async function main() {
4233
4233
  return;
4234
4234
  }
4235
4235
  if (cmd === "pipe") {
4236
- const { runPipeCommand } = await import("./pipeCmd-BWNMUV2X.js");
4236
+ const { runPipeCommand } = await import("./pipeCmd-7THXEGDH.js");
4237
4237
  const intervalSec = parseFloat(opts.interval) || 1;
4238
4238
  const samples = parseInt(opts.samples, 10) || 0;
4239
4239
  await runPipeCommand({
@@ -4645,7 +4645,7 @@ async function runP2PConnect() {
4645
4645
  }
4646
4646
  async function runInfoCommand() {
4647
4647
  const data = await collectAll({ detailed: true });
4648
- const { getDisplayInfo, getTimeMachineStatus } = await import("./collectors-VYUH3UWY.js");
4648
+ const { getDisplayInfo, getTimeMachineStatus } = await import("./collectors-WD6VKH6M.js");
4649
4649
  const displays = await getDisplayInfo();
4650
4650
  const tmStatus = await getTimeMachineStatus();
4651
4651
  const lines = [];
@@ -1,7 +1,7 @@
1
1
  import "./chunk-SG26Y3WF.js";
2
2
  import {
3
3
  collectAll
4
- } from "./chunk-PV4MXTAJ.js";
4
+ } from "./chunk-HGRBBPYX.js";
5
5
  import "./chunk-FH5WDJBF.js";
6
6
 
7
7
  // src/pipeCmd.ts
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "pyre-cli",
3
- "version": "9.5.0",
3
+ "version": "9.5.1",
4
4
  "description": "CLI Mac monitoring tool: temps, system stats, live dashboard, packet monitor, battery predictor, export",
5
5
  "main": "dist/index.js",
6
6
  "type": "module",
@@ -99,6 +99,33 @@ export async function getSmcMetrics(): Promise<SmcMetrics> {
99
99
  }
100
100
  }
101
101
 
102
+ // 2b. AppleSmartBattery fallback — works without sudo on all MacBooks
103
+ // VirtualTemperature reflects the SoC/die temperature; Temperature is
104
+ // the battery cell temperature. Both are reported in centi-Celsius
105
+ // (e.g. 3539 → 35.39 °C).
106
+ if (result.temps['cpu_die'] === undefined) {
107
+ try {
108
+ const battRaw = await run('ioreg -r -n AppleSmartBattery 2>/dev/null', '');
109
+ if (battRaw) {
110
+ // Prefer VirtualTemperature (closer to die temp) over Temperature (battery cell)
111
+ const virtMatch = battRaw.match(/"VirtualTemperature"\s*=\s*(\d+)/);
112
+ const cellMatch = battRaw.match(/"Temperature"\s*=\s*(\d+)/);
113
+ const rawVirt = virtMatch ? parseFloat(virtMatch[1]) : undefined;
114
+ const rawCell = cellMatch ? parseFloat(cellMatch[1]) : undefined;
115
+ // Convert centi-Celsius to Celsius (e.g. 3085 → 30.85 → 30.9)
116
+ const virtC = rawVirt !== undefined ? Math.round(rawVirt / 10) / 10 : undefined;
117
+ const cellC = rawCell !== undefined ? Math.round(rawCell / 10) / 10 : undefined;
118
+ if (virtC !== undefined && virtC >= 15 && virtC <= 115) {
119
+ result.temps['cpu_die'] = virtC;
120
+ } else if (cellC !== undefined && cellC >= 15 && cellC <= 115) {
121
+ result.temps['cpu_die'] = cellC;
122
+ }
123
+ }
124
+ } catch {
125
+ // ignore
126
+ }
127
+ }
128
+
102
129
  // 3. Linux /sys/class/thermal or /sys/class/hwmon fallback
103
130
  if (result.temps['cpu_die'] === undefined) {
104
131
  try {