log-llm-config 1.3.9 → 1.3.10
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.
|
@@ -6,8 +6,8 @@
|
|
|
6
6
|
* the same JSON line to execute_trusted_restarts (TS allowlist + spawn).
|
|
7
7
|
*/
|
|
8
8
|
import { applyAutofixViolations, pruneSatisfiedOneTimeRemediations, runLocalRemediationComplianceCheck, } from './log_config_files/runtime/compliance_check.js';
|
|
9
|
-
import { existsSync, statSync } from 'node:fs';
|
|
10
|
-
import {
|
|
9
|
+
import { existsSync, realpathSync, statSync } from 'node:fs';
|
|
10
|
+
import { fileURLToPath } from 'node:url';
|
|
11
11
|
import { resolve } from 'node:path';
|
|
12
12
|
import { getRemediationInstructionsPath } from './log_config_files/runtime/management_storage.js';
|
|
13
13
|
import { hookLogSessionBanner, hookRunLog } from './log_config_files/runtime/hook_logger.js';
|
|
@@ -65,7 +65,11 @@ function isRunAsCliModule() {
|
|
|
65
65
|
if (!entry)
|
|
66
66
|
return false;
|
|
67
67
|
try {
|
|
68
|
-
|
|
68
|
+
// realpathSync on both sides: npx installs bins as symlinks, so process.argv[1] is the
|
|
69
|
+
// symlink path while import.meta.url is already the real (dereferenced) path in Node ESM.
|
|
70
|
+
const realEntry = realpathSync(resolve(entry));
|
|
71
|
+
const realSelf = realpathSync(fileURLToPath(import.meta.url));
|
|
72
|
+
return realEntry === realSelf;
|
|
69
73
|
}
|
|
70
74
|
catch {
|
|
71
75
|
return false;
|