@ghl-ai/aw 0.1.37-beta.5 → 0.1.37-beta.7

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.
Files changed (2) hide show
  1. package/package.json +1 -1
  2. package/telemetry.mjs +13 -1
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ghl-ai/aw",
3
- "version": "0.1.37-beta.5",
3
+ "version": "0.1.37-beta.7",
4
4
  "description": "Agentic Workspace CLI — pull, push & manage agents, skills and commands from the registry",
5
5
  "type": "module",
6
6
  "bin": "bin.js",
package/telemetry.mjs CHANGED
@@ -99,6 +99,14 @@ function projectHash() {
99
99
  return createHash('sha256').update(process.cwd()).digest('hex').slice(0, 8);
100
100
  }
101
101
 
102
+ function getGitConfig(key) {
103
+ try {
104
+ return execSync(`git config --global ${key}`, {
105
+ encoding: 'utf8', stdio: ['pipe', 'pipe', 'pipe'], timeout: 1000,
106
+ }).trim() || null;
107
+ } catch { return null; }
108
+ }
109
+
102
110
  export function collectEnv(config) {
103
111
  return {
104
112
  machine_id: config.machine_id,
@@ -112,6 +120,8 @@ export function collectEnv(config) {
112
120
  project_hash: projectHash(),
113
121
  trigger: process.env.AW_TRIGGER || 'interactive',
114
122
  registry_head: getRegistryHead(),
123
+ github_user: getGitConfig('user.name'),
124
+ github_email: getGitConfig('user.email'),
115
125
  };
116
126
  }
117
127
 
@@ -181,11 +191,13 @@ export function startSpan(command, args) {
181
191
  async end({ status = 'completed', error_type = null, data = {} } = {}) {
182
192
  if (disabled) return;
183
193
  const duration_ms = Date.now() - startTime;
194
+ // Re-read registry_head so completed event reflects post-command state
195
+ const endEnv = { ...env, registry_head: getRegistryHead() };
184
196
  await send({
185
197
  event: status === 'completed' ? 'command_completed' : 'command_failed',
186
198
  run_id: runId,
187
199
  timestamp: new Date().toISOString(),
188
- env,
200
+ env: endEnv,
189
201
  command: { name: command, args: positional, flags },
190
202
  outcome: { status, duration_ms, error_type, data },
191
203
  });