@ghl-ai/aw 0.1.37-beta.5 → 0.1.37-beta.6
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/package.json +1 -1
- package/telemetry.mjs +10 -0
package/package.json
CHANGED
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
|
|