Download packages/coding-agent/src/core/telemetry.ts from SaylorTwift/pi: direct link, hf CLI and curl.
- Browser
- Download file 515 Bytes
-
https://huggingface.co/SaylorTwift/pi/resolve/main/packages/coding-agent/src/core/telemetry.ts
- Command line
-
hf download hf://SaylorTwift/pi/packages/coding-agent/src/core/telemetry.ts
-
curl -L -o telemetry.ts https://huggingface.co/SaylorTwift/pi/resolve/main/packages/coding-agent/src/core/telemetry.ts
515 Bytes
| import type { SettingsManager } from "./settings-manager.ts"; | |
| function isTruthyEnvFlag(value: string | undefined): boolean { | |
| if (!value) return false; | |
| return value === "1" || value.toLowerCase() === "true" || value.toLowerCase() === "yes"; | |
| } | |
| export function isInstallTelemetryEnabled( | |
| settingsManager: SettingsManager, | |
| telemetryEnv: string | undefined = process.env.PI_TELEMETRY, | |
| ): boolean { | |
| return telemetryEnv !== undefined ? isTruthyEnvFlag(telemetryEnv) : settingsManager.getEnableInstallTelemetry(); | |
| } | |