@merittdev/horus 0.8.2 → 0.8.3
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/index.cjs +25 -9
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -65880,7 +65880,7 @@ init_cjs_shims();
|
|
|
65880
65880
|
|
|
65881
65881
|
// ../../packages/core/src/version.ts
|
|
65882
65882
|
init_cjs_shims();
|
|
65883
|
-
var HORUS_VERSION = true ? "0.8.
|
|
65883
|
+
var HORUS_VERSION = true ? "0.8.3" : "dev";
|
|
65884
65884
|
var PINNED_SOURCE_VERSION = "1.5.0";
|
|
65885
65885
|
|
|
65886
65886
|
// ../../packages/core/src/evidence.ts
|
|
@@ -113819,18 +113819,34 @@ function validateSpawnedRecord(r) {
|
|
|
113819
113819
|
return null;
|
|
113820
113820
|
}
|
|
113821
113821
|
async function getProcessInfo(pid) {
|
|
113822
|
+
let args2;
|
|
113822
113823
|
try {
|
|
113823
|
-
const
|
|
113824
|
-
|
|
113825
|
-
|
|
113826
|
-
|
|
113827
|
-
const args2 = argsResult.stdout.trim();
|
|
113828
|
-
const etimeSeconds = parseInt(etimeResult.stdout.trim(), 10);
|
|
113829
|
-
if (!args2 || isNaN(etimeSeconds)) return null;
|
|
113830
|
-
return { args: args2, etimeSeconds };
|
|
113824
|
+
const argsResult = await execFileAsync("ps", ["-p", String(pid), "-o", "args="], {
|
|
113825
|
+
timeout: 3e3
|
|
113826
|
+
});
|
|
113827
|
+
args2 = argsResult.stdout.trim();
|
|
113831
113828
|
} catch {
|
|
113832
113829
|
return null;
|
|
113833
113830
|
}
|
|
113831
|
+
if (!args2) return null;
|
|
113832
|
+
let etimeSeconds = Number.NaN;
|
|
113833
|
+
try {
|
|
113834
|
+
const etimeResult = await execFileAsync("ps", ["-p", String(pid), "-o", "etime="], {
|
|
113835
|
+
timeout: 3e3
|
|
113836
|
+
});
|
|
113837
|
+
etimeSeconds = parseEtimeSeconds(etimeResult.stdout.trim());
|
|
113838
|
+
} catch {
|
|
113839
|
+
}
|
|
113840
|
+
return { args: args2, etimeSeconds };
|
|
113841
|
+
}
|
|
113842
|
+
function parseEtimeSeconds(etime) {
|
|
113843
|
+
const m5 = etime.match(/^(?:(\d+)-)?(?:(\d+):)?(\d+):(\d+)$/);
|
|
113844
|
+
if (!m5) return Number.NaN;
|
|
113845
|
+
const days = m5[1] ? Number(m5[1]) : 0;
|
|
113846
|
+
const hours = m5[2] ? Number(m5[2]) : 0;
|
|
113847
|
+
const minutes = Number(m5[3]);
|
|
113848
|
+
const seconds = Number(m5[4]);
|
|
113849
|
+
return days * 86400 + hours * 3600 + minutes * 60 + seconds;
|
|
113834
113850
|
}
|
|
113835
113851
|
function extractPort(hostUrl) {
|
|
113836
113852
|
try {
|