log-llm-config 1.3.11 → 1.3.13

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/cli.js CHANGED
@@ -29,7 +29,9 @@ const main = async () => {
29
29
  return;
30
30
  }
31
31
  if (args[0] === 'compliance_prompt_gate') {
32
- await import('./compliance_prompt_gate.js');
32
+ const { runCompliancePromptGateCli } = await import('./compliance_prompt_gate.js');
33
+ await runCompliancePromptGateCli();
34
+ process.exit(0);
33
35
  return;
34
36
  }
35
37
  if (args[0] === 'compliance_check_runner') {
@@ -82,7 +82,15 @@ function autofixDialogLine(v) {
82
82
  const short = d.length > 160 ? `${d.slice(0, 157)}…` : d;
83
83
  return `• [${v.finding_formatted_id}] ${short}`;
84
84
  }
85
- /** Exported for tests; CLI invokes this only when {@link isRunAsCliModule} is true. */
85
+ /**
86
+ * Entry when the default npm bin (`log-llm-config` / cli.js) dispatches
87
+ * `compliance_prompt_gate` — npx does not execute compliance_prompt_gate.js as argv[1], so
88
+ * {@link isRunAsCliModule} is false and the gate must be invoked explicitly from cli.ts.
89
+ */
90
+ export async function runCompliancePromptGateCli() {
91
+ await runCompliancePromptGate().catch(() => printAllow(parseIde()));
92
+ }
93
+ /** Exported for tests; runs when `dist/compliance_prompt_gate.js` is the process entry (argv[1]). */
86
94
  export async function runCompliancePromptGate() {
87
95
  const ide = parseIde();
88
96
  hookLogSessionBanner('compliance_prompt_gate (before submit)');
@@ -152,5 +160,5 @@ export async function runCompliancePromptGate() {
152
160
  printAllow(ide);
153
161
  }
154
162
  if (isRunAsCliModule()) {
155
- runCompliancePromptGate().catch(() => printAllow(parseIde())).finally(() => process.exit(0));
163
+ runCompliancePromptGateCli().finally(() => process.exit(0));
156
164
  }
@@ -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.11",
3
+ "version": "1.3.13",
4
4
  "description": "CLI helpers for logging hardware UUIDs and posting startup payloads to Optimus Security.",
5
5
  "type": "module",
6
6
  "bin": {