log-llm-config 1.3.10 → 1.3.12

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,9 +6,9 @@
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, realpathSync, statSync } from 'node:fs';
9
+ import { existsSync, statSync } from 'node:fs';
10
10
  import { fileURLToPath } from 'node:url';
11
- import { resolve } from 'node:path';
11
+ import { basename } 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';
14
14
  const MANIFEST_STALE_MS = 7 * 24 * 60 * 60 * 1000;
@@ -64,16 +64,11 @@ function isRunAsCliModule() {
64
64
  const entry = process.argv[1];
65
65
  if (!entry)
66
66
  return false;
67
- try {
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;
73
- }
74
- catch {
75
- return false;
76
- }
67
+ // Compare by basename only: npx bins are symlinks (no .js extension) while import.meta.url
68
+ // is the real resolved path with extension full-path comparison reliably fails across setups.
69
+ const entryBase = basename(entry).replace(/\.[cm]?js$/, '');
70
+ const selfBase = basename(fileURLToPath(import.meta.url)).replace(/\.[cm]?js$/, '');
71
+ return entryBase !== '' && entryBase === selfBase;
77
72
  }
78
73
  /** Short line for success dialog: finding title/sentence from manifest, not per-check remediation technical text. */
79
74
  function autofixDialogLine(v) {
@@ -158,9 +158,13 @@ async function sendConfigFile(configFile, hardwareUuid, authKey) {
158
158
  const body = { ...payload, signature, key_id: authKey.key_id || '', metadata: { org_identifier: process.env.GITHUB_ORG || process.env.GH_ORG || '', repo_identifier: process.env.GITHUB_REPOSITORY || process.env.GH_REPOSITORY || '' } };
159
159
  try {
160
160
  const response = await postStartupPayload(apiUrl, body);
161
+ if (response.status !== 'accepted') {
162
+ hookRunLog(`sendConfigFile: rejected status=${response.status} error=${response.error ?? ''} path=${configFile.file_path}`);
163
+ }
161
164
  return response.status === 'accepted';
162
165
  }
163
- catch {
166
+ catch (err) {
167
+ hookRunLog(`sendConfigFile: request failed path=${configFile.file_path} err=${err instanceof Error ? err.message : String(err)}`);
164
168
  return false;
165
169
  }
166
170
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "log-llm-config",
3
- "version": "1.3.10",
3
+ "version": "1.3.12",
4
4
  "description": "CLI helpers for logging hardware UUIDs and posting startup payloads to Optimus Security.",
5
5
  "type": "module",
6
6
  "bin": {