@remcp/runtime 0.2.198 → 0.2.200
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/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@remcp/runtime",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.200",
|
|
4
4
|
"description": "First-party ReMCP local device runtime: filesystem, terminal, computer-use, browser, diagnostics and document tools over MCP.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"license": "MIT",
|
|
@@ -27,6 +27,9 @@
|
|
|
27
27
|
"@jellybrick/dbus-next": "^0.11.3",
|
|
28
28
|
"@modelcontextprotocol/server": "^2.3.0"
|
|
29
29
|
},
|
|
30
|
+
"optionalDependencies": {
|
|
31
|
+
"macos-temperature-sensor": "2.1.1"
|
|
32
|
+
},
|
|
30
33
|
"devDependencies": {
|
|
31
34
|
"@modelcontextprotocol/client": "^2.3.1"
|
|
32
35
|
},
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
// Optional Apple Silicon native sensor adapter. A missing/denied sensor never
|
|
2
|
+
// becomes a fabricated zero: the caller can display "unavailable" explicitly.
|
|
3
|
+
import { createRequire } from 'node:module';
|
|
4
|
+
|
|
5
|
+
const require = createRequire(import.meta.url);
|
|
6
|
+
const CHANNELS = [
|
|
7
|
+
['cpu', 'CPU'],
|
|
8
|
+
['soc', 'SoC'],
|
|
9
|
+
['gpu', 'GPU'],
|
|
10
|
+
];
|
|
11
|
+
|
|
12
|
+
export function normalizeDarwinTemperatures(sample) {
|
|
13
|
+
if (!sample || typeof sample !== 'object' || Array.isArray(sample)) return [];
|
|
14
|
+
return CHANNELS.flatMap(([key, name]) => {
|
|
15
|
+
const value = sample[key];
|
|
16
|
+
// The native package uses 0 when hardware did not expose a channel.
|
|
17
|
+
if (typeof value !== 'number' || !Number.isFinite(value) || value <= 0 || value > 125)
|
|
18
|
+
return [];
|
|
19
|
+
return [{ name, celsius: Number(value.toFixed(1)) }];
|
|
20
|
+
});
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
// No shell, sudo, arbitrary execution or runtime download. The optional native
|
|
24
|
+
// module is installed by the platform's ordinary, version-pinned npm workflow.
|
|
25
|
+
export function darwinTemperatureReadings(loadSensor = () => require('macos-temperature-sensor')) {
|
|
26
|
+
try {
|
|
27
|
+
const sensor = loadSensor();
|
|
28
|
+
if (!sensor || typeof sensor.temperature !== 'function') return [];
|
|
29
|
+
return normalizeDarwinTemperatures(sensor.temperature());
|
|
30
|
+
} catch {
|
|
31
|
+
// Unsupported chip, missing optional package and permission failures all
|
|
32
|
+
// remain "unknown", not a healthy-looking temperature of 0°C.
|
|
33
|
+
return [];
|
|
34
|
+
}
|
|
35
|
+
}
|
|
@@ -4,6 +4,7 @@ import { readFile, readdir } from 'node:fs/promises';
|
|
|
4
4
|
import { execFile } from 'node:child_process';
|
|
5
5
|
import { promisify } from 'node:util';
|
|
6
6
|
import process from 'node:process';
|
|
7
|
+
import { darwinTemperatureReadings } from './darwin-temperature.mjs';
|
|
7
8
|
|
|
8
9
|
const run = promisify(execFile);
|
|
9
10
|
const numeric = value => Number.isFinite(value) && value >= 0 && value <= Number.MAX_SAFE_INTEGER;
|
|
@@ -60,6 +61,7 @@ export async function networkRates() {
|
|
|
60
61
|
}
|
|
61
62
|
|
|
62
63
|
export async function thermalReadings() {
|
|
64
|
+
if (process.platform === 'darwin') return darwinTemperatureReadings();
|
|
63
65
|
if (process.platform !== 'linux') return [];
|
|
64
66
|
const sensors = [];
|
|
65
67
|
// Linux thermal zones expose millidegrees Celsius; only fixed kernel paths are read.
|