great-cto 2.70.0 → 2.71.0
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/dist/telemetry.js +5 -13
- package/package.json +1 -1
package/dist/telemetry.js
CHANGED
|
@@ -50,20 +50,14 @@ const ALLOWED_ARCHETYPES = new Set([
|
|
|
50
50
|
function configPath() {
|
|
51
51
|
return path.join(os.homedir(), ".great_cto", "telemetry.json");
|
|
52
52
|
}
|
|
53
|
-
function legacyConfigPath() {
|
|
54
|
-
return path.join(os.homedir(), ".great_cto", "config.json");
|
|
55
|
-
}
|
|
56
53
|
function readConfig() {
|
|
57
|
-
//
|
|
54
|
+
// ONLY the new opt-in file counts. We deliberately do NOT honor the legacy
|
|
55
|
+
// ~/.great_cto/config.json "telemetry" flag: that consent predates the v2.9.2
|
|
56
|
+
// zero-telemetry reset, so silently reactivating it would re-enable collection
|
|
57
|
+
// without a fresh, informed opt-in. Re-introduction requires a new decision.
|
|
58
58
|
try {
|
|
59
59
|
return JSON.parse(fs.readFileSync(configPath(), "utf8"));
|
|
60
60
|
}
|
|
61
|
-
catch { /* fall through */ }
|
|
62
|
-
// Fall back to legacy config.json (read-only — never write to it).
|
|
63
|
-
try {
|
|
64
|
-
const legacy = JSON.parse(fs.readFileSync(legacyConfigPath(), "utf8"));
|
|
65
|
-
return { enabled: legacy.telemetry, install_id: legacy.install_id };
|
|
66
|
-
}
|
|
67
61
|
catch {
|
|
68
62
|
return {};
|
|
69
63
|
}
|
|
@@ -100,14 +94,12 @@ export function isTelemetryEnabled(cliFlag = false) {
|
|
|
100
94
|
return false;
|
|
101
95
|
if (isCI())
|
|
102
96
|
return false;
|
|
103
|
-
// Opt-in checks:
|
|
97
|
+
// Opt-in checks (explicit, fresh decision only):
|
|
104
98
|
if (process.env.GREAT_CTO_TELEMETRY === "on")
|
|
105
99
|
return true;
|
|
106
100
|
const cfg = readConfig();
|
|
107
101
|
if (cfg.enabled === true)
|
|
108
102
|
return true;
|
|
109
|
-
if (cfg.telemetry === true)
|
|
110
|
-
return true; // legacy
|
|
111
103
|
// Default: opt-out.
|
|
112
104
|
return false;
|
|
113
105
|
}
|
package/package.json
CHANGED