@agentbean/daemon 0.1.13 → 0.1.14
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/scanner.js +11 -0
- package/package.json +1 -1
package/dist/scanner.js
CHANGED
|
@@ -4,6 +4,16 @@ import { join } from "node:path";
|
|
|
4
4
|
import { createHash } from "node:crypto";
|
|
5
5
|
import * as os from "node:os";
|
|
6
6
|
import { logger } from "./log.js";
|
|
7
|
+
function readDaemonVersion() {
|
|
8
|
+
try {
|
|
9
|
+
const packageJson = JSON.parse(readFileSync(new URL("../package.json", import.meta.url), "utf-8"));
|
|
10
|
+
return typeof packageJson.version === "string" ? packageJson.version : "unknown";
|
|
11
|
+
}
|
|
12
|
+
catch {
|
|
13
|
+
return "unknown";
|
|
14
|
+
}
|
|
15
|
+
}
|
|
16
|
+
const DAEMON_VERSION = readDaemonVersion();
|
|
7
17
|
function isExecutableFile(path) {
|
|
8
18
|
try {
|
|
9
19
|
return existsSync(path) && statSync(path).isFile();
|
|
@@ -374,5 +384,6 @@ export function collectSystemInfo() {
|
|
|
374
384
|
totalMemoryGB: Math.round((totalMem / 1024 / 1024 / 1024) * 10) / 10,
|
|
375
385
|
freeMemoryGB: Math.round((freeMem / 1024 / 1024 / 1024) * 10) / 10,
|
|
376
386
|
nodeVersion: process.version,
|
|
387
|
+
daemonVersion: DAEMON_VERSION,
|
|
377
388
|
};
|
|
378
389
|
}
|