cchubber 0.3.3 → 0.3.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.
- package/README.md +3 -0
- package/package.json +1 -1
- package/src/telemetry.js +16 -2
package/README.md
CHANGED
|
@@ -1,5 +1,8 @@
|
|
|
1
1
|
# CC Hubber
|
|
2
2
|
|
|
3
|
+
[](https://www.npmjs.com/package/cchubber)
|
|
4
|
+
[](https://www.npmjs.com/package/cchubber)
|
|
5
|
+
|
|
3
6
|
Your Claude Code usage, diagnosed. One command.
|
|
4
7
|
|
|
5
8
|
```bash
|
package/package.json
CHANGED
package/src/telemetry.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import https from 'https';
|
|
2
2
|
import { platform, arch, homedir } from 'os';
|
|
3
|
-
import { existsSync, readFileSync, readdirSync, statSync } from 'fs';
|
|
3
|
+
import { existsSync, readFileSync, writeFileSync, readdirSync, statSync } from 'fs';
|
|
4
4
|
import { join } from 'path';
|
|
5
5
|
|
|
6
6
|
// Anonymous usage telemetry — no PII, no tokens, no file contents.
|
|
@@ -18,7 +18,8 @@ export function shouldSendTelemetry(flags) {
|
|
|
18
18
|
|
|
19
19
|
export function sendTelemetry(report) {
|
|
20
20
|
const payload = {
|
|
21
|
-
v: '0.3.
|
|
21
|
+
v: '0.3.3',
|
|
22
|
+
uid: getOrCreateUID(),
|
|
22
23
|
ts: new Date().toISOString(),
|
|
23
24
|
os: platform(),
|
|
24
25
|
arch: arch(),
|
|
@@ -145,6 +146,19 @@ function costBucket(cost) {
|
|
|
145
146
|
return '5K+';
|
|
146
147
|
}
|
|
147
148
|
|
|
149
|
+
function getOrCreateUID() {
|
|
150
|
+
// Anonymous install ID — random, no PII. Same approach as Next.js/Turborepo telemetry.
|
|
151
|
+
const idFile = join(homedir(), '.cchubber-uid');
|
|
152
|
+
try {
|
|
153
|
+
if (existsSync(idFile)) return readFileSync(idFile, 'utf-8').trim();
|
|
154
|
+
const uid = 'u_' + Math.random().toString(36).slice(2) + Math.random().toString(36).slice(2);
|
|
155
|
+
writeFileSync(idFile, uid);
|
|
156
|
+
return uid;
|
|
157
|
+
} catch {
|
|
158
|
+
return 'anon_' + Math.random().toString(36).slice(2, 10);
|
|
159
|
+
}
|
|
160
|
+
}
|
|
161
|
+
|
|
148
162
|
function gatherEnvironmentData() {
|
|
149
163
|
const home = homedir();
|
|
150
164
|
const claudeDir = join(home, '.claude');
|