log-llm-config 1.3.38 → 1.3.40

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.
@@ -19,24 +19,15 @@ const createSignature = (payloadSummary, keyHex) => {
19
19
  // Keep this adapter for backward compatibility of public exports in log_uuid.
20
20
  return createSharedSignature(payloadSummary, keyHex);
21
21
  };
22
- const getMetadata = () => {
23
- // Single resolve: `metadata.user_profile` and `metadata.github_username` share the same
24
- // probe order as design_notes/user_profile_field_sources.md (gh api → env git).
25
- const user_profile = { ...resolveUserProfile() };
26
- const github_username = (typeof user_profile.github_username === 'string' && user_profile.github_username.trim()) ||
27
- process.env.GITHUB_USER ||
28
- process.env.GH_USER ||
29
- '';
30
- return {
31
- github_username,
32
- org_identifier: process.env.GITHUB_ORG || '',
33
- repo_identifier: process.env.GITHUB_REPOSITORY || '',
34
- branch: process.env.GITHUB_REF_NAME || process.env.BRANCH_NAME || '',
35
- commit_sha: process.env.GITHUB_SHA || '',
36
- agent_name: process.env.OPTIMUS_AGENT || '',
37
- user_profile,
38
- };
39
- };
22
+ const getMetadata = () => ({
23
+ github_username: process.env.GITHUB_USER || process.env.GH_USER || '',
24
+ org_identifier: process.env.GITHUB_ORG || '',
25
+ repo_identifier: process.env.GITHUB_REPOSITORY || '',
26
+ branch: process.env.GITHUB_REF_NAME || process.env.BRANCH_NAME || '',
27
+ commit_sha: process.env.GITHUB_SHA || '',
28
+ agent_name: process.env.OPTIMUS_AGENT || '',
29
+ user_profile: { ...resolveUserProfile() },
30
+ });
40
31
  function buildRequestBody(hardwareUuid, timestamp) {
41
32
  const payloadSummary = { timestamp, directory: process.cwd(), hardware_uuid: hardwareUuid };
42
33
  const requestBody = { hardware_uuid: hardwareUuid, payload: payloadSummary, metadata: getMetadata(), scan_timestamp: timestamp };
@@ -102,7 +102,7 @@ const readMacUsername = () => {
102
102
  };
103
103
  /**
104
104
  * Matches design_notes order: `gh api user` (login), then CI-style env, then `git config user.name`.
105
- * `startup_sender` `getMetadata()` sets both `metadata.github_username` and `metadata.user_profile.github_username` from one `resolveUserProfile()` call.
105
+ * `metadata.github_username` in startup_sender still uses env only; this field is the richer probe.
106
106
  */
107
107
  const readGithubUsername = () => {
108
108
  try {
@@ -110,6 +110,8 @@ const readGithubUsername = () => {
110
110
  encoding: 'utf8',
111
111
  stdio: ['ignore', 'pipe', 'ignore'],
112
112
  maxBuffer: 1024 * 1024,
113
+ // CI often has `gh` installed; without a cap it can block on auth/network and hang callers.
114
+ timeout: 3500,
113
115
  }).trim();
114
116
  if (out)
115
117
  return out;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "log-llm-config",
3
- "version": "1.3.38",
3
+ "version": "1.3.40",
4
4
  "description": "CLI helpers for logging hardware UUIDs and posting startup payloads to Optimus Security.",
5
5
  "type": "module",
6
6
  "bin": {