log-llm-config-staging 1.4.3 → 1.4.4

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.
@@ -1,11 +1,9 @@
1
1
  import { execFileSync } from 'node:child_process';
2
- import { createRequire } from 'node:module';
3
2
  import { homedir } from 'node:os';
4
3
  import { join } from 'node:path';
5
- import { fileURLToPath } from 'node:url';
6
4
  export const SKILLS_CLI_FILE_TYPE = 'skills_cli_installed';
7
5
  export const SKILLS_CLI_INSTALLED_PATH = join(homedir(), '.agents', '.skills-cli-installed.json');
8
- /** Override fallback runner, e.g. `skills@1.5.10`. Default `skills` uses the machine npx cache. */
6
+ /** Override the skills package spec, e.g. `skills@1.5.10`. Default uses whatever is on the machine. */
9
7
  export const SKILLS_CLI_NPX_PACKAGE_ENV = 'SKILLS_CLI_NPX_PACKAGE';
10
8
  const LIST_TIMEOUT_MS = 120_000;
11
9
  function listExecEnv() {
@@ -14,46 +12,17 @@ function listExecEnv() {
14
12
  DISABLE_TELEMETRY: process.env.DISABLE_TELEMETRY ?? '1',
15
13
  };
16
14
  }
17
- function npxPackageSpecForFallback() {
15
+ function npxPackageSpec() {
18
16
  const fromEnv = (process.env[SKILLS_CLI_NPX_PACKAGE_ENV] || '').trim();
19
17
  return fromEnv || 'skills';
20
18
  }
21
- function resolveSkillsListRunner() {
22
- try {
23
- const require = createRequire(fileURLToPath(import.meta.url));
24
- const bin = require.resolve('skills/bin/cli.mjs');
25
- const pkg = require('skills/package.json');
26
- const version = (pkg.version || '').trim() || 'unknown';
27
- return { mode: 'bundled', bin, version };
28
- }
29
- catch {
30
- return { mode: 'npx', packageSpec: npxPackageSpecForFallback() };
31
- }
32
- }
33
- function execSkillsList(args, cwd, runner) {
34
- if (runner.mode === 'bundled') {
35
- return execFileSync(process.execPath, [runner.bin, 'list', ...args, '--json'], {
36
- encoding: 'utf8',
37
- cwd,
38
- timeout: LIST_TIMEOUT_MS,
39
- env: listExecEnv(),
40
- });
41
- }
42
- return execFileSync('npx', ['--yes', runner.packageSpec, 'list', ...args, '--json'], {
19
+ export function runSkillsListJson(args, cwd) {
20
+ const out = execFileSync('npx', [npxPackageSpec(), 'list', ...args, '--json'], {
43
21
  encoding: 'utf8',
44
22
  cwd,
45
23
  timeout: LIST_TIMEOUT_MS,
46
24
  env: listExecEnv(),
47
25
  });
48
- }
49
- function runnerVersionLabel(runner) {
50
- if (runner.mode === 'bundled')
51
- return runner.version;
52
- return `npx:${runner.packageSpec}`;
53
- }
54
- export function runSkillsListJson(args, cwd) {
55
- const runner = resolveSkillsListRunner();
56
- const out = execSkillsList(args, cwd, runner);
57
26
  const trimmed = out.trim();
58
27
  if (!trimmed)
59
28
  return [];
@@ -96,13 +65,8 @@ export function collectSkillsCliInstalled(projectRoot, log) {
96
65
  log?.(message);
97
66
  };
98
67
  try {
99
- const runner = resolveSkillsListRunner();
100
- if (runner.mode === 'bundled') {
101
- logLine(`skills_cli: bundled skills@${runner.version} — list -g --json && list --json (projectRoot=${projectRoot})`);
102
- }
103
- else {
104
- logLine(`skills_cli: npx fallback (${runner.packageSpec}) — no bundled skills dep; uses machine npx cache (projectRoot=${projectRoot})`);
105
- }
68
+ const packageSpec = npxPackageSpec();
69
+ logLine(`skills_cli: npx ${packageSpec} — list -g --json && list --json (projectRoot=${projectRoot})`);
106
70
  const globalRows = runSkillsListJson(['-g'], projectRoot);
107
71
  const projectRows = runSkillsListJson([], projectRoot);
108
72
  const global = normalizeListRows(globalRows, 'global');
@@ -111,7 +75,7 @@ export function collectSkillsCliInstalled(projectRoot, log) {
111
75
  logLine(formatSkillsListScopeForHookLog('project', project));
112
76
  const payload = {
113
77
  version: 1,
114
- skills_cli_version: runnerVersionLabel(runner),
78
+ skills_cli_version: packageSpec,
115
79
  generated_at: new Date().toISOString(),
116
80
  global,
117
81
  project,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "log-llm-config-staging",
3
- "version": "1.4.3",
3
+ "version": "1.4.4",
4
4
  "description": "CLI helpers for logging hardware UUIDs and posting startup payloads to Optimus Security.",
5
5
  "type": "module",
6
6
  "bin": {
@@ -58,7 +58,6 @@
58
58
  "dependencies": {
59
59
  "axios": "^1.15.2",
60
60
  "canonicalize": "^2.1.0",
61
- "optimus-tofu-staging": "^0.1.17",
62
- "skills": "1.5.10"
61
+ "optimus-tofu-staging": "^0.1.17"
63
62
  }
64
63
  }