log-llm-config 1.3.25 → 1.3.28

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/README.md CHANGED
@@ -15,7 +15,7 @@ Collects the machine hardware UUID (or uses the `OPTIMUS_HARDWARE_UUID` env vari
15
15
 
16
16
  ```bash
17
17
  OPTIMUS_ENDPOINT=http://localhost:8080/endpoint_security/ \
18
- npx log-llm-config log_uuid
18
+ npx --yes log-llm-config@latest log_uuid
19
19
  ```
20
20
 
21
21
  - **Optional flags** (for git context, similar to `optimus-init`):
@@ -32,7 +32,7 @@ Legacy helper that logs local Optimus/Cursor configuration files to `configs.txt
32
32
  You can also pass the UUID explicitly:
33
33
 
34
34
  ```bash
35
- npx log-llm-config log_uuid --uuid "DUMMY-LOCAL-UUID"
35
+ npx --yes log-llm-config@latest log_uuid --uuid "DUMMY-LOCAL-UUID"
36
36
  ```
37
37
 
38
38
  ### Development
package/dist/cli.js CHANGED
@@ -38,6 +38,23 @@ const main = async () => {
38
38
  await import('./compliance_check_runner.js');
39
39
  return;
40
40
  }
41
+ // `npx log-llm-config@latest <name>` runs this file (default bin) with args[0] set — not the named bin file.
42
+ if (args[0] === 'execute-trusted-restarts') {
43
+ const { runExecuteTrustedRestartsFromStdin } = await import('./execute_trusted_restarts.js');
44
+ try {
45
+ runExecuteTrustedRestartsFromStdin();
46
+ }
47
+ catch (e) {
48
+ console.error(e instanceof Error ? e.message : String(e));
49
+ process.exit(1);
50
+ }
51
+ process.exit(0);
52
+ return;
53
+ }
54
+ if (args[0] === 'apply-deferred-vscdb') {
55
+ await import('./apply_deferred_vscdb.js');
56
+ return;
57
+ }
41
58
  // No command matched — output legacy bash script
42
59
  console.log(renderBashScript());
43
60
  };
@@ -7,7 +7,8 @@ import { readFileSync } from 'node:fs';
7
7
  import { isThisCliModule } from './cli_invocation_match.js';
8
8
  import { appendComplianceRunnerLine, hookRunLog } from './log_config_files/runtime/hook_logger.js';
9
9
  import { executeTrustedRestartCommands } from './log_config_files/runtime/trusted_restarts.js';
10
- function main() {
10
+ /** Invoked by dist entrypoint or by `npx log-llm-config@latest execute-trusted-restarts` (cli.js dispatches here). */
11
+ export function runExecuteTrustedRestartsFromStdin() {
11
12
  let raw;
12
13
  try {
13
14
  raw = readFileSync(0, 'utf8');
@@ -44,7 +45,7 @@ function main() {
44
45
  }
45
46
  if (isThisCliModule(process.argv[1], import.meta.url)) {
46
47
  try {
47
- main();
48
+ runExecuteTrustedRestartsFromStdin();
48
49
  }
49
50
  catch (e) {
50
51
  hookRunLog(`execute_trusted_restarts: ${e instanceof Error ? e.message : String(e)}`);
@@ -365,7 +365,7 @@ function assertSafeSqliteIdentifiersForItemTable(table, keyColumn, valueColumn)
365
365
  const TRUSTED_CURSOR_SQLITE_DEFERRED_RESTART_COMMAND = 'REPO_ROOT=$(git rev-parse --show-toplevel 2>/dev/null || pwd) && export REPO_ROOT && ' +
366
366
  'CURSOR_PROJECT="${CURSOR_PROJECT_DIR:-$REPO_ROOT}" && export CURSOR_PROJECT && ' +
367
367
  'OPTIMUS_DEFERRED_LOG="${HOME}/opt-ai-sec/management/deferred_vscdb_restart.log" && mkdir -p "$(dirname "$OPTIMUS_DEFERRED_LOG")" && export OPTIMUS_DEFERRED_LOG && ' +
368
- "nohup bash -c 'exec >>\"\$OPTIMUS_DEFERRED_LOG\" 2>&1; echo deferred_restart:begin ts=\$(date -u +%Y-%m-%dT%H:%M:%SZ) REPO_ROOT=\"\$REPO_ROOT\" CURSOR_PROJECT=\"\$CURSOR_PROJECT\"; sleep 2; if [ -f \"\$REPO_ROOT/npx_packages/log-llm-config/dist/apply_deferred_vscdb.js\" ]; then echo deferred_restart:apply_via_monorepo_node; node \"\$REPO_ROOT/npx_packages/log-llm-config/dist/apply_deferred_vscdb.js\"; APPLY_EC=\$?; else echo deferred_restart:apply_via_npx; cd \"\$REPO_ROOT\" && npx --yes -p log-llm-config apply-deferred-vscdb; APPLY_EC=\$?; fi; echo deferred_restart:apply_exit=\$APPLY_EC; if [ \$APPLY_EC -ne 0 ]; then echo deferred_restart:APPLY_FAILED_see_messages_above; fi; echo deferred_restart:open_cursor; open -a Cursor \"\$CURSOR_PROJECT\"; echo deferred_restart:open_exit=\$?; echo deferred_restart:end ts=\$(date -u +%Y-%m-%dT%H:%M:%SZ)' >/dev/null 2>&1 & killall -9 Cursor";
368
+ "nohup bash -c 'exec >>\"\$OPTIMUS_DEFERRED_LOG\" 2>&1; echo deferred_restart:begin ts=\$(date -u +%Y-%m-%dT%H:%M:%SZ) REPO_ROOT=\"\$REPO_ROOT\" CURSOR_PROJECT=\"\$CURSOR_PROJECT\"; sleep 2; if [ -f \"\$REPO_ROOT/npx_packages/log-llm-config/dist/apply_deferred_vscdb.js\" ]; then echo deferred_restart:apply_via_monorepo_node; node \"\$REPO_ROOT/npx_packages/log-llm-config/dist/apply_deferred_vscdb.js\"; APPLY_EC=\$?; else echo deferred_restart:apply_via_npx; cd \"\$REPO_ROOT\" && npx --yes log-llm-config@latest apply-deferred-vscdb; APPLY_EC=\$?; fi; echo deferred_restart:apply_exit=\$APPLY_EC; if [ \$APPLY_EC -ne 0 ]; then echo deferred_restart:APPLY_FAILED_see_messages_above; fi; echo deferred_restart:open_cursor; open -a Cursor \"\$CURSOR_PROJECT\"; echo deferred_restart:open_exit=\$?; echo deferred_restart:end ts=\$(date -u +%Y-%m-%dT%H:%M:%SZ)' >/dev/null 2>&1 & killall -9 Cursor";
369
369
  const TRUSTED_CURSOR_JSON_SETTINGS_RESTART_COMMAND = 'CURSOR_PROJECT=$(git rev-parse --show-toplevel 2>/dev/null || pwd) && export CURSOR_PROJECT && nohup bash -c \'sleep 2 && open -a Cursor "$CURSOR_PROJECT"\' >/dev/null 2>&1 & killall -9 Cursor';
370
370
  const TRUSTED_CLAUDE_RESTART_COMMAND = "nohup bash -c 'sleep 2 && open -a Claude' >/dev/null 2>&1 & pkill -x 'Claude'";
371
371
  /**
@@ -808,7 +808,7 @@ export async function applyDeferredVscdbFromDisk() {
808
808
  * is the JSON-settings-only Cursor template (kill + reopen, no `apply_deferred_vscdb`).
809
809
  */
810
810
  export function buildDeferredCursorRestartCommand() {
811
- // Prefer monorepo path when hooks run from optimus-secure-fdn; otherwise `npx -p log-llm-config apply-deferred-vscdb`
811
+ // Prefer monorepo path when hooks run from optimus-secure-fdn; otherwise `npx --yes log-llm-config@latest apply-deferred-vscdb`
812
812
  // (package bin) so published installs work without a local npx_packages copy.
813
813
  return TRUSTED_CURSOR_SQLITE_DEFERRED_RESTART_COMMAND;
814
814
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "log-llm-config",
3
- "version": "1.3.25",
3
+ "version": "1.3.28",
4
4
  "description": "CLI helpers for logging hardware UUIDs and posting startup payloads to Optimus Security.",
5
5
  "type": "module",
6
6
  "bin": {