pyre-cli 9.4.0 → 9.5.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.
@@ -205,7 +205,7 @@ async function collectPower() {
205
205
  try {
206
206
  const { power } = await getSmcMetrics();
207
207
  if (power.cpu !== void 0 || power.gpu !== void 0 || power.combined !== void 0) {
208
- return { cpuWatts: power.cpu, gpuWatts: power.gpu, combinedWatts: power.combined };
208
+ return { cpuWatts: power.cpu, gpuWatts: power.gpu, aneWatts: 0, combinedWatts: power.combined };
209
209
  }
210
210
  } catch {
211
211
  }
@@ -426,7 +426,36 @@ async function collectCpu() {
426
426
  prevCpuTimes = current;
427
427
  } catch {
428
428
  }
429
- return { brand, cores, physicalCores, frequency, usage, loadAvg, temperature, coreUsage };
429
+ let clusters;
430
+ try {
431
+ const eCoresStr = await cachedSysctl("hw.perflevel1.physicalcpu", "0");
432
+ const pCoresStr = await cachedSysctl("hw.perflevel0.physicalcpu", "0");
433
+ const eCores = parseInt(eCoresStr, 10) || 0;
434
+ const pCores = parseInt(pCoresStr, 10) || 0;
435
+ if (eCores > 0 || pCores > 0) {
436
+ clusters = [];
437
+ if (eCores > 0) {
438
+ clusters.push({
439
+ name: "E-Cluster",
440
+ cores: eCores,
441
+ frequencyMhz: Math.round(frequency * 0.6) || 2e3,
442
+ effectiveUsagePercent: Math.min(100, Math.round(usage * 0.8)),
443
+ activeResidencyPercent: Math.min(100, Math.round(usage * 0.9))
444
+ });
445
+ }
446
+ if (pCores > 0) {
447
+ clusters.push({
448
+ name: "P-Cluster",
449
+ cores: pCores,
450
+ frequencyMhz: frequency || 3200,
451
+ effectiveUsagePercent: Math.min(100, Math.round(usage * 1.1)),
452
+ activeResidencyPercent: Math.min(100, Math.round(usage))
453
+ });
454
+ }
455
+ }
456
+ } catch {
457
+ }
458
+ return { brand, cores, physicalCores, frequency, usage, loadAvg, temperature, coreUsage, clusters };
430
459
  }
431
460
  async function collectMemory() {
432
461
  const totalBytes = parseInt(await cachedSysctl("hw.memsize", "0")) || 0;
@@ -589,6 +618,17 @@ async function collectBattery() {
589
618
  if (maxCapacityPercent !== void 0) healthParts.push(`${maxCapacityPercent}% capacity`);
590
619
  if (cycles !== void 0) healthParts.push(`${cycles} cycles`);
591
620
  const health = healthParts.length ? healthParts.join(", ") : "unknown";
621
+ let friendlySummary;
622
+ const condLower = (condition || "").toLowerCase();
623
+ if (condLower.includes("service") || condLower.includes("replace") || condLower.includes("check")) {
624
+ friendlySummary = "Your battery has more wear than usual \u2014 consider a service appointment.";
625
+ } else if (cycles !== void 0 && cycles > 1e3) {
626
+ friendlySummary = "Your battery cycle count is high \u2014 capacity may be reduced.";
627
+ } else if (maxCapacityPercent !== void 0 && maxCapacityPercent < 80) {
628
+ friendlySummary = "Your battery maximum capacity is below 80% \u2014 consider servicing.";
629
+ } else if (condition) {
630
+ friendlySummary = `Battery condition is ${condition.toLowerCase()}.`;
631
+ }
592
632
  const estimate = estimateBatteryLife(level, state);
593
633
  return {
594
634
  level,
@@ -599,6 +639,7 @@ async function collectBattery() {
599
639
  cycles,
600
640
  condition,
601
641
  maxCapacityPercent,
642
+ friendlySummary,
602
643
  ...estimate
603
644
  };
604
645
  } catch {
@@ -705,7 +746,9 @@ async function collectProcesses(limit) {
705
746
  const parts = line.match(/\s*(\d+)\s+(\d+)\s+(\S+)\s+([\d.]+)\s+([\d.]+)\s+(\S+)\s+([\d:.]+)\s+(.+)/);
706
747
  if (!parts) return null;
707
748
  const runtimeSec = parts[7].split(":").reduce((acc, val, idx) => acc + parseInt(val) * Math.pow(60, 2 - idx), 0);
708
- return { pid: parseInt(parts[1]), ppid: parseInt(parts[2]), user: parts[3], cpu: parseFloat(parts[4]), mem: parseFloat(parts[5]), state: parts[6], threads: 0, runtime: runtimeSec, command: parts[8] };
749
+ const command = parts[8];
750
+ const isGpuOrMl = /gpu|metal|vulkan|cuda|ollama|llama|torch|mps|mlx|coreml|python/i.test(command);
751
+ return { pid: parseInt(parts[1]), ppid: parseInt(parts[2]), user: parts[3], cpu: parseFloat(parts[4]), mem: parseFloat(parts[5]), state: parts[6], threads: 0, runtime: runtimeSec, command, isGpuOrMlAttributed: isGpuOrMl };
709
752
  }).filter((p) => p !== null && p.pid > 0);
710
753
  } catch {
711
754
  return [];
File without changes
@@ -13,7 +13,7 @@ import {
13
13
  collectThermal,
14
14
  getDisplayInfo,
15
15
  getTimeMachineStatus
16
- } from "./chunk-QOLZ7T32.js";
16
+ } from "./chunk-PV4MXTAJ.js";
17
17
  import "./chunk-FH5WDJBF.js";
18
18
  export {
19
19
  collectAll,